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

refactor: renaming Result in IncentivizedAcknowledgement to AppAcknowledgement #1338

Merged
merged 4 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### API Breaking

* (transfer) [\#1250](https://github.com/cosmos/ibc-go/pull/1250) Deprecate `GetTransferAccount` since the `transfer` module account is never used.
* (modules/29-fee)[\#1338](https://github.com/cosmos/ibc-go/pull/1338) Renaming `Result` field in `IncentivizedAcknowledgement` to `AppAcknowledgement`.

### State Machine Breaking

Expand Down
2 changes: 1 addition & 1 deletion docs/ibc/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ IncentivizedAcknowledgement is the acknowledgement format to be used by applicat

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `result` | [bytes](#bytes) | | the underlying app acknowledgement result bytes |
| `app_acknowledgement` | [bytes](#bytes) | | the underlying app acknowledgement result bytes |
| `forward_relayer_address` | [string](#string) | | the relayer address which submits the recv packet message |
| `underlying_app_success` | [bool](#bool) | | success flag of the base application callback |

Expand Down
4 changes: 2 additions & 2 deletions modules/apps/29-fee/ibc_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (im IBCMiddleware) OnAcknowledgementPacket(
// for fee enabled channels
//
// Please see ADR 004 for more information.
return im.app.OnAcknowledgementPacket(ctx, packet, ack.Result, relayer)
return im.app.OnAcknowledgementPacket(ctx, packet, ack.AppAcknowledgement, relayer)
}

packetID := channeltypes.NewPacketId(packet.SourcePort, packet.SourceChannel, packet.Sequence)
Expand All @@ -239,7 +239,7 @@ func (im IBCMiddleware) OnAcknowledgementPacket(
}

// call underlying callback
return im.app.OnAcknowledgementPacket(ctx, packet, ack.Result, relayer)
return im.app.OnAcknowledgementPacket(ctx, packet, ack.AppAcknowledgement, relayer)
}

// OnTimeoutPacket implements the IBCMiddleware interface
Expand Down
10 changes: 5 additions & 5 deletions modules/apps/29-fee/ibc_middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ func (suite *FeeTestSuite) TestOnRecvPacket() {
forwardAddr, _ := suite.chainB.GetSimApp().IBCFeeKeeper.GetCounterpartyAddress(suite.chainB.GetContext(), suite.chainA.SenderAccount.GetAddress().String(), suite.path.EndpointB.ChannelID)

expectedAck := types.IncentivizedAcknowledgement{
Result: ibcmock.MockAcknowledgement.Acknowledgement(),
AppAcknowledgement: ibcmock.MockAcknowledgement.Acknowledgement(),
ForwardRelayerAddress: forwardAddr,
UnderlyingAppSuccess: true,
}
Expand All @@ -545,7 +545,7 @@ func (suite *FeeTestSuite) TestOnRecvPacket() {

case !tc.forwardRelayer:
expectedAck := types.IncentivizedAcknowledgement{
Result: ibcmock.MockAcknowledgement.Acknowledgement(),
AppAcknowledgement: ibcmock.MockAcknowledgement.Acknowledgement(),
ForwardRelayerAddress: "",
UnderlyingAppSuccess: true,
}
Expand Down Expand Up @@ -584,7 +584,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() {
suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeesInEscrow(suite.chainA.GetContext(), packetID)

ack = types.IncentivizedAcknowledgement{
Result: ibcmock.MockAcknowledgement.Acknowledgement(),
AppAcknowledgement: ibcmock.MockAcknowledgement.Acknowledgement(),
ForwardRelayerAddress: suite.chainA.SenderAccount.GetAddress().String(),
}.Acknowledgement()

Expand Down Expand Up @@ -626,7 +626,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() {
blockedAddr := suite.chainA.GetSimApp().AccountKeeper.GetModuleAccount(suite.chainA.GetContext(), transfertypes.ModuleName).GetAddress()

ack = types.IncentivizedAcknowledgement{
Result: ibcmock.MockAcknowledgement.Acknowledgement(),
AppAcknowledgement: ibcmock.MockAcknowledgement.Acknowledgement(),
ForwardRelayerAddress: blockedAddr.String(),
}.Acknowledgement()

Expand Down Expand Up @@ -673,7 +673,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() {

// must be changed explicitly
ack = types.IncentivizedAcknowledgement{
Result: ibcmock.MockAcknowledgement.Acknowledgement(),
AppAcknowledgement: ibcmock.MockAcknowledgement.Acknowledgement(),
ForwardRelayerAddress: relayerAddr.String(),
}.Acknowledgement()

Expand Down
2 changes: 1 addition & 1 deletion modules/apps/29-fee/types/ack.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
// NewIncentivizedAcknowledgement creates a new instance of IncentivizedAcknowledgement
func NewIncentivizedAcknowledgement(relayer string, ack []byte, success bool) IncentivizedAcknowledgement {
return IncentivizedAcknowledgement{
Result: ack,
AppAcknowledgement: ack,
ForwardRelayerAddress: relayer,
UnderlyingAppSuccess: success,
}
Expand Down
67 changes: 34 additions & 33 deletions modules/apps/29-fee/types/ack.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/ibc/applications/fee/v1/ack.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "gogoproto/gogo.proto";
// IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware
message IncentivizedAcknowledgement {
// the underlying app acknowledgement result bytes
seantking marked this conversation as resolved.
Show resolved Hide resolved
bytes result = 1;
bytes app_acknowledgement = 1;
colin-axner marked this conversation as resolved.
Show resolved Hide resolved
// the relayer address which submits the recv packet message
string forward_relayer_address = 2 [(gogoproto.moretags) = "yaml:\"forward_relayer_address\""];
// success flag of the base application callback
Expand Down