-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Init ccipReader e2e tests #1203
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity 0.8.24; | ||
|
||
contract CCIPReaderTester { | ||
struct SourceChainConfig { | ||
bool isEnabled; | ||
uint64 minSeqNr; | ||
bytes onRamp; | ||
} | ||
|
||
struct EVM2AnyRampMessage { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: we can use the structs directly, they are already defined: import {Internal} from "../../libraries/Internal.sol"; Would it cause issues off-chain if we use the full |
||
RampMessageHeader header; | ||
address sender; | ||
} | ||
|
||
struct RampMessageHeader { | ||
bytes32 messageId; | ||
uint64 sourceChainSelector; | ||
uint64 destChainSelector; | ||
uint64 sequenceNumber; | ||
uint64 nonce; | ||
} | ||
|
||
mapping(uint64 sourceChainSelector => SourceChainConfig sourceChainConfig) internal s_sourceChainConfigs; | ||
|
||
function getSourceChainConfig(uint64 sourceChainSelector) external view returns (SourceChainConfig memory) { | ||
return s_sourceChainConfigs[sourceChainSelector]; | ||
} | ||
|
||
function setSourceChainConfig(uint64 sourceChainSelector, SourceChainConfig memory sourceChainConfig) external { | ||
s_sourceChainConfigs[sourceChainSelector] = sourceChainConfig; | ||
} | ||
|
||
event CCIPSendRequested(uint64 indexed destChainSelector, EVM2AnyRampMessage message); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: I think you might also be able to use the event directly without re-defining it: Though this might be limited to test files |
||
|
||
function EmitCCIPSendRequested(uint64 destChainSelector, EVM2AnyRampMessage memory message) external { | ||
emit CCIPSendRequested(destChainSelector, message); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: we can use the struct directly:
Usage: