-
Notifications
You must be signed in to change notification settings - Fork 75
feat: update scripts #776
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
feat: update scripts #776
Conversation
…l/contracts into chrismaree/update-scripts
|
|
||
| [provider] | ||
| cluster = "localnet" | ||
| wallet = "test/svm/keys/localnet-wallet.json" |
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.
this would break forking tests where we have overrided CCTP state with this key as permissioned actor
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.
yes, was not planning on committing when the PR is ready
scripts/svm/simpleFill.ts
Outdated
| const outputAmount = new BN(resolvedArgv.outputAmount); | ||
| const originChainId = new BN(resolvedArgv.originChainId); | ||
| const depositId = resolvedArgv.depositId; | ||
| const depositId = intToU8Array32(resolvedArgv.depositId); |
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.
this might not work with deterministic ids because of JS number size limitations. maybe better let resolvedArgv.depositId be string and parse it as BigNum->U8Array32 if it starts with 0x?
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.
ye, this is a good point. I've updated accordingly and updated intToU8Array32 to support BN.
| const outputAmount = new BN(resolvedArgv.outputAmount); | ||
| const originChainId = new BN(resolvedArgv.originChainId); | ||
| const depositId = intToU8Array32(resolvedArgv.depositId); | ||
| const depositId = intToU8Array32(new BN(resolvedArgv.depositId)); |
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 don't think BN constructor automatically detects and parses hex strings
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.
it's assumed its just a large number in a string so should be fine.
| describe: "Ethereum address to convert", | ||
| }).argv; | ||
|
|
||
| async function logPublicKey(): Promise<void> { |
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.
Do we want to add this to Anchor.toml scripts?
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.
can run it with node as well but I'll add it, sure.
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.
Looks good after addressing the BN issue that Reinis raised. Also, some scripts are not included in the Anchor.toml scripts section. Were they intended to be run differently than with anchor run?
After playing with scripts last week, a number of the scripts were broken due to recent changes pre-audit.
This PR fixes this.