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

Fix cw20-base helpers.ts and point to heldernet #201

Merged
merged 2 commits into from
Dec 22, 2020
Merged

Conversation

orkunkl
Copy link
Contributor

@orkunkl orkunkl commented Dec 21, 2020

This change is required for coralnet to heldernet update in docs.

Copy link
Member

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

Looks good. Please double-check the cosmjs version and update the header if needed.

Otherwise, feel free to merge and I will look into InitMsg later

@@ -20,24 +20,29 @@ interface Options {
readonly httpUrl: string
readonly networkId: string
readonly feeToken: string
readonly gasPrice: number
readonly gasPrice: GasPrice
Copy link
Member

Choose a reason for hiding this comment

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

This changed. Is this using 0.22 still? or 0.23?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for v0.23.0

@@ -202,7 +181,7 @@ interface CW20Contract {
// codeId must come from a previous deploy
// label is the public name of the contract in listing
// if you set admin, you can run migrations on this contract (likely client.senderAddress)
instantiate: (codeId: number, initMsg: InitMsg, label: string, admin?: string) => Promise<CW20Instance>
instantiate: (codeId: number, initMsg: Record<string, unknown>, label: string, admin?: string) => Promise<CW20Instance>
Copy link
Member

Choose a reason for hiding this comment

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

The TS compiler forces this on you?

Ideally it would auto downcast InitMsg to this more general Record<string, unknown>. And nice to have the clarity in the contract-specific API. If you have TS issues, leave it and I can look into it later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the error I get with v0.23:

../../../../../.npm/_npx/10245/lib/node_modules/@cosmjs/cli/[eval].ts:307:53 - error TS2345: Argument of type 'InitMsg' is not assignable to parameter of type 'Record<string, unknown>'.
  Index signature is missing in type 'InitMsg'.

307     const result = await client.instantiate(codeId, initMsg, label, { memo: `Init ${label}`, admin});
                                                        ~~~~~~~

Copy link
Member

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

Oh, and can you update https://github.com/CosmWasm/cosmwasm-plus/tree/v0.2.1/contracts/cw20-base to v0.3.2?

I think it is the same public interface, but good to keep using the most recent versions. I have done some minor bug fixes on that contract

@orkunkl orkunkl changed the title Fix cw20-base helper.ts and point to heldernet Fix cw20-base helpers.ts and point to heldernet Dec 22, 2020
@orkunkl
Copy link
Contributor Author

orkunkl commented Dec 22, 2020

@ethanfrey I don't know which version of rust-optimizer is used to build v0.3.2. Maybe we could do a minor release with v0.10.7 to make sure it is updated?

@ethanfrey
Copy link
Member

I'll merge this (doesn't have to be correct) and update shortly with the v0.4.0 release

@ethanfrey ethanfrey merged commit e4ef2df into master Dec 22, 2020
@ethanfrey ethanfrey deleted the fix-cw20-helper branch December 22, 2020 20:48
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.

2 participants