-
Notifications
You must be signed in to change notification settings - Fork 409
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
Alex ibc spike2 #231
Alex ibc spike2 #231
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
types that belong to go-cosmwasm. copied here temporary for faster dev feedback. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package cosmwasm | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
wasmTypes "github.com/CosmWasm/go-cosmwasm/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
type OnReceiveIBCResponse struct { | ||
Messages []sdk.Msg `json:"messages"` | ||
|
||
Acknowledgement json.RawMessage | ||
// log message to return over abci interface | ||
Log []wasmTypes.LogAttribute `json:"log"` | ||
} | ||
|
||
type OnAcknowledgeIBCResponse struct { | ||
Messages []sdk.Msg `json:"messages"` | ||
|
||
// log message to return over abci interface | ||
Log []wasmTypes.LogAttribute `json:"log"` | ||
} | ||
type OnTimeoutIBCResponse struct { | ||
Messages []sdk.Msg `json:"messages"` | ||
|
||
// log message to return over abci interface | ||
Log []wasmTypes.LogAttribute `json:"log"` | ||
} | ||
|
||
type AcceptChannelResponse struct { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would be one more contract callback? for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have used this for |
||
Result bool `json:"result"` | ||
Reason string `json:"reason"` | ||
RestrictCounterpartyVersions []string `json:"accepted_counterpary_versions"` | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are three clear entrypoints. I would like to make
OnAcknowledgeIBCResponse
/OnTimeoutIBCResponse
=>OnAcknowledgeIBCSuccess
/OnAcknowledgeIBCError
as I see no difference in handling a timeout from a rejected packet (it failed, undo state changes)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Success and Error are a bit ambiguous as an Ack can contain an application level error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, the IBC/wasmd entry points make sense for the protocol level.
I would like to use more semantically interesting ones for the contracts.
And yes, I am only thinking of the interface we expose to the contracts, and figure we provide an adaptor between the official IBC and our desired API.