diff --git a/CHANGELOG.md b/CHANGELOG.md index bad11038acb..65274b8fa95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index cf411ade14c..799ad8243ec 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -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 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 | diff --git a/modules/apps/29-fee/ibc_middleware.go b/modules/apps/29-fee/ibc_middleware.go index 236c7456b0d..96bb8be4030 100644 --- a/modules/apps/29-fee/ibc_middleware.go +++ b/modules/apps/29-fee/ibc_middleware.go @@ -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) @@ -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 diff --git a/modules/apps/29-fee/ibc_middleware_test.go b/modules/apps/29-fee/ibc_middleware_test.go index d46c414270e..8c76720ad3e 100644 --- a/modules/apps/29-fee/ibc_middleware_test.go +++ b/modules/apps/29-fee/ibc_middleware_test.go @@ -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, } @@ -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, } @@ -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() @@ -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() @@ -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() diff --git a/modules/apps/29-fee/types/ack.go b/modules/apps/29-fee/types/ack.go index 229d8e4cc3f..d0fe4269868 100644 --- a/modules/apps/29-fee/types/ack.go +++ b/modules/apps/29-fee/types/ack.go @@ -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, } diff --git a/modules/apps/29-fee/types/ack.pb.go b/modules/apps/29-fee/types/ack.pb.go index 4f6437da224..3a3e6eae58e 100644 --- a/modules/apps/29-fee/types/ack.pb.go +++ b/modules/apps/29-fee/types/ack.pb.go @@ -25,8 +25,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware type IncentivizedAcknowledgement struct { - // the underlying app acknowledgement result bytes - Result []byte `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` + // the underlying app acknowledgement bytes + AppAcknowledgement []byte `protobuf:"bytes,1,opt,name=app_acknowledgement,json=appAcknowledgement,proto3" json:"app_acknowledgement,omitempty" yaml:"app_acknowledgement"` // the relayer address which submits the recv packet message ForwardRelayerAddress string `protobuf:"bytes,2,opt,name=forward_relayer_address,json=forwardRelayerAddress,proto3" json:"forward_relayer_address,omitempty" yaml:"forward_relayer_address"` // success flag of the base application callback @@ -66,9 +66,9 @@ func (m *IncentivizedAcknowledgement) XXX_DiscardUnknown() { var xxx_messageInfo_IncentivizedAcknowledgement proto.InternalMessageInfo -func (m *IncentivizedAcknowledgement) GetResult() []byte { +func (m *IncentivizedAcknowledgement) GetAppAcknowledgement() []byte { if m != nil { - return m.Result + return m.AppAcknowledgement } return nil } @@ -94,27 +94,28 @@ func init() { func init() { proto.RegisterFile("ibc/applications/fee/v1/ack.proto", fileDescriptor_ab2834946fb65ea4) } var fileDescriptor_ab2834946fb65ea4 = []byte{ - // 315 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xb1, 0x4e, 0xf3, 0x30, - 0x14, 0x85, 0xeb, 0xff, 0x97, 0x2a, 0x88, 0x98, 0xa2, 0xd2, 0x56, 0x20, 0x85, 0x92, 0xa9, 0x4b, - 0x63, 0x95, 0x8a, 0x01, 0xb6, 0x76, 0x63, 0x42, 0x0a, 0x0b, 0xea, 0x12, 0x39, 0xf6, 0x6d, 0xb0, - 0xea, 0xd8, 0x96, 0xed, 0xa4, 0x0a, 0x4f, 0xc1, 0x63, 0x31, 0x76, 0x64, 0x42, 0xa8, 0x1d, 0xd9, - 0x78, 0x02, 0x94, 0xa6, 0x12, 0x1d, 0x60, 0xbb, 0xf7, 0x9c, 0x4f, 0x67, 0xf8, 0xbc, 0x4b, 0x9e, - 0x52, 0x4c, 0xb4, 0x16, 0x9c, 0x12, 0xc7, 0x95, 0xb4, 0x78, 0x01, 0x80, 0xcb, 0x31, 0x26, 0x74, - 0x19, 0x69, 0xa3, 0x9c, 0xf2, 0x7b, 0x3c, 0xa5, 0xd1, 0x21, 0x12, 0x2d, 0x00, 0xa2, 0x72, 0x7c, - 0xd6, 0xc9, 0x54, 0xa6, 0x76, 0x0c, 0xae, 0xaf, 0x06, 0x0f, 0x3f, 0x91, 0x77, 0x7e, 0x27, 0x29, - 0x48, 0xc7, 0x4b, 0xfe, 0x0c, 0x6c, 0x4a, 0x97, 0x52, 0xad, 0x04, 0xb0, 0x0c, 0x72, 0x90, 0xce, - 0xef, 0x7a, 0x6d, 0x03, 0xb6, 0x10, 0xae, 0x8f, 0x06, 0x68, 0x78, 0x12, 0xef, 0x3f, 0x7f, 0xee, - 0xf5, 0x16, 0xca, 0xac, 0x88, 0x61, 0x89, 0x01, 0x41, 0x2a, 0x30, 0x09, 0x61, 0xcc, 0x80, 0xb5, - 0xfd, 0x7f, 0x03, 0x34, 0x3c, 0x9e, 0x85, 0x5f, 0xef, 0x17, 0x41, 0x45, 0x72, 0x71, 0x1b, 0xfe, - 0x01, 0x86, 0xf1, 0xe9, 0xbe, 0x89, 0x9b, 0x62, 0xda, 0xe4, 0xfe, 0xa3, 0xd7, 0x2d, 0x24, 0x03, - 0x23, 0x2a, 0x2e, 0xb3, 0x84, 0x68, 0x9d, 0xd8, 0x82, 0xd2, 0x7a, 0xfa, 0xff, 0x00, 0x0d, 0x8f, - 0x0e, 0xa7, 0x7f, 0xe7, 0x44, 0x18, 0x77, 0x7e, 0x9a, 0xa9, 0xd6, 0x0f, 0x4d, 0x3e, 0xbb, 0x7f, - 0xdd, 0x04, 0x68, 0xbd, 0x09, 0xd0, 0xc7, 0x26, 0x40, 0x2f, 0xdb, 0xa0, 0xb5, 0xde, 0x06, 0xad, - 0xb7, 0x6d, 0xd0, 0x9a, 0x5f, 0x67, 0xdc, 0x3d, 0x15, 0x69, 0x44, 0x55, 0x8e, 0xa9, 0xb2, 0xb9, - 0xb2, 0x98, 0xa7, 0x74, 0x94, 0x29, 0x5c, 0x4e, 0x70, 0xae, 0x58, 0x21, 0xc0, 0xd6, 0xe6, 0x2d, - 0xbe, 0xba, 0x19, 0xd5, 0xd2, 0x5d, 0xa5, 0xc1, 0xa6, 0xed, 0x9d, 0xc5, 0xc9, 0x77, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x2e, 0x38, 0x5f, 0x80, 0x99, 0x01, 0x00, 0x00, + // 329 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xb1, 0x4e, 0xc2, 0x40, + 0x1c, 0xc6, 0x29, 0x26, 0x46, 0x1b, 0xa7, 0x8a, 0x42, 0x30, 0x39, 0xb0, 0x13, 0x0b, 0xbd, 0x20, + 0x71, 0xd0, 0x0d, 0x36, 0x27, 0x92, 0xba, 0x18, 0x96, 0xe6, 0x7a, 0xfd, 0x53, 0x2f, 0x5c, 0xef, + 0x2e, 0x77, 0x6d, 0x49, 0x7d, 0x0a, 0x1f, 0xc2, 0x87, 0x71, 0x64, 0x74, 0x22, 0x06, 0xde, 0x80, + 0x27, 0x30, 0xa5, 0x26, 0xa2, 0xc1, 0xed, 0xf2, 0x7d, 0xbf, 0xfc, 0x72, 0xf9, 0x7f, 0xf6, 0x35, + 0x0b, 0x29, 0x26, 0x4a, 0x71, 0x46, 0x49, 0xca, 0xa4, 0x30, 0x78, 0x06, 0x80, 0xf3, 0x01, 0x26, + 0x74, 0xee, 0x29, 0x2d, 0x53, 0xe9, 0x34, 0x59, 0x48, 0xbd, 0x7d, 0xc4, 0x9b, 0x01, 0x78, 0xf9, + 0xa0, 0xdd, 0x88, 0x65, 0x2c, 0x77, 0x0c, 0x2e, 0x5f, 0x15, 0xee, 0xbe, 0xd5, 0xed, 0xab, 0x07, + 0x41, 0x41, 0xa4, 0x2c, 0x67, 0x2f, 0x10, 0x8d, 0xe8, 0x5c, 0xc8, 0x05, 0x87, 0x28, 0x86, 0x04, + 0x44, 0xea, 0x4c, 0xec, 0x73, 0xa2, 0x54, 0x40, 0x7e, 0xc7, 0x2d, 0xab, 0x6b, 0xf5, 0xce, 0xc6, + 0x68, 0xbb, 0xea, 0xb4, 0x0b, 0x92, 0xf0, 0x7b, 0xf7, 0x00, 0xe4, 0xfa, 0x0e, 0x51, 0xea, 0xaf, + 0x70, 0x6a, 0x37, 0x67, 0x52, 0x2f, 0x88, 0x8e, 0x02, 0x0d, 0x9c, 0x14, 0xa0, 0x03, 0x12, 0x45, + 0x1a, 0x8c, 0x69, 0xd5, 0xbb, 0x56, 0xef, 0x74, 0xec, 0x6e, 0x57, 0x1d, 0x54, 0x49, 0xff, 0x01, + 0x5d, 0xff, 0xe2, 0xbb, 0xf1, 0xab, 0x62, 0x54, 0xe5, 0xce, 0x93, 0x7d, 0x99, 0x89, 0x08, 0x34, + 0x2f, 0x98, 0x88, 0x83, 0xf2, 0x4b, 0x26, 0xa3, 0xb4, 0x54, 0x1f, 0x75, 0xad, 0xde, 0xc9, 0xbe, + 0xfa, 0x30, 0xc7, 0x5d, 0xbf, 0xf1, 0xd3, 0x8c, 0x94, 0x7a, 0xac, 0xf2, 0xf1, 0xe4, 0x7d, 0x8d, + 0xac, 0xe5, 0x1a, 0x59, 0x9f, 0x6b, 0x64, 0xbd, 0x6e, 0x50, 0x6d, 0xb9, 0x41, 0xb5, 0x8f, 0x0d, + 0xaa, 0x4d, 0x6f, 0x63, 0x96, 0x3e, 0x67, 0xa1, 0x47, 0x65, 0x82, 0xa9, 0x34, 0x89, 0x34, 0x98, + 0x85, 0xb4, 0x1f, 0x4b, 0x9c, 0x0f, 0x71, 0x22, 0xa3, 0x8c, 0x83, 0x29, 0x27, 0x33, 0xf8, 0xe6, + 0xae, 0x5f, 0xae, 0x95, 0x16, 0x0a, 0x4c, 0x78, 0xbc, 0x3b, 0xff, 0xf0, 0x2b, 0x00, 0x00, 0xff, + 0xff, 0x08, 0xe8, 0xda, 0xf9, 0xd2, 0x01, 0x00, 0x00, } func (m *IncentivizedAcknowledgement) Marshal() (dAtA []byte, err error) { @@ -154,10 +155,10 @@ func (m *IncentivizedAcknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, er i-- dAtA[i] = 0x12 } - if len(m.Result) > 0 { - i -= len(m.Result) - copy(dAtA[i:], m.Result) - i = encodeVarintAck(dAtA, i, uint64(len(m.Result))) + if len(m.AppAcknowledgement) > 0 { + i -= len(m.AppAcknowledgement) + copy(dAtA[i:], m.AppAcknowledgement) + i = encodeVarintAck(dAtA, i, uint64(len(m.AppAcknowledgement))) i-- dAtA[i] = 0xa } @@ -181,7 +182,7 @@ func (m *IncentivizedAcknowledgement) Size() (n int) { } var l int _ = l - l = len(m.Result) + l = len(m.AppAcknowledgement) if l > 0 { n += 1 + l + sovAck(uint64(l)) } @@ -232,7 +233,7 @@ func (m *IncentivizedAcknowledgement) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AppAcknowledgement", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -259,9 +260,9 @@ func (m *IncentivizedAcknowledgement) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Result = append(m.Result[:0], dAtA[iNdEx:postIndex]...) - if m.Result == nil { - m.Result = []byte{} + m.AppAcknowledgement = append(m.AppAcknowledgement[:0], dAtA[iNdEx:postIndex]...) + if m.AppAcknowledgement == nil { + m.AppAcknowledgement = []byte{} } iNdEx = postIndex case 2: diff --git a/proto/ibc/applications/fee/v1/ack.proto b/proto/ibc/applications/fee/v1/ack.proto index 728c7536c6b..88b4d9fdd2c 100644 --- a/proto/ibc/applications/fee/v1/ack.proto +++ b/proto/ibc/applications/fee/v1/ack.proto @@ -8,8 +8,8 @@ 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 - bytes result = 1; + // the underlying app acknowledgement bytes + bytes app_acknowledgement = 1 [(gogoproto.moretags) = "yaml:\"app_acknowledgement\""]; // 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