-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support tx parameter overrides #158
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.
I'm not the biggest fan of the name with_params
and Parameters
. My initial reaction to .call().with_params()
is that those are parameters for the call, not the transaction. Maybe .tx_params()
and TxParameters
?
Yeah, I wasn't attached to the |
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, but will defer to @vnepveu
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.
Some naming issues, 1/2 nits and 1/2 questions to make sure I understand. Otherwise great!!!
This PR adds support for setting parameters to contract calls and deployments. These parameters are byte price, gas limit, and gas price for now.
It's done through a new method
tx_params()
that's chained to the generated ABI method:This doesn't break the way contract calls were made previously. i.e.
initialize_counter(42).call();
(without.tx_params()
) works just like before and, also just like before, it will use default values for these parameters. If the user wants to override the default values, then they can chaintx_params()
to the method call.However, this does break previous contract deployments, as the deployment method now requires these params to be set:
Closes #138.