Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified the naming of RLP encoded parameters #528

Merged
merged 5 commits into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion contracts/core/KernelGateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,6 @@ contract KernelGateway is KernelGatewayInterface {
// Array 3rd position is storage root.
storageRoot_ = RLP.toBytes32(accountArray[2]);

// Hash the rlpEncodedValue value.
bytes32 hashedAccount = keccak256(
abi.encodePacked(_accountRlp)
);
Expand Down
57 changes: 28 additions & 29 deletions contracts/gateway/EIP20CoGateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -311,24 +311,24 @@ contract EIP20CoGateway is GatewayBase {
* Gateway is either declared or progressed.
*
* @param _messageHash Message hash.
* @param _rlpEncodedParentNodes RLP encoded parent node data to prove in
* messageBox inbox of Gateway
* @param _blockHeight Block number for which the proof is valid
* @param _rlpParentNodes RLP encoded parent node data to prove in
* messageBox inbox of Gateway.
* @param _blockHeight Block number for which the proof is valid.
* @param _messageStatus Message status i.e. Declared or Progressed that
* will be proved.
*
* @return beneficiary_ Address to which the utility tokens will be
* transferred after minting
* transferred after minting.
* @return stakeAmount_ Total amount for which the stake was initiated. The
* reward amount is deducted from the total amount and
* is given to the facilitator.
* @return mintedAmount_ Actual minted amount, after deducting the reward
* from the total amount.
* @return rewardAmount_ Reward amount that is transferred to facilitator
* from the total amount.
* @return rewardAmount_ Reward amount that is transferred to facilitator.
*/
function progressMintWithProof(
bytes32 _messageHash,
bytes memory _rlpEncodedParentNodes,
bytes memory _rlpParentNodes,
uint256 _blockHeight,
uint256 _messageStatus
)
Expand All @@ -348,8 +348,8 @@ contract EIP20CoGateway is GatewayBase {
"Message hash must not be zero"
);
require(
_rlpEncodedParentNodes.length > 0,
"RLP encoded parent nodes must not be zero"
_rlpParentNodes.length > 0,
"RLP parent nodes must not be zero"
);

// Get the storage root for the given block height
Expand All @@ -365,7 +365,7 @@ contract EIP20CoGateway is GatewayBase {
messageBox,
STAKE_TYPEHASH,
message,
_rlpEncodedParentNodes,
_rlpParentNodes,
MESSAGE_BOX_OFFSET,
storageRoot,
MessageBus.MessageStatus(_messageStatus)
Expand All @@ -384,9 +384,9 @@ contract EIP20CoGateway is GatewayBase {
*
* @param _messageHash Message hash.
* @param _blockHeight Block number for which the proof is valid
* @param _rlpEncodedParentNodes RLP encoded parent node data to prove
* DeclaredRevocation in messageBox outbox
* of Gateway
* @param _rlpParentNodes RLP encoded parent node data to prove
* DeclaredRevocation in messageBox outbox of
* Gateway.
*
* @return staker_ Staker address
* @return stakerNonce_ Staker nonce
Expand All @@ -395,7 +395,7 @@ contract EIP20CoGateway is GatewayBase {
function confirmRevertStakeIntent(
bytes32 _messageHash,
uint256 _blockHeight,
bytes calldata _rlpEncodedParentNodes
bytes calldata _rlpParentNodes
)
external
returns (
Expand All @@ -412,8 +412,8 @@ contract EIP20CoGateway is GatewayBase {
"Message hash must not be zero"
);
require(
_rlpEncodedParentNodes.length > 0,
"RLP encoded parent nodes must not be zero"
_rlpParentNodes.length > 0,
"RLP parent nodes must not be zero"
);

MessageBus.Message storage message = messages[_messageHash];
Expand All @@ -434,7 +434,7 @@ contract EIP20CoGateway is GatewayBase {
messageBox,
STAKE_TYPEHASH,
message,
_rlpEncodedParentNodes,
_rlpParentNodes,
MESSAGE_BOX_OFFSET,
storageRoot
);
Expand Down Expand Up @@ -516,7 +516,7 @@ contract EIP20CoGateway is GatewayBase {
* Gateway is either declared or progressed.
*
* @param _messageHash Message hash.
* @param _rlpEncodedParentNodes RLP encoded parent node data to prove in
* @param _rlpParentNodes RLP encoded parent node data to prove in
* messageBox outbox of Gateway
* @param _blockHeight Block number for which the proof is valid
* @param _messageStatus Message status i.e. Declared or Progressed that
Expand All @@ -527,7 +527,7 @@ contract EIP20CoGateway is GatewayBase {
*/
function progressRedeemWithProof(
bytes32 _messageHash,
bytes calldata _rlpEncodedParentNodes,
bytes calldata _rlpParentNodes,
uint256 _blockHeight,
uint256 _messageStatus
)
Expand All @@ -542,8 +542,8 @@ contract EIP20CoGateway is GatewayBase {
"Message hash must not be zero"
);
require(
_rlpEncodedParentNodes.length > 0,
"RLP encoded parent nodes must not be zero"
_rlpParentNodes.length > 0,
"RLP parent nodes must not be zero"
);

bytes32 storageRoot = storageRoots[_blockHeight];
Expand All @@ -562,7 +562,7 @@ contract EIP20CoGateway is GatewayBase {
messageBox,
REDEEM_TYPEHASH,
message,
_rlpEncodedParentNodes,
_rlpParentNodes,
MESSAGE_BOX_OFFSET,
storageRoot,
MessageBus.MessageStatus(_messageStatus)
Expand Down Expand Up @@ -656,9 +656,8 @@ contract EIP20CoGateway is GatewayBase {
*
* @param _messageHash Message hash.
* @param _blockHeight Block number for which the proof is valid
* @param _rlpEncodedParentNodes RLP encoded parent node data to prove
* DeclaredRevocation in messageBox inbox
* of Gateway
* @param _rlpParentNodes RLP encoded parent node data to prove
* DeclaredRevocation in messageBox inbox of Gateway.
*
* @return redeemer_ Redeemer address
* @return redeemerNonce_ Redeemer nonce
Expand All @@ -667,7 +666,7 @@ contract EIP20CoGateway is GatewayBase {
function progressRevertRedeem(
bytes32 _messageHash,
uint256 _blockHeight,
bytes calldata _rlpEncodedParentNodes
bytes calldata _rlpParentNodes
)
external
returns (
Expand All @@ -681,8 +680,8 @@ contract EIP20CoGateway is GatewayBase {
"Message hash must not be zero"
);
require(
_rlpEncodedParentNodes.length > 0,
"RLP encoded parent nodes must not be zero"
_rlpParentNodes.length > 0,
"RLP parent nodes must not be zero"
);

// Get the message object
Expand All @@ -705,7 +704,7 @@ contract EIP20CoGateway is GatewayBase {
message,
REDEEM_TYPEHASH,
MESSAGE_BOX_OFFSET,
_rlpEncodedParentNodes,
_rlpParentNodes,
storageRoot,
MessageBus.MessageStatus.Revoked
);
Expand Down
Loading