Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions test/abstract/FlowTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,24 +119,26 @@ abstract contract FlowTest is FlowTransferOperation, InterpreterMockTest {
vm.assume(account != address(0x000000000000000000636F6e736F6c652e6c6f67));
}

function _buildFlowStack(FlowTransferV1 memory transfer) private pure returns (uint256[] memory, bytes32) {
bytes32 transferHash = keccak256(abi.encode(transfer));
uint256[] memory stack = Sentinel.unwrap(RAIN_FLOW_SENTINEL).generateFlowStack(transfer);
return (stack, transferHash);
}

function burnFlowStack(address, uint256, uint256, FlowTransferV1 memory transfer)
internal
pure
returns (uint256[] memory, bytes32)
{
bytes32 transferHash = keccak256(abi.encode(transfer));
uint256[] memory stack = Sentinel.unwrap(RAIN_FLOW_SENTINEL).generateFlowStack(transfer);
return (stack, transferHash);
return _buildFlowStack(transfer);
}

function mintFlowStack(address, uint256, uint256, FlowTransferV1 memory transfer)
internal
pure
returns (uint256[] memory, bytes32)
{
bytes32 transferHash = keccak256(abi.encode(transfer));
uint256[] memory stack = Sentinel.unwrap(RAIN_FLOW_SENTINEL).generateFlowStack(transfer);
return (stack, transferHash);
return _buildFlowStack(transfer);
}

function buildConfig(string memory, string memory, string memory, address, EvaluableConfigV3[] memory flowConfig)
Expand Down Expand Up @@ -179,8 +181,6 @@ abstract contract FlowTest is FlowTransferOperation, InterpreterMockTest {
pure
returns (uint256[] memory, bytes32)
{
bytes32 transferHash = keccak256(abi.encode(transfer));
uint256[] memory stack = Sentinel.unwrap(RAIN_FLOW_SENTINEL).generateFlowStack(transfer);
return (stack, transferHash);
return _buildFlowStack(transfer);
}
}
Loading