diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index f571101508f..ff79278b80a 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -49,8 +49,8 @@ - [ibc/applications/fee/v1/tx.proto](#ibc/applications/fee/v1/tx.proto) - [MsgEscrowPacketFee](#ibc.applications.fee.v1.MsgEscrowPacketFee) - [MsgEscrowPacketFeeResponse](#ibc.applications.fee.v1.MsgEscrowPacketFeeResponse) - - [MsgRegisterCounterPartyAddressResponse](#ibc.applications.fee.v1.MsgRegisterCounterPartyAddressResponse) - [MsgRegisterCounterpartyAddress](#ibc.applications.fee.v1.MsgRegisterCounterpartyAddress) + - [MsgRegisterCounterpartyAddressResponse](#ibc.applications.fee.v1.MsgRegisterCounterpartyAddressResponse) - [Msg](#ibc.applications.fee.v1.Msg) @@ -915,16 +915,6 @@ MsgEscrowPacketFeeResponse defines the response type for Msg/EscrowPacketFee - - -### MsgRegisterCounterPartyAddressResponse -MsgRegisterCounterPartyAddressResponse defines the Msg/RegisterCounteryPartyAddress response type - - - - - - ### MsgRegisterCounterpartyAddress @@ -940,6 +930,16 @@ MsgRegisterCounterpartyAddress is the request type for registering the counter p + + + +### MsgRegisterCounterpartyAddressResponse +MsgRegisterCounterpartyAddressResponse defines the Msg/RegisterCounterypartyAddress response type + + + + + @@ -954,7 +954,7 @@ Msg defines the ibc/fee Msg service. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `RegisterCounterPartyAddress` | [MsgRegisterCounterpartyAddress](#ibc.applications.fee.v1.MsgRegisterCounterpartyAddress) | [MsgRegisterCounterPartyAddressResponse](#ibc.applications.fee.v1.MsgRegisterCounterPartyAddressResponse) | RegisterCounterpartyAddress defines a rpc handler method for MsgRegisterCounterpartyAddress RegisterCounterpartyAddress is called by the relayer on each channelEnd and allows them to specify their counterparty address before relaying. This ensures they will be properly compensated for forward relaying since destination chain must send back relayer's source address (counterparty address) in acknowledgement. This function may be called more than once by a relayer, in which case, latest counterparty address is always used. | | +| `RegisterCounterpartyAddress` | [MsgRegisterCounterpartyAddress](#ibc.applications.fee.v1.MsgRegisterCounterpartyAddress) | [MsgRegisterCounterpartyAddressResponse](#ibc.applications.fee.v1.MsgRegisterCounterpartyAddressResponse) | RegisterCounterpartyAddress defines a rpc handler method for MsgRegisterCounterpartyAddress RegisterCounterpartyAddress is called by the relayer on each channelEnd and allows them to specify their counterparty address before relaying. This ensures they will be properly compensated for forward relaying since destination chain must send back relayer's source address (counterparty address) in acknowledgement. This function may be called more than once by a relayer, in which case, latest counterparty address is always used. | | | `EscrowPacketFee` | [MsgEscrowPacketFee](#ibc.applications.fee.v1.MsgEscrowPacketFee) | [MsgEscrowPacketFeeResponse](#ibc.applications.fee.v1.MsgEscrowPacketFeeResponse) | EscrowPacketFee defines a rpc handler method for MsgEscrowPacketFee EscrowPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to incentivize the relaying of the given packet. | | diff --git a/modules/apps/29-fee/client/cli/cli.go b/modules/apps/29-fee/client/cli/cli.go index fb8b9db8320..c7be975a534 100644 --- a/modules/apps/29-fee/client/cli/cli.go +++ b/modules/apps/29-fee/client/cli/cli.go @@ -1,9 +1,9 @@ package cli import ( - "github.com/spf13/cobra" - + // external library imports "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" ) // GetQueryCmd returns the query commands for 29-fee diff --git a/modules/apps/29-fee/keeper/keeper.go b/modules/apps/29-fee/keeper/keeper.go index db304dd4cf9..a8319944613 100644 --- a/modules/apps/29-fee/keeper/keeper.go +++ b/modules/apps/29-fee/keeper/keeper.go @@ -1,15 +1,15 @@ package keeper -/* import ( - "github.com/tendermint/tendermint/libs/log" - + // external library imports "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/cosmos/ibc-go/modules/apps/transfer/types" + "github.com/tendermint/tendermint/libs/log" + + // ibc-go imports + "github.com/cosmos/ibc-go/modules/apps/29-fee/types" host "github.com/cosmos/ibc-go/modules/core/24-host" ) @@ -25,7 +25,6 @@ type Keeper struct { scopedKeeper capabilitykeeper.ScopedKeeper } - // NewKeeper creates a new 29-fee Keeper instance func NewKeeper( cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace paramtypes.Subspace, @@ -49,6 +48,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", "x/"+host.ModuleName+"-"+types.ModuleName) } +/* // IsBound checks if the transfer module is already bound to the desired port func (k Keeper) IsBound(ctx sdk.Context, portID string) bool { _, ok := k.scopedKeeper.GetCapability(ctx, host.PortPath(portID)) @@ -62,12 +62,6 @@ func (k Keeper) BindPort(ctx sdk.Context, portID string) error { return k.ClaimCapability(ctx, cap, host.PortPath(portID)) } -// GetPort returns the portID for the transfer module. Used in ExportGenesis -func (k Keeper) GetPort(ctx sdk.Context) string { - store := ctx.KVStore(k.storeKey) - return string(store.Get(types.PortKey)) -} - // SetPort sets the portID for the transfer module. Used in InitGenesis func (k Keeper) SetPort(ctx sdk.Context, portID string) { store := ctx.KVStore(k.storeKey) @@ -85,3 +79,22 @@ func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability return k.scopedKeeper.ClaimCapability(ctx, cap, name) } */ + +// SetCounterpartyAddress maps the destination chain relayer address to the source relayer address +// The receiving chain must store the mapping from: address -> counterpartyAddress for the given channel +func (k Keeper) SetCounterpartyAddress(ctx sdk.Context, address, counterpartyAddress string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.KeyRelayerAddress(address), []byte(counterpartyAddress)) +} + +// GetCounterpartyAddress gets the relayer counterparty address given a destination relayer address +func (k Keeper) GetCounterpartyAddress(ctx sdk.Context, address sdk.AccAddress) (sdk.AccAddress, bool) { + store := ctx.KVStore(k.storeKey) + key := types.KeyRelayerAddress(address.String()) + + if !store.Has(key) { + return []byte{}, false + } + + return store.Get(key), true +} diff --git a/modules/apps/29-fee/keeper/keeper_test.go b/modules/apps/29-fee/keeper/keeper_test.go index b355ccfe847..11c1768a1cf 100644 --- a/modules/apps/29-fee/keeper/keeper_test.go +++ b/modules/apps/29-fee/keeper/keeper_test.go @@ -1,15 +1,13 @@ package keeper_test -/* import ( + // standard library importsn "testing" + // external library imports "github.com/stretchr/testify/suite" - "github.com/tendermint/tendermint/crypto" - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/ibc-go/modules/apps/transfer/types" + // ibc-go imports ibctesting "github.com/cosmos/ibc-go/testing" ) @@ -31,15 +29,6 @@ func (suite *KeeperTestSuite) SetupTest() { suite.chainC = suite.coordinator.GetChain(ibctesting.GetChainID(2)) } -func NewFeePath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { - path := ibctesting.NewPath(chainA, chainB) - path.EndpointA.ChannelConfig.PortID = ibctesting.FeePort - path.EndpointB.ChannelConfig.PortID = ibctesting.FeePort - - return path -} - func TestKeeperTestSuite(t *testing.T) { suite.Run(t, new(KeeperTestSuite)) } -*/ diff --git a/modules/apps/29-fee/keeper/msg_server.go b/modules/apps/29-fee/keeper/msg_server.go index 2194eed8a68..54b0dadbc37 100644 --- a/modules/apps/29-fee/keeper/msg_server.go +++ b/modules/apps/29-fee/keeper/msg_server.go @@ -1,4 +1,33 @@ package keeper -// TODO -//var _ types.MsgServer = Keeper{} +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/cosmos/ibc-go/modules/apps/29-fee/types" +) + +var _ types.MsgServer = Keeper{} + +// RegisterCounterpartyAddress is called by the relayer on each channelEnd and allows them to specify their counterparty address before relaying +// This ensures they will be properly compensated for forward relaying on the source chain since the destination chain must send back relayer's source address (counterparty address) in acknowledgement +// This function may be called more than once by relayers, in which case, the previous counterparty address will be overwritten by the new counterparty address +func (k Keeper) RegisterCounterpartyAddress(goCtx context.Context, msg *types.MsgRegisterCounterpartyAddress) (*types.MsgRegisterCounterpartyAddressResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + k.SetCounterpartyAddress( + ctx, msg.Address, msg.CounterpartyAddress, + ) + + k.Logger(ctx).Info("Registering counterparty address for relayer.", "Address:", msg.Address, "Counterparty Address:", msg.CounterpartyAddress) + + return &types.MsgRegisterCounterpartyAddressResponse{}, nil +} + +// EscrowPacketFee defines a rpc handler method for MsgEscrowPacketFee +// EscrowPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to +// incentivize the relaying of the given packet. +func (k Keeper) EscrowPacketFee(goCtx context.Context, msg *types.MsgEscrowPacketFee) (*types.MsgEscrowPacketFeeResponse, error) { + return &types.MsgEscrowPacketFeeResponse{}, nil +} diff --git a/modules/apps/29-fee/types/expected_keepers.go b/modules/apps/29-fee/types/expected_keepers.go index 68513b476a5..a17a443623d 100644 --- a/modules/apps/29-fee/types/expected_keepers.go +++ b/modules/apps/29-fee/types/expected_keepers.go @@ -1,10 +1,12 @@ package types -/* import ( + //external library imports sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + + // ibc-go imports connectiontypes "github.com/cosmos/ibc-go/modules/core/03-connection/types" channeltypes "github.com/cosmos/ibc-go/modules/core/04-channel/types" ibcexported "github.com/cosmos/ibc-go/modules/core/exported" @@ -47,4 +49,3 @@ type ConnectionKeeper interface { type PortKeeper interface { BindPort(ctx sdk.Context, portID string) *capabilitytypes.Capability } -*/ diff --git a/modules/apps/29-fee/types/keys.go b/modules/apps/29-fee/types/keys.go index 769113f504a..5d1057dccca 100644 --- a/modules/apps/29-fee/types/keys.go +++ b/modules/apps/29-fee/types/keys.go @@ -1,5 +1,8 @@ package types +// standard library imports +import "fmt" + const ( // ModuleName defines the 29-fee name ModuleName = "ibcfee" @@ -7,9 +10,20 @@ const ( // StoreKey is the store key string for IBC transfer StoreKey = ModuleName + // PortKey is the port id that is wrapped by fee middleware + PortKey = "feetransfer" + // RouterKey is the message route for IBC transfer RouterKey = ModuleName // QuerierRoute is the querier route for IBC transfer QuerierRoute = ModuleName + + // RelayerAddressKeyPrefix is the key prefix for relayer address mapping + RelayerAddressKeyPrefix = "relayerAddress" ) + +// KeyRelayerAddress returns the key for relayer address -> counteryparty address mapping +func KeyRelayerAddress(address string) []byte { + return []byte(fmt.Sprintf("%s/%s", RelayerAddressKeyPrefix, address)) +} diff --git a/modules/apps/29-fee/types/keys_test.go b/modules/apps/29-fee/types/keys_test.go new file mode 100644 index 00000000000..312188c5e21 --- /dev/null +++ b/modules/apps/29-fee/types/keys_test.go @@ -0,0 +1,19 @@ +package types_test + +import ( + fmt "fmt" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/ibc-go/modules/apps/29-fee/types" +) + +func TestKeyRelayerAddress(t *testing.T) { + var ( + relayerAddress = "relayer_address" + ) + + key := types.KeyRelayerAddress(relayerAddress) + require.Equal(t, string(key), fmt.Sprintf("%s/relayer_address", types.RelayerAddressKeyPrefix)) +} diff --git a/modules/apps/29-fee/types/msgs.go b/modules/apps/29-fee/types/msgs.go index 4df0e84ff1a..6d1a92ef945 100644 --- a/modules/apps/29-fee/types/msgs.go +++ b/modules/apps/29-fee/types/msgs.go @@ -1,32 +1,44 @@ package types -/* import ( - "strings" - + // external library imports sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - clienttypes "github.com/cosmos/ibc-go/modules/core/02-client/types" - host "github.com/cosmos/ibc-go/modules/core/24-host" ) -// NewMsg -func NewMsg() *Msg { - return &Msg{ +// msg types +const ( + TypeMsgRegisterCounterpartyAddress = "registerCounterpartyAddress" +) + +// NewMsgRegisterCounterpartyAddress creates a new instance of MsgRegisterCounterpartyAddress +func NewMsgRegisterCounterpartyAddress(address, counterpartyAddress string) *MsgRegisterCounterpartyAddress { + return &MsgRegisterCounterpartyAddress{ + Address: address, + CounterpartyAddress: counterpartyAddress, } } -// ValidateBasic performs a basic check of the Msg fields. -func (msg Msg) ValidateBasic() error { +// ValidateBasic performs a basic check of the MsgRegisterCounterpartyAddress fields +func (msg MsgRegisterCounterpartyAddress) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Address) + if err != nil { + return sdkerrors.Wrap(err, "failed to convert msg.Address into sdk.AccAddress") + } + + _, err = sdk.AccAddressFromBech32(msg.CounterpartyAddress) + if err != nil { + return sdkerrors.Wrap(err, "failed to convert msg.CounterpartyAddress into sdk.AccAddress") + } + return nil } // GetSigners implements sdk.Msg -func (msg MsgTransfer) GetSigners() []sdk.AccAddress { - signer, err := sdk.AccAddressFromBech32(msg.Sender) +func (msg MsgRegisterCounterpartyAddress) GetSigners() []sdk.AccAddress { + signer, err := sdk.AccAddressFromBech32(msg.Address) if err != nil { panic(err) } return []sdk.AccAddress{signer} } -*/ diff --git a/modules/apps/29-fee/types/msgs_test.go b/modules/apps/29-fee/types/msgs_test.go index 132bde75752..d29073f75a7 100644 --- a/modules/apps/29-fee/types/msgs_test.go +++ b/modules/apps/29-fee/types/msgs_test.go @@ -1,36 +1,36 @@ package types -/* import ( - "fmt" "testing" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/crypto/secp256k1" +) - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - sdk "github.com/cosmos/cosmos-sdk/types" +var ( + validAddr = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String() + invalidAddr = "invalid_address" ) -func (suite *TypesTestSuite) TestMsgValidateBasic() { +// TestMsgTransferValidation tests ValidateBasic for MsgTransfer +func TestMsgRegisterCountepartyAddressValidation(t *testing.T) { testCases := []struct { name string - msg *types.Msg + msg *MsgRegisterCounterpartyAddress expPass bool }{ - {"", types.NewMsg(), true}, + {"validate with correct sdk.AccAddress", NewMsgRegisterCounterpartyAddress(validAddr, validAddr), true}, + {"validate with incorrect destination relayer address", NewMsgRegisterCounterpartyAddress(invalidAddr, validAddr), false}, + {"validate with incorrect counterparty relayer address", NewMsgRegisterCounterpartyAddress(validAddr, invalidAddr), false}, } - for _, tc := range testCases { - tc := tc - - suite.Run(tc.name, func() { - err := tc.msg.ValidateBasic() - if tc.expPass { - suite.Require().NoError(err) - } else { - suite.Require().Error(err) - } - }) + for i, tc := range testCases { + err := tc.msg.ValidateBasic() + if tc.expPass { + require.NoError(t, err, "valid test case %d failed: %s", i, tc.name) + } else { + require.Error(t, err, "invalid test case %d passed: %s", i, tc.name) + } } } -*/ diff --git a/modules/apps/29-fee/types/tx.pb.go b/modules/apps/29-fee/types/tx.pb.go index cb46345e9f1..c9fb330d12b 100644 --- a/modules/apps/29-fee/types/tx.pb.go +++ b/modules/apps/29-fee/types/tx.pb.go @@ -68,24 +68,24 @@ func (m *MsgRegisterCounterpartyAddress) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRegisterCounterpartyAddress proto.InternalMessageInfo -// MsgRegisterCounterPartyAddressResponse defines the Msg/RegisterCounteryPartyAddress response type -type MsgRegisterCounterPartyAddressResponse struct { +// MsgRegisterCounterpartyAddressResponse defines the Msg/RegisterCounterypartyAddress response type +type MsgRegisterCounterpartyAddressResponse struct { } -func (m *MsgRegisterCounterPartyAddressResponse) Reset() { - *m = MsgRegisterCounterPartyAddressResponse{} +func (m *MsgRegisterCounterpartyAddressResponse) Reset() { + *m = MsgRegisterCounterpartyAddressResponse{} } -func (m *MsgRegisterCounterPartyAddressResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterCounterPartyAddressResponse) ProtoMessage() {} -func (*MsgRegisterCounterPartyAddressResponse) Descriptor() ([]byte, []int) { +func (m *MsgRegisterCounterpartyAddressResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterCounterpartyAddressResponse) ProtoMessage() {} +func (*MsgRegisterCounterpartyAddressResponse) Descriptor() ([]byte, []int) { return fileDescriptor_05c93128649f1b96, []int{1} } -func (m *MsgRegisterCounterPartyAddressResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgRegisterCounterpartyAddressResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgRegisterCounterPartyAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgRegisterCounterpartyAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgRegisterCounterPartyAddressResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgRegisterCounterpartyAddressResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -95,17 +95,17 @@ func (m *MsgRegisterCounterPartyAddressResponse) XXX_Marshal(b []byte, determini return b[:n], nil } } -func (m *MsgRegisterCounterPartyAddressResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterCounterPartyAddressResponse.Merge(m, src) +func (m *MsgRegisterCounterpartyAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterCounterpartyAddressResponse.Merge(m, src) } -func (m *MsgRegisterCounterPartyAddressResponse) XXX_Size() int { +func (m *MsgRegisterCounterpartyAddressResponse) XXX_Size() int { return m.Size() } -func (m *MsgRegisterCounterPartyAddressResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterCounterPartyAddressResponse.DiscardUnknown(m) +func (m *MsgRegisterCounterpartyAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterCounterpartyAddressResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgRegisterCounterPartyAddressResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgRegisterCounterpartyAddressResponse proto.InternalMessageInfo // MsgEscrowPacketFee defines the request type EscrowPacketFee RPC type MsgEscrowPacketFee struct { @@ -185,7 +185,7 @@ var xxx_messageInfo_MsgEscrowPacketFeeResponse proto.InternalMessageInfo func init() { proto.RegisterType((*MsgRegisterCounterpartyAddress)(nil), "ibc.applications.fee.v1.MsgRegisterCounterpartyAddress") - proto.RegisterType((*MsgRegisterCounterPartyAddressResponse)(nil), "ibc.applications.fee.v1.MsgRegisterCounterPartyAddressResponse") + proto.RegisterType((*MsgRegisterCounterpartyAddressResponse)(nil), "ibc.applications.fee.v1.MsgRegisterCounterpartyAddressResponse") proto.RegisterType((*MsgEscrowPacketFee)(nil), "ibc.applications.fee.v1.MsgEscrowPacketFee") proto.RegisterType((*MsgEscrowPacketFeeResponse)(nil), "ibc.applications.fee.v1.MsgEscrowPacketFeeResponse") } @@ -193,36 +193,36 @@ func init() { func init() { proto.RegisterFile("ibc/applications/fee/v1/tx.proto", fileDescriptor_05c93128649f1b96) } var fileDescriptor_05c93128649f1b96 = []byte{ - // 454 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0xcf, 0x6b, 0xd4, 0x40, + // 451 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0x41, 0x6b, 0xd4, 0x40, 0x14, 0xc7, 0x93, 0x16, 0xb4, 0x1d, 0x0f, 0xc2, 0xb4, 0x60, 0x49, 0x25, 0xa9, 0x39, 0xc8, 0x82, - 0x36, 0x43, 0xb7, 0x07, 0xb1, 0x17, 0x71, 0x45, 0x41, 0x70, 0xa1, 0xe4, 0xe8, 0xa5, 0x4c, 0x26, - 0x6f, 0xa7, 0x83, 0xd9, 0x4c, 0x98, 0x37, 0xbb, 0xba, 0x82, 0x77, 0x8f, 0x1e, 0x04, 0x3d, 0xf6, - 0xdf, 0xf0, 0x3f, 0xf0, 0xd8, 0xa3, 0xa7, 0x22, 0xbb, 0x17, 0xcf, 0xfd, 0x0b, 0x64, 0x36, 0xdd, - 0x12, 0xba, 0x3f, 0xa0, 0xb7,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, 0x03, 0x00, 0x00, + 0x36, 0x43, 0xb7, 0x07, 0xb1, 0x17, 0x71, 0x45, 0x41, 0x70, 0x41, 0x72, 0xf4, 0x52, 0x26, 0x93, + 0xb7, 0xd3, 0xc1, 0x6c, 0x26, 0xcc, 0x9b, 0x5d, 0x5d, 0xc1, 0xbb, 0x47, 0x0f, 0x82, 0x1e, 0xfb, + 0x35, 0xfc, 0x06, 0x1e, 0x7b, 0xf4, 0x54, 0x64, 0xf7, 0xe2, 0xb9, 0x9f, 0x40, 0x66, 0x63, 0x4a, + 0x68, 0x77, 0x17, 0xf4, 0xf6, 0x26, 0xf3, 0xfb, 0xbf, 0x79, 0xff, 0x7f, 0x78, 0x64, 0x4f, 0x65, + 0x82, 0xf1, 0xaa, 0x2a, 0x94, 0xe0, 0x56, 0xe9, 0x12, 0xd9, 0x00, 0x80, 0x8d, 0x0f, 0x98, 0x7d, + 0x9f, 0x54, 0x46, 0x5b, 0x4d, 0xef, 0xa8, 0x4c, 0x24, 0x6d, 0x22, 0x19, 0x00, 0x24, 0xe3, 0x83, + 0x60, 0x5b, 0x6a, 0xa9, 0xe7, 0x0c, 0x73, 0x55, 0x8d, 0x07, 0xf7, 0x96, 0x35, 0x74, 0xaa, 0x16, + 0x22, 0xb4, 0x01, 0x26, 0x4e, 0x78, 0x59, 0x42, 0xe1, 0xae, 0xff, 0x96, 0x35, 0x12, 0x7f, 0xf3, + 0x49, 0xd8, 0x47, 0x99, 0x82, 0x54, 0x68, 0xc1, 0x3c, 0xd3, 0xa3, 0xd2, 0x82, 0xa9, 0xb8, 0xb1, + 0x93, 0xa7, 0x79, 0x6e, 0x00, 0x91, 0xee, 0x90, 0x9b, 0xbc, 0x2e, 0x77, 0xfc, 0x3d, 0xbf, 0xb3, + 0x99, 0x36, 0x47, 0x9a, 0x92, 0x6d, 0xd1, 0x12, 0x1c, 0x37, 0xd8, 0x9a, 0xc3, 0x7a, 0xd1, 0xc5, + 0x79, 0xb4, 0x3b, 0xe1, 0xc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x39, 0x0b, 0xbd, 0x37, 0x5d, 0xa9, 0xec, + 0xc9, 0x28, 0x4b, 0x84, 0x1e, 0x32, 0xa1, 0x71, 0xa8, 0x91, 0xa9, 0x4c, 0xec, 0x4b, 0xcd, 0x86, + 0x3a, 0x1f, 0x15, 0x80, 0x6e, 0x65, 0x90, 0x75, 0x1f, 0xef, 0xbb, 0x6d, 0xb1, 0x93, 0x0a, 0x30, + 0xbb, 0x31, 0x5f, 0x85, 0xc3, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x9e, 0xf3, 0xe6, 0xf1, 0xa3, + 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -242,7 +242,7 @@ type MsgClient interface { // counterparty address before relaying. This ensures they will be properly compensated for forward relaying since // destination chain must send back relayer's source address (counterparty address) in acknowledgement. This function // may be called more than once by a relayer, in which case, latest counterparty address is always used. - RegisterCounterPartyAddress(ctx context.Context, in *MsgRegisterCounterpartyAddress, opts ...grpc.CallOption) (*MsgRegisterCounterPartyAddressResponse, error) + RegisterCounterpartyAddress(ctx context.Context, in *MsgRegisterCounterpartyAddress, opts ...grpc.CallOption) (*MsgRegisterCounterpartyAddressResponse, error) // EscrowPacketFee defines a rpc handler method for MsgEscrowPacketFee // EscrowPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to // incentivize the relaying of the given packet. @@ -257,9 +257,9 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } -func (c *msgClient) RegisterCounterPartyAddress(ctx context.Context, in *MsgRegisterCounterpartyAddress, opts ...grpc.CallOption) (*MsgRegisterCounterPartyAddressResponse, error) { - out := new(MsgRegisterCounterPartyAddressResponse) - err := c.cc.Invoke(ctx, "/ibc.applications.fee.v1.Msg/RegisterCounterPartyAddress", in, out, opts...) +func (c *msgClient) RegisterCounterpartyAddress(ctx context.Context, in *MsgRegisterCounterpartyAddress, opts ...grpc.CallOption) (*MsgRegisterCounterpartyAddressResponse, error) { + out := new(MsgRegisterCounterpartyAddressResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.fee.v1.Msg/RegisterCounterpartyAddress", in, out, opts...) if err != nil { return nil, err } @@ -282,7 +282,7 @@ type MsgServer interface { // counterparty address before relaying. This ensures they will be properly compensated for forward relaying since // destination chain must send back relayer's source address (counterparty address) in acknowledgement. This function // may be called more than once by a relayer, in which case, latest counterparty address is always used. - RegisterCounterPartyAddress(context.Context, *MsgRegisterCounterpartyAddress) (*MsgRegisterCounterPartyAddressResponse, error) + RegisterCounterpartyAddress(context.Context, *MsgRegisterCounterpartyAddress) (*MsgRegisterCounterpartyAddressResponse, error) // EscrowPacketFee defines a rpc handler method for MsgEscrowPacketFee // EscrowPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to // incentivize the relaying of the given packet. @@ -293,8 +293,8 @@ type MsgServer interface { type UnimplementedMsgServer struct { } -func (*UnimplementedMsgServer) RegisterCounterPartyAddress(ctx context.Context, req *MsgRegisterCounterpartyAddress) (*MsgRegisterCounterPartyAddressResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterCounterPartyAddress not implemented") +func (*UnimplementedMsgServer) RegisterCounterpartyAddress(ctx context.Context, req *MsgRegisterCounterpartyAddress) (*MsgRegisterCounterpartyAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterCounterpartyAddress not implemented") } func (*UnimplementedMsgServer) EscrowPacketFee(ctx context.Context, req *MsgEscrowPacketFee) (*MsgEscrowPacketFeeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method EscrowPacketFee not implemented") @@ -304,20 +304,20 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } -func _Msg_RegisterCounterPartyAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_RegisterCounterpartyAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgRegisterCounterpartyAddress) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).RegisterCounterPartyAddress(ctx, in) + return srv.(MsgServer).RegisterCounterpartyAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ibc.applications.fee.v1.Msg/RegisterCounterPartyAddress", + FullMethod: "/ibc.applications.fee.v1.Msg/RegisterCounterpartyAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RegisterCounterPartyAddress(ctx, req.(*MsgRegisterCounterpartyAddress)) + return srv.(MsgServer).RegisterCounterpartyAddress(ctx, req.(*MsgRegisterCounterpartyAddress)) } return interceptor(ctx, in, info, handler) } @@ -345,8 +345,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "RegisterCounterPartyAddress", - Handler: _Msg_RegisterCounterPartyAddress_Handler, + MethodName: "RegisterCounterpartyAddress", + Handler: _Msg_RegisterCounterpartyAddress_Handler, }, { MethodName: "EscrowPacketFee", @@ -394,7 +394,7 @@ func (m *MsgRegisterCounterpartyAddress) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *MsgRegisterCounterPartyAddressResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgRegisterCounterpartyAddressResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -404,12 +404,12 @@ func (m *MsgRegisterCounterPartyAddressResponse) Marshal() (dAtA []byte, err err return dAtA[:n], nil } -func (m *MsgRegisterCounterPartyAddressResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgRegisterCounterpartyAddressResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRegisterCounterPartyAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgRegisterCounterpartyAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -512,7 +512,7 @@ func (m *MsgRegisterCounterpartyAddress) Size() (n int) { return n } -func (m *MsgRegisterCounterPartyAddressResponse) Size() (n int) { +func (m *MsgRegisterCounterpartyAddressResponse) Size() (n int) { if m == nil { return 0 } @@ -669,7 +669,7 @@ func (m *MsgRegisterCounterpartyAddress) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRegisterCounterPartyAddressResponse) Unmarshal(dAtA []byte) error { +func (m *MsgRegisterCounterpartyAddressResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -692,10 +692,10 @@ func (m *MsgRegisterCounterPartyAddressResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRegisterCounterPartyAddressResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRegisterCounterpartyAddressResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterCounterPartyAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRegisterCounterpartyAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: diff --git a/proto/ibc/applications/fee/v1/tx.proto b/proto/ibc/applications/fee/v1/tx.proto index 85ee09d0672..f9b56cf5011 100644 --- a/proto/ibc/applications/fee/v1/tx.proto +++ b/proto/ibc/applications/fee/v1/tx.proto @@ -14,7 +14,7 @@ service Msg { // counterparty address before relaying. This ensures they will be properly compensated for forward relaying since // destination chain must send back relayer's source address (counterparty address) in acknowledgement. This function // may be called more than once by a relayer, in which case, latest counterparty address is always used. - rpc RegisterCounterPartyAddress(MsgRegisterCounterpartyAddress) returns (MsgRegisterCounterPartyAddressResponse); + rpc RegisterCounterpartyAddress(MsgRegisterCounterpartyAddress) returns (MsgRegisterCounterpartyAddressResponse); // EscrowPacketFee defines a rpc handler method for MsgEscrowPacketFee // EscrowPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to // incentivize the relaying of the given packet. @@ -30,8 +30,8 @@ message MsgRegisterCounterpartyAddress { string counterparty_address = 2 [(gogoproto.moretags) = "yaml:\"counterparty_address\""]; } -// MsgRegisterCounterPartyAddressResponse defines the Msg/RegisterCounteryPartyAddress response type -message MsgRegisterCounterPartyAddressResponse {} +// MsgRegisterCounterpartyAddressResponse defines the Msg/RegisterCounterypartyAddress response type +message MsgRegisterCounterpartyAddressResponse {} // MsgEscrowPacketFee defines the request type EscrowPacketFee RPC message MsgEscrowPacketFee {