-
Notifications
You must be signed in to change notification settings - Fork 23
test(e2e): deploy ERC20s with different decimals #1220
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
Conversation
9ec732c to
18a22d0
Compare
18a22d0 to
bbbbe50
Compare
| // Either 6 or 18 decimals to test interop between same asset UIDs with different decimals. | ||
| // | ||
| // TODO: is there a nicer way to do this deterministically? | ||
| let decimals_ = if provider.get_chain_id().await? % 2 == 0 { 6 } else { 18 }; |
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'd rather not tie this to chain ID, and instead maybe pass rng all the way to this function, so that we can set the seed if we want. Making it a derivative of chain ID means that all ERC-20 on that chain will have the same number of decimals, right?
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.
yeah agree that this feels a bit hacky, though I wouldn't want it to be random either because with 4 retries any failing test will likely just be retried and succeed
another option would be to run all kinds of configurations like we do with payment configs
Lines 45 to 51 in f8d6585
| /// Runs all configurations (in both ERC20 and native payment methods). | |
| pub async fn run_e2e<'a, F>(build_txs: F) -> Result<()> | |
| where | |
| F: Fn(&Environment) -> Vec<TxContext<'a>> + Send + Sync + Copy, | |
| { | |
| run_configs(build_txs, PaymentConfig::iter()).await | |
| } |
|
was merged into #1201 |
Fixes #1200 Blocked by #1220, needs testing --------- Co-authored-by: Arsenii Kulikov <[email protected]>
Test for #1200