-
Notifications
You must be signed in to change notification settings - Fork 450
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 gas usage of hostios that don't have good EVM equivalents #2767
base: master
Are you sure you want to change the base?
Conversation
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.
LGTM
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.
let's have it with multiple values
system_tests/program_gas_test.go
Outdated
funcName := matchSnake.ReplaceAllStringFunc(tc.hostio, func(s string) string { | ||
return strings.ToUpper(strings.TrimPrefix(s, "_")) | ||
}) | ||
signature := fmt.Sprintf("%v()", funcName) | ||
data := crypto.Keccak256([]byte(signature))[:4] |
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.
You could create an interface in the solidity mocks to facilitate the generation of the call args.
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 want to avoid doing that 😬.
Ideally we could use an ABI that is generated directly from the rust smart contract, but we don't have a setup for this yet, so I decided to build calldata in a more low level approach since tests are simple.
30a4518
to
ec8a8b1
Compare
hostios with multiple arguments
ec8a8b1
to
7c6cf62
Compare
Resolves NIT-2829
Test gas usage of hostios that don't have good EVM equivalents