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 ibc v3 support #332

Merged
merged 4 commits into from
May 13, 2022
Merged

Add ibc v3 support #332

merged 4 commits into from
May 13, 2022

Conversation

ethanfrey
Copy link
Member

This updates the Go types to match changes in CosmWasm/cosmwasm#1302

Only merge once that will be merged. Doesn't require the library to be updated first, just that we agree on the structs. This is backwards compatible.

.gitignore Outdated Show resolved Hide resolved
lib.go Outdated Show resolved Hide resolved
types/ibc.go Outdated
@@ -133,16 +133,19 @@ func (m *IBCCloseConfirm) ToMsg() IBCChannelCloseMsg {
}

type IBCPacketReceiveMsg struct {
Packet IBCPacket `json:"packet"`
Packet IBCPacket `json:"packet"`
Relayer string `json:"relayer,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

If this guaranteed to be non-empty in v3?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it must always be a valid address in ibcv3.
I guess we can remove omitempty, if we assume anyone importing this is supporting ibc3, which is a fair assumption

Copy link
Member

Choose a reason for hiding this comment

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

The omitempty then makes perfect sense for the v1 case. Good to know we don't have a case distiction withon v3.

types/ibc.go Outdated Show resolved Hide resolved
@ethanfrey
Copy link
Member Author

ethanfrey commented May 12, 2022

Is this good to merge?

We can safely merge before the new CosmWasm tag, as it works fine with the old VM (and ibc1 contract in the new VM)

Reason would be to make a wasmd PR as well with these types. It won't really work (enable features) until we have a new tagged CosmWasm and wasmvm release, but we could write and code it now to make less work when tagging releases.

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.

LGTM. Did you test this?

@@ -133,16 +133,19 @@ func (m *IBCCloseConfirm) ToMsg() IBCChannelCloseMsg {
}

type IBCPacketReceiveMsg struct {
Packet IBCPacket `json:"packet"`
Packet IBCPacket `json:"packet"`
Relayer string `json:"relayer"`
Copy link
Member

Choose a reason for hiding this comment

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

Sorry if I confused you, but isn't omitempt required or at least useful to support v1 and v3 at the same time? In v1 the field should not be there. In v3 it is always set.

I guess both ways work. Why did you change it?

@webmaster128 webmaster128 merged commit 5de69cc into main May 13, 2022
@webmaster128 webmaster128 deleted the add-ibc-v3-support branch May 13, 2022 07:26
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