diff --git a/contracts/core/KernelGateway.sol b/contracts/core/KernelGateway.sol index 4b8876c7..5057de46 100644 --- a/contracts/core/KernelGateway.sol +++ b/contracts/core/KernelGateway.sol @@ -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) ); diff --git a/contracts/gateway/EIP20CoGateway.sol b/contracts/gateway/EIP20CoGateway.sol index f32dfcc5..16ae893d 100644 --- a/contracts/gateway/EIP20CoGateway.sol +++ b/contracts/gateway/EIP20CoGateway.sol @@ -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 ) @@ -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 @@ -365,7 +365,7 @@ contract EIP20CoGateway is GatewayBase { messageBox, STAKE_TYPEHASH, message, - _rlpEncodedParentNodes, + _rlpParentNodes, MESSAGE_BOX_OFFSET, storageRoot, MessageBus.MessageStatus(_messageStatus) @@ -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 @@ -395,7 +395,7 @@ contract EIP20CoGateway is GatewayBase { function confirmRevertStakeIntent( bytes32 _messageHash, uint256 _blockHeight, - bytes calldata _rlpEncodedParentNodes + bytes calldata _rlpParentNodes ) external returns ( @@ -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]; @@ -434,7 +434,7 @@ contract EIP20CoGateway is GatewayBase { messageBox, STAKE_TYPEHASH, message, - _rlpEncodedParentNodes, + _rlpParentNodes, MESSAGE_BOX_OFFSET, storageRoot ); @@ -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 @@ -527,7 +527,7 @@ contract EIP20CoGateway is GatewayBase { */ function progressRedeemWithProof( bytes32 _messageHash, - bytes calldata _rlpEncodedParentNodes, + bytes calldata _rlpParentNodes, uint256 _blockHeight, uint256 _messageStatus ) @@ -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]; @@ -562,7 +562,7 @@ contract EIP20CoGateway is GatewayBase { messageBox, REDEEM_TYPEHASH, message, - _rlpEncodedParentNodes, + _rlpParentNodes, MESSAGE_BOX_OFFSET, storageRoot, MessageBus.MessageStatus(_messageStatus) @@ -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 @@ -667,7 +666,7 @@ contract EIP20CoGateway is GatewayBase { function progressRevertRedeem( bytes32 _messageHash, uint256 _blockHeight, - bytes calldata _rlpEncodedParentNodes + bytes calldata _rlpParentNodes ) external returns ( @@ -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 @@ -705,7 +704,7 @@ contract EIP20CoGateway is GatewayBase { message, REDEEM_TYPEHASH, MESSAGE_BOX_OFFSET, - _rlpEncodedParentNodes, + _rlpParentNodes, storageRoot, MessageBus.MessageStatus.Revoked ); diff --git a/contracts/gateway/EIP20Gateway.sol b/contracts/gateway/EIP20Gateway.sol index d1055f50..91beab05 100644 --- a/contracts/gateway/EIP20Gateway.sol +++ b/contracts/gateway/EIP20Gateway.sol @@ -447,9 +447,9 @@ contract EIP20Gateway is GatewayBase { * CoGateway is either declared or progressed. * * @param _messageHash Message hash. - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox outbox of CoGateway - * @param _blockHeight Block number for which the proof is valid + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox outbox of CoGateway. + * @param _blockHeight Block number for which the proof is valid. * @param _messageStatus Message status i.e. Declared or Progressed that * will be proved. * @@ -458,7 +458,7 @@ contract EIP20Gateway is GatewayBase { */ function progressStakeWithProof( bytes32 _messageHash, - bytes calldata _rlpEncodedParentNodes, + bytes calldata _rlpParentNodes, uint256 _blockHeight, uint256 _messageStatus ) @@ -473,7 +473,7 @@ contract EIP20Gateway is GatewayBase { "Message hash must not be zero" ); require( - _rlpEncodedParentNodes.length > 0, + _rlpParentNodes.length > 0, "RLP encoded parent nodes must not be zero" ); @@ -498,7 +498,7 @@ contract EIP20Gateway is GatewayBase { messageBox, STAKE_TYPEHASH, message, - _rlpEncodedParentNodes, + _rlpParentNodes, MESSAGE_BOX_OFFSET, storageRoot, MessageBus.MessageStatus(_messageStatus) @@ -579,18 +579,18 @@ contract EIP20Gateway 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 CoGateway + * @param _rlpParentNodes RLP encoded parent node data to prove + * DeclaredRevocation in messageBox inbox of + * CoGateway. * - * @return staker_ Staker address - * @return stakerNonce_ Staker nonce - * @return amount_ Stake amount + * @return staker_ Staker address. + * @return stakerNonce_ Staker nonce. + * @return amount_ Stake amount. */ function progressRevertStake( bytes32 _messageHash, uint256 _blockHeight, - bytes calldata _rlpEncodedParentNodes + bytes calldata _rlpParentNodes ) external returns ( @@ -604,8 +604,8 @@ contract EIP20Gateway 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 @@ -628,7 +628,7 @@ contract EIP20Gateway is GatewayBase { message, STAKE_TYPEHASH, MESSAGE_BOX_OFFSET, - _rlpEncodedParentNodes, + _rlpParentNodes, storageRoot, MessageBus.MessageStatus.Revoked ); @@ -673,12 +673,12 @@ contract EIP20Gateway is GatewayBase { * redeem and unstake process done * @param _gasLimit Gas limit that redeemer is ready to pay. * @param _blockHeight Block number for which the proof is valid. - * @param _hashLock Hash lock - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove - * Declared in messageBox outbox - * of CoGateway + * @param _hashLock Hash lock. + * @param _rlpParentNodes RLP encoded parent node data to prove + * Declared in messageBox outbox of + * CoGateway. * - * @return messageHash_ Message hash + * @return messageHash_ Message hash. */ function confirmRedeemIntent( address _redeemer, @@ -689,7 +689,7 @@ contract EIP20Gateway is GatewayBase { uint256 _gasLimit, uint256 _blockHeight, bytes32 _hashLock, - bytes memory _rlpEncodedParentNodes + bytes memory _rlpParentNodes ) public returns (bytes32 messageHash_) @@ -710,7 +710,7 @@ contract EIP20Gateway is GatewayBase { "Redeem amount must not be zero" ); require( - _rlpEncodedParentNodes.length > 0, + _rlpParentNodes.length > 0, "RLP encoded parent nodes must not be zero" ); @@ -756,7 +756,7 @@ contract EIP20Gateway is GatewayBase { confirmRedeemIntentInternal( messages[messageHash_], _blockHeight, - _rlpEncodedParentNodes + _rlpParentNodes ); // Emit RedeemIntentConfirmed event. @@ -834,9 +834,9 @@ contract EIP20Gateway is GatewayBase { * CoGateway is either declared or progressed. * * @param _messageHash Message hash. - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox inbox of CoGateway - * @param _blockHeight Block number for which the proof is valid + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox inbox of CoGateway. + * @param _blockHeight Block number for which the proof is valid. * @param _messageStatus Message status i.e. Declared or Progressed that * will be proved. * @@ -850,7 +850,7 @@ contract EIP20Gateway is GatewayBase { */ function progressUnstakeWithProof( bytes32 _messageHash, - bytes memory _rlpEncodedParentNodes, + bytes memory _rlpParentNodes, uint256 _blockHeight, uint256 _messageStatus ) @@ -869,8 +869,8 @@ contract EIP20Gateway 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 @@ -887,7 +887,7 @@ contract EIP20Gateway is GatewayBase { messageBox, REDEEM_TYPEHASH, message, - _rlpEncodedParentNodes, + _rlpParentNodes, MESSAGE_BOX_OFFSET, storageRoot, MessageBus.MessageStatus(_messageStatus) @@ -903,19 +903,19 @@ contract EIP20Gateway is GatewayBase { * clear unstakes mapping storage. * * @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 CoGateway + * @param _blockHeight Block number for which the proof is valid. + * @param _rlpParentNodes RLP encoded parent node data to prove + * DeclaredRevocation in messageBox outbox of + * CoGateway. * - * @return redeemer_ Redeemer address - * @return redeemerNonce_ Redeemer nonce - * @return amount_ Redeem amount + * @return redeemer_ Redeemer address. + * @return redeemerNonce_ Redeemer nonce. + * @return amount_ Redeem amount. */ function confirmRevertRedeemIntent( bytes32 _messageHash, uint256 _blockHeight, - bytes calldata _rlpEncodedParentNodes + bytes calldata _rlpParentNodes ) external returns ( @@ -932,8 +932,8 @@ contract EIP20Gateway 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. @@ -955,7 +955,7 @@ contract EIP20Gateway is GatewayBase { messageBox, REDEEM_TYPEHASH, message, - _rlpEncodedParentNodes, + _rlpParentNodes, MESSAGE_BOX_OFFSET, storageRoot ); diff --git a/contracts/gateway/GatewayBase.sol b/contracts/gateway/GatewayBase.sol index 3f8df5ba..1d542a34 100644 --- a/contracts/gateway/GatewayBase.sol +++ b/contracts/gateway/GatewayBase.sol @@ -168,23 +168,23 @@ contract GatewayBase is Organized { * * @param _blockHeight Block height at which Gateway/CoGateway is to be * proven. - * @param _rlpEncodedAccount RLP encoded account node object. + * @param _rlpAccount RLP encoded account node object. * @param _rlpParentNodes RLP encoded value of account proof parent nodes. * * @return `true` if Gateway account is proved */ function proveGateway( uint256 _blockHeight, - bytes calldata _rlpEncodedAccount, + bytes calldata _rlpAccount, bytes calldata _rlpParentNodes ) external returns (bool /* success */) { - // _rlpEncodedAccount should be valid + // _rlpAccount should be valid require( - _rlpEncodedAccount.length != 0, - "Length of RLP encoded account is 0" + _rlpAccount.length != 0, + "Length of RLP account must not be 0." ); // _rlpParentNodes should be valid @@ -220,7 +220,7 @@ contract GatewayBase is Organized { } bytes32 storageRoot = GatewayLib.proveAccount( - _rlpEncodedAccount, + _rlpAccount, _rlpParentNodes, encodedGatewayPath, stateRoot diff --git a/contracts/gateway/MessageBus.sol b/contracts/gateway/MessageBus.sol index aecef84c..277f284d 100644 --- a/contracts/gateway/MessageBus.sol +++ b/contracts/gateway/MessageBus.sol @@ -147,21 +147,21 @@ library MessageBus { * status in source chains outbox. This will update the inbox * status to `Declared` for the given message hash. * - * @param _messageBox Message Box - * @param _messageTypeHash Message type hash - * @param _message Message object - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox outbox. + * @param _messageBox Message Box. + * @param _messageTypeHash Message type hash. + * @param _message Message object. + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox outbox. * @param _messageBoxOffset position of the messageBox. - * @param _storageRoot storage root for proof + * @param _storageRoot Storage root for proof. * - * @return messageHash_ Message hash + * @return messageHash_ Message hash. */ function confirmMessage( MessageBox storage _messageBox, bytes32 _messageTypeHash, Message storage _message, - bytes calldata _rlpEncodedParentNodes, + bytes calldata _rlpParentNodes, uint8 _messageBoxOffset, bytes32 _storageRoot ) @@ -198,7 +198,7 @@ library MessageBus { MerklePatriciaProof.verify( keccak256(abi.encodePacked(MessageStatus.Declared)), path, - _rlpEncodedParentNodes, + _rlpParentNodes, _storageRoot), "Merkle proof verification failed" ); @@ -262,23 +262,23 @@ library MessageBus { * either `Declared` or `Progresses`. Either of this status will be * verified in the merkle proof * - * @param _messageBox Message Box - * @param _messageTypeHash Message type hash - * @param _message Message object - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox inbox. + * @param _messageBox Message Box. + * @param _messageTypeHash Message type hash. + * @param _message Message object. + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox inbox. * @param _messageBoxOffset position of the messageBox. - * @param _storageRoot storage root for proof + * @param _storageRoot storage root for proof. * @param _messageStatus Message status of message hash in the inbox of - * source chain + * source chain. * - * @return messageHash_ Message hash + * @return messageHash_ Message hash. */ function progressOutboxWithProof( MessageBox storage _messageBox, bytes32 _messageTypeHash, Message storage _message, - bytes calldata _rlpEncodedParentNodes, + bytes calldata _rlpParentNodes, uint8 _messageBoxOffset, bytes32 _storageRoot, MessageStatus _messageStatus @@ -326,7 +326,7 @@ library MessageBus { MerklePatriciaProof.verify( keccak256(abi.encodePacked(_messageStatus)), path, - _rlpEncodedParentNodes, + _rlpParentNodes, _storageRoot), "Merkle proof verification failed" ); @@ -390,23 +390,23 @@ library MessageBus { * either `Declared` or `Progresses`. Either of this status will be * verified in the merkle proof * - * @param _messageBox Message Box - * @param _messageTypeHash Message type hash - * @param _message Message object - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox outbox. + * @param _messageBox Message Box. + * @param _messageTypeHash Message type hash. + * @param _message Message object. + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox outbox. * @param _messageBoxOffset position of the messageBox. - * @param _storageRoot storage root for proof + * @param _storageRoot storage root for proof. * @param _messageStatus Message status of message hash in the outbox of - * source chain + * source chain. * - * @return messageHash_ Message hash + * @return messageHash_ Message hash. */ function progressInboxWithProof( MessageBox storage _messageBox, bytes32 _messageTypeHash, Message storage _message, - bytes calldata _rlpEncodedParentNodes, + bytes calldata _rlpParentNodes, uint8 _messageBoxOffset, bytes32 _storageRoot, MessageStatus _messageStatus @@ -452,8 +452,9 @@ library MessageBus { MerklePatriciaProof.verify( keccak256(abi.encodePacked(_messageStatus)), path, - _rlpEncodedParentNodes, - _storageRoot), + _rlpParentNodes, + _storageRoot + ), "Merkle proof verification failed" ); @@ -513,8 +514,8 @@ library MessageBus { * @param _messageBox Message Box * @param _messageTypeHash Message type hash * @param _message Message object - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox outbox. + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox outbox. * @param _messageBoxOffset position of the messageBox. * @param _storageRoot storage root for proof * @@ -524,7 +525,7 @@ library MessageBus { MessageBox storage _messageBox, bytes32 _messageTypeHash, Message storage _message, - bytes calldata _rlpEncodedParentNodes, + bytes calldata _rlpParentNodes, uint8 _messageBoxOffset, bytes32 _storageRoot ) @@ -557,11 +558,13 @@ library MessageBus { ); // Perform the merkle proof - require(MerklePatriciaProof.verify( + require( + MerklePatriciaProof.verify( keccak256(abi.encodePacked(MessageStatus.DeclaredRevocation)), path, - _rlpEncodedParentNodes, - _storageRoot), + _rlpParentNodes, + _storageRoot + ), "Merkle proof verification failed" ); @@ -576,26 +579,26 @@ library MessageBus { * * @dev The messsage status in the inbox should be * either `DeclaredRevocation` or `Revoked`. Either of this status - * will be verified in the merkle proof + * will be verified in the merkle proof. * - * @param _messageBox Message Box - * @param _message Message object - * @param _messageTypeHash Message type hash + * @param _messageBox Message Box. + * @param _message Message object. + * @param _messageTypeHash Message type hash. * @param _messageBoxOffset position of the messageBox. - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox inbox. - * @param _storageRoot storage root for proof + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox inbox. + * @param _storageRoot storage root for proof. * @param _messageStatus Message status of message hash in the inbox of - * source chain + * source chain. * - * @return messageHash_ Message hash + * @return messageHash_ Message hash. */ function progressOutboxRevocation( MessageBox storage _messageBox, Message storage _message, bytes32 _messageTypeHash, uint8 _messageBoxOffset, - bytes calldata _rlpEncodedParentNodes, + bytes calldata _rlpParentNodes, bytes32 _storageRoot, MessageStatus _messageStatus ) @@ -642,8 +645,9 @@ library MessageBus { MerklePatriciaProof.verify( keccak256(abi.encodePacked(_messageStatus)), path, - _rlpEncodedParentNodes, - _storageRoot), + _rlpParentNodes, + _storageRoot + ), "Merkle proof verification failed" ); diff --git a/contracts/gateway/MockMessageBus.sol b/contracts/gateway/MockMessageBus.sol index a9029524..6da60ea4 100644 --- a/contracts/gateway/MockMessageBus.sol +++ b/contracts/gateway/MockMessageBus.sol @@ -148,21 +148,21 @@ library MockMessageBus { * status in source chains outbox. This will update the inbox * status to `Declared` for the given message hash. * - * @param _messageBox Message Box - * @param _messageTypeHash Message type hash - * @param _message Message object - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox outbox. + * @param _messageBox Message Box. + * @param _messageTypeHash Message type hash. + * @param _message Message object. + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox outbox. * @param _messageBoxOffset position of the messageBox. - * @param _storageRoot storage root for proof + * @param _storageRoot storage root for proof. * - * @return messageHash_ Message hash + * @return messageHash_ Message hash. */ function confirmMessage( MessageBox storage _messageBox, bytes32 _messageTypeHash, Message storage _message, - bytes calldata _rlpEncodedParentNodes, + bytes calldata _rlpParentNodes, uint8 _messageBoxOffset, bytes32 _storageRoot ) @@ -199,8 +199,9 @@ library MockMessageBus { MockMerklePatriciaProof.verify( keccak256(abi.encodePacked(MessageStatus.Declared)), path, - _rlpEncodedParentNodes, - _storageRoot), + _rlpParentNodes, + _storageRoot + ), "Merkle proof verification failed" ); @@ -261,25 +262,25 @@ library MockMessageBus { * * @dev The messsage status for the message hash in the inbox should be * either `Declared` or `Progresses`. Either of this status will be - * verified in the merkle proof + * verified in the merkle proof. * - * @param _messageBox Message Box - * @param _messageTypeHash Message type hash - * @param _message Message object - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox inbox. + * @param _messageBox Message Box. + * @param _messageTypeHash Message type hash. + * @param _message Message object. + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox inbox. * @param _messageBoxOffset position of the messageBox. - * @param _storageRoot storage root for proof + * @param _storageRoot storage root for proof. * @param _messageStatus Message status of message hash in the inbox of - * source chain + * source chain. * - * @return messageHash_ Message hash + * @return messageHash_ Message hash. */ function progressOutboxWithProof( MessageBox storage _messageBox, bytes32 _messageTypeHash, Message storage _message, - bytes calldata _rlpEncodedParentNodes, + bytes calldata _rlpParentNodes, uint8 _messageBoxOffset, bytes32 _storageRoot, MessageStatus _messageStatus @@ -327,8 +328,9 @@ library MockMessageBus { MockMerklePatriciaProof.verify( keccak256(abi.encodePacked(_messageStatus)), path, - _rlpEncodedParentNodes, - _storageRoot), + _rlpParentNodes, + _storageRoot + ), "Merkle proof verification failed" ); @@ -389,26 +391,26 @@ library MockMessageBus { * * @dev The messsage status for the message hash in the outbox should be * either `Declared` or `Progresses`. Either of this status will be - * verified in the merkle proof + * verified in the merkle proof. * - * @param _messageBox Message Box - * @param _messageTypeHash Message type hash - * @param _message Message object - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox outbox. + * @param _messageBox Message Box. + * @param _messageTypeHash Message type hash. + * @param _message Message object. + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox outbox. * @param _messageBoxOffset position of the messageBox. - * @param _storageRoot storage root for proof + * @param _storageRoot storage root for proof. * @param _messageStatus Message status of message hash in the outbox of - * source chain + * source chain. * - * @return messageHash_ Message hash + * @return messageHash_ Message hash. */ function progressInboxWithProof( MessageBox storage _messageBox, bytes32 _messageTypeHash, Message storage _message, - bytes calldata _rlpEncodedParentNodes, + bytes calldata _rlpParentNodes, uint8 _messageBoxOffset, bytes32 _storageRoot, MessageStatus _messageStatus @@ -454,8 +456,9 @@ library MockMessageBus { MockMerklePatriciaProof.verify( keccak256(abi.encodePacked(_messageStatus)), path, - _rlpEncodedParentNodes, - _storageRoot), + _rlpParentNodes, + _storageRoot + ), "Merkle proof verification failed" ); @@ -588,21 +591,21 @@ library MockMessageBus { * @dev In order to declare revocation the existing message status for the * given message hash should be `Declared`. * - * @param _messageBox Message Box - * @param _messageTypeHash Message type hash - * @param _message Message object - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox outbox. + * @param _messageBox Message Box. + * @param _messageTypeHash Message type hash. + * @param _message Message object. + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox outbox. * @param _messageBoxOffset position of the messageBox. - * @param _storageRoot storage root for proof + * @param _storageRoot storage root for proof. * - * @return messageHash_ Message hash + * @return messageHash_ Message hash. */ function confirmRevocation( MessageBox storage _messageBox, bytes32 _messageTypeHash, Message storage _message, - bytes calldata _rlpEncodedParentNodes, + bytes calldata _rlpParentNodes, uint8 _messageBoxOffset, bytes32 _storageRoot ) @@ -635,11 +638,13 @@ library MockMessageBus { ); // Perform the merkle proof - require(MockMerklePatriciaProof.verify( + require( + MockMerklePatriciaProof.verify( keccak256(abi.encodePacked(MessageStatus.DeclaredRevocation)), path, - _rlpEncodedParentNodes, - _storageRoot), + _rlpParentNodes, + _storageRoot + ), "Merkle proof verification failed" ); @@ -654,26 +659,26 @@ library MockMessageBus { * * @dev The messsage status in the inbox should be * either `DeclaredRevocation` or `Revoked`. Either of this status - * will be verified in the merkle proof + * will be verified in the merkle proof. * - * @param _messageBox Message Box - * @param _message Message object - * @param _messageTypeHash Message type hash + * @param _messageBox Message Box. + * @param _message Message object. + * @param _messageTypeHash Message type hash. * @param _messageBoxOffset position of the messageBox. - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox inbox. - * @param _storageRoot storage root for proof + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox inbox. + * @param _storageRoot storage root for proof. * @param _messageStatus Message status of message hash in the inbox of - * source chain + * source chain. * - * @return messageHash_ Message hash + * @return messageHash_ Message hash. */ function progressOutboxRevocation( MessageBox storage _messageBox, Message storage _message, bytes32 _messageTypeHash, uint8 _messageBoxOffset, - bytes calldata _rlpEncodedParentNodes, + bytes calldata _rlpParentNodes, bytes32 _storageRoot, MessageStatus _messageStatus ) @@ -720,8 +725,9 @@ library MockMessageBus { MockMerklePatriciaProof.verify( keccak256(abi.encodePacked(_messageStatus)), path, - _rlpEncodedParentNodes, - _storageRoot), + _rlpParentNodes, + _storageRoot + ), "Merkle proof verification failed" ); diff --git a/contracts/lib/GatewayLib.sol b/contracts/lib/GatewayLib.sol index e08f3a06..1b54ac74 100644 --- a/contracts/lib/GatewayLib.sol +++ b/contracts/lib/GatewayLib.sol @@ -97,7 +97,7 @@ library GatewayLib { /** * @notice Merkle proof verification of account. * - * @param _rlpEncodedAccount rlp encoded data of account. + * @param _rlpAccount rlp encoded data of account. * @param _rlpParentNodes path from root node to leaf in merkle tree. * @param _encodedPath encoded path to search account node in merkle tree. * @param _stateRoot state root for given block height. @@ -105,7 +105,7 @@ library GatewayLib { * @return bytes32 Storage path of the variable */ function proveAccount( - bytes calldata _rlpEncodedAccount, + bytes calldata _rlpAccount, bytes calldata _rlpParentNodes, bytes calldata _encodedPath, bytes32 _stateRoot @@ -115,14 +115,14 @@ library GatewayLib { returns (bytes32 storageRoot_) { // Decode RLP encoded account value - RLP.RLPItem memory accountItem = RLP.toRLPItem(_rlpEncodedAccount); + RLP.RLPItem memory accountItem = RLP.toRLPItem(_rlpAccount); // Convert to list RLP.RLPItem[] memory accountArray = RLP.toList(accountItem); // Array 3rd position is storage root storageRoot_ = RLP.toBytes32(accountArray[2]); - // Hash the rlpEncodedValue value + // Hash the rlpValue value bytes32 hashedAccount = keccak256( - abi.encodePacked(_rlpEncodedAccount) + abi.encodePacked(_rlpAccount) ); /** diff --git a/contracts/lib/RLPTest.sol b/contracts/lib/RLPTest.sol index 050cfea1..1267659e 100644 --- a/contracts/lib/RLPTest.sol +++ b/contracts/lib/RLPTest.sol @@ -12,19 +12,19 @@ contract RLPTest { /** * @notice Creates an RLPItem from an array of RLP encoded bytes. * - * @param rlpEncodedData The RLP encoded bytes. + * @param rlpData The RLP encoded bytes. *  * @return memory pointer at which rlp data is present.  * @return length of the rlp data. */ function toRLPItem( - bytes memory rlpEncodedData + bytes memory rlpData ) public pure returns(uint memoryPointer_, uint length_) { - RLP.RLPItem memory item = RLP.toRLPItem(rlpEncodedData); + RLP.RLPItem memory item = RLP.toRLPItem(rlpData); memoryPointer_ = item._unsafe_memPtr; length_ = item._unsafe_length; } @@ -33,21 +33,21 @@ contract RLPTest { * @notice Get the list of sub-items from an RLP encoded list. * Warning: This is inefficient, as it requires that the list is read twice. * -  * @param rlpEncodedData The RLP encoded bytes. +  * @param rlpData The RLP encoded bytes.  * @param index The position in the input array of which data is returned  *  * @return data kept at index.  * @return length of list.  */ function toList( - bytes memory rlpEncodedData, + bytes memory rlpData, uint256 index ) public pure returns (bytes memory data_, uint256 length_) { - RLP.RLPItem memory item = RLP.toRLPItem(rlpEncodedData); + RLP.RLPItem memory item = RLP.toRLPItem(rlpData); RLP.RLPItem[] memory list = RLP.toList(item); length_ = list.length; @@ -59,36 +59,36 @@ contract RLPTest { /** *@notice Decode an RLPItem into a bytes32. This will not work if the RLPItem is a list. * - * @param rlpEncodedData The RLPItem encoded bytes. + * @param rlpData The RLPItem encoded bytes. * * @return toBytes decoded value in the from of bytes. */ function toBytes( - bytes memory rlpEncodedData + bytes memory rlpData ) public pure returns(bytes memory bytes_) { - RLP.RLPItem memory item = RLP.toRLPItem(rlpEncodedData); + RLP.RLPItem memory item = RLP.toRLPItem(rlpData); bytes_ = RLP.toBytes(item); } /** * @notice Decode an RLPItem into bytes. This will not work if the RLPItem is a list. * -  * @param rlpEncodedData The RLPItem encoded bytes. +  * @param rlpData The RLPItem encoded bytes. * * @return toData The decoded string in bytes format. */ function toData( - bytes memory rlpEncodedData + bytes memory rlpData ) public pure returns(bytes memory bytes_) { - RLP.RLPItem memory item = RLP.toRLPItem(rlpEncodedData); + RLP.RLPItem memory item = RLP.toRLPItem(rlpData); bytes_ = RLP.toData(item); } } diff --git a/contracts/test/MessageBusWrapper.sol b/contracts/test/MessageBusWrapper.sol index cdb33484..540deb1f 100644 --- a/contracts/test/MessageBusWrapper.sol +++ b/contracts/test/MessageBusWrapper.sol @@ -193,8 +193,8 @@ contract MessageBusWrapper { * @param _nonce message nonce. * @param _sender signer of the signature. * @param _messageBoxOffset position of the messageBox. - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox inbox. + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox inbox. * @param _storageRoot storage root for proof * @param _messageStatus Message status of message hash in the inbox of * source chain @@ -208,7 +208,7 @@ contract MessageBusWrapper { uint256 _nonce, address _sender, uint8 _messageBoxOffset, - bytes memory _rlpEncodedParentNodes, + bytes memory _rlpParentNodes, bytes32 _storageRoot, MockMessageBus.MessageStatus _messageStatus, bytes32 _hashLock @@ -231,7 +231,7 @@ contract MessageBusWrapper { message, _messageTypeHash, _messageBoxOffset, - _rlpEncodedParentNodes, + _rlpParentNodes, _storageRoot, _messageStatus ); @@ -249,8 +249,8 @@ contract MessageBusWrapper { * @param _intentHash Intent hash. * @param _nonce message nonce. * @param _sender signer of the signature. - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox outbox. + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox outbox. * @param _messageBoxOffset position of the messageBox. * @param _storageRoot storage root for proof. * @param _hashLock Hash lock. @@ -263,7 +263,7 @@ contract MessageBusWrapper { uint256 _nonce, address _sender, uint8 _messageBoxOffset, - bytes memory _rlpEncodedParentNodes, + bytes memory _rlpParentNodes, bytes32 _storageRoot, bytes32 _hashLock ) @@ -284,7 +284,7 @@ contract MessageBusWrapper { messageBox, _messageTypeHash, message, - _rlpEncodedParentNodes, + _rlpParentNodes, _messageBoxOffset, _storageRoot ); @@ -300,8 +300,8 @@ contract MessageBusWrapper { * @param _intentHash Intent hash. * @param _nonce message nonce. * @param _sender signer of the signature. - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox outbox. + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox outbox. * @param _messageBoxOffset position of the messageBox. * @param _storageRoot storage root for proof. * @param _hashLock Hash lock. @@ -313,7 +313,7 @@ contract MessageBusWrapper { bytes32 _intentHash, uint256 _nonce, address _sender, - bytes memory _rlpEncodedParentNodes, + bytes memory _rlpParentNodes, bytes32 _storageRoot, uint8 _messageBoxOffset, bytes32 _hashLock @@ -335,7 +335,7 @@ contract MessageBusWrapper { messageBox, _messageTypeHash, message, - _rlpEncodedParentNodes, + _rlpParentNodes, _messageBoxOffset, _storageRoot ); @@ -383,7 +383,7 @@ contract MessageBusWrapper { gasConsumed: _gasConsumed }); - messageHash_= MockMessageBus.declareRevocationMessage( + messageHash_ = MockMessageBus.declareRevocationMessage( messageBox, _messageTypeHash, message @@ -404,8 +404,8 @@ contract MessageBusWrapper { * @param _intentHash Intent hash. * @param _nonce message nonce. * @param _sender signer of the signature. - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox inbox. + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox inbox. * @param _storageRoot storage root for proof * @param _messageStatus Message status of message hash in the inbox of * source chain @@ -418,7 +418,7 @@ contract MessageBusWrapper { bytes32 _intentHash, uint256 _nonce, address _sender, - bytes memory _rlpEncodedParentNodes, + bytes memory _rlpParentNodes, bytes32 _storageRoot, MockMessageBus.MessageStatus _messageStatus, bytes32 _hashLock, @@ -441,7 +441,7 @@ contract MessageBusWrapper { messageBox, _messageTypeHash, message, - _rlpEncodedParentNodes, + _rlpParentNodes, _messageBoxOffset, _storageRoot, _messageStatus @@ -456,26 +456,26 @@ contract MessageBusWrapper { * * @dev The messsage status for the message hash in the outbox should be * either `Declared` or `Progresses`. Either of this status will be - * verified in the merkle proof + * verified in the merkle proof. * - * @param _messageTypeHash Message type hash + * @param _messageTypeHash Message type hash. * @param _intentHash Intent hash. * @param _nonce message nonce. * @param _sender signer of the signature. - * @param _rlpEncodedParentNodes RLP encoded parent node data to prove in - * messageBox outbox. - * @param _storageRoot storage root for proof + * @param _rlpParentNodes RLP encoded parent node data to prove in + * messageBox outbox. + * @param _storageRoot storage root for proof. * @param _messageStatus Message status of message hash in the outbox of - * source chain + * source chain. * - * @return messageHash_ Message hash + * @return messageHash_ Message hash. */ function progressInboxWithProof( bytes32 _messageTypeHash, bytes32 _intentHash, uint256 _nonce, address _sender, - bytes memory _rlpEncodedParentNodes, + bytes memory _rlpParentNodes, bytes32 _storageRoot, MockMessageBus.MessageStatus _messageStatus, bytes32 _hashLock, @@ -498,7 +498,7 @@ contract MessageBusWrapper { messageBox, _messageTypeHash, message, - _rlpEncodedParentNodes, + _rlpParentNodes, _messageBoxOffset, _storageRoot, _messageStatus diff --git a/contracts/test/gateway/MockGatewayBase.sol b/contracts/test/gateway/MockGatewayBase.sol index bd2513d8..3ec855b8 100644 --- a/contracts/test/gateway/MockGatewayBase.sol +++ b/contracts/test/gateway/MockGatewayBase.sol @@ -42,29 +42,29 @@ contract MockGatewayBase is GatewayBase { * * @param _blockHeight Block height at which Gateway/CoGateway is to be * proven. - * @param _rlpEncodedAccount RLP encoded account node object. + * @param _rlpAccount RLP encoded account node object. * @param _rlpParentNodes RLP encoded value of account proof parent nodes. * * @return `true` if Gateway account is proved */ function proveGateway( uint256 _blockHeight, - bytes calldata _rlpEncodedAccount, + bytes calldata _rlpAccount, bytes calldata _rlpParentNodes ) external returns (bool) { - // _rlpEncodedAccount should be valid + // _rlpAccount should be valid require( - _rlpEncodedAccount.length != 0, - "Length of RLP encoded account is 0" + _rlpAccount.length != 0, + "Length of RLP account must not be 0." ); // _rlpParentNodes should be valid require( _rlpParentNodes.length != 0, - "Length of RLP parent nodes is 0" + "Length of RLP parent nodes must not be 0." ); bytes32 stateRoot = StateRootInterface(address(core)).getStateRoot(_blockHeight); @@ -96,7 +96,7 @@ contract MockGatewayBase is GatewayBase { // On successful proof verification storage root is returned other wise // transaction is reverted. bytes32 storageRoot = MockGatewayLib.proveAccount( - _rlpEncodedAccount, + _rlpAccount, _rlpParentNodes, encodedGatewayPath, stateRoot diff --git a/test/core/kernel_gateway/prove_origin_core.js b/test/core/kernel_gateway/prove_origin_core.js index a8d120f3..1dc85bbc 100644 --- a/test/core/kernel_gateway/prove_origin_core.js +++ b/test/core/kernel_gateway/prove_origin_core.js @@ -33,13 +33,11 @@ contract('KernelGateway.proveOriginCore()', async (accounts) => { let originCore, kernelGateway, originBlockStore, auxiliaryBlockStore; - let accountRlp = testData.account.rlpEncodedAccount; + let accountRlp = testData.account.rlpAccount; let accountBranchRlp = testData.account.rlpParentNodes; let stateRoot = testData.account.stateRoot; let originBlockHeight = new BN(100); - let encodedPath; - async function deploy(KernelGateway) { // deploy the kernel gateway originCore = accounts[1]; @@ -53,7 +51,6 @@ contract('KernelGateway.proveOriginCore()', async (accounts) => { web3.utils.sha3('genesisKernelHash'), ); - encodedPath = await kernelGateway.encodedOriginCorePath(); await originBlockStore.setStateRoot(stateRoot); } diff --git a/test/data/proof.json b/test/data/proof.json index b0af48a4..9efc49c4 100644 --- a/test/data/proof.json +++ b/test/data/proof.json @@ -1,7 +1,7 @@ { "account": { - "rlpEncodedAccount": "0xf8468206fb80a036ed801abf5678f1506f1fa61e5ccda1f4de53cc7cd03224e3b2a03159b6460da05b7534dec07bb70fb401032a60cb5a9d67f2bd2f50dfad5f2656c3c2fe8f2675", - "sha3EncodedAccount":"0x589b8a2a740936d7fd4bfa15532ab33ad68a1083da31609e2a3bd9ebcbd04002", + "rlpAccount": "0xf8468206fb80a036ed801abf5678f1506f1fa61e5ccda1f4de53cc7cd03224e3b2a03159b6460da05b7534dec07bb70fb401032a60cb5a9d67f2bd2f50dfad5f2656c3c2fe8f2675", + "sha3EncodedAccount": "0x589b8a2a740936d7fd4bfa15532ab33ad68a1083da31609e2a3bd9ebcbd04002", "accountAddress": "0x01db94fdca0ffedc40a6965de97790085d71b412", "hashedPath": "0x0d00ce4ced21ae7bedd22cd1f49238c2280cf1e50a14e8f5d2038e29f59f37af", "rlpParentNodes": "0xf908cef90211a0f113fc83479a9dcb7a7b5c98cdb42f24260f4d12b82003c3a99c0396d58918e4a007da904438ce6e90091514622c5f43816ebda4b28edb7d28c185af95b0b5d0bba0fa08a20a1e7b354aea4186ce7a56c66f08e0bad3d384ccbec3308b86a048f28da082faa84d23c856e00add29d83dffd20c640f7c4cb500a2f1b6ec345730518090a0db06fd0cd48958bdadc30f163ea9bb95d5cd1ca5605b649bca7a94f51e629b86a001cb1bae18830ad03bffb1ed8ad4c2c0338dfb6d4edc734b60d4751c838cf6d1a0b549ccb01890070dde0c2339fe189a54c3f9b5d6c0dee5c3228ec13ea8154f08a0fa860a8dd11a45a645c8f2add444311d0ce77e0e0153af518a8c82cd2a4e530ca0582c96d90db5da3e59dee0bb2ca191d97613717000c24f012539b61be5d777a9a0bc30df4754a90bde3a6f795a03f6cb2747f9180fa13087a249eda1993e38213ba04030ae5f6e34465c29bf9f164bd168e291fea360fa9ac6e2a01bcfaa29c97837a028f4323329a54f02e9fa6c65b9992b380602ce8d86f3c4ea6d1f799376eede97a099728882f75d2777db12440f90756cad8ce90637726e2949cc3039a310c0d26ba015e593e9d83137f2a6b3d6e79f3efdb62b7c2e0d4885f242392903c458adbecba0a022e3488e55dcdd8ff64c000e33f45c51a5fce1225647042ee26e512cfaf8aea03c35754a8a080ec63632e7b3d5fd2b653b4d217116dc74ec44c1eee04d2f611280f90211a056236df72b2a3baf3c4b110622911d48e8134dce5fab96dc4aa0e86bf1345f38a0e02f83a4f33cc5e624d7243d341d4b4d06a91e074250dbf2caebfa2c3e4765d0a0a72d49adff0c5e77dc9d95b4191d8d6668971f74077797659f83d415cd0fd1d1a0c60abc4f0a940d618cf9cea13adfaa4c03e3061bd702986daf5237d1065ef788a05d962c16915d89ede187bd317d3b90c6e4fdd076e53267e1857102cefadf22eda0926dc3780e5eefb8e262d98db26df3429404beb9ae838e69ba7c071d09891791a0a5f7008f700c2d6f10e14071c6471f62005f8409ed6af67a955ad7fb939c27caa0b558c2fee610404a708a543aebd8a729da27434f5608cbaa4691462c72874056a0faa4cce3c8599c6d984e9577ab6bd9b0c006068c31d9e03215cc8908114d7757a0a3d6d16c957326cd262da81bad6b7dee022e4dbd202adff5d7ccc4342a61d21fa0d55c004ac2e9eaec20c2cffef567de49df83fde291e52abc815db781dac5456ba06ab98c39c210c5e2a9ffb994afdefd5ca02bdceff8cfd8e60d68c199d864b94ca0522232d286697b81da8721463bce6e8dedff3330bc13c02937b78fe1afa9005ba0c3bf8ac2260dab7d0108b546f94e2c714aaea8b2274745b7575ded129520304ea0a481df0f7947c98bd4ea7738f706826df3031ae129e362fcfeca937e8651eb4ea05193d68afbd4b7509f77498f1587ea9e090697c2e95c4d2bafbb52a8cf9bd62480f90211a011561aaab4838e5fa61b9e6debfdba192744c612d2ba76ab61deb015746aa5a0a00026c65c973bbd95e6c0e980f4d22e4627715e5e9f421c80fc49f1f67f7b971fa00d119e6b55db30543e2065bc456dbe0828b97c1b0d217846c4ee787bee670d79a0bc563733a582905db3b2eb375218ff1b64cc9a12abc84ec663086a460a625394a093ff057cda650d4808cb25651fe2f77652107c4c56d9647fe75c8c0a3d2d0d64a06cf305021c9a1a175e01fe56f8ef8f527f8a69fc9042e9b1b0a4ba53ea3b0025a078a50de369a7bddf71b0f8bab722b4c34c56918eb051776a7cb8598c0011170ba0699884e0545d810a93c1c80a6ba48020ade2ada6b556764f937712c8628c033da00d02491b26b79333b5a3ec8ffd455921600cc327183d260ad4d4ed5d63fc2aa6a02d9468383a418e9303989bbad1845e3c48ef803bacea406e1fd68e25a565a9d2a0a4453049a044659669a5ff8c56229d339ea860b934ad895bab0ef865cce2fffea0d654be53e9c8fc64a068ef9cd7768eadbeb52bcaa764cececfa6be01b8e074f2a087f0f15350b42c7a8efe19eb64bf8b7ab13daeeebb40f4f3f8b3685b0fc0031ea0ce410da15fc84e9b8caf8d6785f241c74a6b70d5b62f71ba4a1d09ff47921d8da0fcf5effb792c9b1ca3fbffe251cdb27c0facf30d3445b3e230537df48399da69a042acf9ab2c371e984f2c280566ba342a4e0a081e555bbec957aab3296fb4af1980f901d1a07c6a2cff79b45c222da90c55b00dca5f51b62b0cbeff1a0c1f6984851be684daa097fa80b5e381a5d49663a6b86e8721843b93e534da0db48e1db74967c28d7e82a045009364e98f5b0ead865504e8209ccffb7fb63b2a28464717504a78141f518fa039bcfc875dbca2f973a7f5f2f19b55b3bc22f80f387413a12ee0dab5e0254107a009c6f751027ce16b579633a060bee4028dd0ba87567fadf0a887811d9ed7e594a0d0eba05cdd60831f8532710718106860bc2853dc628e55e286c78afe6f3891d0a0904d4bf3896ac04520fd93e47169b6bfff4c7cdf25420b342784abd7090f2dd4a0feb4a9be9f299e0f58645e4ae2f8e2c2082368d2e08a9cec0c6ae37411c56de9a0e30f69e6968d9611a3d52d210a282244316d31367642f2c4f159161fec71e269a0a665c800370015f89a458e68e95b96c4e6976347a6a5f76df6b58f1451bb8948a0120a7594596f36b628223057eb375c73653dfa6fcbfc3ec8d2ce201a685aaa9680a0c7bbde5d654a3bf527ae035eeba861d25280b88b7a0376bf7c39625d9ffd9879a005d5ae3d04a79a90f21af570116b6e4c29e6e606c877bf9b015a5f03e18d1e24a0b2b77afc6c3b77c6a171e5f49bd6508f455fbe93864c7c832a02b303e4f227e48080f8518080808080a081dc71924e3436de3a7ddd7cd6abcc0d7f8beb7d7186e388c7dabc158ad6e0b1808080808080a011947a5a80ea783ca7627105736c527e60b5565bb4af2a1fd594f7d9adc01e5d80808080f8699e3e4ced21ae7bedd22cd1f49238c2280cf1e50a14e8f5d2038e29f59f37afb848f8468206fb80a036ed801abf5678f1506f1fa61e5ccda1f4de53cc7cd03224e3b2a03159b6460da05b7534dec07bb70fb401032a60cb5a9d67f2bd2f50dfad5f2656c3c2fe8f2675", @@ -9,73 +9,68 @@ "storageRoot": "0x36ed801abf5678f1506f1fa61e5ccda1f4de53cc7cd03224e3b2a03159b6460d" }, "storage": { - "variable":{ + "variable": { "storageRoot": "0x70b4172eb30c495bf20b5b12224cd2380fccdd7ffa2292416b9dbdfc8511585d", "valueAtStorage": "0xa03132333400000000000000000000000000000000000000000000000000000008", - "sha3ValueAtStorage":"0xebd99339043e01b92f9846626ec39c553416f8ba847cee551a82e4725f1fc56c", + "sha3ValueAtStorage": "0xebd99339043e01b92f9846626ec39c553416f8ba847cee551a82e4725f1fc56c", "path": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563", "rlpParentNodes": "0xf8f8f8b18080a011eb05caf5fa62e9b0fffc9118cf6c7a6f10870db11d837223bf585fc7283b2c80a0be65b7596c589a734b53d15e0cc9f13eae2083bf0173b1c2baf1534d9273882d8080808080a0997f2ab256882c505e8887d9f7622a18a17dc5727a0e9d04d314e59d482a508780a088976b814f3477b2d25aa3992c31abc4a4299557a6e94ca7786a440b15a07f1e80a04b140101c7c54b2c4d69e4cf35a353d7d969e439c48fe7388eaec325f1bfe6578080f843a0390decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563a1a03132333400000000000000000000000000000000000000000000000000000008", "storageIndex": "00" }, - "mapping":{ + "mapping": { "storageRoot": "0x3c07c8f6cffe2687a45fd960e79a901d7ca4c32ced27943a5246dd392e98ec85", - "valueAtStorage":"0xa0e9b4840066c399dde8e90bef68ea9a3b81b979c0a51fe819ac008cc84736bf34", - "sha3ValueAtStorage":"0xa6f980edf24a3c80583cc64fba39845cb7cfed2fee12e20b47b3bc4f13f50827", + "valueAtStorage": "0xa0e9b4840066c399dde8e90bef68ea9a3b81b979c0a51fe819ac008cc84736bf34", + "sha3ValueAtStorage": "0xa6f980edf24a3c80583cc64fba39845cb7cfed2fee12e20b47b3bc4f13f50827", "path": "0x4d6e9a4b1a3576f692c1333198a77a5fb8b72c326f2a4c35eeeaab187773da7f", "rlpParentNodes": "0xf9012bf8918080a011eb05caf5fa62e9b0fffc9118cf6c7a6f10870db11d837223bf585fc7283b2c80a07b52b0a189ce7d8d338f576b43b4074ebfc0a51ee4b1b02c9561b75d23ac35908080a0f78f9e2d4859c3834ed1f457485c634bbb5860c9c9686de6c07c653f8634159680808080a080fe60a794b389787491aa22e649e659a14f7498ea80585e881874ac18964a5680808080f851a0253d33639fdada4c4907913dcb5b92a73e1ff478fd3e9093cd0dd510c6bd108a808080808080808080808080a06d09ce3e89bf788cd8a7eb11db585a608734e6d00a05725130612630f360c95b808080f843a0206e9a4b1a3576f692c1333198a77a5fb8b72c326f2a4c35eeeaab187773da7fa1a0e9b4840066c399dde8e90bef68ea9a3b81b979c0a51fe819ac008cc84736bf34", "key": "0x571f2c23fe07742677f468ede63fd1262bcc79dc1e7132cd6eef476f1bf1b124", "storageIndex": "1" } - }, - "redemptionProof":{ - "dataSet1":{ + "redemptionProof": { + "dataSet1": { "uuid": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563", - "redeemer":"0x79376dc1925ba1e0276473244802287394216a39", - "redeemerNonce":"0", - "beneficiary":"0x4e4ea3140f3d4a07e2f054cbabfd1f8038b3b4b0", - "amountUT":"10", - "redemptionUnlockHeight":"100", - "hashLock":"0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", + "redeemer": "0x79376dc1925ba1e0276473244802287394216a39", + "redeemerNonce": "0", + "beneficiary": "0x4e4ea3140f3d4a07e2f054cbabfd1f8038b3b4b0", + "amountUT": "10", + "redemptionUnlockHeight": "100", + "hashLock": "0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", "redemptionIntentHash": "0xe9b4840066c399dde8e90bef68ea9a3b81b979c0a51fe819ac008cc84736bf34", "key": "0x571f2c23fe07742677f468ede63fd1262bcc79dc1e7132cd6eef476f1bf1b124", "storageRoot": "0x3c07c8f6cffe2687a45fd960e79a901d7ca4c32ced27943a5246dd392e98ec85", - "valueAtStorage":"0xa0e9b4840066c399dde8e90bef68ea9a3b81b979c0a51fe819ac008cc84736bf34", + "valueAtStorage": "0xa0e9b4840066c399dde8e90bef68ea9a3b81b979c0a51fe819ac008cc84736bf34", "path": "0x4d6e9a4b1a3576f692c1333198a77a5fb8b72c326f2a4c35eeeaab187773da7f", "rlpParentNodes": "0xf9012bf8918080a011eb05caf5fa62e9b0fffc9118cf6c7a6f10870db11d837223bf585fc7283b2c80a07b52b0a189ce7d8d338f576b43b4074ebfc0a51ee4b1b02c9561b75d23ac35908080a0f78f9e2d4859c3834ed1f457485c634bbb5860c9c9686de6c07c653f8634159680808080a080fe60a794b389787491aa22e649e659a14f7498ea80585e881874ac18964a5680808080f851a0253d33639fdada4c4907913dcb5b92a73e1ff478fd3e9093cd0dd510c6bd108a808080808080808080808080a06d09ce3e89bf788cd8a7eb11db585a608734e6d00a05725130612630f360c95b808080f843a0206e9a4b1a3576f692c1333198a77a5fb8b72c326f2a4c35eeeaab187773da7fa1a0e9b4840066c399dde8e90bef68ea9a3b81b979c0a51fe819ac008cc84736bf34", "storageIndex": "1" }, - "dataSet2":{ + "dataSet2": { "uuid": "0x405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace", - "redeemer":"0xda3bbd42ba0a16be50ff2963947e03d7bab26291", - "redeemerNonce":"1", - "beneficiary":"0x5c587b1cadb7b6373bf320e65a873792373271ee", - "amountUT":"100", - "redemptionUnlockHeight":"200", - "hashLock":"0xc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b", + "redeemer": "0xda3bbd42ba0a16be50ff2963947e03d7bab26291", + "redeemerNonce": "1", + "beneficiary": "0x5c587b1cadb7b6373bf320e65a873792373271ee", + "amountUT": "100", + "redemptionUnlockHeight": "200", + "hashLock": "0xc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b", "redemptionIntentHash": "0x85d8990c3d618bff153ca600cc8cbef1dcae091a2efa72cb4a9f5a1759090d0d", "key": "0xef520ae68ad2c1398c2f3a239869a611c7b4cc30cf3112a7ff705e0e2bf0b537", "storageRoot": "0x3c07c8f6cffe2687a45fd960e79a901d7ca4c32ced27943a5246dd392e98ec85", - "valueAtStorage":"0xa085d8990c3d618bff153ca600cc8cbef1dcae091a2efa72cb4a9f5a1759090d0d", + "valueAtStorage": "0xa085d8990c3d618bff153ca600cc8cbef1dcae091a2efa72cb4a9f5a1759090d0d", "path": "0x7b10814667a046030d1db1bb359b8c06192de369d9de2d2bac70d8858b399d10", "rlpParentNodes": "0xf8d8f8918080a011eb05caf5fa62e9b0fffc9118cf6c7a6f10870db11d837223bf585fc7283b2c80a07b52b0a189ce7d8d338f576b43b4074ebfc0a51ee4b1b02c9561b75d23ac35908080a0f78f9e2d4859c3834ed1f457485c634bbb5860c9c9686de6c07c653f8634159680808080a080fe60a794b389787491aa22e649e659a14f7498ea80585e881874ac18964a5680808080f843a03b10814667a046030d1db1bb359b8c06192de369d9de2d2bac70d8858b399d10a1a085d8990c3d618bff153ca600cc8cbef1dcae091a2efa72cb4a9f5a1759090d0d", "storageIndex": "1" } }, - "storagePath":{ - "dataSet1":{ + "storagePath": { + "dataSet1": { "storageIndex": "2", "mappingKey": "0xad7c56403eba8c288188d9f1b9bbc5d67d0119807e4505f73d02d6da76f4181d", "expectedPath": "0x8f019f771e744709d6aaf3cf36adfb5285af696d06f532e94f78d85f334240e6" }, - "dataSet2":{ + "dataSet2": { "storageIndex": "0", "mappingKey": "0x8f019f771e744709d6aaf3cf36adfb5285af696d06f532e94f78d85f334240e6", "expectedPath": "0x4b1b424b6d4b5ad19b3035c344e9b2ba553dfa46fb1a023e028502d49ae6c34e" } } } - - - - diff --git a/test/gateway/gateway_base/prove_gateway.js b/test/gateway/gateway_base/prove_gateway.js index 5da440d8..8e2910c1 100644 --- a/test/gateway/gateway_base/prove_gateway.js +++ b/test/gateway/gateway_base/prove_gateway.js @@ -10,7 +10,7 @@ contract('GatewayBase.sol', function (accounts) { describe('prove gateway', async () => { let gatewayBaseInstance; - let rlpEncodedAccount = "0xf8468206fb80a036ed801abf5678f1506f1fa61e5ccda1f4de53cc7cd03224e3b2a03159b6460da05b7534dec07bb70fb401032a60cb5a9d67f2bd2f50dfad5f2656c3c2fe8f2675"; + let rlpAccount = "0xf8468206fb80a036ed801abf5678f1506f1fa61e5ccda1f4de53cc7cd03224e3b2a03159b6460da05b7534dec07bb70fb401032a60cb5a9d67f2bd2f50dfad5f2656c3c2fe8f2675"; let rlpParentNodes = "0xf908cef90211a0f113fc83479a9dcb7a7b5c98cdb42f24260f4d12b82003c3a99c0396d58918e4a007da904438ce6e90091514622c5f43816ebda4b28edb7d28c185af95b0b5d0bba0fa08a20a1e7b354aea4186ce7a56c66f08e0bad3d384ccbec3308b86a048f28da082faa84d23c856e00add29d83dffd20c640f7c4cb500a2f1b6ec345730518090a0db06fd0cd48958bdadc30f163ea9bb95d5cd1ca5605b649bca7a94f51e629b86a001cb1bae18830ad03bffb1ed8ad4c2c0338dfb6d4edc734b60d4751c838cf6d1a0b549ccb01890070dde0c2339fe189a54c3f9b5d6c0dee5c3228ec13ea8154f08a0fa860a8dd11a45a645c8f2add444311d0ce77e0e0153af518a8c82cd2a4e530ca0582c96d90db5da3e59dee0bb2ca191d97613717000c24f012539b61be5d777a9a0bc30df4754a90bde3a6f795a03f6cb2747f9180fa13087a249eda1993e38213ba04030ae5f6e34465c29bf9f164bd168e291fea360fa9ac6e2a01bcfaa29c97837a028f4323329a54f02e9fa6c65b9992b380602ce8d86f3c4ea6d1f799376eede97a099728882f75d2777db12440f90756cad8ce90637726e2949cc3039a310c0d26ba015e593e9d83137f2a6b3d6e79f3efdb62b7c2e0d4885f242392903c458adbecba0a022e3488e55dcdd8ff64c000e33f45c51a5fce1225647042ee26e512cfaf8aea03c35754a8a080ec63632e7b3d5fd2b653b4d217116dc74ec44c1eee04d2f611280f90211a056236df72b2a3baf3c4b110622911d48e8134dce5fab96dc4aa0e86bf1345f38a0e02f83a4f33cc5e624d7243d341d4b4d06a91e074250dbf2caebfa2c3e4765d0a0a72d49adff0c5e77dc9d95b4191d8d6668971f74077797659f83d415cd0fd1d1a0c60abc4f0a940d618cf9cea13adfaa4c03e3061bd702986daf5237d1065ef788a05d962c16915d89ede187bd317d3b90c6e4fdd076e53267e1857102cefadf22eda0926dc3780e5eefb8e262d98db26df3429404beb9ae838e69ba7c071d09891791a0a5f7008f700c2d6f10e14071c6471f62005f8409ed6af67a955ad7fb939c27caa0b558c2fee610404a708a543aebd8a729da27434f5608cbaa4691462c72874056a0faa4cce3c8599c6d984e9577ab6bd9b0c006068c31d9e03215cc8908114d7757a0a3d6d16c957326cd262da81bad6b7dee022e4dbd202adff5d7ccc4342a61d21fa0d55c004ac2e9eaec20c2cffef567de49df83fde291e52abc815db781dac5456ba06ab98c39c210c5e2a9ffb994afdefd5ca02bdceff8cfd8e60d68c199d864b94ca0522232d286697b81da8721463bce6e8dedff3330bc13c02937b78fe1afa9005ba0c3bf8ac2260dab7d0108b546f94e2c714aaea8b2274745b7575ded129520304ea0a481df0f7947c98bd4ea7738f706826df3031ae129e362fcfeca937e8651eb4ea05193d68afbd4b7509f77498f1587ea9e090697c2e95c4d2bafbb52a8cf9bd62480f90211a011561aaab4838e5fa61b9e6debfdba192744c612d2ba76ab61deb015746aa5a0a00026c65c973bbd95e6c0e980f4d22e4627715e5e9f421c80fc49f1f67f7b971fa00d119e6b55db30543e2065bc456dbe0828b97c1b0d217846c4ee787bee670d79a0bc563733a582905db3b2eb375218ff1b64cc9a12abc84ec663086a460a625394a093ff057cda650d4808cb25651fe2f77652107c4c56d9647fe75c8c0a3d2d0d64a06cf305021c9a1a175e01fe56f8ef8f527f8a69fc9042e9b1b0a4ba53ea3b0025a078a50de369a7bddf71b0f8bab722b4c34c56918eb051776a7cb8598c0011170ba0699884e0545d810a93c1c80a6ba48020ade2ada6b556764f937712c8628c033da00d02491b26b79333b5a3ec8ffd455921600cc327183d260ad4d4ed5d63fc2aa6a02d9468383a418e9303989bbad1845e3c48ef803bacea406e1fd68e25a565a9d2a0a4453049a044659669a5ff8c56229d339ea860b934ad895bab0ef865cce2fffea0d654be53e9c8fc64a068ef9cd7768eadbeb52bcaa764cececfa6be01b8e074f2a087f0f15350b42c7a8efe19eb64bf8b7ab13daeeebb40f4f3f8b3685b0fc0031ea0ce410da15fc84e9b8caf8d6785f241c74a6b70d5b62f71ba4a1d09ff47921d8da0fcf5effb792c9b1ca3fbffe251cdb27c0facf30d3445b3e230537df48399da69a042acf9ab2c371e984f2c280566ba342a4e0a081e555bbec957aab3296fb4af1980f901d1a07c6a2cff79b45c222da90c55b00dca5f51b62b0cbeff1a0c1f6984851be684daa097fa80b5e381a5d49663a6b86e8721843b93e534da0db48e1db74967c28d7e82a045009364e98f5b0ead865504e8209ccffb7fb63b2a28464717504a78141f518fa039bcfc875dbca2f973a7f5f2f19b55b3bc22f80f387413a12ee0dab5e0254107a009c6f751027ce16b579633a060bee4028dd0ba87567fadf0a887811d9ed7e594a0d0eba05cdd60831f8532710718106860bc2853dc628e55e286c78afe6f3891d0a0904d4bf3896ac04520fd93e47169b6bfff4c7cdf25420b342784abd7090f2dd4a0feb4a9be9f299e0f58645e4ae2f8e2c2082368d2e08a9cec0c6ae37411c56de9a0e30f69e6968d9611a3d52d210a282244316d31367642f2c4f159161fec71e269a0a665c800370015f89a458e68e95b96c4e6976347a6a5f76df6b58f1451bb8948a0120a7594596f36b628223057eb375c73653dfa6fcbfc3ec8d2ce201a685aaa9680a0c7bbde5d654a3bf527ae035eeba861d25280b88b7a0376bf7c39625d9ffd9879a005d5ae3d04a79a90f21af570116b6e4c29e6e606c877bf9b015a5f03e18d1e24a0b2b77afc6c3b77c6a171e5f49bd6508f455fbe93864c7c832a02b303e4f227e48080f8518080808080a081dc71924e3436de3a7ddd7cd6abcc0d7f8beb7d7186e388c7dabc158ad6e0b1808080808080a011947a5a80ea783ca7627105736c527e60b5565bb4af2a1fd594f7d9adc01e5d80808080f8699e3e4ced21ae7bedd22cd1f49238c2280cf1e50a14e8f5d2038e29f59f37afb848f8468206fb80a036ed801abf5678f1506f1fa61e5ccda1f4de53cc7cd03224e3b2a03159b6460da05b7534dec07bb70fb401032a60cb5a9d67f2bd2f50dfad5f2656c3c2fe8f2675"; let stateRoot = "0x70b4172eb30c495bf20b5b12224cd2380fccdd7ffa2292416b9dbdfc8511585d"; let storageRoot = '0x8c0ee0843488170879578464b1cadcdb7377efa787372405ff373e4cec6a56db'; @@ -34,7 +34,7 @@ contract('GatewayBase.sol', function (accounts) { it('should be able to prove with correct request', async function () { - let response = await gatewayBaseInstance.proveGateway(1, rlpEncodedAccount, rlpParentNodes); + let response = await gatewayBaseInstance.proveGateway(1, rlpAccount, rlpParentNodes); let expectedEvent = { GatewayProven: { @@ -57,10 +57,17 @@ contract('GatewayBase.sol', function (accounts) { it('should return already proven flag as true if already proven', async function () { - await gatewayBaseInstance.proveGateway(2, rlpEncodedAccount, - rlpParentNodes); + await gatewayBaseInstance.proveGateway( + 2, + rlpAccount, + rlpParentNodes, + ); - let response = await gatewayBaseInstance.proveGateway(2, rlpEncodedAccount, rlpParentNodes); + let response = await gatewayBaseInstance.proveGateway( + 2, + rlpAccount, + rlpParentNodes, + ); let expectedEvent = { GatewayProven: { @@ -90,7 +97,9 @@ contract('GatewayBase.sol', function (accounts) { it('should fail if rlp parent nodes is not passed', async function () { - await Utils.expectThrow(gatewayBaseInstance.proveGateway(1, rlpEncodedAccount, "0x")); + await Utils.expectThrow( + gatewayBaseInstance.proveGateway(1, rlpAccount, "0x") + ); }); diff --git a/test/lib/RLP.js b/test/lib/RLP.js index 43acf167..9d65f537 100644 --- a/test/lib/RLP.js +++ b/test/lib/RLP.js @@ -52,9 +52,9 @@ contract('RLP', function (accounts) { it('should pass when list is RLP encoded of length one', async () => { let rlpItem = RLP.encode('5') , items = [rlpItem] - , rlpEncodedArray = RLP.encode(items).toString('hex') + , rlpArray = RLP.encode(items).toString('hex') , index = 0; - let result = await rlpTest.toList.call('0x' + rlpEncodedArray, index) + let result = await rlpTest.toList.call('0x' + rlpArray, index) , itemAtIndex = result[0]; assert.equal('0x' + rlpItem.toString('hex'), itemAtIndex); @@ -63,10 +63,10 @@ contract('RLP', function (accounts) { let rlpItemOne = RLP.encode('5') , rlpItemTwo = RLP.encode('6') , items = [rlpItemOne, rlpItemTwo] - , rlpEncodedArray = RLP.encode(items).toString('hex'); + , rlpArray = RLP.encode(items).toString('hex'); for (let index = 0; index < items.length; index++) { - let result = await rlpTest.toList.call('0x' + rlpEncodedArray, index) + let result = await rlpTest.toList.call('0x' + rlpArray, index) , itemAtIndex = result[0]; assert.equal('0x' + items[index].toString('hex'), itemAtIndex); } diff --git a/test/lib/TestBlock.sol b/test/lib/TestBlock.sol index 067fc1b4..d83c3953 100644 --- a/test/lib/TestBlock.sol +++ b/test/lib/TestBlock.sol @@ -47,8 +47,8 @@ contract TestBlock { /* External Functions */ function testDecodeSuccessful() external { - bytes memory rlpEncodedHeader = hex"f901f9a083cafc574e1f51ba9dc0568fc617a08ea2429fb384059c972f13b19fa1c8dd55a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0ef1552a40b7165c3cd773806b9e0c165b75356e0314bf0706f279c729f51e017a05fe50b260da6308036625b850b5d6ced6d0a9f814c0688bc91ffb7b7a3a54b67a0bc37d79753ad738a6dac4921e57392f145d8887476de3f783dfa7edae9283e52b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000001832fefd8825208845506eb0780a0bd4472abb6659ebe3ee06ee4d7b72a00a9f4d001caca51342001075469aff49888a13a5a8c8f2bb1c4"; - Block.Header memory header = Block.decodeHeader(rlpEncodedHeader); + bytes memory rlpHeader = hex"f901f9a083cafc574e1f51ba9dc0568fc617a08ea2429fb384059c972f13b19fa1c8dd55a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0ef1552a40b7165c3cd773806b9e0c165b75356e0314bf0706f279c729f51e017a05fe50b260da6308036625b850b5d6ced6d0a9f814c0688bc91ffb7b7a3a54b67a0bc37d79753ad738a6dac4921e57392f145d8887476de3f783dfa7edae9283e52b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000001832fefd8825208845506eb0780a0bd4472abb6659ebe3ee06ee4d7b72a00a9f4d001caca51342001075469aff49888a13a5a8c8f2bb1c4"; + Block.Header memory header = Block.decodeHeader(rlpHeader); Assert.equal( header.blockHash, @@ -137,9 +137,9 @@ contract TestBlock { function testDecodeWithInvalidHeaderData() external { // RLP encoded transaction data from https://web3js.readthedocs.io/en/1.0/web3-eth.html#id72 - bytes memory rlpEncodedData = hex"f86c808504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a04f4c17305743700648bc4f6cd3038ec6f6af0df73e31757007b7f59df7bee88da07e1941b264348e80c78c4027afc65a87b0a5e43e86742b8ca0823584c6788fd0"; + bytes memory rlpData = hex"f86c808504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a04f4c17305743700648bc4f6cd3038ec6f6af0df73e31757007b7f59df7bee88da07e1941b264348e80c78c4027afc65a87b0a5e43e86742b8ca0823584c6788fd0"; - bool result = callDecodeHeader(rlpEncodedData); + bool result = callDecodeHeader(rlpData); Assert.equal( result, diff --git a/test/messagebus/confirm_message.js b/test/messagebus/confirm_message.js index 0b774acd..c26816dd 100644 --- a/test/messagebus/confirm_message.js +++ b/test/messagebus/confirm_message.js @@ -38,7 +38,7 @@ let intentHash, params, messageBoxOffset, storageRoot, - rlpEncodedParentNodes, + rlpParentNodes, generatedHashLock; contract('MessageBus', async (accounts) => { @@ -61,7 +61,7 @@ contract('MessageBus', async (accounts) => { , hashLock = generatedHashLock.l , messageBoxOffset = 1 , signature = "0xd0448f820b67d07ee7c7d1a4141177401933d97f744e785c435458032b7c8ae46a482c3c058fc94c3110df3488e1e537bcd8b13468f16aaea5d203e17301d47300" - , rlpEncodedParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' + , rlpParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' , storageRoot = '0x9642e5c7f830dbf5cb985c9a2755ea2e5e560dbe12f98fd19d9b5b6463c2e771'; await messageBusUtils.deployedMessageBus(); @@ -80,7 +80,7 @@ contract('MessageBus', async (accounts) => { messageHash: messageHash, unlockSecret: unlockSecret, messageBoxOffset: messageBoxOffset, - rlpEncodedParentNodes: rlpEncodedParentNodes, + rlpParentNodes: rlpParentNodes, storageRoot: storageRoot }; diff --git a/test/messagebus/confirm_revocation.js b/test/messagebus/confirm_revocation.js index 8810d889..bad000fd 100644 --- a/test/messagebus/confirm_revocation.js +++ b/test/messagebus/confirm_revocation.js @@ -38,20 +38,20 @@ let intentHash, params, messageBoxOffset, storageRoot, - rlpEncodedParentNodes, + rlpParentNodes, generatedHashLock; -contract('MessageBus', async (accounts) => { - +contract('MessageBus', async (accounts) => { + describe('confirmRevocation', async () => { - - beforeEach(async function() { - - intentHash = web3.utils.soliditySha3({type: 'bytes32', value:'intent'}) + + beforeEach(async function () { + + intentHash = web3.utils.soliditySha3({ type: 'bytes32', value: 'intent' }) , nonce = 1 , gasPrice = 0x12A05F200 , sender = accounts[7] - , messageTypeHash = web3.utils.soliditySha3({type: 'bytes32', value: 'gatewaylink'}) + , messageTypeHash = web3.utils.soliditySha3({ type: 'bytes32', value: 'gatewaylink' }) , gasLimit = 0 , gasConsumed = 0 , messageHash = '0x9bdab5cbc3ebd8d50e3831bc73da35c1170e21bfb7145e41ce4a952b977a8f84' @@ -61,11 +61,11 @@ contract('MessageBus', async (accounts) => { , hashLock = generatedHashLock.l , messageBoxOffset = 1 , signature = "0xd0448f820b67d07ee7c7d1a4141177401933d97f744e785c435458032b7c8ae46a482c3c058fc94c3110df3488e1e537bcd8b13468f16aaea5d203e17301d47300" - , rlpEncodedParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' + , rlpParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' , storageRoot = '0x9642e5c7f830dbf5cb985c9a2755ea2e5e560dbe12f98fd19d9b5b6463c2e771'; - + await messageBusUtils.deployedMessageBus(); - + params = { messageTypeHash: messageTypeHash, intentHash: intentHash, @@ -80,39 +80,39 @@ contract('MessageBus', async (accounts) => { messageHash: messageHash, unlockSecret: unlockSecret, messageBoxOffset: messageBoxOffset, - rlpEncodedParentNodes: rlpEncodedParentNodes, + rlpParentNodes: rlpParentNodes, storageRoot: storageRoot }; - + }); - + it('should fail when message status of the message hash in inbox is' + ' undeclared ', async () => { - - await messageBusUtils.confirmRevocation(params, false); - - }); - + + await messageBusUtils.confirmRevocation(params, false); + + }); + it('should fail when message status of the message hash in inbox is' + ' progressed ', async () => { - - await messageBusUtils.confirmMessage(params, true); - await messageBusUtils.progressInbox(params, true); - - await messageBusUtils.confirmRevocation(params, false); - - }); - + + await messageBusUtils.confirmMessage(params, true); + await messageBusUtils.progressInbox(params, true); + + await messageBusUtils.confirmRevocation(params, false); + + }); + it('should fail when message status of the message hash in inbox is' + ' revoked', async () => { - - await messageBusUtils.confirmMessage(params, true); - await messageBusUtils.confirmRevocation(params, true); - - await messageBusUtils.confirmRevocation(params, false); - - }); - + + await messageBusUtils.confirmMessage(params, true); + await messageBusUtils.confirmRevocation(params, true); + + await messageBusUtils.confirmRevocation(params, false); + + }); + }); }); diff --git a/test/messagebus/declare_message.js b/test/messagebus/declare_message.js index 73759fb2..9f1ceaaa 100644 --- a/test/messagebus/declare_message.js +++ b/test/messagebus/declare_message.js @@ -38,28 +38,28 @@ let intentHash, params, messageBoxOffset, storageRoot, - rlpEncodedParentNodes, + rlpParentNodes, generatedHashLock; let MessageStatusEnum = { - Undeclared : 0, - Declared : 1, - Progressed : 2, - DeclaredRevocation : 3, - Revoked : 4 + Undeclared: 0, + Declared: 1, + Progressed: 2, + DeclaredRevocation: 3, + Revoked: 4 }; -contract('MessageBus', async (accounts) => { - +contract('MessageBus', async (accounts) => { + describe('declareMessage', async () => { - + beforeEach(async function () { - - intentHash = web3.utils.soliditySha3({type: 'bytes32', value:'intent'}) + + intentHash = web3.utils.soliditySha3({ type: 'bytes32', value: 'intent' }) , nonce = 1 , gasPrice = 0x12A05F200 , sender = accounts[7] - , messageTypeHash = web3.utils.soliditySha3({type: 'bytes32', value: 'gatewaylink'}) + , messageTypeHash = web3.utils.soliditySha3({ type: 'bytes32', value: 'gatewaylink' }) , gasLimit = 0 , gasConsumed = 0 , messageHash = '0x9bdab5cbc3ebd8d50e3831bc73da35c1170e21bfb7145e41ce4a952b977a8f84' @@ -69,11 +69,11 @@ contract('MessageBus', async (accounts) => { , hashLock = generatedHashLock.l , messageBoxOffset = 1 , signature = "0xd0448f820b67d07ee7c7d1a4141177401933d97f744e785c435458032b7c8ae46a482c3c058fc94c3110df3488e1e537bcd8b13468f16aaea5d203e17301d47300" - , rlpEncodedParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' + , rlpParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' , storageRoot = '0x9642e5c7f830dbf5cb985c9a2755ea2e5e560dbe12f98fd19d9b5b6463c2e771'; - + await messageBusUtils.deployedMessageBus(); - + params = { messageTypeHash: messageTypeHash, intentHash: intentHash, @@ -88,59 +88,59 @@ contract('MessageBus', async (accounts) => { messageHash: messageHash, unlockSecret: unlockSecret, messageBoxOffset: messageBoxOffset, - rlpEncodedParentNodes: rlpEncodedParentNodes, + rlpParentNodes: rlpParentNodes, storageRoot: storageRoot }; - + }); - + it('should fail when message status is already in declared state', async () => { - + await messageBusUtils.declareMessage(params, true); await messageBusUtils.declareMessage(params, false); - + }); - + it('should fail when message status is progressed in outbox', async () => { - + await messageBusUtils.declareMessage(params, true); await messageBusUtils.progressOutbox(params, true); - + await messageBusUtils.declareMessage(params, false); - + }); - + it('should fail when message status is DeclaredRevocation in outbox', async () => { - + await messageBusUtils.declareMessage(params, true); await messageBusUtils.declareRevocationMessage(params, true); - + await messageBusUtils.declareMessage(params, false); - + }); - + it('should fail when message status is Revoked in outbox', async () => { - + await messageBusUtils.declareMessage(params, true); await messageBusUtils.declareRevocationMessage(params, true); params.messageStatus = MessageStatusEnum.DeclaredRevocation; await messageBusUtils.progressOutboxRevocation(params, true); - + await messageBusUtils.declareMessage(params, false); }); - + it('should fail when signature incorrect', async () => { - + params.signature = "0xa0448f820b67d07ee7c7d1a4141177401933d97f744e785c435458032b7c8ae46a482c3c058fc94c3110df3488e1e537bcd8b13468f16aaea5d203e17301d47301"; await messageBusUtils.declareMessage(params, false); - + }); - + it('should fail when signature is empty', async () => { - + params.signature = '0x00'; await messageBusUtils.declareMessage(params, false); - + }); }); }); diff --git a/test/messagebus/declare_revocation_message.js b/test/messagebus/declare_revocation_message.js index c5db416b..6b237bf4 100644 --- a/test/messagebus/declare_revocation_message.js +++ b/test/messagebus/declare_revocation_message.js @@ -38,7 +38,7 @@ let intentHash, params, messageBoxOffset, storageRoot, - rlpEncodedParentNodes, + rlpParentNodes, generatedHashLock; let MessageStatusEnum = { @@ -69,7 +69,7 @@ contract('MessageBus', async (accounts) => { , hashLock = generatedHashLock.l , messageBoxOffset = 1 , signature = "0xd0448f820b67d07ee7c7d1a4141177401933d97f744e785c435458032b7c8ae46a482c3c058fc94c3110df3488e1e537bcd8b13468f16aaea5d203e17301d47300" - , rlpEncodedParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' + , rlpParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' , storageRoot = '0x9642e5c7f830dbf5cb985c9a2755ea2e5e560dbe12f98fd19d9b5b6463c2e771'; @@ -89,7 +89,7 @@ contract('MessageBus', async (accounts) => { messageHash: messageHash, unlockSecret: unlockSecret, messageBoxOffset: messageBoxOffset, - rlpEncodedParentNodes: rlpEncodedParentNodes, + rlpParentNodes: rlpParentNodes, storageRoot: storageRoot }; diff --git a/test/messagebus/messagebus_utils.js b/test/messagebus/messagebus_utils.js index e8afa4af..44d9a443 100644 --- a/test/messagebus/messagebus_utils.js +++ b/test/messagebus/messagebus_utils.js @@ -190,7 +190,7 @@ MessageBusUtils.prototype = { nonce = params.nonce, sender = params.sender, messageStatus = params.messageStatus, - rlpEncodedParentNodes = params.rlpEncodedParentNodes, + rlpParentNodes = params.rlpParentNodes, messageBoxOffset = params.messageBoxOffset, storageRoot = params.storageRoot, hashLock = params.hashLock; @@ -203,7 +203,7 @@ MessageBusUtils.prototype = { nonce, sender, messageBoxOffset, - rlpEncodedParentNodes, + rlpParentNodes, storageRoot, messageStatus, hashLock @@ -217,7 +217,7 @@ MessageBusUtils.prototype = { nonce, sender, messageBoxOffset, - rlpEncodedParentNodes, + rlpParentNodes, storageRoot, messageStatus, hashLock @@ -233,7 +233,7 @@ MessageBusUtils.prototype = { nonce = params.nonce, sender = params.sender, messageStatus = params.messageStatus, - rlpEncodedParentNodes = params.rlpEncodedParentNodes, + rlpParentNodes = params.rlpParentNodes, messageBoxOffset = params.messageBoxOffset, storageRoot = params.storageRoot, hashLock = params.hashLock; @@ -246,7 +246,7 @@ MessageBusUtils.prototype = { nonce, sender, messageBoxOffset, - rlpEncodedParentNodes, + rlpParentNodes, storageRoot, messageStatus, hashLock @@ -261,7 +261,7 @@ MessageBusUtils.prototype = { nonce, sender, messageBoxOffset, - rlpEncodedParentNodes, + rlpParentNodes, storageRoot, messageStatus, hashLock @@ -274,7 +274,7 @@ MessageBusUtils.prototype = { let messageTypeHash = params.messageTypeHash, intentHash = params.intentHash, nonce = params.nonce, - rlpEncodedParentNodes = params.rlpEncodedParentNodes, + rlpParentNodes = params.rlpParentNodes, messageBoxOffset = params.messageBoxOffset, storageRoot = params.storageRoot, sender = params.sender, @@ -288,7 +288,7 @@ MessageBusUtils.prototype = { nonce, sender, messageBoxOffset, - rlpEncodedParentNodes, + rlpParentNodes, storageRoot, hashLock )); @@ -302,7 +302,7 @@ MessageBusUtils.prototype = { nonce, sender, messageBoxOffset, - rlpEncodedParentNodes, + rlpParentNodes, storageRoot, hashLock ); @@ -316,7 +316,7 @@ MessageBusUtils.prototype = { intentHash = params.intentHash, nonce = params.nonce, sender = params.sender, - rlpEncodedParentNodes = params.rlpEncodedParentNodes, + rlpParentNodes = params.rlpParentNodes, storageRoot = params.storageRoot, messageBoxOffset = params.messageBoxOffset, hashLock = params.hashLock; @@ -329,7 +329,7 @@ MessageBusUtils.prototype = { intentHash, nonce, sender, - rlpEncodedParentNodes, + rlpParentNodes, storageRoot, messageBoxOffset, hashLock @@ -343,7 +343,7 @@ MessageBusUtils.prototype = { intentHash, nonce, sender, - rlpEncodedParentNodes, + rlpParentNodes, storageRoot, messageBoxOffset, hashLock @@ -358,7 +358,7 @@ MessageBusUtils.prototype = { nonce = params.nonce, sender = params.sender, messageStatus = params.messageStatus, - rlpEncodedParentNodes = params.rlpEncodedParentNodes, + rlpParentNodes = params.rlpParentNodes, storageRoot = params.storageRoot, hashLock = params.hashLock, messageBoxOffset = params.messageBoxOffset;; @@ -370,7 +370,7 @@ MessageBusUtils.prototype = { intentHash, nonce, sender, - rlpEncodedParentNodes, + rlpParentNodes, storageRoot, messageStatus, hashLock, @@ -385,7 +385,7 @@ MessageBusUtils.prototype = { intentHash, nonce, sender, - rlpEncodedParentNodes, + rlpParentNodes, storageRoot, messageStatus, hashLock, @@ -402,7 +402,7 @@ MessageBusUtils.prototype = { nonce = params.nonce, sender = params.sender, messageStatus = params.messageStatus, - rlpEncodedParentNodes = params.rlpEncodedParentNodes, + rlpParentNodes = params.rlpParentNodes, storageRoot = params.storageRoot, hashLock = params.hashLock, messageBoxOffset = params.messageBoxOffset; @@ -413,7 +413,7 @@ MessageBusUtils.prototype = { intentHash, nonce, sender, - rlpEncodedParentNodes, + rlpParentNodes, storageRoot, messageStatus, hashLock, @@ -428,7 +428,7 @@ MessageBusUtils.prototype = { intentHash, nonce, sender, - rlpEncodedParentNodes, + rlpParentNodes, storageRoot, messageStatus, hashLock, diff --git a/test/messagebus/progress_inbox.js b/test/messagebus/progress_inbox.js index c4eb2bf8..3504186e 100644 --- a/test/messagebus/progress_inbox.js +++ b/test/messagebus/progress_inbox.js @@ -38,7 +38,7 @@ let intentHash, params, messageBoxOffset, storageRoot, - rlpEncodedParentNodes, + rlpParentNodes, generatedHashLock; contract('MessageBus', async (accounts) => { @@ -62,7 +62,7 @@ contract('MessageBus', async (accounts) => { , hashLock = generatedHashLock.l , messageBoxOffset = 1 , signature = "0xd0448f820b67d07ee7c7d1a4141177401933d97f744e785c435458032b7c8ae46a482c3c058fc94c3110df3488e1e537bcd8b13468f16aaea5d203e17301d47300" - , rlpEncodedParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' + , rlpParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' , storageRoot = '0x9642e5c7f830dbf5cb985c9a2755ea2e5e560dbe12f98fd19d9b5b6463c2e771'; @@ -82,7 +82,7 @@ contract('MessageBus', async (accounts) => { messageHash: messageHash, unlockSecret: unlockSecret, messageBoxOffset: messageBoxOffset, - rlpEncodedParentNodes: rlpEncodedParentNodes, + rlpParentNodes: rlpParentNodes, storageRoot: storageRoot }; diff --git a/test/messagebus/progress_inbox_with_proof.js b/test/messagebus/progress_inbox_with_proof.js index ed885156..28474b04 100644 --- a/test/messagebus/progress_inbox_with_proof.js +++ b/test/messagebus/progress_inbox_with_proof.js @@ -37,7 +37,7 @@ var params, messageStatus, unlockSecret, hashLock, - rlpEncodedParentNodes, + rlpParentNodes, storageRoot, generatedHashLock; @@ -72,7 +72,7 @@ contract('MessageBus', async (accounts) => { , hashLock = generatedHashLock.l , messageBoxOffset = 1 , signature = "0xd0448f820b67d07ee7c7d1a4141177401933d97f744e785c435458032b7c8ae46a482c3c058fc94c3110df3488e1e537bcd8b13468f16aaea5d203e17301d47300" - , rlpEncodedParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' + , rlpParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' , storageRoot = '0x9642e5c7f830dbf5cb985c9a2755ea2e5e560dbe12f98fd19d9b5b6463c2e771'; @@ -92,7 +92,7 @@ contract('MessageBus', async (accounts) => { messageHash: messageHash, unlockSecret: unlockSecret, messageBoxOffset: messageBoxOffset, - rlpEncodedParentNodes: rlpEncodedParentNodes, + rlpParentNodes: rlpParentNodes, storageRoot: storageRoot }; diff --git a/test/messagebus/progress_outbox.js b/test/messagebus/progress_outbox.js index 69a986b4..10df4563 100644 --- a/test/messagebus/progress_outbox.js +++ b/test/messagebus/progress_outbox.js @@ -38,7 +38,7 @@ let intentHash, params, messageBoxOffset, storageRoot, - rlpEncodedParentNodes, + rlpParentNodes, generatedHashLock; contract('MessageBus', async (accounts) => { @@ -61,7 +61,7 @@ contract('MessageBus', async (accounts) => { , hashLock = generatedHashLock.l , messageBoxOffset = 1 , signature = "0xd0448f820b67d07ee7c7d1a4141177401933d97f744e785c435458032b7c8ae46a482c3c058fc94c3110df3488e1e537bcd8b13468f16aaea5d203e17301d47300" - , rlpEncodedParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' + , rlpParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' , storageRoot = '0x9642e5c7f830dbf5cb985c9a2755ea2e5e560dbe12f98fd19d9b5b6463c2e771'; await messageBusUtils.deployedMessageBus(); @@ -80,7 +80,7 @@ contract('MessageBus', async (accounts) => { messageHash: messageHash, unlockSecret: unlockSecret, messageBoxOffset: messageBoxOffset, - rlpEncodedParentNodes: rlpEncodedParentNodes, + rlpParentNodes: rlpParentNodes, storageRoot: storageRoot }; diff --git a/test/messagebus/progress_outbox_revocation.js b/test/messagebus/progress_outbox_revocation.js index 39045cf4..93def68e 100644 --- a/test/messagebus/progress_outbox_revocation.js +++ b/test/messagebus/progress_outbox_revocation.js @@ -24,11 +24,11 @@ const messageBusUtilsKlass = require('./messagebus_utils'), messageBusUtils = new messageBusUtilsKlass(); let MessageStatusEnum = { - Undeclared : 0, - Declared : 1, - Progressed : 2, - DeclaredRevocation : 3, - Revoked : 4 + Undeclared: 0, + Declared: 1, + Progressed: 2, + DeclaredRevocation: 3, + Revoked: 4 }; let intentHash, @@ -46,21 +46,21 @@ let intentHash, params, messageBoxOffset, storageRoot, - rlpEncodedParentNodes, + rlpParentNodes, generatedHashLock; -contract('MessageBus', async (accounts) => { - +contract('MessageBus', async (accounts) => { + describe('progressOutboxRevocation', async () => { - - beforeEach(async function() { - - - intentHash = web3.utils.soliditySha3({type: 'bytes32', value:'intent'}) + + beforeEach(async function () { + + + intentHash = web3.utils.soliditySha3({ type: 'bytes32', value: 'intent' }) , nonce = 1 , gasPrice = 0x12A05F200 , sender = accounts[7] - , messageTypeHash = web3.utils.soliditySha3({type: 'bytes32', value: 'gatewaylink'}) + , messageTypeHash = web3.utils.soliditySha3({ type: 'bytes32', value: 'gatewaylink' }) , gasLimit = 0 , gasConsumed = 0 , messageHash = '0x9bdab5cbc3ebd8d50e3831bc73da35c1170e21bfb7145e41ce4a952b977a8f84' @@ -70,12 +70,12 @@ contract('MessageBus', async (accounts) => { , hashLock = generatedHashLock.l , messageBoxOffset = 1 , signature = "0xd0448f820b67d07ee7c7d1a4141177401933d97f744e785c435458032b7c8ae46a482c3c058fc94c3110df3488e1e537bcd8b13468f16aaea5d203e17301d47300" - , rlpEncodedParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' + , rlpParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' , storageRoot = '0x9642e5c7f830dbf5cb985c9a2755ea2e5e560dbe12f98fd19d9b5b6463c2e771'; - - + + await messageBusUtils.deployedMessageBus(); - + params = { messageTypeHash: messageTypeHash, intentHash: intentHash, @@ -90,76 +90,76 @@ contract('MessageBus', async (accounts) => { messageHash: messageHash, unlockSecret: unlockSecret, messageBoxOffset: messageBoxOffset, - rlpEncodedParentNodes: rlpEncodedParentNodes, + rlpParentNodes: rlpParentNodes, storageRoot: storageRoot }; - + }); - + it('should fail when message status is undeclared and message hash status is undeclared', async () => { - + await messageBusUtils.progressOutboxRevocation(params, false); - + }); - + it('should fail when message status is declared ', async () => { - + await messageBusUtils.declareMessage(params, true); - + await messageBusUtils.progressOutboxRevocation(params, false); - + }); - + it('should fail when message status is progressed ', async () => { - + await messageBusUtils.declareMessage(params, true); await messageBusUtils.progressOutbox(params, true); - + await messageBusUtils.progressOutboxRevocation(params, false); - + }); - + it('should fail when message status is already revoked in inbox', async () => { - + await messageBusUtils.declareMessage(params, true); await messageBusUtils.declareRevocationMessage(params, true); params.messageStatus = MessageStatusEnum.DeclaredRevocation; await messageBusUtils.progressOutboxRevocation(params, true); - + await messageBusUtils.progressOutboxRevocation(params, false); - + }); - + it('should fail when message status of the message hash in inbox is undeclared ', async () => { - + params.messageStatus = MessageStatusEnum.Undeclared; await messageBusUtils.progressOutboxRevocation(params, false); - + }); - + it('should fail when message status of the message hash in inbox is declared ', async () => { - + params.messageStatus = MessageStatusEnum.Declared; await messageBusUtils.progressOutboxRevocation(params, false); - + }); - + it('should fail when message status of the message hash in inbox is progressed ', async () => { - + params.messageStatus = MessageStatusEnum.Progressed; await messageBusUtils.declareMessage(params, true); params.messageStatus = MessageStatusEnum.Declared; await messageBusUtils.progressOutboxWithProof(params, true); await messageBusUtils.progressOutboxRevocation(params, false); - + }); it('should fail when message status of the message hash in inbox is empty ', async () => { - + params.messageStatus = ''; await messageBusUtils.progressOutboxRevocation(params, false); - + }); }); }); diff --git a/test/messagebus/progress_outbox_with_proof.js b/test/messagebus/progress_outbox_with_proof.js index 0c0310c9..9b6b6dd8 100644 --- a/test/messagebus/progress_outbox_with_proof.js +++ b/test/messagebus/progress_outbox_with_proof.js @@ -38,7 +38,7 @@ let intentHash, params, messageBoxOffset, storageRoot, - rlpEncodedParentNodes, + rlpParentNodes, generatedHashLock; let MessageStatusEnum = { @@ -71,7 +71,7 @@ contract('MessageBus', async (accounts) => { , hashLock = generatedHashLock.l , messageBoxOffset = 1 , signature = "0xd0448f820b67d07ee7c7d1a4141177401933d97f744e785c435458032b7c8ae46a482c3c058fc94c3110df3488e1e537bcd8b13468f16aaea5d203e17301d47300" - , rlpEncodedParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' + , rlpParentNodes = '0xf9019ff901318080a09d4484981c7edad9f3182d5ae48f8d9d37920c6b38a2871cebef30386741a92280a0e159e6e0f6ff669a91e7d4d1cf5eddfcd53dde292231841f09dd29d7d29048e9a0670573eb7c83ac10c87de570273e1fde94c1acbd166758e85aeec2219669ceb5a06f09c8eefdb579cae94f595c48c0ee5e8052bef55f0aeb3cc4fac8ec1650631fa05176aab172a56135b9d01a89ccada74a9d11d8c33cbd07680acaf9704cbec062a0df7d6e63240928af91e7c051508a0306389d41043954c0e3335f6f37b8e53cc18080a03d30b1a0d2a61cafd83521c5701a8bf63d0020c0cd9e844ad62e9b4444527144a0a5aa2db9dc726541f2a493b79b83aeebe5bc8f7e7910570db218d30fa7d2ead18080a0b60ddc26977a026cc88f0d5b0236f4cee7b93007a17e2475547c0b4d59d16c3d80f869a034d7a0307ecd0d12f08317f9b12c4d34dfbe55ec8bdc90c4d8a6597eb4791f0ab846f8440280a0e99d9c02761142de96f3c92a63bb0edb761a8cd5bbfefed1e72341a94957ec51a0144788d43dba972c568df04560b995d9e57b58ef09fddf3b68cba065997efff7' , storageRoot = '0x9642e5c7f830dbf5cb985c9a2755ea2e5e560dbe12f98fd19d9b5b6463c2e771'; @@ -91,7 +91,7 @@ contract('MessageBus', async (accounts) => { messageHash: messageHash, unlockSecret: unlockSecret, messageBoxOffset: messageBoxOffset, - rlpEncodedParentNodes: rlpEncodedParentNodes, + rlpParentNodes: rlpParentNodes, storageRoot: storageRoot };