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

add instantiate2 broadcast in SigningCosmwasmClient #1407

Merged
merged 3 commits into from
May 24, 2023

Conversation

loin3
Copy link
Contributor

@loin3 loin3 commented Apr 4, 2023

Closes #1399

Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Very nice, thank you!

Comment on lines 133 to 137
/**
* FixMsg include the msg value into the hash for the predictable address.
* Default is false
*/
readonly fixMsg?: boolean;
Copy link
Member

Choose a reason for hiding this comment

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

This should be removed (and hardcoded to false)

funds: [...(options.funds || [])],
admin: options.admin,
salt: options.salt,
fixMsg: options.fixMsg,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
fixMsg: options.fixMsg,
fixMsg: false,

/**
* salt is an arbitrary value provided by the sender. Size can be 1 to 64.
*/
readonly salt?: Uint8Array;
Copy link
Member

Choose a reason for hiding this comment

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

This value is required. Let's add it as a required positional argument after codeId: number,

public async instantiate2(
senderAddress: string,
codeId: number,
msg: Record<string, unknown>,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
msg: Record<string, unknown>,
msg: JsonObject,

* The options of an .instantiate() call.
* All properties are optional.
*/
export interface Instantiate2Options {
Copy link
Member

Choose a reason for hiding this comment

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

This should be listed in index.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found that Instantiate2Options is exactly same with InstantiateOptions after I delete salt and fixMsg.
So I delete Instantiate2Options.

@@ -103,6 +105,38 @@ export interface InstantiateOptions {
readonly admin?: string;
}

/**
* The options of an .instantiate() call.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* The options of an .instantiate() call.
* The options of an .instantiate2() call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found that Instantiate2Options is exactly same with InstantiateOptions after I delete salt and fixMsg.
So I delete Instantiate2Options.

@loin3 loin3 requested a review from webmaster128 April 5, 2023 11:43
webmaster128 added a commit that referenced this pull request May 24, 2023
@webmaster128 webmaster128 merged commit dcb358b into cosmos:main May 24, 2023
@webmaster128
Copy link
Member

Thank you. Will be shipped in the next release.

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.

Add SigningCosmWasmClient.instantiate2
2 participants