-
Notifications
You must be signed in to change notification settings - Fork 619
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
test: access keys scenarios in meta transactions #8570
test: access keys scenarios in meta transactions #8570
Conversation
Final set of tests to complement the integration tests listed in near#8467.
assert_eq!( | ||
allowance.unwrap(), | ||
initial_allowance, | ||
"allowance should not change, we used the relayer's fund not the sender's" |
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.
Should this also check relayer’s and sender’s balance to validate that relayer’s funds been used and that sender’s overall balance was also left untouched (regardless of what the kay’s allowance says?)
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.
check_meta_tx_fn_call
does all these checks already, including complicated balance calculations for the 30% contract rewards and all that jazz
deposit: 0, | ||
})]; | ||
|
||
let tx_result = node.user().meta_tx(sender, receiver, relayer, actions).unwrap(); |
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 an unfortunate amount of duplication between the three tests added here? Would it be possible to consolidate them somehow?
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 tried my best to reduce duplication, but the consolidated function need an awful lot of parameters. See my latest commit.
In terms of LOC, I ended up with more code than before. But I think it's still an improvement, as the logical duplication is reduced. Not sure if the code is cleaner to read though.
7d59df9
to
63d6927
Compare
Final set of tests to complement the integration tests listed in #8467.