Skip to content

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

Merged
cmichi merged 1 commit intouse-ink:masterfrom
Supercolony-net:features/alter-call-argument
Mar 8, 2022
Merged

We forgot to add an ability to alter the arguments of the call#1169
cmichi merged 1 commit intouse-ink:masterfrom
Supercolony-net:features/alter-call-argument

Conversation

@xgreenx
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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
Copy Markdown
Contributor 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