-
Notifications
You must be signed in to change notification settings - Fork 586
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: WriteAcknowledgement API (#882)
* refactor: WriteAcknowledgement takes exported.Acknowledgement instead of bytes * fix: adding check for empty byte string * chore: update changelog * fixing test case + adding migration docs * testing: Adding MockEmptyAcknowledgement to testing library * docs: fix version * test: add check for ack is nil (cherry picked from commit acbc9b6) # Conflicts: # CHANGELOG.md
- Loading branch information
Showing
8 changed files
with
82 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Migrating from ibc-go v2 to v3 | ||
|
||
This document is intended to highlight significant changes which may require more information than presented in the CHANGELOG. | ||
Any changes that must be done by a user of ibc-go should be documented here. | ||
|
||
There are four sections based on the four potential user groups of this document: | ||
- Chains | ||
- IBC Apps | ||
- Relayers | ||
- IBC Light Clients | ||
|
||
**Note:** ibc-go supports golang semantic versioning and therefore all imports must be updated to bump the version number on major releases. | ||
```go | ||
github.com/cosmos/ibc-go/v3 -> github.com/cosmos/ibc-go/v4 | ||
``` | ||
|
||
No genesis or in-place migrations required when upgrading from v1 or v2 of ibc-go. | ||
|
||
## Chains | ||
|
||
### IS04 - Channel | ||
|
||
The `WriteAcknowledgement` API now takes the `exported.Acknowledgement` type instead of passing in the acknowledgement byte array directly. | ||
This is an API breaking change and as such IBC application developers will have to update any calls to `WriteAcknowledgement`. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package mock | ||
|
||
// MockEmptyAcknowledgement implements the exported.Acknowledgement interface and always returns an empty byte string as Response | ||
type MockEmptyAcknowledgement struct { | ||
Response []byte | ||
} | ||
|
||
// NewMockEmptyAcknowledgement returns a new instance of MockEmptyAcknowledgement | ||
func NewMockEmptyAcknowledgement() MockEmptyAcknowledgement { | ||
return MockEmptyAcknowledgement{ | ||
Response: []byte{}, | ||
} | ||
} | ||
|
||
// Success implements the Acknowledgement interface | ||
func (ack MockEmptyAcknowledgement) Success() bool { | ||
return true | ||
} | ||
|
||
// Acknowledgement implements the Acknowledgement interface | ||
func (ack MockEmptyAcknowledgement) Acknowledgement() []byte { | ||
return []byte{} | ||
} |