Skip to content

Conversation

@ethanfrey
Copy link
Contributor

Adds support for CosmWasm 1.0.0-soon

For Go, the biggest changes are to add the TransactionInfo field to Env as well as the ContractInfoQuery variant to WasmQuery

@ethanfrey ethanfrey requested a review from alpe September 22, 2021 13:56
@ethanfrey
Copy link
Contributor Author

Happy for a review, so we can work on wasmd integration

Copy link
Contributor

@alpe alpe left a comment

Choose a reason for hiding this comment

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

👍 Added some questions

types/env.go Outdated
}

type ContractInfo struct {
// binary encoding of sdk.AccAddress of the contract, to be used when sending messages
Copy link
Contributor

Choose a reason for hiding this comment

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

q: should this be "bech32 encoded address" instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, you are right. I will update all the comments

Creator string `json:"creator"`
// Set to the admin who can migrate contract, if any
Admin string `json:"admin,omit_empty"`
Pinned bool `json:"pinned"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: We have this info with an extra index in wasmd but I was wondering now if pinned would be useful for a contract? 🤷

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 don't know how you want to store it, but it is interesting info if you want an idea of gas cost (maybe you do powerful Smart Queries if pinned and weaker Raw Queries if not).

Contract ContractInfo `json:"contract"`
Block BlockInfo `json:"block"`
Contract ContractInfo `json:"contract"`
Transaction *TransactionInfo `json:"transaction_info,omit_empty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

q: Would this be empty for simulations/ queries? In the "spike" I did not make a different and defaulted to 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Also empty if the contract was called in a cron job or such. Thus optional.

If this was directly triggered by a TX in a block (DeliverTx), then this should be filled in.
This allows contacts to store some unique reference (requested by Secret Network, but may be useful in other use cases to identify or order tx)

@ethanfrey ethanfrey merged commit 8369711 into main Sep 22, 2021
@ethanfrey ethanfrey deleted the update-1.0-soon branch September 22, 2021 15:32
@webmaster128
Copy link
Member

Nice work, thanks!

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.

4 participants