Skip to content

Commit

Permalink
CCIP-4918 feat: Add SVM encoding and decoding to MessageHasher.sol (#…
Browse files Browse the repository at this point in the history
…15983)

* CCIP-4918 feat: Add SVM encoding and decoding to MessageHasher.sol

* add changeset file

* [Bot] Update changeset file with jira issues

* change to named init

---------

Co-authored-by: app-token-issuer-infra-releng[bot] <120227048+app-token-issuer-infra-releng[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 566643d commit 78d548d
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 4 deletions.
10 changes: 10 additions & 0 deletions contracts/.changeset/wicked-maps-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@chainlink/contracts': minor
---

#internal Add EVM extraArgs encode & decode to MessageHasher

PR issue: CCIP-4918


Solidity Review issue: CCIP-3966
24 changes: 23 additions & 1 deletion contracts/src/v0.8/ccip/test/helpers/MessageHasher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,28 @@ contract MessageHasher {
uint256 gasLimit,
bool allowOutOfOrderExecution
) public pure returns (Client.EVMExtraArgsV2 memory) {
return Client.EVMExtraArgsV2(gasLimit, allowOutOfOrderExecution);
return Client.EVMExtraArgsV2({gasLimit: gasLimit, allowOutOfOrderExecution: allowOutOfOrderExecution});
}

function encodeSVMExtraArgsV1(
Client.SVMExtraArgsV1 memory extraArgs
) public pure returns (bytes memory) {
return Client._svmArgsToBytes(extraArgs);
}

function decodeSVMExtraArgsV1(
uint32 computeUnits,
uint64 accountIsWritableBitmap,
bool allowOutOfOrderExecution,
bytes32 tokenReceiver,
bytes32[] memory accounts
) public pure returns (Client.SVMExtraArgsV1 memory) {
return Client.SVMExtraArgsV1({
computeUnits: computeUnits,
accountIsWritableBitmap: accountIsWritableBitmap,
allowOutOfOrderExecution: allowOutOfOrderExecution,
tokenReceiver: tokenReceiver,
accounts: accounts
});
}
}
Loading

0 comments on commit 78d548d

Please sign in to comment.