Skip to content
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

We forgot to add an ability to alter the arguments of the call #1169

Merged

Conversation

xgreenx
Copy link
Collaborator

@xgreenx xgreenx commented Mar 8, 2022

The developer can't alter the default arguments of codegen after #1133.

For example, it is normal to alter transferred_value=)

Also renamed set_call_type -> call_type to be more consistent.

@cmichi cmichi merged commit 184ec88 into use-ink:master Mar 8, 2022
Copy link
Collaborator

@ascjones ascjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate a bit? In the doc comments we are setting callee transferred_value and gas_limit directly on initialization via call_type. So where would we use these new CallBuilder methods instead?

@xgreenx
Copy link
Collaborator Author

xgreenx commented Mar 8, 2022

If call_type is initialized, the user can't alter the values inside. For example, codegen here only initializes the callee field(.call_type(::ink_env::call::Call::new().callee(::ink_lang::ToAccountId::to_account_id(self)))). And if some wants to modify transferred_value he can't do that. And it is a common case when the user wants to do a cross contract call via auto-generated builder and modify some arguments like call_flags or transferred_value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants