-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #502 from omisego/458-refactor-wire-tx
WireTransaction refactor
- Loading branch information
Showing
105 changed files
with
1,225 additions
and
658 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
plasma_framework/contracts/mocks/transactions/FungibleTokenOutputWrapper.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
pragma solidity 0.5.11; | ||
pragma experimental ABIEncoderV2; | ||
|
||
import "../../src/transactions/FungibleTokenOutputModel.sol"; | ||
|
||
contract FungibleTokenOutputWrapper { | ||
using RLPReader for bytes; | ||
using RLPReader for RLPReader.RLPItem; | ||
|
||
function decodeOutput(bytes memory encodedOutput) | ||
public | ||
pure | ||
returns (FungibleTokenOutputModel.Output memory) | ||
{ | ||
GenericTransaction.Output memory genericOutput = GenericTransaction.decodeOutput(encodedOutput.toRlpItem()); | ||
return FungibleTokenOutputModel.decodeOutput(genericOutput); | ||
} | ||
|
||
function getOutput(bytes memory transaction, uint16 outputIndex) | ||
public | ||
pure | ||
returns (FungibleTokenOutputModel.Output memory) | ||
{ | ||
GenericTransaction.Transaction memory genericTx = GenericTransaction.decode(transaction); | ||
return FungibleTokenOutputModel.getOutput(genericTx, outputIndex); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
plasma_framework/contracts/mocks/transactions/GenericTransactionWrapper.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
pragma solidity 0.5.11; | ||
pragma experimental ABIEncoderV2; | ||
|
||
import "../../src/transactions/GenericTransaction.sol"; | ||
|
||
contract GenericTransactionWrapper { | ||
|
||
function decode(bytes memory transaction) public pure returns (GenericTransaction.Transaction memory) { | ||
return GenericTransaction.decode(transaction); | ||
} | ||
|
||
function getOutput(bytes memory transaction, uint16 outputIndex) public pure returns (GenericTransaction.Output memory) { | ||
GenericTransaction.Transaction memory genericTx = GenericTransaction.decode(transaction); | ||
return GenericTransaction.getOutput(genericTx, outputIndex); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
plasma_framework/contracts/mocks/transactions/WireTransactionWrapper.sol
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
plasma_framework/contracts/mocks/transactions/outputs/PaymentOutputModelMock.sol
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.