-
Notifications
You must be signed in to change notification settings - Fork 10
add simple foundry scripts for live testing #825
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
base: main
Are you sure you want to change the base?
Conversation
|
||
uint64 public s_sourceChainSelector; | ||
uint64 public s_sequenceNumber; | ||
bytes public s_manualExecutionData; |
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.
I'm assuming a user is supposed to fill every param here? There's no docs on anything so not 100% sure.
How useful is this script if you need to construct the tx manually?
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.
Better to inject the values using env
We can make a .env.example
file which shows all the keys which will be used to inject the values to these variables
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.
- There's no way to get the sequence number dynamically on chain from the script it needs to be provided manually. I will include some comments for the user that they can get the sequencer number from the CCIP explorer front-end as well. I don't think using an ENV is any simpler if you still have to fill in the data it just adds more friction if you need to change things.
- The script is useful for simulating and debugging manual executions in foundry locally. During the Ronin situation recently we had to test manual executions. You can get manual execution data from a variety of other tools and I will include links to those on how to use them.
data: s_data, | ||
tokenAmounts: tokens, | ||
feeToken: address(0), | ||
extraArgs: s_extraArgs |
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.
Better to take specific extra args fields as input (maybe through env) and build the struct and encode it in this script
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.
While that would be better, as the number of different extra Args structs grows as we add more non-evm chains this may become unwieldy and unnecessary complex. This pattern is also present in some of our other example contracts such as PingPong so I feel like it is reasonable to expect the user to generate this themselves if required.
|
To better perform live testing on deployed contracts this PR creates some simple foundry scripts instead of relying on transporter, etherscan, or go scripts.
It also includes changes to github actions to exclude scripts from testing and coverage requirements