Make cross-contract callee non-optional#1636
Merged
ascjones merged 12 commits intohc-remove-default-account-idfrom Feb 1, 2023
Merged
Make cross-contract callee non-optional#1636ascjones merged 12 commits intohc-remove-default-account-idfrom
ascjones merged 12 commits intohc-remove-default-account-idfrom
Conversation
HCastano
reviewed
Feb 1, 2023
crates/env/src/call/call_builder.rs
Outdated
| } | ||
|
|
||
| /// Sets the `code_hash` for the current cross-contract delegate call. | ||
| pub fn code_hash( |
Contributor
There was a problem hiding this comment.
So @ascjones I guess what you're suggesting is we rename this to delegate?
Collaborator
Author
There was a problem hiding this comment.
Yes exactly, so by calling one method or the other we instantiate the builder type for the type of call we want.
Collaborator
Author
There was a problem hiding this comment.
Actually maybe the choices are
callee&code_hashcall&delegate
Contributor
There was a problem hiding this comment.
Sure, but then we should rename the callee builder method to call
Collaborator
Author
|
Not going to wait for examples test to run, tests run locally okay and it is hanging occasionally. |
ascjones
added a commit
that referenced
this pull request
Feb 1, 2023
* Remove `Default` bound on `AccountId` type * Manually implement storage traits for AccountID Since it doesn't implement `Default` we can't use the macro implementations anymore. * Update `Call` builder to not use default AccountId * Use non-Default bound functions when reading AccountIds * Remove unused `get_property_inplace` method * Update `CallParams` to use `None` when no account ID is set * Update examples to explicitly use zero address * Remove unused environment function * Manually implement `Default` in DNS example * Fix spellcheck * Correctly encode the `callee` account ID when calling `pallet-contracts` * Update `CHANGELOG` * Make cross-contract callee non-optional (#1636) * Make cross-contract callee non-optional * clippy * Fmt * Fix * clippy * clippy * clippy * Add a similar method for `code_hash` * Fix doc tests * RustFmt * Rename top level methods to `call` and `delegate` * Fix some renames --------- Co-authored-by: Hernando Castano <hernando@hcastano.com> --------- Co-authored-by: Andrew Jones <ascjones@gmail.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Suggestion for how to enforce
calleein #1255.This breaks the
CallBuilderAPI by introducing two new methods:callanddelegate, which canbe used to streamline the
CallBuilderset-up for the respective call types.