From 1e7bb69598733ee50903ee72252888b203304942 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 11 Sep 2024 15:20:45 -0500 Subject: [PATCH 01/13] wip new ibcmodule in progress --- .../01-setup/02-install-spawn.md | 4 + .../02-build-your-chain/wipppp-ibc.md | 21 + simapp/api/example/module/v1/module.pulsar.go | 79 +- simapp/api/example/v1/genesis.pulsar.go | 21 +- simapp/api/example/v1/query.pulsar.go | 21 +- simapp/api/example/v1/state.pulsar.go | 20 +- simapp/api/example/v1/tx.pulsar.go | 20 +- .../ibcmiddleware/module/v1/module.pulsar.go | 85 +- simapp/api/ibcmiddleware/v1/genesis.pulsar.go | 25 +- simapp/api/ibcmiddleware/v1/query.pulsar.go | 24 +- simapp/api/ibcmiddleware/v1/tx.pulsar.go | 24 +- .../api/ibcmodule/module/v1/module.pulsar.go | 503 ++++ simapp/api/ibcmodule/v1/genesis.pulsar.go | 570 ++++ simapp/api/ibcmodule/v1/query.pulsar.go | 76 + simapp/api/ibcmodule/v1/tx.pulsar.go | 2490 +++++++++++++++++ simapp/api/ibcmodule/v1/tx_grpc.pb.go | 111 + simapp/proto/ibcmodule/module/v1/module.proto | 13 + simapp/proto/ibcmodule/v1/genesis.proto | 12 + simapp/proto/ibcmodule/v1/query.proto | 7 + simapp/proto/ibcmodule/v1/tx.proto | 54 + simapp/x/example/types/genesis.pb.go | 15 +- simapp/x/example/types/query.pb.go | 36 +- simapp/x/example/types/state.pb.go | 12 +- simapp/x/example/types/tx.pb.go | 12 +- simapp/x/ibcmiddleware/types/genesis.pb.go | 14 +- simapp/x/ibcmiddleware/types/query.pb.go | 12 +- simapp/x/ibcmiddleware/types/tx.pb.go | 13 +- simapp/x/ibcmodule/README.md | 3 + simapp/x/ibcmodule/client/tx.go | 79 + simapp/x/ibcmodule/ibc_module.go | 127 + simapp/x/ibcmodule/keeper/genesis.go | 32 + simapp/x/ibcmodule/keeper/ibc_helpers.go | 54 + simapp/x/ibcmodule/keeper/keeper.go | 80 + simapp/x/ibcmodule/keeper/msg_server.go | 80 + simapp/x/ibcmodule/module.go | 132 + simapp/x/ibcmodule/types/errors.go | 7 + simapp/x/ibcmodule/types/expected_keepers.go | 3 + simapp/x/ibcmodule/types/genesis.go | 16 + simapp/x/ibcmodule/types/genesis.pb.go | 318 +++ simapp/x/ibcmodule/types/keys.go | 16 + simapp/x/ibcmodule/types/msgs.go | 18 + simapp/x/ibcmodule/types/query.pb.go | 38 + simapp/x/ibcmodule/types/tx.pb.go | 1252 +++++++++ 43 files changed, 6326 insertions(+), 223 deletions(-) create mode 100644 docs/versioned_docs/version-v0.50.x/02-build-your-chain/wipppp-ibc.md create mode 100644 simapp/api/ibcmodule/module/v1/module.pulsar.go create mode 100644 simapp/api/ibcmodule/v1/genesis.pulsar.go create mode 100644 simapp/api/ibcmodule/v1/query.pulsar.go create mode 100644 simapp/api/ibcmodule/v1/tx.pulsar.go create mode 100644 simapp/api/ibcmodule/v1/tx_grpc.pb.go create mode 100644 simapp/proto/ibcmodule/module/v1/module.proto create mode 100644 simapp/proto/ibcmodule/v1/genesis.proto create mode 100644 simapp/proto/ibcmodule/v1/query.proto create mode 100644 simapp/proto/ibcmodule/v1/tx.proto create mode 100644 simapp/x/ibcmodule/README.md create mode 100644 simapp/x/ibcmodule/client/tx.go create mode 100644 simapp/x/ibcmodule/ibc_module.go create mode 100644 simapp/x/ibcmodule/keeper/genesis.go create mode 100644 simapp/x/ibcmodule/keeper/ibc_helpers.go create mode 100644 simapp/x/ibcmodule/keeper/keeper.go create mode 100644 simapp/x/ibcmodule/keeper/msg_server.go create mode 100644 simapp/x/ibcmodule/module.go create mode 100644 simapp/x/ibcmodule/types/errors.go create mode 100644 simapp/x/ibcmodule/types/expected_keepers.go create mode 100644 simapp/x/ibcmodule/types/genesis.go create mode 100644 simapp/x/ibcmodule/types/genesis.pb.go create mode 100644 simapp/x/ibcmodule/types/keys.go create mode 100644 simapp/x/ibcmodule/types/msgs.go create mode 100644 simapp/x/ibcmodule/types/query.pb.go create mode 100644 simapp/x/ibcmodule/types/tx.pb.go diff --git a/docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md b/docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md index 41529f58..d0b8b88f 100644 --- a/docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md +++ b/docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md @@ -43,4 +43,8 @@ source ~/.bashrc # MacOS echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.zshrc source ~/.zshrc + +# Legacy MacOS Go +echo 'export PATH=$PATH:$HOME/go/bin' >> ~/.zshrc +source ~/.zshrc ``` diff --git a/docs/versioned_docs/version-v0.50.x/02-build-your-chain/wipppp-ibc.md b/docs/versioned_docs/version-v0.50.x/02-build-your-chain/wipppp-ibc.md new file mode 100644 index 00000000..3e37fd6e --- /dev/null +++ b/docs/versioned_docs/version-v0.50.x/02-build-your-chain/wipppp-ibc.md @@ -0,0 +1,21 @@ + + +spawn module new nameserviceibc --ibc-middleware + + +app.go: + + (so is spawn an --ibc-middleware or ibc.Module?) + + var nameserviceStack porttypes.IBCModule + nameserviceStack = nameserviceibc.NewIBCMiddleware(transferStack, app.NameserviceibcKeeper) + + + ibcRouter.AddRoute(nameserviceibctypes.ModuleName, nameserviceStack) + app.IBCKeeper.SetRouter(ibcRouter) + + +proto/nameserviceibc/genesis.proto + + + string port_id = 2; diff --git a/simapp/api/example/module/v1/module.pulsar.go b/simapp/api/example/module/v1/module.pulsar.go index eca68b74..f01a6566 100644 --- a/simapp/api/example/module/v1/module.pulsar.go +++ b/simapp/api/example/module/v1/module.pulsar.go @@ -104,9 +104,9 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.simapp.example.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: example.module.v1.Module")) } - panic(fmt.Errorf("message strangelove_ventures.simapp.example.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message example.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -120,9 +120,9 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.simapp.example.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: example.module.v1.Module")) } - panic(fmt.Errorf("message strangelove_ventures.simapp.example.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message example.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -136,9 +136,9 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.simapp.example.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: example.module.v1.Module")) } - panic(fmt.Errorf("message strangelove_ventures.simapp.example.module.v1.Module does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message example.module.v1.Module does not contain field %s", descriptor.FullName())) } } @@ -156,9 +156,9 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.simapp.example.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: example.module.v1.Module")) } - panic(fmt.Errorf("message strangelove_ventures.simapp.example.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message example.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -176,9 +176,9 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.simapp.example.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: example.module.v1.Module")) } - panic(fmt.Errorf("message strangelove_ventures.simapp.example.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message example.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -189,9 +189,9 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.simapp.example.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: example.module.v1.Module")) } - panic(fmt.Errorf("message strangelove_ventures.simapp.example.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message example.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -201,7 +201,7 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in strangelove_ventures.simapp.example.module.v1.Module", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in example.module.v1.Module", d.FullName())) } panic("unreachable") } @@ -415,36 +415,27 @@ var File_example_module_v1_module_proto protoreflect.FileDescriptor var file_example_module_v1_module_proto_rawDesc = []byte{ 0x0a, 0x1e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x2d, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, - 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2e, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, - 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x2e, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x24, 0xba, 0xc0, 0x96, - 0xda, 0x01, 0x1e, 0x0a, 0x1c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, - 0x70, 0x42, 0xd2, 0x02, 0x0a, 0x31, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x73, - 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x69, - 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x53, 0x53, 0x45, 0x4d, 0xaa, 0x02, 0x2c, 0x53, 0x74, 0x72, - 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, - 0x2e, 0x53, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x2c, 0x53, 0x74, 0x72, 0x61, - 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, - 0x53, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x5c, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x38, 0x53, 0x74, 0x72, 0x61, 0x6e, - 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x53, - 0x69, 0x6d, 0x61, 0x70, 0x70, 0x5c, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x30, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, - 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x3a, 0x3a, 0x53, 0x69, 0x6d, 0x61, 0x70, - 0x70, 0x3a, 0x3a, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x11, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x34, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, + 0x2a, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x24, 0x0a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, + 0x70, 0x61, 0x77, 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x42, 0xcd, 0x01, 0x0a, 0x15, + 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x61, 0x77, + 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x45, 0x4d, 0x58, 0xaa, 0x02, 0x11, + 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x11, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, + 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -461,7 +452,7 @@ func file_example_module_v1_module_proto_rawDescGZIP() []byte { var file_example_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_example_module_v1_module_proto_goTypes = []interface{}{ - (*Module)(nil), // 0: strangelove_ventures.simapp.example.module.v1.Module + (*Module)(nil), // 0: example.module.v1.Module } var file_example_module_v1_module_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type diff --git a/simapp/api/example/v1/genesis.pulsar.go b/simapp/api/example/v1/genesis.pulsar.go index bcb65135..eb203ff5 100644 --- a/simapp/api/example/v1/genesis.pulsar.go +++ b/simapp/api/example/v1/genesis.pulsar.go @@ -878,7 +878,7 @@ type GenesisState struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Params defines all the paramaters of the module. + // Params defines all the parameters of the module. Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` } @@ -961,17 +961,18 @@ var file_example_v1_genesis_proto_rawDesc = []byte{ 0x6f, 0x6d, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x6f, 0x6d, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x1b, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x9e, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, + 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xa4, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, - 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, + 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x73, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, - 0x31, 0xa2, 0x02, 0x03, 0x45, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x56, - 0x31, 0xe2, 0x02, 0x16, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x2f, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x45, 0x58, 0x58, 0xaa, 0x02, 0x0a, + 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x45, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/simapp/api/example/v1/query.pulsar.go b/simapp/api/example/v1/query.pulsar.go index 9bce1ada..15052c20 100644 --- a/simapp/api/example/v1/query.pulsar.go +++ b/simapp/api/example/v1/query.pulsar.go @@ -902,17 +902,18 @@ var file_example_v1_query_proto_rawDesc = []byte{ 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x9c, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x78, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xa2, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x69, - 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, - 0x45, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x0a, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x70, + 0x61, 0x77, 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x45, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x45, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x45, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/simapp/api/example/v1/state.pulsar.go b/simapp/api/example/v1/state.pulsar.go index 516cb7f5..a0c58fe2 100644 --- a/simapp/api/example/v1/state.pulsar.go +++ b/simapp/api/example/v1/state.pulsar.go @@ -552,17 +552,17 @@ var file_example_v1_state_proto_rawDesc = []byte{ 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x1f, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x19, 0x0a, 0x09, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0a, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0x01, 0x18, 0x01, 0x42, - 0x9c, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, + 0xa2, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, - 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x45, 0x58, 0x58, 0xaa, 0x02, 0x0a, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, + 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x2f, 0x73, 0x69, + 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x45, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x0a, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, + 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/simapp/api/example/v1/tx.pulsar.go b/simapp/api/example/v1/tx.pulsar.go index 81fde882..a08fd01c 100644 --- a/simapp/api/example/v1/tx.pulsar.go +++ b/simapp/api/example/v1/tx.pulsar.go @@ -990,18 +990,18 @@ var file_example_v1_tx_proto_rawDesc = []byte{ 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x23, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x99, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x9f, 0x01, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, - 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, + 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x45, 0x58, 0x58, 0xaa, 0x02, 0x0a, 0x45, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x56, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, + 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x45, 0x58, 0x58, 0xaa, + 0x02, 0x0a, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0a, 0x45, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x16, 0x45, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/simapp/api/ibcmiddleware/module/v1/module.pulsar.go b/simapp/api/ibcmiddleware/module/v1/module.pulsar.go index 27bff7e8..8ff58cb5 100644 --- a/simapp/api/ibcmiddleware/module/v1/module.pulsar.go +++ b/simapp/api/ibcmiddleware/module/v1/module.pulsar.go @@ -104,9 +104,9 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.simapp.ibcmiddleware.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmiddleware.module.v1.Module")) } - panic(fmt.Errorf("message strangelove_ventures.simapp.ibcmiddleware.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message ibcmiddleware.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -120,9 +120,9 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.simapp.ibcmiddleware.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmiddleware.module.v1.Module")) } - panic(fmt.Errorf("message strangelove_ventures.simapp.ibcmiddleware.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message ibcmiddleware.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -136,9 +136,9 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.simapp.ibcmiddleware.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmiddleware.module.v1.Module")) } - panic(fmt.Errorf("message strangelove_ventures.simapp.ibcmiddleware.module.v1.Module does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message ibcmiddleware.module.v1.Module does not contain field %s", descriptor.FullName())) } } @@ -156,9 +156,9 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.simapp.ibcmiddleware.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmiddleware.module.v1.Module")) } - panic(fmt.Errorf("message strangelove_ventures.simapp.ibcmiddleware.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message ibcmiddleware.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -176,9 +176,9 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.simapp.ibcmiddleware.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmiddleware.module.v1.Module")) } - panic(fmt.Errorf("message strangelove_ventures.simapp.ibcmiddleware.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message ibcmiddleware.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -189,9 +189,9 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.simapp.ibcmiddleware.module.v1.Module")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmiddleware.module.v1.Module")) } - panic(fmt.Errorf("message strangelove_ventures.simapp.ibcmiddleware.module.v1.Module does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message ibcmiddleware.module.v1.Module does not contain field %s", fd.FullName())) } } @@ -201,7 +201,7 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in strangelove_ventures.simapp.ibcmiddleware.module.v1.Module", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in ibcmiddleware.module.v1.Module", d.FullName())) } panic("unreachable") } @@ -415,39 +415,30 @@ var File_ibcmiddleware_module_v1_module_proto protoreflect.FileDescriptor var file_ibcmiddleware_module_v1_module_proto_rawDesc = []byte{ 0x0a, 0x24, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x33, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, - 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x73, 0x69, 0x6d, - 0x61, 0x70, 0x70, 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, - 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2e, 0x0a, - 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x24, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x1e, 0x0a, - 0x1c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, 0x6c, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x42, 0xf6, 0x02, - 0x0a, 0x37, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, - 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x73, 0x69, 0x6d, 0x61, 0x70, - 0x70, 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, - 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, - 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x62, 0x63, 0x6d, 0x69, - 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, - 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x53, 0x53, - 0x49, 0x4d, 0xaa, 0x02, 0x32, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, - 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2e, - 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x32, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x53, 0x69, - 0x6d, 0x61, 0x70, 0x70, 0x5c, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, - 0x72, 0x65, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x3e, 0x53, - 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x5c, 0x53, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x5c, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, - 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x36, - 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, - 0x72, 0x65, 0x73, 0x3a, 0x3a, 0x53, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x3a, 0x3a, 0x49, 0x62, 0x63, - 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, + 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, + 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x34, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x2a, 0xba, 0xc0, 0x96, + 0xda, 0x01, 0x24, 0x0a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x61, 0x77, 0x6e, + 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x42, 0xf1, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, + 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x70, + 0x61, 0x77, 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, + 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2f, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x49, 0x4d, 0x58, 0xaa, 0x02, 0x17, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, + 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x17, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x5c, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x23, 0x49, 0x62, 0x63, 0x6d, + 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x19, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x3a, + 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -464,7 +455,7 @@ func file_ibcmiddleware_module_v1_module_proto_rawDescGZIP() []byte { var file_ibcmiddleware_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_ibcmiddleware_module_v1_module_proto_goTypes = []interface{}{ - (*Module)(nil), // 0: strangelove_ventures.simapp.ibcmiddleware.module.v1.Module + (*Module)(nil), // 0: ibcmiddleware.module.v1.Module } var file_ibcmiddleware_module_v1_module_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type diff --git a/simapp/api/ibcmiddleware/v1/genesis.pulsar.go b/simapp/api/ibcmiddleware/v1/genesis.pulsar.go index d5064e7d..a92451fd 100644 --- a/simapp/api/ibcmiddleware/v1/genesis.pulsar.go +++ b/simapp/api/ibcmiddleware/v1/genesis.pulsar.go @@ -417,20 +417,21 @@ var file_ibcmiddleware_v1_genesis_proto_rawDesc = []byte{ 0x12, 0x10, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0e, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, - 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0xc8, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, + 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0xce, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, - 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, - 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, - 0x72, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x49, 0x58, 0x58, 0xaa, 0x02, 0x10, 0x49, 0x62, 0x63, - 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, - 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x1c, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, - 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x11, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, + 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x2f, 0x73, + 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, + 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x69, 0x62, 0x63, 0x6d, 0x69, + 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x49, 0x58, 0x58, + 0xaa, 0x02, 0x10, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, + 0x61, 0x72, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, + 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, + 0x65, 0x77, 0x61, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/simapp/api/ibcmiddleware/v1/query.pulsar.go b/simapp/api/ibcmiddleware/v1/query.pulsar.go index b228e7a7..421d97a4 100644 --- a/simapp/api/ibcmiddleware/v1/query.pulsar.go +++ b/simapp/api/ibcmiddleware/v1/query.pulsar.go @@ -28,20 +28,20 @@ var file_ibcmiddleware_v1_query_proto_rawDesc = []byte{ 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0xc6, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x69, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0xcc, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x42, - 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, + 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2f, 0x76, 0x31, - 0x3b, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x49, 0x58, 0x58, 0xaa, 0x02, 0x10, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, - 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x49, 0x62, 0x63, 0x6d, - 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x49, - 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x5c, 0x56, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x49, 0x62, - 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, + 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, + 0x61, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, + 0x77, 0x61, 0x72, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x49, 0x58, 0x58, 0xaa, 0x02, 0x10, 0x49, + 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x10, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, + 0x72, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x11, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, + 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_ibcmiddleware_v1_query_proto_goTypes = []interface{}{} diff --git a/simapp/api/ibcmiddleware/v1/tx.pulsar.go b/simapp/api/ibcmiddleware/v1/tx.pulsar.go index c7b871f2..e3e37956 100644 --- a/simapp/api/ibcmiddleware/v1/tx.pulsar.go +++ b/simapp/api/ibcmiddleware/v1/tx.pulsar.go @@ -28,20 +28,20 @@ var file_ibcmiddleware_v1_tx_proto_rawDesc = []byte{ 0x76, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x42, 0xc3, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x62, 0x63, 0x6d, + 0x6f, 0x74, 0x6f, 0x42, 0xc9, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, - 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, - 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x69, 0x62, 0x63, 0x6d, 0x69, - 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x49, 0x58, 0x58, - 0xaa, 0x02, 0x10, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, - 0x61, 0x72, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, - 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, - 0x65, 0x77, 0x61, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x70, 0x61, 0x77, 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2f, 0x76, 0x31, + 0x3b, 0x69, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x49, 0x58, 0x58, 0xaa, 0x02, 0x10, 0x49, 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, + 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x49, 0x62, 0x63, 0x6d, + 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x49, + 0x62, 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x49, 0x62, + 0x63, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x77, 0x61, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var file_ibcmiddleware_v1_tx_proto_goTypes = []interface{}{} diff --git a/simapp/api/ibcmodule/module/v1/module.pulsar.go b/simapp/api/ibcmodule/module/v1/module.pulsar.go new file mode 100644 index 00000000..4fcc0c1f --- /dev/null +++ b/simapp/api/ibcmodule/module/v1/module.pulsar.go @@ -0,0 +1,503 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package modulev1 + +import ( + _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor +) + +func init() { + file_ibcmodule_module_v1_module_proto_init() + md_Module = File_ibcmodule_module_v1_module_proto.Messages().ByName("Module") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_ibcmodule_module_v1_module_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.module.v1.Module")) + } + panic(fmt.Errorf("message ibcmodule.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.module.v1.Module")) + } + panic(fmt.Errorf("message ibcmodule.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.module.v1.Module")) + } + panic(fmt.Errorf("message ibcmodule.module.v1.Module does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.module.v1.Module")) + } + panic(fmt.Errorf("message ibcmodule.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.module.v1.Module")) + } + panic(fmt.Errorf("message ibcmodule.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.module.v1.Module")) + } + panic(fmt.Errorf("message ibcmodule.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in ibcmodule.module.v1.Module", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Module) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: ibcmodule/module/v1/module.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Module is the app config object of the module. +// Learn more: https://docs.cosmos.network/main/building-modules/depinject +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_ibcmodule_module_v1_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_ibcmodule_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +var File_ibcmodule_module_v1_module_proto protoreflect.FileDescriptor + +var file_ibcmodule_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x13, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x34, 0x0a, 0x06, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x3a, 0x2a, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x24, 0x0a, 0x22, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x42, + 0xd9, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x73, 0x2f, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x49, 0x4d, 0x58, 0xaa, 0x02, 0x13, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x49, 0x62, + 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x1f, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, + 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_ibcmodule_module_v1_module_proto_rawDescOnce sync.Once + file_ibcmodule_module_v1_module_proto_rawDescData = file_ibcmodule_module_v1_module_proto_rawDesc +) + +func file_ibcmodule_module_v1_module_proto_rawDescGZIP() []byte { + file_ibcmodule_module_v1_module_proto_rawDescOnce.Do(func() { + file_ibcmodule_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_ibcmodule_module_v1_module_proto_rawDescData) + }) + return file_ibcmodule_module_v1_module_proto_rawDescData +} + +var file_ibcmodule_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_ibcmodule_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: ibcmodule.module.v1.Module +} +var file_ibcmodule_module_v1_module_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_ibcmodule_module_v1_module_proto_init() } +func file_ibcmodule_module_v1_module_proto_init() { + if File_ibcmodule_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ibcmodule_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ibcmodule_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ibcmodule_module_v1_module_proto_goTypes, + DependencyIndexes: file_ibcmodule_module_v1_module_proto_depIdxs, + MessageInfos: file_ibcmodule_module_v1_module_proto_msgTypes, + }.Build() + File_ibcmodule_module_v1_module_proto = out.File + file_ibcmodule_module_v1_module_proto_rawDesc = nil + file_ibcmodule_module_v1_module_proto_goTypes = nil + file_ibcmodule_module_v1_module_proto_depIdxs = nil +} diff --git a/simapp/api/ibcmodule/v1/genesis.pulsar.go b/simapp/api/ibcmodule/v1/genesis.pulsar.go new file mode 100644 index 00000000..4f2deb36 --- /dev/null +++ b/simapp/api/ibcmodule/v1/genesis.pulsar.go @@ -0,0 +1,570 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package ibcmodulev1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_port_id protoreflect.FieldDescriptor +) + +func init() { + file_ibcmodule_v1_genesis_proto_init() + md_GenesisState = File_ibcmodule_v1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_port_id = md_GenesisState.Fields().ByName("port_id") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_ibcmodule_v1_genesis_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.PortId != "" { + value := protoreflect.ValueOfString(x.PortId) + if !f(fd_GenesisState_port_id, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "ibcmodule.v1.GenesisState.port_id": + return x.PortId != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.GenesisState")) + } + panic(fmt.Errorf("message ibcmodule.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "ibcmodule.v1.GenesisState.port_id": + x.PortId = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.GenesisState")) + } + panic(fmt.Errorf("message ibcmodule.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "ibcmodule.v1.GenesisState.port_id": + value := x.PortId + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.GenesisState")) + } + panic(fmt.Errorf("message ibcmodule.v1.GenesisState does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "ibcmodule.v1.GenesisState.port_id": + x.PortId = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.GenesisState")) + } + panic(fmt.Errorf("message ibcmodule.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "ibcmodule.v1.GenesisState.port_id": + panic(fmt.Errorf("field port_id of message ibcmodule.v1.GenesisState is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.GenesisState")) + } + panic(fmt.Errorf("message ibcmodule.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "ibcmodule.v1.GenesisState.port_id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.GenesisState")) + } + panic(fmt.Errorf("message ibcmodule.v1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in ibcmodule.v1.GenesisState", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GenesisState) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GenesisState) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.PortId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.PortId) > 0 { + i -= len(x.PortId) + copy(dAtA[i:], x.PortId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PortId))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: ibcmodule/v1/genesis.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GenesisState defines the modules genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_ibcmodule_v1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_ibcmodule_v1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetPortId() string { + if x != nil { + return x.PortId + } + return "" +} + +var File_ibcmodule_v1_genesis_proto protoreflect.FileDescriptor + +var file_ibcmodule_v1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x67, + 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x69, 0x62, + 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x27, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x17, 0x0a, 0x07, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x42, 0xb2, 0x01, 0x0a, 0x10, 0x63, 0x6f, + 0x6d, 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0c, + 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x61, + 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2f, 0x76, 0x31, 0x3b, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x49, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x0d, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ibcmodule_v1_genesis_proto_rawDescOnce sync.Once + file_ibcmodule_v1_genesis_proto_rawDescData = file_ibcmodule_v1_genesis_proto_rawDesc +) + +func file_ibcmodule_v1_genesis_proto_rawDescGZIP() []byte { + file_ibcmodule_v1_genesis_proto_rawDescOnce.Do(func() { + file_ibcmodule_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_ibcmodule_v1_genesis_proto_rawDescData) + }) + return file_ibcmodule_v1_genesis_proto_rawDescData +} + +var file_ibcmodule_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_ibcmodule_v1_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: ibcmodule.v1.GenesisState +} +var file_ibcmodule_v1_genesis_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_ibcmodule_v1_genesis_proto_init() } +func file_ibcmodule_v1_genesis_proto_init() { + if File_ibcmodule_v1_genesis_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ibcmodule_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ibcmodule_v1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ibcmodule_v1_genesis_proto_goTypes, + DependencyIndexes: file_ibcmodule_v1_genesis_proto_depIdxs, + MessageInfos: file_ibcmodule_v1_genesis_proto_msgTypes, + }.Build() + File_ibcmodule_v1_genesis_proto = out.File + file_ibcmodule_v1_genesis_proto_rawDesc = nil + file_ibcmodule_v1_genesis_proto_goTypes = nil + file_ibcmodule_v1_genesis_proto_depIdxs = nil +} diff --git a/simapp/api/ibcmodule/v1/query.pulsar.go b/simapp/api/ibcmodule/v1/query.pulsar.go new file mode 100644 index 00000000..4da97ff5 --- /dev/null +++ b/simapp/api/ibcmodule/v1/query.pulsar.go @@ -0,0 +1,76 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package ibcmodulev1 + +import ( + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: ibcmodule/v1/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_ibcmodule_v1_query_proto protoreflect.FileDescriptor + +var file_ibcmodule_v1_query_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x69, 0x62, 0x63, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0xb0, + 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, + 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x2f, 0x73, + 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x49, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x49, 0x62, 0x63, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x0d, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_ibcmodule_v1_query_proto_goTypes = []interface{}{} +var file_ibcmodule_v1_query_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_ibcmodule_v1_query_proto_init() } +func file_ibcmodule_v1_query_proto_init() { + if File_ibcmodule_v1_query_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ibcmodule_v1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ibcmodule_v1_query_proto_goTypes, + DependencyIndexes: file_ibcmodule_v1_query_proto_depIdxs, + }.Build() + File_ibcmodule_v1_query_proto = out.File + file_ibcmodule_v1_query_proto_rawDesc = nil + file_ibcmodule_v1_query_proto_goTypes = nil + file_ibcmodule_v1_query_proto_depIdxs = nil +} diff --git a/simapp/api/ibcmodule/v1/tx.pulsar.go b/simapp/api/ibcmodule/v1/tx.pulsar.go new file mode 100644 index 00000000..d2f7f447 --- /dev/null +++ b/simapp/api/ibcmodule/v1/tx.pulsar.go @@ -0,0 +1,2490 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package ibcmodulev1 + +import ( + _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MsgSendTx protoreflect.MessageDescriptor + fd_MsgSendTx_sender protoreflect.FieldDescriptor + fd_MsgSendTx_source_port protoreflect.FieldDescriptor + fd_MsgSendTx_source_channel protoreflect.FieldDescriptor + fd_MsgSendTx_timeout_timestamp protoreflect.FieldDescriptor + fd_MsgSendTx_some_data protoreflect.FieldDescriptor +) + +func init() { + file_ibcmodule_v1_tx_proto_init() + md_MsgSendTx = File_ibcmodule_v1_tx_proto.Messages().ByName("MsgSendTx") + fd_MsgSendTx_sender = md_MsgSendTx.Fields().ByName("sender") + fd_MsgSendTx_source_port = md_MsgSendTx.Fields().ByName("source_port") + fd_MsgSendTx_source_channel = md_MsgSendTx.Fields().ByName("source_channel") + fd_MsgSendTx_timeout_timestamp = md_MsgSendTx.Fields().ByName("timeout_timestamp") + fd_MsgSendTx_some_data = md_MsgSendTx.Fields().ByName("some_data") +} + +var _ protoreflect.Message = (*fastReflection_MsgSendTx)(nil) + +type fastReflection_MsgSendTx MsgSendTx + +func (x *MsgSendTx) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgSendTx)(x) +} + +func (x *MsgSendTx) slowProtoReflect() protoreflect.Message { + mi := &file_ibcmodule_v1_tx_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgSendTx_messageType fastReflection_MsgSendTx_messageType +var _ protoreflect.MessageType = fastReflection_MsgSendTx_messageType{} + +type fastReflection_MsgSendTx_messageType struct{} + +func (x fastReflection_MsgSendTx_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgSendTx)(nil) +} +func (x fastReflection_MsgSendTx_messageType) New() protoreflect.Message { + return new(fastReflection_MsgSendTx) +} +func (x fastReflection_MsgSendTx_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSendTx +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgSendTx) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSendTx +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgSendTx) Type() protoreflect.MessageType { + return _fastReflection_MsgSendTx_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgSendTx) New() protoreflect.Message { + return new(fastReflection_MsgSendTx) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgSendTx) Interface() protoreflect.ProtoMessage { + return (*MsgSendTx)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgSendTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Sender != "" { + value := protoreflect.ValueOfString(x.Sender) + if !f(fd_MsgSendTx_sender, value) { + return + } + } + if x.SourcePort != "" { + value := protoreflect.ValueOfString(x.SourcePort) + if !f(fd_MsgSendTx_source_port, value) { + return + } + } + if x.SourceChannel != "" { + value := protoreflect.ValueOfString(x.SourceChannel) + if !f(fd_MsgSendTx_source_channel, value) { + return + } + } + if x.TimeoutTimestamp != uint64(0) { + value := protoreflect.ValueOfUint64(x.TimeoutTimestamp) + if !f(fd_MsgSendTx_timeout_timestamp, value) { + return + } + } + if x.SomeData != "" { + value := protoreflect.ValueOfString(x.SomeData) + if !f(fd_MsgSendTx_some_data, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgSendTx) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "ibcmodule.v1.MsgSendTx.sender": + return x.Sender != "" + case "ibcmodule.v1.MsgSendTx.source_port": + return x.SourcePort != "" + case "ibcmodule.v1.MsgSendTx.source_channel": + return x.SourceChannel != "" + case "ibcmodule.v1.MsgSendTx.timeout_timestamp": + return x.TimeoutTimestamp != uint64(0) + case "ibcmodule.v1.MsgSendTx.some_data": + return x.SomeData != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTx")) + } + panic(fmt.Errorf("message ibcmodule.v1.MsgSendTx does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgSendTx) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "ibcmodule.v1.MsgSendTx.sender": + x.Sender = "" + case "ibcmodule.v1.MsgSendTx.source_port": + x.SourcePort = "" + case "ibcmodule.v1.MsgSendTx.source_channel": + x.SourceChannel = "" + case "ibcmodule.v1.MsgSendTx.timeout_timestamp": + x.TimeoutTimestamp = uint64(0) + case "ibcmodule.v1.MsgSendTx.some_data": + x.SomeData = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTx")) + } + panic(fmt.Errorf("message ibcmodule.v1.MsgSendTx does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgSendTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "ibcmodule.v1.MsgSendTx.sender": + value := x.Sender + return protoreflect.ValueOfString(value) + case "ibcmodule.v1.MsgSendTx.source_port": + value := x.SourcePort + return protoreflect.ValueOfString(value) + case "ibcmodule.v1.MsgSendTx.source_channel": + value := x.SourceChannel + return protoreflect.ValueOfString(value) + case "ibcmodule.v1.MsgSendTx.timeout_timestamp": + value := x.TimeoutTimestamp + return protoreflect.ValueOfUint64(value) + case "ibcmodule.v1.MsgSendTx.some_data": + value := x.SomeData + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTx")) + } + panic(fmt.Errorf("message ibcmodule.v1.MsgSendTx does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgSendTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "ibcmodule.v1.MsgSendTx.sender": + x.Sender = value.Interface().(string) + case "ibcmodule.v1.MsgSendTx.source_port": + x.SourcePort = value.Interface().(string) + case "ibcmodule.v1.MsgSendTx.source_channel": + x.SourceChannel = value.Interface().(string) + case "ibcmodule.v1.MsgSendTx.timeout_timestamp": + x.TimeoutTimestamp = value.Uint() + case "ibcmodule.v1.MsgSendTx.some_data": + x.SomeData = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTx")) + } + panic(fmt.Errorf("message ibcmodule.v1.MsgSendTx does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgSendTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "ibcmodule.v1.MsgSendTx.sender": + panic(fmt.Errorf("field sender of message ibcmodule.v1.MsgSendTx is not mutable")) + case "ibcmodule.v1.MsgSendTx.source_port": + panic(fmt.Errorf("field source_port of message ibcmodule.v1.MsgSendTx is not mutable")) + case "ibcmodule.v1.MsgSendTx.source_channel": + panic(fmt.Errorf("field source_channel of message ibcmodule.v1.MsgSendTx is not mutable")) + case "ibcmodule.v1.MsgSendTx.timeout_timestamp": + panic(fmt.Errorf("field timeout_timestamp of message ibcmodule.v1.MsgSendTx is not mutable")) + case "ibcmodule.v1.MsgSendTx.some_data": + panic(fmt.Errorf("field some_data of message ibcmodule.v1.MsgSendTx is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTx")) + } + panic(fmt.Errorf("message ibcmodule.v1.MsgSendTx does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgSendTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "ibcmodule.v1.MsgSendTx.sender": + return protoreflect.ValueOfString("") + case "ibcmodule.v1.MsgSendTx.source_port": + return protoreflect.ValueOfString("") + case "ibcmodule.v1.MsgSendTx.source_channel": + return protoreflect.ValueOfString("") + case "ibcmodule.v1.MsgSendTx.timeout_timestamp": + return protoreflect.ValueOfUint64(uint64(0)) + case "ibcmodule.v1.MsgSendTx.some_data": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTx")) + } + panic(fmt.Errorf("message ibcmodule.v1.MsgSendTx does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgSendTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in ibcmodule.v1.MsgSendTx", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgSendTx) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgSendTx) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgSendTx) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgSendTx) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgSendTx) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Sender) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.SourcePort) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.SourceChannel) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.TimeoutTimestamp != 0 { + n += 1 + runtime.Sov(uint64(x.TimeoutTimestamp)) + } + l = len(x.SomeData) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgSendTx) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.SomeData) > 0 { + i -= len(x.SomeData) + copy(dAtA[i:], x.SomeData) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SomeData))) + i-- + dAtA[i] = 0x2a + } + if x.TimeoutTimestamp != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TimeoutTimestamp)) + i-- + dAtA[i] = 0x20 + } + if len(x.SourceChannel) > 0 { + i -= len(x.SourceChannel) + copy(dAtA[i:], x.SourceChannel) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SourceChannel))) + i-- + dAtA[i] = 0x1a + } + if len(x.SourcePort) > 0 { + i -= len(x.SourcePort) + copy(dAtA[i:], x.SourcePort) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SourcePort))) + i-- + dAtA[i] = 0x12 + } + if len(x.Sender) > 0 { + i -= len(x.Sender) + copy(dAtA[i:], x.Sender) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgSendTx) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSendTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSendTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SourcePort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.SourcePort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SourceChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.SourceChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", wireType) + } + x.TimeoutTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.TimeoutTimestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SomeData", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.SomeData = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgSendTxResponse protoreflect.MessageDescriptor + fd_MsgSendTxResponse_sequence protoreflect.FieldDescriptor +) + +func init() { + file_ibcmodule_v1_tx_proto_init() + md_MsgSendTxResponse = File_ibcmodule_v1_tx_proto.Messages().ByName("MsgSendTxResponse") + fd_MsgSendTxResponse_sequence = md_MsgSendTxResponse.Fields().ByName("sequence") +} + +var _ protoreflect.Message = (*fastReflection_MsgSendTxResponse)(nil) + +type fastReflection_MsgSendTxResponse MsgSendTxResponse + +func (x *MsgSendTxResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgSendTxResponse)(x) +} + +func (x *MsgSendTxResponse) slowProtoReflect() protoreflect.Message { + mi := &file_ibcmodule_v1_tx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgSendTxResponse_messageType fastReflection_MsgSendTxResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgSendTxResponse_messageType{} + +type fastReflection_MsgSendTxResponse_messageType struct{} + +func (x fastReflection_MsgSendTxResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgSendTxResponse)(nil) +} +func (x fastReflection_MsgSendTxResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgSendTxResponse) +} +func (x fastReflection_MsgSendTxResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSendTxResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgSendTxResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSendTxResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgSendTxResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgSendTxResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgSendTxResponse) New() protoreflect.Message { + return new(fastReflection_MsgSendTxResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgSendTxResponse) Interface() protoreflect.ProtoMessage { + return (*MsgSendTxResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgSendTxResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Sequence != uint64(0) { + value := protoreflect.ValueOfUint64(x.Sequence) + if !f(fd_MsgSendTxResponse_sequence, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgSendTxResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "ibcmodule.v1.MsgSendTxResponse.sequence": + return x.Sequence != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTxResponse")) + } + panic(fmt.Errorf("message ibcmodule.v1.MsgSendTxResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgSendTxResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "ibcmodule.v1.MsgSendTxResponse.sequence": + x.Sequence = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTxResponse")) + } + panic(fmt.Errorf("message ibcmodule.v1.MsgSendTxResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgSendTxResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "ibcmodule.v1.MsgSendTxResponse.sequence": + value := x.Sequence + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTxResponse")) + } + panic(fmt.Errorf("message ibcmodule.v1.MsgSendTxResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgSendTxResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "ibcmodule.v1.MsgSendTxResponse.sequence": + x.Sequence = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTxResponse")) + } + panic(fmt.Errorf("message ibcmodule.v1.MsgSendTxResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgSendTxResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "ibcmodule.v1.MsgSendTxResponse.sequence": + panic(fmt.Errorf("field sequence of message ibcmodule.v1.MsgSendTxResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTxResponse")) + } + panic(fmt.Errorf("message ibcmodule.v1.MsgSendTxResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgSendTxResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "ibcmodule.v1.MsgSendTxResponse.sequence": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTxResponse")) + } + panic(fmt.Errorf("message ibcmodule.v1.MsgSendTxResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgSendTxResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in ibcmodule.v1.MsgSendTxResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgSendTxResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgSendTxResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgSendTxResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgSendTxResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgSendTxResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Sequence != 0 { + n += 1 + runtime.Sov(uint64(x.Sequence)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgSendTxResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Sequence != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Sequence)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgSendTxResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSendTxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSendTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + x.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_ExamplePacketData protoreflect.MessageDescriptor + fd_ExamplePacketData_sender protoreflect.FieldDescriptor + fd_ExamplePacketData_some_data protoreflect.FieldDescriptor +) + +func init() { + file_ibcmodule_v1_tx_proto_init() + md_ExamplePacketData = File_ibcmodule_v1_tx_proto.Messages().ByName("ExamplePacketData") + fd_ExamplePacketData_sender = md_ExamplePacketData.Fields().ByName("sender") + fd_ExamplePacketData_some_data = md_ExamplePacketData.Fields().ByName("some_data") +} + +var _ protoreflect.Message = (*fastReflection_ExamplePacketData)(nil) + +type fastReflection_ExamplePacketData ExamplePacketData + +func (x *ExamplePacketData) ProtoReflect() protoreflect.Message { + return (*fastReflection_ExamplePacketData)(x) +} + +func (x *ExamplePacketData) slowProtoReflect() protoreflect.Message { + mi := &file_ibcmodule_v1_tx_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ExamplePacketData_messageType fastReflection_ExamplePacketData_messageType +var _ protoreflect.MessageType = fastReflection_ExamplePacketData_messageType{} + +type fastReflection_ExamplePacketData_messageType struct{} + +func (x fastReflection_ExamplePacketData_messageType) Zero() protoreflect.Message { + return (*fastReflection_ExamplePacketData)(nil) +} +func (x fastReflection_ExamplePacketData_messageType) New() protoreflect.Message { + return new(fastReflection_ExamplePacketData) +} +func (x fastReflection_ExamplePacketData_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ExamplePacketData +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ExamplePacketData) Descriptor() protoreflect.MessageDescriptor { + return md_ExamplePacketData +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ExamplePacketData) Type() protoreflect.MessageType { + return _fastReflection_ExamplePacketData_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ExamplePacketData) New() protoreflect.Message { + return new(fastReflection_ExamplePacketData) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ExamplePacketData) Interface() protoreflect.ProtoMessage { + return (*ExamplePacketData)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ExamplePacketData) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Sender != "" { + value := protoreflect.ValueOfString(x.Sender) + if !f(fd_ExamplePacketData_sender, value) { + return + } + } + if x.SomeData != "" { + value := protoreflect.ValueOfString(x.SomeData) + if !f(fd_ExamplePacketData_some_data, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ExamplePacketData) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "ibcmodule.v1.ExamplePacketData.sender": + return x.Sender != "" + case "ibcmodule.v1.ExamplePacketData.some_data": + return x.SomeData != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.ExamplePacketData")) + } + panic(fmt.Errorf("message ibcmodule.v1.ExamplePacketData does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExamplePacketData) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "ibcmodule.v1.ExamplePacketData.sender": + x.Sender = "" + case "ibcmodule.v1.ExamplePacketData.some_data": + x.SomeData = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.ExamplePacketData")) + } + panic(fmt.Errorf("message ibcmodule.v1.ExamplePacketData does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ExamplePacketData) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "ibcmodule.v1.ExamplePacketData.sender": + value := x.Sender + return protoreflect.ValueOfString(value) + case "ibcmodule.v1.ExamplePacketData.some_data": + value := x.SomeData + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.ExamplePacketData")) + } + panic(fmt.Errorf("message ibcmodule.v1.ExamplePacketData does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExamplePacketData) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "ibcmodule.v1.ExamplePacketData.sender": + x.Sender = value.Interface().(string) + case "ibcmodule.v1.ExamplePacketData.some_data": + x.SomeData = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.ExamplePacketData")) + } + panic(fmt.Errorf("message ibcmodule.v1.ExamplePacketData does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExamplePacketData) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "ibcmodule.v1.ExamplePacketData.sender": + panic(fmt.Errorf("field sender of message ibcmodule.v1.ExamplePacketData is not mutable")) + case "ibcmodule.v1.ExamplePacketData.some_data": + panic(fmt.Errorf("field some_data of message ibcmodule.v1.ExamplePacketData is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.ExamplePacketData")) + } + panic(fmt.Errorf("message ibcmodule.v1.ExamplePacketData does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ExamplePacketData) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "ibcmodule.v1.ExamplePacketData.sender": + return protoreflect.ValueOfString("") + case "ibcmodule.v1.ExamplePacketData.some_data": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.ExamplePacketData")) + } + panic(fmt.Errorf("message ibcmodule.v1.ExamplePacketData does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ExamplePacketData) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in ibcmodule.v1.ExamplePacketData", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ExamplePacketData) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExamplePacketData) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ExamplePacketData) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ExamplePacketData) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ExamplePacketData) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Sender) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.SomeData) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ExamplePacketData) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.SomeData) > 0 { + i -= len(x.SomeData) + copy(dAtA[i:], x.SomeData) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SomeData))) + i-- + dAtA[i] = 0x12 + } + if len(x.Sender) > 0 { + i -= len(x.Sender) + copy(dAtA[i:], x.Sender) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ExamplePacketData) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ExamplePacketData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ExamplePacketData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SomeData", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.SomeData = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_Acknowledgement protoreflect.MessageDescriptor + fd_Acknowledgement_result protoreflect.FieldDescriptor + fd_Acknowledgement_error protoreflect.FieldDescriptor +) + +func init() { + file_ibcmodule_v1_tx_proto_init() + md_Acknowledgement = File_ibcmodule_v1_tx_proto.Messages().ByName("Acknowledgement") + fd_Acknowledgement_result = md_Acknowledgement.Fields().ByName("result") + fd_Acknowledgement_error = md_Acknowledgement.Fields().ByName("error") +} + +var _ protoreflect.Message = (*fastReflection_Acknowledgement)(nil) + +type fastReflection_Acknowledgement Acknowledgement + +func (x *Acknowledgement) ProtoReflect() protoreflect.Message { + return (*fastReflection_Acknowledgement)(x) +} + +func (x *Acknowledgement) slowProtoReflect() protoreflect.Message { + mi := &file_ibcmodule_v1_tx_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Acknowledgement_messageType fastReflection_Acknowledgement_messageType +var _ protoreflect.MessageType = fastReflection_Acknowledgement_messageType{} + +type fastReflection_Acknowledgement_messageType struct{} + +func (x fastReflection_Acknowledgement_messageType) Zero() protoreflect.Message { + return (*fastReflection_Acknowledgement)(nil) +} +func (x fastReflection_Acknowledgement_messageType) New() protoreflect.Message { + return new(fastReflection_Acknowledgement) +} +func (x fastReflection_Acknowledgement_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Acknowledgement +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Acknowledgement) Descriptor() protoreflect.MessageDescriptor { + return md_Acknowledgement +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Acknowledgement) Type() protoreflect.MessageType { + return _fastReflection_Acknowledgement_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Acknowledgement) New() protoreflect.Message { + return new(fastReflection_Acknowledgement) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Acknowledgement) Interface() protoreflect.ProtoMessage { + return (*Acknowledgement)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Acknowledgement) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Response != nil { + switch o := x.Response.(type) { + case *Acknowledgement_Result: + v := o.Result + value := protoreflect.ValueOfBytes(v) + if !f(fd_Acknowledgement_result, value) { + return + } + case *Acknowledgement_Error: + v := o.Error + value := protoreflect.ValueOfString(v) + if !f(fd_Acknowledgement_error, value) { + return + } + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Acknowledgement) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "ibcmodule.v1.Acknowledgement.result": + if x.Response == nil { + return false + } else if _, ok := x.Response.(*Acknowledgement_Result); ok { + return true + } else { + return false + } + case "ibcmodule.v1.Acknowledgement.error": + if x.Response == nil { + return false + } else if _, ok := x.Response.(*Acknowledgement_Error); ok { + return true + } else { + return false + } + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.Acknowledgement")) + } + panic(fmt.Errorf("message ibcmodule.v1.Acknowledgement does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Acknowledgement) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "ibcmodule.v1.Acknowledgement.result": + x.Response = nil + case "ibcmodule.v1.Acknowledgement.error": + x.Response = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.Acknowledgement")) + } + panic(fmt.Errorf("message ibcmodule.v1.Acknowledgement does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Acknowledgement) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "ibcmodule.v1.Acknowledgement.result": + if x.Response == nil { + return protoreflect.ValueOfBytes(nil) + } else if v, ok := x.Response.(*Acknowledgement_Result); ok { + return protoreflect.ValueOfBytes(v.Result) + } else { + return protoreflect.ValueOfBytes(nil) + } + case "ibcmodule.v1.Acknowledgement.error": + if x.Response == nil { + return protoreflect.ValueOfString("") + } else if v, ok := x.Response.(*Acknowledgement_Error); ok { + return protoreflect.ValueOfString(v.Error) + } else { + return protoreflect.ValueOfString("") + } + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.Acknowledgement")) + } + panic(fmt.Errorf("message ibcmodule.v1.Acknowledgement does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Acknowledgement) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "ibcmodule.v1.Acknowledgement.result": + cv := value.Bytes() + x.Response = &Acknowledgement_Result{Result: cv} + case "ibcmodule.v1.Acknowledgement.error": + cv := value.Interface().(string) + x.Response = &Acknowledgement_Error{Error: cv} + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.Acknowledgement")) + } + panic(fmt.Errorf("message ibcmodule.v1.Acknowledgement does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Acknowledgement) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "ibcmodule.v1.Acknowledgement.result": + panic(fmt.Errorf("field result of message ibcmodule.v1.Acknowledgement is not mutable")) + case "ibcmodule.v1.Acknowledgement.error": + panic(fmt.Errorf("field error of message ibcmodule.v1.Acknowledgement is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.Acknowledgement")) + } + panic(fmt.Errorf("message ibcmodule.v1.Acknowledgement does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Acknowledgement) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "ibcmodule.v1.Acknowledgement.result": + return protoreflect.ValueOfBytes(nil) + case "ibcmodule.v1.Acknowledgement.error": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.Acknowledgement")) + } + panic(fmt.Errorf("message ibcmodule.v1.Acknowledgement does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Acknowledgement) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + case "ibcmodule.v1.Acknowledgement.response": + if x.Response == nil { + return nil + } + switch x.Response.(type) { + case *Acknowledgement_Result: + return x.Descriptor().Fields().ByName("result") + case *Acknowledgement_Error: + return x.Descriptor().Fields().ByName("error") + } + default: + panic(fmt.Errorf("%s is not a oneof field in ibcmodule.v1.Acknowledgement", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Acknowledgement) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Acknowledgement) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Acknowledgement) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Acknowledgement) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Acknowledgement) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + switch x := x.Response.(type) { + case *Acknowledgement_Result: + if x == nil { + break + } + l = len(x.Result) + n += 2 + l + runtime.Sov(uint64(l)) + case *Acknowledgement_Error: + if x == nil { + break + } + l = len(x.Error) + n += 2 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Acknowledgement) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + switch x := x.Response.(type) { + case *Acknowledgement_Result: + i -= len(x.Result) + copy(dAtA[i:], x.Result) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Result))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + case *Acknowledgement_Error: + i -= len(x.Error) + copy(dAtA[i:], x.Error) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Error))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Acknowledgement) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Acknowledgement: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Acknowledgement: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 21: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + v := make([]byte, postIndex-iNdEx) + copy(v, dAtA[iNdEx:postIndex]) + x.Response = &Acknowledgement_Result{v} + iNdEx = postIndex + case 22: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Response = &Acknowledgement_Error{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: ibcmodule/v1/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgSendTx defines the payload for Msg/SendTx +type MsgSendTx struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + SourcePort string `protobuf:"bytes,2,opt,name=source_port,json=sourcePort,proto3" json:"source_port,omitempty"` + SourceChannel string `protobuf:"bytes,3,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty"` + TimeoutTimestamp uint64 `protobuf:"varint,4,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty"` + SomeData string `protobuf:"bytes,5,opt,name=some_data,json=someData,proto3" json:"some_data,omitempty"` +} + +func (x *MsgSendTx) Reset() { + *x = MsgSendTx{} + if protoimpl.UnsafeEnabled { + mi := &file_ibcmodule_v1_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgSendTx) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSendTx) ProtoMessage() {} + +// Deprecated: Use MsgSendTx.ProtoReflect.Descriptor instead. +func (*MsgSendTx) Descriptor() ([]byte, []int) { + return file_ibcmodule_v1_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgSendTx) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +func (x *MsgSendTx) GetSourcePort() string { + if x != nil { + return x.SourcePort + } + return "" +} + +func (x *MsgSendTx) GetSourceChannel() string { + if x != nil { + return x.SourceChannel + } + return "" +} + +func (x *MsgSendTx) GetTimeoutTimestamp() uint64 { + if x != nil { + return x.TimeoutTimestamp + } + return 0 +} + +func (x *MsgSendTx) GetSomeData() string { + if x != nil { + return x.SomeData + } + return "" +} + +// MsgSendTxResponse defines the response for MsgSendTx +type MsgSendTxResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` +} + +func (x *MsgSendTxResponse) Reset() { + *x = MsgSendTxResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ibcmodule_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgSendTxResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSendTxResponse) ProtoMessage() {} + +// Deprecated: Use MsgSendTxResponse.ProtoReflect.Descriptor instead. +func (*MsgSendTxResponse) Descriptor() ([]byte, []int) { + return file_ibcmodule_v1_tx_proto_rawDescGZIP(), []int{1} +} + +func (x *MsgSendTxResponse) GetSequence() uint64 { + if x != nil { + return x.Sequence + } + return 0 +} + +// ExamplePacketData +type ExamplePacketData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + SomeData string `protobuf:"bytes,2,opt,name=some_data,json=someData,proto3" json:"some_data,omitempty"` +} + +func (x *ExamplePacketData) Reset() { + *x = ExamplePacketData{} + if protoimpl.UnsafeEnabled { + mi := &file_ibcmodule_v1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExamplePacketData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExamplePacketData) ProtoMessage() {} + +// Deprecated: Use ExamplePacketData.ProtoReflect.Descriptor instead. +func (*ExamplePacketData) Descriptor() ([]byte, []int) { + return file_ibcmodule_v1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *ExamplePacketData) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +func (x *ExamplePacketData) GetSomeData() string { + if x != nil { + return x.SomeData + } + return "" +} + +// Acknowledgement +type Acknowledgement struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // response + // + // Types that are assignable to Response: + // + // *Acknowledgement_Result + // *Acknowledgement_Error + Response isAcknowledgement_Response `protobuf_oneof:"response"` +} + +func (x *Acknowledgement) Reset() { + *x = Acknowledgement{} + if protoimpl.UnsafeEnabled { + mi := &file_ibcmodule_v1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Acknowledgement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Acknowledgement) ProtoMessage() {} + +// Deprecated: Use Acknowledgement.ProtoReflect.Descriptor instead. +func (*Acknowledgement) Descriptor() ([]byte, []int) { + return file_ibcmodule_v1_tx_proto_rawDescGZIP(), []int{3} +} + +func (x *Acknowledgement) GetResponse() isAcknowledgement_Response { + if x != nil { + return x.Response + } + return nil +} + +func (x *Acknowledgement) GetResult() []byte { + if x, ok := x.GetResponse().(*Acknowledgement_Result); ok { + return x.Result + } + return nil +} + +func (x *Acknowledgement) GetError() string { + if x, ok := x.GetResponse().(*Acknowledgement_Error); ok { + return x.Error + } + return "" +} + +type isAcknowledgement_Response interface { + isAcknowledgement_Response() +} + +type Acknowledgement_Result struct { + Result []byte `protobuf:"bytes,21,opt,name=result,proto3,oneof"` +} + +type Acknowledgement_Error struct { + Error string `protobuf:"bytes,22,opt,name=error,proto3,oneof"` +} + +func (*Acknowledgement_Result) isAcknowledgement_Response() {} + +func (*Acknowledgement_Error) isAcknowledgement_Response() {} + +var File_ibcmodule_v1_tx_proto protoreflect.FileDescriptor + +var file_ibcmodule_v1_tx_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, + 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc6, 0x01, 0x0a, 0x09, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, + 0x54, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, + 0x65, 0x6c, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x74, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x1b, 0x0a, 0x09, 0x73, 0x6f, 0x6d, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x6d, 0x65, 0x44, 0x61, 0x74, 0x61, 0x3a, 0x0f, 0x88, 0xa0, + 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, 0x35, 0x0a, + 0x11, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x3a, 0x04, + 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x48, 0x0a, 0x11, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x50, + 0x61, 0x63, 0x6b, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x6f, 0x6d, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x6d, 0x65, 0x44, 0x61, 0x74, 0x61, 0x22, 0x4f, + 0x0a, 0x0f, 0x41, 0x63, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x12, 0x18, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, + 0x0c, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, + 0x50, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x42, 0x0a, 0x06, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x78, + 0x12, 0x17, 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x78, 0x1a, 0x1f, 0x2e, 0x69, 0x62, 0x63, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, + 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, + 0x01, 0x42, 0xad, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, + 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x2f, 0x73, + 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x49, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x49, 0x62, 0x63, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x0d, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ibcmodule_v1_tx_proto_rawDescOnce sync.Once + file_ibcmodule_v1_tx_proto_rawDescData = file_ibcmodule_v1_tx_proto_rawDesc +) + +func file_ibcmodule_v1_tx_proto_rawDescGZIP() []byte { + file_ibcmodule_v1_tx_proto_rawDescOnce.Do(func() { + file_ibcmodule_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_ibcmodule_v1_tx_proto_rawDescData) + }) + return file_ibcmodule_v1_tx_proto_rawDescData +} + +var file_ibcmodule_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_ibcmodule_v1_tx_proto_goTypes = []interface{}{ + (*MsgSendTx)(nil), // 0: ibcmodule.v1.MsgSendTx + (*MsgSendTxResponse)(nil), // 1: ibcmodule.v1.MsgSendTxResponse + (*ExamplePacketData)(nil), // 2: ibcmodule.v1.ExamplePacketData + (*Acknowledgement)(nil), // 3: ibcmodule.v1.Acknowledgement +} +var file_ibcmodule_v1_tx_proto_depIdxs = []int32{ + 0, // 0: ibcmodule.v1.Msg.SendTx:input_type -> ibcmodule.v1.MsgSendTx + 1, // 1: ibcmodule.v1.Msg.SendTx:output_type -> ibcmodule.v1.MsgSendTxResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_ibcmodule_v1_tx_proto_init() } +func file_ibcmodule_v1_tx_proto_init() { + if File_ibcmodule_v1_tx_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ibcmodule_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgSendTx); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ibcmodule_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgSendTxResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ibcmodule_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExamplePacketData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ibcmodule_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Acknowledgement); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_ibcmodule_v1_tx_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*Acknowledgement_Result)(nil), + (*Acknowledgement_Error)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ibcmodule_v1_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_ibcmodule_v1_tx_proto_goTypes, + DependencyIndexes: file_ibcmodule_v1_tx_proto_depIdxs, + MessageInfos: file_ibcmodule_v1_tx_proto_msgTypes, + }.Build() + File_ibcmodule_v1_tx_proto = out.File + file_ibcmodule_v1_tx_proto_rawDesc = nil + file_ibcmodule_v1_tx_proto_goTypes = nil + file_ibcmodule_v1_tx_proto_depIdxs = nil +} diff --git a/simapp/api/ibcmodule/v1/tx_grpc.pb.go b/simapp/api/ibcmodule/v1/tx_grpc.pb.go new file mode 100644 index 00000000..7011a89f --- /dev/null +++ b/simapp/api/ibcmodule/v1/tx_grpc.pb.go @@ -0,0 +1,111 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: ibcmodule/v1/tx.proto + +package ibcmodulev1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Msg_SendTx_FullMethodName = "/ibcmodule.v1.Msg/SendTx" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MsgClient interface { + // SendTx defines a rpc handler for MsgSendTx. + SendTx(ctx context.Context, in *MsgSendTx, opts ...grpc.CallOption) (*MsgSendTxResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) SendTx(ctx context.Context, in *MsgSendTx, opts ...grpc.CallOption) (*MsgSendTxResponse, error) { + out := new(MsgSendTxResponse) + err := c.cc.Invoke(ctx, Msg_SendTx_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility +type MsgServer interface { + // SendTx defines a rpc handler for MsgSendTx. + SendTx(context.Context, *MsgSendTx) (*MsgSendTxResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) SendTx(context.Context, *MsgSendTx) (*MsgSendTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendTx not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_SendTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSendTx) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SendTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_SendTx_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SendTx(ctx, req.(*MsgSendTx)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "ibcmodule.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SendTx", + Handler: _Msg_SendTx_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibcmodule/v1/tx.proto", +} diff --git a/simapp/proto/ibcmodule/module/v1/module.proto b/simapp/proto/ibcmodule/module/v1/module.proto new file mode 100644 index 00000000..9752ecda --- /dev/null +++ b/simapp/proto/ibcmodule/module/v1/module.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package ibcmodule.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the app config object of the module. +// Learn more: https://docs.cosmos.network/main/building-modules/depinject +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import : "github.com/rollchains/spawn/simapp" + }; +} diff --git a/simapp/proto/ibcmodule/v1/genesis.proto b/simapp/proto/ibcmodule/v1/genesis.proto new file mode 100644 index 00000000..9a6fb018 --- /dev/null +++ b/simapp/proto/ibcmodule/v1/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package ibcmodule.v1; + +option go_package = "github.com/rollchains/spawn/simapp/x/ibcmodule/types"; + +import "gogoproto/gogo.proto"; + +// GenesisState defines the modules genesis state. +message GenesisState { + string port_id = 1; +} diff --git a/simapp/proto/ibcmodule/v1/query.proto b/simapp/proto/ibcmodule/v1/query.proto new file mode 100644 index 00000000..7b41fed9 --- /dev/null +++ b/simapp/proto/ibcmodule/v1/query.proto @@ -0,0 +1,7 @@ +syntax = "proto3"; + +package ibcmodule.v1; + +option go_package = "github.com/rollchains/spawn/simapp/x/ibcmodule/types"; + +import "gogoproto/gogo.proto"; diff --git a/simapp/proto/ibcmodule/v1/tx.proto b/simapp/proto/ibcmodule/v1/tx.proto new file mode 100644 index 00000000..68cd7c7e --- /dev/null +++ b/simapp/proto/ibcmodule/v1/tx.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; + +package ibcmodule.v1; + +option go_package = "github.com/rollchains/spawn/simapp/x/ibcmodule/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; + +// Msg defines the 27-interchain-accounts/controller Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // SendTx defines a rpc handler for MsgSendTx. + rpc SendTx(MsgSendTx) returns (MsgSendTxResponse); +} + +// MsgSendTx defines the payload for Msg/SendTx +message MsgSendTx { + option (cosmos.msg.v1.signer) = "sender"; + + option (gogoproto.goproto_getters) = false; + + string sender = 1; + + string source_port = 2; + string source_channel = 3; + uint64 timeout_timestamp = 4; + + string some_data = 5; + } + +// MsgSendTxResponse defines the response for MsgSendTx +message MsgSendTxResponse { + option (gogoproto.goproto_getters) = false; + + uint64 sequence = 1; +} + + +// ExamplePacketData +message ExamplePacketData { + string sender = 1; + string some_data = 2; +} + +// Acknowledgement +message Acknowledgement { + // response + oneof response { + bytes result = 21; + string error = 22; + } +} diff --git a/simapp/x/example/types/genesis.pb.go b/simapp/x/example/types/genesis.pb.go index aaf2a956..17aa6289 100644 --- a/simapp/x/example/types/genesis.pb.go +++ b/simapp/x/example/types/genesis.pb.go @@ -26,7 +26,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the module genesis state type GenesisState struct { - // Params defines all the paramaters of the module. + // Params defines all the parameters of the module. Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` } @@ -122,7 +122,7 @@ func init() { func init() { proto.RegisterFile("example/v1/genesis.proto", fileDescriptor_b873a20abde33944) } var fileDescriptor_b873a20abde33944 = []byte{ - // 253 bytes of a gzipped FileDescriptorProto + // 259 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x48, 0xad, 0x48, 0xcc, 0x2d, 0xc8, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0xca, 0xe8, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, @@ -133,12 +133,13 @@ var fileDescriptor_b873a20abde33944 = []byte{ 0x54, 0x9d, 0x92, 0x0b, 0x17, 0x1b, 0x44, 0x5c, 0x48, 0x96, 0x8b, 0xab, 0x38, 0x3f, 0x37, 0x35, 0xbe, 0x2c, 0x31, 0xa7, 0x34, 0x55, 0x82, 0x49, 0x81, 0x51, 0x83, 0x23, 0x88, 0x13, 0x24, 0x12, 0x06, 0x12, 0xb0, 0x92, 0x9e, 0xb1, 0x40, 0x9e, 0xe1, 0xc5, 0x02, 0x79, 0xc6, 0xae, 0xe7, 0x1b, - 0xb4, 0xf8, 0x60, 0xde, 0x80, 0x98, 0xe2, 0xe4, 0x76, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, + 0xb4, 0xf8, 0x60, 0xde, 0x80, 0x98, 0xe2, 0xe4, 0x73, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, - 0x72, 0x0c, 0x51, 0x3a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x45, - 0xf9, 0x39, 0x39, 0xc9, 0x19, 0x89, 0x99, 0x79, 0xc5, 0xfa, 0xc5, 0x99, 0xb9, 0x89, 0x05, 0x05, - 0xfa, 0x15, 0xfa, 0x30, 0x83, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xde, 0x32, 0x06, - 0x04, 0x00, 0x00, 0xff, 0xff, 0xaf, 0xe7, 0xf0, 0x32, 0x27, 0x01, 0x00, 0x00, + 0x72, 0x0c, 0x51, 0x46, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x45, + 0xf9, 0x39, 0x39, 0xc9, 0x19, 0x89, 0x99, 0x79, 0xc5, 0xfa, 0xc5, 0x05, 0x89, 0xe5, 0x79, 0xfa, + 0xc5, 0x99, 0xb9, 0x89, 0x05, 0x05, 0xfa, 0x15, 0xfa, 0x30, 0xe3, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, + 0x93, 0xd8, 0xc0, 0x9e, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x28, 0x5b, 0x6c, 0x2d, + 0x01, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { diff --git a/simapp/x/example/types/query.pb.go b/simapp/x/example/types/query.pb.go index 761d7883..7ad5cc2b 100644 --- a/simapp/x/example/types/query.pb.go +++ b/simapp/x/example/types/query.pb.go @@ -119,24 +119,24 @@ func init() { func init() { proto.RegisterFile("example/v1/query.proto", fileDescriptor_b8295460cd91ceef) } var fileDescriptor_b8295460cd91ceef = []byte{ - // 259 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xc1, 0x4a, 0xc4, 0x30, - 0x14, 0x45, 0x1b, 0xc1, 0x2e, 0xe2, 0x2e, 0x0e, 0x32, 0x14, 0x89, 0xd2, 0x95, 0x88, 0x24, 0xcc, - 0xf8, 0x05, 0xba, 0x70, 0xad, 0x2e, 0xdd, 0x65, 0x86, 0x47, 0x27, 0xd0, 0xe6, 0x65, 0xfa, 0xd2, - 0x61, 0x66, 0xeb, 0x17, 0x08, 0xfe, 0x94, 0xcb, 0x82, 0x1b, 0x97, 0xd2, 0xfa, 0x21, 0x62, 0x5b, - 0xb4, 0x22, 0x6e, 0xef, 0x3d, 0x9c, 0x9b, 0x3c, 0x7e, 0x04, 0x5b, 0x53, 0xf8, 0x1c, 0xf4, 0x66, - 0xa6, 0xd7, 0x15, 0x94, 0x3b, 0xe5, 0x4b, 0x0c, 0x28, 0xf8, 0x90, 0xab, 0xcd, 0x2c, 0x39, 0xce, - 0x10, 0xb3, 0x1c, 0xb4, 0xf1, 0x56, 0x1b, 0xe7, 0x30, 0x98, 0x60, 0xd1, 0x51, 0x4f, 0x26, 0xd3, - 0x91, 0x21, 0x03, 0x07, 0x64, 0x87, 0x26, 0x9d, 0x70, 0x71, 0xf7, 0xa5, 0xbc, 0x35, 0xa5, 0x29, - 0xe8, 0x1e, 0xd6, 0x15, 0x50, 0x48, 0xaf, 0xf8, 0xe1, 0xaf, 0x94, 0x3c, 0x3a, 0x02, 0x71, 0xce, - 0x63, 0xdf, 0x25, 0x53, 0x76, 0xca, 0xce, 0x0e, 0xe6, 0x42, 0xfd, 0xbc, 0x40, 0x0d, 0xec, 0x40, - 0xcc, 0x1d, 0xdf, 0xef, 0x14, 0x02, 0x78, 0xdc, 0x57, 0x42, 0x8e, 0xf1, 0xbf, 0xab, 0xc9, 0xc9, - 0xbf, 0x7d, 0xbf, 0x9f, 0x26, 0x8f, 0xaf, 0x1f, 0xcf, 0x7b, 0x13, 0x21, 0xf4, 0xe8, 0x3f, 0xfd, - 0xde, 0xf5, 0xcd, 0x4b, 0x23, 0x59, 0xdd, 0x48, 0xf6, 0xde, 0x48, 0xf6, 0xd4, 0xca, 0xa8, 0x6e, - 0x65, 0xf4, 0xd6, 0xca, 0xe8, 0xe1, 0x22, 0xb3, 0x61, 0x55, 0x2d, 0xd4, 0x12, 0x0b, 0x5d, 0x62, - 0x9e, 0x2f, 0x57, 0xc6, 0x3a, 0xd2, 0x64, 0x0b, 0xe3, 0xbd, 0xde, 0x7e, 0xbb, 0xc2, 0xce, 0x03, - 0x2d, 0xe2, 0xee, 0x2e, 0x97, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x6c, 0x23, 0xd5, 0x49, 0x75, - 0x01, 0x00, 0x00, + // 263 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0x31, 0x4b, 0xc4, 0x30, + 0x18, 0x86, 0x1b, 0xc1, 0x0e, 0x71, 0x8b, 0x87, 0x1c, 0x45, 0xa2, 0x74, 0x12, 0x87, 0x84, 0xab, + 0xbf, 0x40, 0x67, 0x07, 0x75, 0x74, 0xcb, 0x1d, 0x1f, 0xbd, 0x40, 0x9b, 0x7c, 0xd7, 0x2f, 0x3d, + 0xef, 0x56, 0x7f, 0x81, 0xe0, 0x9f, 0x72, 0x3c, 0x70, 0x71, 0x94, 0xd6, 0x1f, 0x22, 0xb6, 0x45, + 0x2b, 0xe2, 0xfa, 0xbe, 0x0f, 0xcf, 0x9b, 0x7c, 0xfc, 0x08, 0x36, 0xa6, 0xc4, 0x02, 0xf4, 0x7a, + 0xa6, 0x57, 0x35, 0x54, 0x5b, 0x85, 0x95, 0x0f, 0x5e, 0xf0, 0x21, 0x57, 0xeb, 0x59, 0x72, 0x9c, + 0x7b, 0x9f, 0x17, 0xa0, 0x0d, 0x5a, 0x6d, 0x9c, 0xf3, 0xc1, 0x04, 0xeb, 0x1d, 0xf5, 0x64, 0x32, + 0x1d, 0x19, 0x72, 0x70, 0x40, 0x76, 0x68, 0xd2, 0x09, 0x17, 0xb7, 0x5f, 0xca, 0x1b, 0x53, 0x99, + 0x92, 0xee, 0x60, 0x55, 0x03, 0x85, 0xf4, 0x92, 0x1f, 0xfe, 0x4a, 0x09, 0xbd, 0x23, 0x10, 0xe7, + 0x3c, 0xc6, 0x2e, 0x99, 0xb2, 0x53, 0x76, 0x76, 0x90, 0x09, 0xf5, 0xf3, 0x02, 0x35, 0xb0, 0x03, + 0x91, 0x39, 0xbe, 0xdf, 0x29, 0x04, 0xf0, 0xb8, 0xaf, 0x84, 0x1c, 0xe3, 0x7f, 0x57, 0x93, 0x93, + 0x7f, 0xfb, 0x7e, 0x3f, 0x4d, 0x1e, 0x5f, 0x3f, 0x9e, 0xf7, 0x26, 0x42, 0xe8, 0xd1, 0x7f, 0xfa, + 0xbd, 0xab, 0xeb, 0x97, 0x46, 0xb2, 0x5d, 0x23, 0xd9, 0x7b, 0x23, 0xd9, 0x53, 0x2b, 0xa3, 0x5d, + 0x2b, 0xa3, 0xb7, 0x56, 0x46, 0xf7, 0x59, 0x6e, 0xc3, 0xb2, 0x9e, 0xab, 0x85, 0x2f, 0x75, 0xe5, + 0x8b, 0x62, 0xb1, 0x34, 0xd6, 0x91, 0x26, 0x34, 0x0f, 0x4e, 0x93, 0x2d, 0x0d, 0xa2, 0xde, 0x7c, + 0x1b, 0xc3, 0x16, 0x81, 0xe6, 0x71, 0x77, 0x9d, 0x8b, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5e, + 0xd2, 0xfa, 0x28, 0x7b, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/simapp/x/example/types/state.pb.go b/simapp/x/example/types/state.pb.go index 6fead63f..0ae42647 100644 --- a/simapp/x/example/types/state.pb.go +++ b/simapp/x/example/types/state.pb.go @@ -82,7 +82,7 @@ func init() { func init() { proto.RegisterFile("example/v1/state.proto", fileDescriptor_a06572813783339b) } var fileDescriptor_a06572813783339b = []byte{ - // 214 bytes of a gzipped FileDescriptorProto + // 220 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4b, 0xad, 0x48, 0xcc, 0x2d, 0xc8, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0x2e, 0x49, 0x2c, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0x8a, 0xeb, 0x95, 0x19, 0x4a, 0x89, 0x27, 0xe7, 0x17, 0xe7, 0xe6, @@ -91,12 +91,12 @@ var fileDescriptor_a06572813783339b = []byte{ 0xe6, 0x95, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x04, 0xc1, 0xb8, 0x42, 0x62, 0x5c, 0x6c, 0x89, 0xb9, 0x60, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x96, 0x20, 0x28, 0xcf, 0x4a, 0xfe, 0xd3, 0xbc, 0xcb, 0x7d, 0xcc, 0x92, 0x5c, 0x9c, 0x70, 0x9d, 0x42, 0x5c, 0x30, 0xa5, 0x02, 0x8c, 0x12, 0x8c, 0x4e, - 0x6e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, - 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x93, 0x9e, 0x59, 0x92, + 0x3e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, + 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x94, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x5f, 0x94, 0x9f, 0x93, 0x93, 0x9c, 0x91, 0x98, 0x99, - 0x57, 0xac, 0x5f, 0x9c, 0x99, 0x9b, 0x58, 0x50, 0xa0, 0x5f, 0xa1, 0x0f, 0xf3, 0x57, 0x49, 0x65, - 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0xc1, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x89, 0x3b, - 0x54, 0x2c, 0xef, 0x00, 0x00, 0x00, + 0x57, 0xac, 0x5f, 0x5c, 0x90, 0x58, 0x9e, 0xa7, 0x5f, 0x9c, 0x99, 0x9b, 0x58, 0x50, 0xa0, 0x5f, + 0xa1, 0x0f, 0xf3, 0x5d, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0xd9, 0xc6, 0x80, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xb9, 0x5c, 0x1a, 0x25, 0xf5, 0x00, 0x00, 0x00, } func (m *ExampleData) Marshal() (dAtA []byte, err error) { diff --git a/simapp/x/example/types/tx.pb.go b/simapp/x/example/types/tx.pb.go index 8528591d..75f958f0 100644 --- a/simapp/x/example/types/tx.pb.go +++ b/simapp/x/example/types/tx.pb.go @@ -137,7 +137,7 @@ func init() { func init() { proto.RegisterFile("example/v1/tx.proto", fileDescriptor_6f2888efd21b80b6) } var fileDescriptor_6f2888efd21b80b6 = []byte{ - // 327 bytes of a gzipped FileDescriptorProto + // 333 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4e, 0xad, 0x48, 0xcc, 0x2d, 0xc8, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0x0a, 0xea, 0x95, 0x19, 0x4a, 0x89, 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0xeb, 0xe7, @@ -153,12 +153,12 @@ var fileDescriptor_6f2888efd21b80b6 = []byte{ 0x30, 0x41, 0x49, 0x92, 0x4b, 0x1c, 0xcd, 0x31, 0x41, 0xa9, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x46, 0x71, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x42, 0x01, 0x5c, 0x3c, 0x28, 0x6e, 0x95, 0x46, 0xb6, 0x03, 0x4d, 0xaf, 0x94, 0x32, 0x1e, 0x49, 0x98, 0xc1, 0x52, 0xac, 0x0d, 0xcf, 0x37, 0x68, 0x31, - 0x3a, 0xb9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, - 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x4e, 0x7a, 0x66, + 0x3a, 0xf9, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, + 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x51, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x51, 0x7e, 0x4e, 0x4e, 0x72, 0x46, 0x62, - 0x66, 0x5e, 0xb1, 0x7e, 0x71, 0x66, 0x6e, 0x62, 0x41, 0x81, 0x7e, 0x85, 0x3e, 0x2c, 0x32, 0x4a, - 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xe1, 0x6a, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x52, - 0xe6, 0x9b, 0xac, 0xde, 0x01, 0x00, 0x00, + 0x66, 0x5e, 0xb1, 0x7e, 0x71, 0x41, 0x62, 0x79, 0x9e, 0x7e, 0x71, 0x66, 0x6e, 0x62, 0x41, 0x81, + 0x7e, 0x85, 0x3e, 0x2c, 0x4a, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xa1, 0x6b, 0x0c, + 0x08, 0x00, 0x00, 0xff, 0xff, 0x6d, 0xee, 0x9d, 0xe3, 0xe4, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/simapp/x/ibcmiddleware/types/genesis.pb.go b/simapp/x/ibcmiddleware/types/genesis.pb.go index 44ad10f7..065c36bb 100644 --- a/simapp/x/ibcmiddleware/types/genesis.pb.go +++ b/simapp/x/ibcmiddleware/types/genesis.pb.go @@ -67,18 +67,18 @@ func init() { func init() { proto.RegisterFile("ibcmiddleware/v1/genesis.proto", fileDescriptor_d0bd9c2fd79b48cf) } var fileDescriptor_d0bd9c2fd79b48cf = []byte{ - // 161 bytes of a gzipped FileDescriptorProto + // 167 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcb, 0x4c, 0x4a, 0xce, 0xcd, 0x4c, 0x49, 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x40, 0x91, 0xd7, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x4b, 0xea, 0x83, 0x58, 0x10, 0x75, 0x4a, 0x7c, - 0x5c, 0x3c, 0xee, 0x10, 0x8d, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x4e, 0x3e, 0x27, 0x1e, 0xc9, 0x31, + 0x5c, 0x3c, 0xee, 0x10, 0x8d, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x4e, 0x41, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, - 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x94, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, - 0x9f, 0xab, 0x5f, 0x94, 0x9f, 0x93, 0x93, 0x9c, 0x91, 0x98, 0x99, 0x57, 0xac, 0x5f, 0x9c, 0x99, - 0x9b, 0x58, 0x50, 0xa0, 0x5f, 0xa1, 0x8f, 0xea, 0xa0, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, - 0xb0, 0x25, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xe6, 0xf3, 0x9b, 0xae, 0x00, 0x00, - 0x00, + 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x91, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, + 0x9f, 0xab, 0x5f, 0x94, 0x9f, 0x93, 0x93, 0x9c, 0x91, 0x98, 0x99, 0x57, 0xac, 0x5f, 0x5c, 0x90, + 0x58, 0x9e, 0xa7, 0x5f, 0x9c, 0x99, 0x9b, 0x58, 0x50, 0xa0, 0x5f, 0xa1, 0x8f, 0xea, 0xac, 0x92, + 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x55, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbd, + 0xcb, 0xb6, 0x55, 0xb4, 0x00, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/simapp/x/ibcmiddleware/types/query.pb.go b/simapp/x/ibcmiddleware/types/query.pb.go index 247623ea..5e5aa12c 100644 --- a/simapp/x/ibcmiddleware/types/query.pb.go +++ b/simapp/x/ibcmiddleware/types/query.pb.go @@ -24,15 +24,15 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("ibcmiddleware/v1/query.proto", fileDescriptor_c2f2f87cfbe44411) } var fileDescriptor_c2f2f87cfbe44411 = []byte{ - // 147 bytes of a gzipped FileDescriptorProto + // 153 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xc9, 0x4c, 0x4a, 0xce, 0xcd, 0x4c, 0x49, 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x40, 0x91, 0xd5, 0x2b, 0x33, 0x94, - 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x4b, 0xea, 0x83, 0x58, 0x10, 0x75, 0x4e, 0x3e, 0x27, 0x1e, + 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x4b, 0xea, 0x83, 0x58, 0x10, 0x75, 0x4e, 0x41, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, - 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x94, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, + 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x91, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x5f, 0x94, 0x9f, 0x93, 0x93, 0x9c, 0x91, 0x98, 0x99, 0x57, 0xac, 0x5f, - 0x9c, 0x99, 0x9b, 0x58, 0x50, 0xa0, 0x5f, 0xa1, 0x8f, 0x6a, 0x7d, 0x49, 0x65, 0x41, 0x6a, 0x71, - 0x12, 0x1b, 0xd8, 0x50, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x66, 0xc4, 0x01, 0x1f, 0x9c, - 0x00, 0x00, 0x00, + 0x5c, 0x90, 0x58, 0x9e, 0xa7, 0x5f, 0x9c, 0x99, 0x9b, 0x58, 0x50, 0xa0, 0x5f, 0xa1, 0x8f, 0xea, + 0x88, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xd1, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x87, 0x4e, 0xd1, 0xd5, 0xa2, 0x00, 0x00, 0x00, } diff --git a/simapp/x/ibcmiddleware/types/tx.pb.go b/simapp/x/ibcmiddleware/types/tx.pb.go index fbb8fbfe..8ea5c327 100644 --- a/simapp/x/ibcmiddleware/types/tx.pb.go +++ b/simapp/x/ibcmiddleware/types/tx.pb.go @@ -24,14 +24,15 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("ibcmiddleware/v1/tx.proto", fileDescriptor_9bdcdb1b00d59650) } var fileDescriptor_9bdcdb1b00d59650 = []byte{ - // 144 bytes of a gzipped FileDescriptorProto + // 150 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0x4c, 0x4a, 0xce, 0xcd, 0x4c, 0x49, 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x40, 0x91, 0xd2, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, - 0x4f, 0xcf, 0x07, 0x4b, 0xea, 0x83, 0x58, 0x10, 0x75, 0x4e, 0x3e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, + 0x4f, 0xcf, 0x07, 0x4b, 0xea, 0x83, 0x58, 0x10, 0x75, 0x4e, 0x41, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, - 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x94, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, - 0xab, 0x5f, 0x94, 0x9f, 0x93, 0x93, 0x9c, 0x91, 0x98, 0x99, 0x57, 0xac, 0x5f, 0x9c, 0x99, 0x9b, - 0x58, 0x50, 0xa0, 0x5f, 0xa1, 0x8f, 0x6a, 0x77, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, - 0x50, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xad, 0x37, 0xea, 0x0e, 0x99, 0x00, 0x00, 0x00, + 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x91, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, + 0xab, 0x5f, 0x94, 0x9f, 0x93, 0x93, 0x9c, 0x91, 0x98, 0x99, 0x57, 0xac, 0x5f, 0x5c, 0x90, 0x58, + 0x9e, 0xa7, 0x5f, 0x9c, 0x99, 0x9b, 0x58, 0x50, 0xa0, 0x5f, 0xa1, 0x8f, 0xea, 0x82, 0x92, 0xca, + 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xd1, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x85, + 0xf0, 0xbd, 0x9f, 0x00, 0x00, 0x00, } diff --git a/simapp/x/ibcmodule/README.md b/simapp/x/ibcmodule/README.md new file mode 100644 index 00000000..a40428d7 --- /dev/null +++ b/simapp/x/ibcmodule/README.md @@ -0,0 +1,3 @@ +# ibc-middleware-template + +Template for an IBC middleware compliant with the [ics-30 spec](https://github.com/cosmos/ibc/tree/a4b29b7cdae6c548eb17187545f167d5d37c23a1/spec/app/ics-030-middleware) \ No newline at end of file diff --git a/simapp/x/ibcmodule/client/tx.go b/simapp/x/ibcmodule/client/tx.go new file mode 100644 index 00000000..02761c8f --- /dev/null +++ b/simapp/x/ibcmodule/client/tx.go @@ -0,0 +1,79 @@ +package cli + +import ( + "time" + + "github.com/rollchains/spawn/simapp/x/ibcmodule/types" + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" +) + +// NewTxCmd creates and returns the tx command +func NewTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "ibcmodule", // todo: rename me on generate + Short: "ibcmodule subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + NewSomeDataTxCmd(), + ) + + return cmd +} + +const ( + flagPacketTimeoutTimestamp = "packet-timeout-timestamp" +) + +var defaultTimeout = uint64((time.Duration(10) * time.Minute).Nanoseconds()) + +// NewSomeDataTxCmd +func NewSomeDataTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "some-data [src-port] [src-channel] [data]", + Short: "Send a packet for some data", + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + sender := clientCtx.GetFromAddress().String() + srcPort := args[0] + srcChannel := args[1] + someData := args[2] + + timeoutTimestamp, err := cmd.Flags().GetUint64(flagPacketTimeoutTimestamp) + if err != nil { + return err + } + + if timeoutTimestamp != 0 { + now := time.Now().UnixNano() + timeoutTimestamp = uint64(now + time.Duration(1*time.Hour).Nanoseconds()) + } + + msg := &types.MsgSendTx{ + Sender: sender, + SourcePort: srcPort, + SourceChannel: srcChannel, + TimeoutTimestamp: timeoutTimestamp, + SomeData: someData, + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + cmd.Flags().Uint64(flagPacketTimeoutTimestamp, defaultTimeout, "Packet timeout timestamp in nanoseconds from now. Default is 10 minutes. The timeout is disabled when set to 0.") + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/simapp/x/ibcmodule/ibc_module.go b/simapp/x/ibcmodule/ibc_module.go new file mode 100644 index 00000000..463bb74f --- /dev/null +++ b/simapp/x/ibcmodule/ibc_module.go @@ -0,0 +1,127 @@ +package ibcmodule + +import ( + "github.com/rollchains/spawn/simapp/x/ibcmodule/keeper" + + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" +) + +var _ porttypes.IBCModule = &IBCModule{} + +// IBCModule implements the ICS26 callbacks for the middleware given the +// keeper and the underlying application. +type IBCModule struct { + app porttypes.IBCModule + keeper keeper.Keeper +} + +// NewIBCMiddleware creates a new IBCMiddleware given the keeper and underlying application. +func NewIBCMiddleware(app porttypes.IBCModule, k keeper.Keeper) IBCModule { + return IBCModule{ + app: app, + keeper: k, + } +} + +// OnChanOpenInit implements the IBCMiddleware interface. +func (im IBCModule) OnChanOpenInit( + ctx sdk.Context, + order channeltypes.Order, + connectionHops []string, + portID string, + channelID string, + chanCap *capabilitytypes.Capability, + counterparty channeltypes.Counterparty, + version string, +) (string, error) { + return im.app.OnChanOpenInit( + ctx, + order, + connectionHops, + portID, + channelID, + chanCap, + counterparty, + version, + ) +} + +// OnChanOpenTry implements the IBCMiddleware interface. +func (im IBCModule) OnChanOpenTry( + ctx sdk.Context, + order channeltypes.Order, + connectionHops []string, + portID, channelID string, + chanCap *capabilitytypes.Capability, + counterparty channeltypes.Counterparty, + counterpartyVersion string, +) (version string, err error) { + return im.app.OnChanOpenTry( + ctx, + order, + connectionHops, + portID, + channelID, + chanCap, + counterparty, + counterpartyVersion, + ) +} + +// OnChanOpenAck implements the IBCMiddleware interface. +func (im IBCModule) OnChanOpenAck( + ctx sdk.Context, + portID, channelID string, + counterpartyChannelID string, + counterpartyVersion string, +) error { + return im.app.OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) +} + +// OnChanOpenConfirm implements the IBCMiddleware interface. +func (im IBCModule) OnChanOpenConfirm(ctx sdk.Context, portID, channelID string) error { + return im.app.OnChanOpenConfirm(ctx, portID, channelID) +} + +// OnChanCloseInit implements the IBCMiddleware interface. +func (im IBCModule) OnChanCloseInit(ctx sdk.Context, portID, channelID string) error { + return im.app.OnChanCloseInit(ctx, portID, channelID) +} + +// OnChanCloseConfirm implements the IBCMiddleware interface. +func (im IBCModule) OnChanCloseConfirm(ctx sdk.Context, portID, channelID string) error { + return im.app.OnChanCloseConfirm(ctx, portID, channelID) +} + +// OnRecvPacket implements the IBCMiddleware interface. +func (im IBCModule) OnRecvPacket( + ctx sdk.Context, + packet channeltypes.Packet, + relayer sdk.AccAddress, +) ibcexported.Acknowledgement { + return im.app.OnRecvPacket(ctx, packet, relayer) +} + +// OnAcknowledgementPacket implements the IBCMiddleware interface. +func (im IBCModule) OnAcknowledgementPacket( + ctx sdk.Context, + packet channeltypes.Packet, + acknowledgement []byte, + relayer sdk.AccAddress, +) error { + return im.app.OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer) +} + +// OnTimeoutPacket implements the IBCMiddleware interface. +func (im IBCModule) OnTimeoutPacket( + ctx sdk.Context, + packet channeltypes.Packet, + relayer sdk.AccAddress, +) error { + return im.app.OnTimeoutPacket(ctx, packet, relayer) +} diff --git a/simapp/x/ibcmodule/keeper/genesis.go b/simapp/x/ibcmodule/keeper/genesis.go new file mode 100644 index 00000000..c63f31f0 --- /dev/null +++ b/simapp/x/ibcmodule/keeper/genesis.go @@ -0,0 +1,32 @@ +package keeper + +import ( + "fmt" + + "github.com/rollchains/spawn/simapp/x/ibcmodule/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// InitGenesis initializes the middlewares state from a specified GenesisState. +func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState) { + k.SetPort(ctx, types.PortID) + + // Only try to bind to port if it is not already bound, since we may already own + // port capability from capability InitGenesis + if !k.hasCapability(ctx, types.PortID) { + // module binds to the port on InitChain + // and claims the returned capability + if err := k.BindPort(ctx, types.PortID); err != nil { + panic(fmt.Sprintf("could not claim port capability: %v", err)) + } + } +} + +// ExportGenesis exports the middlewares state. +func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { + port := k.GetPort(ctx) + return &types.GenesisState{ + PortId: port, + } +} diff --git a/simapp/x/ibcmodule/keeper/ibc_helpers.go b/simapp/x/ibcmodule/keeper/ibc_helpers.go new file mode 100644 index 00000000..18f03658 --- /dev/null +++ b/simapp/x/ibcmodule/keeper/ibc_helpers.go @@ -0,0 +1,54 @@ +package keeper + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + host "github.com/cosmos/ibc-go/v8/modules/core/24-host" +) + +// hasCapability checks if the IBC app module owns the port capability for the desired port +func (k Keeper) hasCapability(ctx sdk.Context, portID string) bool { + _, ok := k.ScopedKeeper.GetCapability(ctx, host.PortPath(portID)) + return ok +} + +func (k Keeper) IsBound(ctx sdk.Context, portID string) bool { + return k.PortKeeper.IsBound(ctx, portID) +} + +// BindPort defines a wrapper function for the port Keeper's function in +// order to expose it to module's InitGenesis function +func (k Keeper) BindPort(ctx sdk.Context, portID string) error { + cap := k.PortKeeper.BindPort(ctx, portID) + fmt.Printf("port binded: %s\n", portID) + err := k.ClaimCapability(ctx, cap, host.PortPath(portID)) + fmt.Printf("port capability claimed: %s\n", portID) + return err + +} + +// GetPort returns the portID for the IBC app 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 IBC app module. Used in InitGenesis +func (k Keeper) SetPort(ctx sdk.Context, portID string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.PortKey, []byte(portID)) +} + +// AuthenticateCapability wraps the scopedKeeper's AuthenticateCapability function +func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool { + return k.ScopedKeeper.AuthenticateCapability(ctx, cap, name) +} + +// ClaimCapability allows the IBC app module to claim a capability that core IBC +// passes to it +func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error { + return k.ScopedKeeper.ClaimCapability(ctx, cap, name) +} diff --git a/simapp/x/ibcmodule/keeper/keeper.go b/simapp/x/ibcmodule/keeper/keeper.go new file mode 100644 index 00000000..6b08bea8 --- /dev/null +++ b/simapp/x/ibcmodule/keeper/keeper.go @@ -0,0 +1,80 @@ +package keeper + +import ( + "github.com/rollchains/spawn/simapp/x/ibcmodule/types" + + "cosmossdk.io/collections" + "cosmossdk.io/core/store" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + "cosmossdk.io/log" + + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + channelkeeper "github.com/cosmos/ibc-go/v8/modules/core/04-channel/keeper" + portkeeper "github.com/cosmos/ibc-go/v8/modules/core/05-port/keeper" + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" +) + +// Keeper defines the middleware keeper. +type Keeper struct { + storeKey storetypes.StoreKey + cdc codec.BinaryCodec + msgServiceRouter *baseapp.MsgServiceRouter + Schema collections.Schema + + ChannelKeeper channelkeeper.Keeper // TODO: this or use ics4Wrapper? + PortKeeper *portkeeper.Keeper + ScopedKeeper capabilitykeeper.ScopedKeeper + + // used to send the packet, usually the IBC channel keeper. + ics4Wrapper porttypes.ICS4Wrapper +} + +// NewKeeper creates a new swap Keeper instance. +func NewKeeper( + cdc codec.BinaryCodec, + storeService store.KVStoreService, + msgServiceRouter *baseapp.MsgServiceRouter, + ics4Wrapper porttypes.ICS4Wrapper, + scopedKeeper capabilitykeeper.ScopedKeeper, + portKeeper *portkeeper.Keeper, + channelKeeper channelkeeper.Keeper, +) Keeper { + sb := collections.NewSchemaBuilder(storeService) + + k := Keeper{ + cdc: cdc, + msgServiceRouter: msgServiceRouter, + ics4Wrapper: ics4Wrapper, + + storeKey: storetypes.NewKVStoreKey(types.StoreKey), // TODO: remove me + ChannelKeeper: channelKeeper, + PortKeeper: portKeeper, + ScopedKeeper: scopedKeeper, + } + + schema, err := sb.Build() + if err != nil { + panic(err) + } + + k.Schema = schema + + return k +} + +// WithICS4Wrapper sets the ICS4Wrapper. This function may be used after +// the keeper's creation to set the middleware which is above this module +// in the IBC application stack. +func (k *Keeper) WithICS4Wrapper(wrapper porttypes.ICS4Wrapper) { + k.ics4Wrapper = wrapper +} + +// Logger returns a module-specific logger. +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", "x/"+ibcexported.ModuleName+"-"+types.ModuleName) +} diff --git a/simapp/x/ibcmodule/keeper/msg_server.go b/simapp/x/ibcmodule/keeper/msg_server.go new file mode 100644 index 00000000..cbe7be9f --- /dev/null +++ b/simapp/x/ibcmodule/keeper/msg_server.go @@ -0,0 +1,80 @@ +package keeper + +import ( + "context" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + host "github.com/cosmos/ibc-go/v8/modules/core/24-host" + "github.com/rollchains/spawn/simapp/x/ibcmodule/types" +) + +var _ types.MsgServer = msgServer{} + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the module MsgServer interface. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +// SendTx implements types.MsgServer. +func (ms msgServer) SendTx(ctx context.Context, msg *types.MsgSendTx) (*types.MsgSendTxResponse, error) { + // ctx := sdk.UnwrapSDKContext(goCtx) + // panic("SendTx is unimplemented") + + // sender, err := sdk.AccAddressFromBech32(msg.Sender) + // if err != nil { + // return nil, err + // } + + sequence, err := ms.sendPacket( + ctx, msg.SourcePort, msg.SourceChannel, msg.Sender, msg.SomeData, msg.TimeoutTimestamp) + if err != nil { + return nil, err + } + + return &types.MsgSendTxResponse{ + Sequence: sequence, + }, nil +} + +func (ms msgServer) sendPacket(ctx context.Context, sourcePort, sourceChannel, sender, someData string, timeoutTimestamp uint64) (sequence uint64, err error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + channel, found := ms.ChannelKeeper.GetChannel(sdkCtx, sourcePort, sourceChannel) + if !found { + return 0, fmt.Errorf("channel not found: port ID (%s) channel ID (%s)", sourcePort, sourceChannel) + } + + destinationPort := channel.GetCounterparty().GetPortID() + destinationChannel := channel.GetCounterparty().GetChannelID() + + fmt.Printf("destinationPort: %s\n", destinationPort) + fmt.Printf("destinationChannel: %s\n", destinationChannel) + fmt.Printf("Channel Information: %+v\n", channel) + + // begin createOutgoingPacket logic + // See spec for this logic: https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#packet-relay + channelCap, ok := ms.ScopedKeeper.GetCapability(sdkCtx, host.ChannelCapabilityPath(sourcePort, sourceChannel)) + if !ok { + return 0, fmt.Errorf("module does not own channel capability") + } + + // TODO(future): lock up the nameservice name in an escrow. + + packetData := types.ExamplePacketData{ + Sender: sender, + SomeData: someData, + } + // packetDataBz := types.EncodePacketData(packetData) + + sequence, err = ms.ics4Wrapper.SendPacket(sdkCtx, channelCap, sourcePort, sourceChannel, clienttypes.ZeroHeight(), timeoutTimestamp, packetData.GetBytes()) + if err != nil { + return 0, err + } + return sequence, nil +} diff --git a/simapp/x/ibcmodule/module.go b/simapp/x/ibcmodule/module.go new file mode 100644 index 00000000..1f46fa3a --- /dev/null +++ b/simapp/x/ibcmodule/module.go @@ -0,0 +1,132 @@ +package ibcmodule + +import ( + "encoding/json" + + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/rollchains/spawn/simapp/x/ibcmodule/keeper" + "github.com/rollchains/spawn/simapp/x/ibcmodule/types" + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + + abci "github.com/cometbft/cometbft/abci/types" +) + +var ( + _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModule = AppModule{} + _ module.AppModuleSimulation = AppModule{} +) + +// AppModuleBasic is the middleware AppModuleBasic. +type AppModuleBasic struct{} + +// Name implements AppModuleBasic interface. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec implements AppModuleBasic interface. +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} + +// RegisterInterfaces registers module concrete types into protobuf Any. +func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) {} + +// DefaultGenesis returns default genesis state as raw bytes for the swap module. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return nil +} + +// ValidateGenesis performs genesis state validation for the swap module. +func (AppModuleBasic) ValidateGenesis( + cdc codec.JSONCodec, + config client.TxEncodingConfig, + bz json.RawMessage, +) error { + return nil +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the swap module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {} + +// GetTxCmd implements AppModuleBasic interface. +func (AppModuleBasic) GetTxCmd() *cobra.Command { + return nil +} + +// GetQueryCmd implements AppModuleBasic interface. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return nil +} + +// AppModule is the middleware AppModule. +type AppModule struct { + AppModuleBasic + keeper keeper.Keeper +} + +// IsAppModule implements module.AppModule. +func (AppModule) IsAppModule() { +} + +// IsOnePerModuleType implements module.AppModule. +func (AppModule) IsOnePerModuleType() { +} + +// NewAppModule initializes a new AppModule for the middleware. +func NewAppModule(keeper keeper.Keeper) *AppModule { + return &AppModule{ + keeper: keeper, + } +} + +// RegisterInvariants implements the AppModule interface. +func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {} + +// RegisterServices registers module services. +func (am AppModule) RegisterServices(cfg module.Configurator) {} + +// InitGenesis performs genesis initialization for the ibc-router module. It returns +// no validator updates. +func (am AppModule) InitGenesis( + ctx sdk.Context, + cdc codec.JSONCodec, + data json.RawMessage, +) []abci.ValidatorUpdate { + var genesisState types.GenesisState + cdc.MustUnmarshalJSON(data, &genesisState) + am.keeper.InitGenesis(ctx, genesisState) + + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the exported genesis state as raw bytes for the swap module. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + gs := am.keeper.ExportGenesis(ctx) + return cdc.MustMarshalJSON(gs) +} + +// ConsensusVersion returns the consensus state breaking version for the swap module. +func (am AppModule) ConsensusVersion() uint64 { return 1 } + +// GenerateGenesisState implements the AppModuleSimulation interface. +func (am AppModule) GenerateGenesisState(simState *module.SimulationState) {} + +// ProposalContents implements the AppModuleSimulation interface. +func (am AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// RegisterStoreDecoder implements the AppModuleSimulation interface. +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) {} + +// WeightedOperations implements the AppModuleSimulation interface. +func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { + return nil +} diff --git a/simapp/x/ibcmodule/types/errors.go b/simapp/x/ibcmodule/types/errors.go new file mode 100644 index 00000000..f46defe8 --- /dev/null +++ b/simapp/x/ibcmodule/types/errors.go @@ -0,0 +1,7 @@ +package types + +import sdkerrors "cosmossdk.io/errors" + +var ( + ErrInvalidGenesisState = sdkerrors.Register(ModuleName, 1, "invalid genesis state") +) diff --git a/simapp/x/ibcmodule/types/expected_keepers.go b/simapp/x/ibcmodule/types/expected_keepers.go new file mode 100644 index 00000000..10772f1b --- /dev/null +++ b/simapp/x/ibcmodule/types/expected_keepers.go @@ -0,0 +1,3 @@ +package types + +// Define the expected interfaces that the middleware needs in order to properly function here. diff --git a/simapp/x/ibcmodule/types/genesis.go b/simapp/x/ibcmodule/types/genesis.go new file mode 100644 index 00000000..efb7d8e0 --- /dev/null +++ b/simapp/x/ibcmodule/types/genesis.go @@ -0,0 +1,16 @@ +package types + +// DefaultGenesisState returns the default middleware GenesisState. +func DefaultGenesisState() *GenesisState { + return &GenesisState{} +} + +// NewGenesisState initializes and returns a new GenesisState. +func NewGenesisState() *GenesisState { + return &GenesisState{} +} + +// Validate performs basic validation of the GenesisState. +func (gs *GenesisState) Validate() error { + return nil +} diff --git a/simapp/x/ibcmodule/types/genesis.pb.go b/simapp/x/ibcmodule/types/genesis.pb.go new file mode 100644 index 00000000..f5ca4023 --- /dev/null +++ b/simapp/x/ibcmodule/types/genesis.pb.go @@ -0,0 +1,318 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibcmodule/v1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the modules genesis state. +type GenesisState struct { + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_50f044dd23da5d20, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetPortId() string { + if m != nil { + return m.PortId + } + return "" +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "ibcmodule.v1.GenesisState") +} + +func init() { proto.RegisterFile("ibcmodule/v1/genesis.proto", fileDescriptor_50f044dd23da5d20) } + +var fileDescriptor_50f044dd23da5d20 = []byte{ + // 185 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xca, 0x4c, 0x4a, 0xce, + 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, + 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x81, 0xcb, 0xe9, 0x95, 0x19, 0x4a, 0x89, 0xa4, + 0xe7, 0xa7, 0xe7, 0x83, 0x25, 0xf4, 0x41, 0x2c, 0x88, 0x1a, 0x25, 0x75, 0x2e, 0x1e, 0x77, 0x88, + 0xa6, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x71, 0x2e, 0xf6, 0x82, 0xfc, 0xa2, 0x92, 0xf8, 0xcc, + 0x14, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x36, 0x10, 0xd7, 0x33, 0xc5, 0xc9, 0xef, 0xc4, + 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, + 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x4c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, + 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x8b, 0xf2, 0x73, 0x72, 0x92, 0x33, 0x12, 0x33, 0xf3, 0x8a, 0xf5, + 0x8b, 0x0b, 0x12, 0xcb, 0xf3, 0xf4, 0x8b, 0x33, 0x73, 0x13, 0x0b, 0x0a, 0xf4, 0x2b, 0xf4, 0x11, + 0xee, 0x2c, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0xdb, 0x6f, 0x0c, 0x08, 0x00, 0x00, 0xff, + 0xff, 0xfb, 0x6e, 0x0c, 0xbc, 0xc1, 0x00, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/simapp/x/ibcmodule/types/keys.go b/simapp/x/ibcmodule/types/keys.go new file mode 100644 index 00000000..bb814f00 --- /dev/null +++ b/simapp/x/ibcmodule/types/keys.go @@ -0,0 +1,16 @@ +package types + +const ( + // ModuleName defines the name of module. + ModuleName = "ibcmodule" + PortID = ModuleName + + // StoreKey is the store key string for the middleware. + StoreKey = ModuleName + + // RouterKey is the message route for the middleware. + RouterKey = ModuleName + + // QuerierRoute is the querier route for the middleware. + QuerierRoute = ModuleName +) diff --git a/simapp/x/ibcmodule/types/msgs.go b/simapp/x/ibcmodule/types/msgs.go new file mode 100644 index 00000000..310a6ba2 --- /dev/null +++ b/simapp/x/ibcmodule/types/msgs.go @@ -0,0 +1,18 @@ +package types + +import ( + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" +) + +var _ ibcexported.PacketData = (*ExamplePacketData)(nil) + +// GetPacketSender implements exported.PacketData. +func (epd *ExamplePacketData) GetPacketSender(sourcePortID string) string { + panic("unimplemented") +} + +// GetBytes is a helper for serialising +func (epd ExamplePacketData) GetBytes() []byte { + // return sdk.MustSortJSON(mustProtoMarshalJSON(&ftpd)) + return nil +} diff --git a/simapp/x/ibcmodule/types/query.pb.go b/simapp/x/ibcmodule/types/query.pb.go new file mode 100644 index 00000000..8a2246a3 --- /dev/null +++ b/simapp/x/ibcmodule/types/query.pb.go @@ -0,0 +1,38 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibcmodule/v1/query.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +func init() { proto.RegisterFile("ibcmodule/v1/query.proto", fileDescriptor_7328e789c44a7a1e) } + +var fileDescriptor_7328e789c44a7a1e = []byte{ + // 148 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xc8, 0x4c, 0x4a, 0xce, + 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x81, 0xcb, 0xe8, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, + 0xe7, 0x83, 0x25, 0xf4, 0x41, 0x2c, 0x88, 0x1a, 0x27, 0xbf, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, + 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, + 0x3c, 0x96, 0x63, 0x88, 0x32, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, + 0x2f, 0xca, 0xcf, 0xc9, 0x49, 0xce, 0x48, 0xcc, 0xcc, 0x2b, 0xd6, 0x2f, 0x2e, 0x48, 0x2c, 0xcf, + 0xd3, 0x2f, 0xce, 0xcc, 0x4d, 0x2c, 0x28, 0xd0, 0xaf, 0xd0, 0x47, 0x58, 0x5e, 0x52, 0x59, 0x90, + 0x5a, 0x9c, 0xc4, 0x06, 0x36, 0xd6, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x77, 0xe2, 0x63, 0xe9, + 0x96, 0x00, 0x00, 0x00, +} diff --git a/simapp/x/ibcmodule/types/tx.pb.go b/simapp/x/ibcmodule/types/tx.pb.go new file mode 100644 index 00000000..6fbb1b4c --- /dev/null +++ b/simapp/x/ibcmodule/types/tx.pb.go @@ -0,0 +1,1252 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibcmodule/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgSendTx defines the payload for Msg/SendTx +type MsgSendTx struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + SourcePort string `protobuf:"bytes,2,opt,name=source_port,json=sourcePort,proto3" json:"source_port,omitempty"` + SourceChannel string `protobuf:"bytes,3,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty"` + TimeoutTimestamp uint64 `protobuf:"varint,4,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty"` + SomeData string `protobuf:"bytes,5,opt,name=some_data,json=someData,proto3" json:"some_data,omitempty"` +} + +func (m *MsgSendTx) Reset() { *m = MsgSendTx{} } +func (m *MsgSendTx) String() string { return proto.CompactTextString(m) } +func (*MsgSendTx) ProtoMessage() {} +func (*MsgSendTx) Descriptor() ([]byte, []int) { + return fileDescriptor_05cec4d6b8fbe27a, []int{0} +} +func (m *MsgSendTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSendTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSendTx.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSendTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSendTx.Merge(m, src) +} +func (m *MsgSendTx) XXX_Size() int { + return m.Size() +} +func (m *MsgSendTx) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSendTx.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSendTx proto.InternalMessageInfo + +// MsgSendTxResponse defines the response for MsgSendTx +type MsgSendTxResponse struct { + Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` +} + +func (m *MsgSendTxResponse) Reset() { *m = MsgSendTxResponse{} } +func (m *MsgSendTxResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSendTxResponse) ProtoMessage() {} +func (*MsgSendTxResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_05cec4d6b8fbe27a, []int{1} +} +func (m *MsgSendTxResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSendTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSendTxResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSendTxResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSendTxResponse.Merge(m, src) +} +func (m *MsgSendTxResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSendTxResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSendTxResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSendTxResponse proto.InternalMessageInfo + +// ExamplePacketData +type ExamplePacketData struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + SomeData string `protobuf:"bytes,2,opt,name=some_data,json=someData,proto3" json:"some_data,omitempty"` +} + +func (m *ExamplePacketData) Reset() { *m = ExamplePacketData{} } +func (m *ExamplePacketData) String() string { return proto.CompactTextString(m) } +func (*ExamplePacketData) ProtoMessage() {} +func (*ExamplePacketData) Descriptor() ([]byte, []int) { + return fileDescriptor_05cec4d6b8fbe27a, []int{2} +} +func (m *ExamplePacketData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExamplePacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExamplePacketData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ExamplePacketData) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExamplePacketData.Merge(m, src) +} +func (m *ExamplePacketData) XXX_Size() int { + return m.Size() +} +func (m *ExamplePacketData) XXX_DiscardUnknown() { + xxx_messageInfo_ExamplePacketData.DiscardUnknown(m) +} + +var xxx_messageInfo_ExamplePacketData proto.InternalMessageInfo + +func (m *ExamplePacketData) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *ExamplePacketData) GetSomeData() string { + if m != nil { + return m.SomeData + } + return "" +} + +// Acknowledgement +type Acknowledgement struct { + // response + // + // Types that are valid to be assigned to Response: + // + // *Acknowledgement_Result + // *Acknowledgement_Error + Response isAcknowledgement_Response `protobuf_oneof:"response"` +} + +func (m *Acknowledgement) Reset() { *m = Acknowledgement{} } +func (m *Acknowledgement) String() string { return proto.CompactTextString(m) } +func (*Acknowledgement) ProtoMessage() {} +func (*Acknowledgement) Descriptor() ([]byte, []int) { + return fileDescriptor_05cec4d6b8fbe27a, []int{3} +} +func (m *Acknowledgement) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Acknowledgement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Acknowledgement.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Acknowledgement) XXX_Merge(src proto.Message) { + xxx_messageInfo_Acknowledgement.Merge(m, src) +} +func (m *Acknowledgement) XXX_Size() int { + return m.Size() +} +func (m *Acknowledgement) XXX_DiscardUnknown() { + xxx_messageInfo_Acknowledgement.DiscardUnknown(m) +} + +var xxx_messageInfo_Acknowledgement proto.InternalMessageInfo + +type isAcknowledgement_Response interface { + isAcknowledgement_Response() + MarshalTo([]byte) (int, error) + Size() int +} + +type Acknowledgement_Result struct { + Result []byte `protobuf:"bytes,21,opt,name=result,proto3,oneof" json:"result,omitempty"` +} +type Acknowledgement_Error struct { + Error string `protobuf:"bytes,22,opt,name=error,proto3,oneof" json:"error,omitempty"` +} + +func (*Acknowledgement_Result) isAcknowledgement_Response() {} +func (*Acknowledgement_Error) isAcknowledgement_Response() {} + +func (m *Acknowledgement) GetResponse() isAcknowledgement_Response { + if m != nil { + return m.Response + } + return nil +} + +func (m *Acknowledgement) GetResult() []byte { + if x, ok := m.GetResponse().(*Acknowledgement_Result); ok { + return x.Result + } + return nil +} + +func (m *Acknowledgement) GetError() string { + if x, ok := m.GetResponse().(*Acknowledgement_Error); ok { + return x.Error + } + return "" +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Acknowledgement) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Acknowledgement_Result)(nil), + (*Acknowledgement_Error)(nil), + } +} + +func init() { + proto.RegisterType((*MsgSendTx)(nil), "ibcmodule.v1.MsgSendTx") + proto.RegisterType((*MsgSendTxResponse)(nil), "ibcmodule.v1.MsgSendTxResponse") + proto.RegisterType((*ExamplePacketData)(nil), "ibcmodule.v1.ExamplePacketData") + proto.RegisterType((*Acknowledgement)(nil), "ibcmodule.v1.Acknowledgement") +} + +func init() { proto.RegisterFile("ibcmodule/v1/tx.proto", fileDescriptor_05cec4d6b8fbe27a) } + +var fileDescriptor_05cec4d6b8fbe27a = []byte{ + // 455 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xcb, 0x6e, 0xd3, 0x40, + 0x14, 0xb5, 0xdb, 0x24, 0x4a, 0x86, 0x42, 0xc9, 0x88, 0xa6, 0x96, 0x91, 0x9c, 0x28, 0x12, 0x52, + 0x54, 0x24, 0x5b, 0xe5, 0xb1, 0xe9, 0x8e, 0x00, 0x52, 0x36, 0x85, 0xc8, 0x74, 0xc5, 0x26, 0x9a, + 0xd8, 0x57, 0x8e, 0x55, 0xcf, 0x83, 0xb9, 0xe3, 0x36, 0xec, 0x10, 0x2b, 0x96, 0x7c, 0x02, 0x9f, + 0xd0, 0xaf, 0x40, 0x2c, 0xbb, 0x64, 0x89, 0x92, 0x45, 0x7f, 0x03, 0xf9, 0xd1, 0x40, 0x17, 0x59, + 0xd9, 0xe7, 0x9c, 0x3b, 0x47, 0xe7, 0x3e, 0xc8, 0x41, 0x3a, 0x8f, 0xb8, 0x8c, 0xf3, 0x0c, 0x82, + 0x8b, 0xe3, 0xc0, 0x2c, 0x7d, 0xa5, 0xa5, 0x91, 0x74, 0x6f, 0x43, 0xfb, 0x17, 0xc7, 0xee, 0xa3, + 0x44, 0x26, 0xb2, 0x14, 0x82, 0xe2, 0xaf, 0xaa, 0x71, 0x0f, 0x23, 0x89, 0x5c, 0x62, 0xc0, 0x31, + 0x29, 0xde, 0x72, 0x4c, 0x2a, 0x61, 0xf8, 0xd3, 0x26, 0x9d, 0x53, 0x4c, 0x3e, 0x80, 0x88, 0xcf, + 0x96, 0xb4, 0x47, 0x5a, 0x08, 0x22, 0x06, 0xed, 0xd8, 0x03, 0x7b, 0xd4, 0x09, 0x6b, 0x44, 0xfb, + 0xe4, 0x1e, 0xca, 0x5c, 0x47, 0x30, 0x53, 0x52, 0x1b, 0x67, 0xa7, 0x14, 0x49, 0x45, 0x4d, 0xa5, + 0x36, 0xf4, 0x09, 0x79, 0x50, 0x17, 0x44, 0x0b, 0x26, 0x04, 0x64, 0xce, 0x6e, 0x59, 0x73, 0xbf, + 0x62, 0x5f, 0x57, 0x24, 0x7d, 0x4a, 0xba, 0x26, 0xe5, 0x20, 0x73, 0x33, 0x2b, 0xbe, 0x68, 0x18, + 0x57, 0x4e, 0x63, 0x60, 0x8f, 0x1a, 0xe1, 0xc3, 0x5a, 0x38, 0xbb, 0xe5, 0xe9, 0x63, 0xd2, 0x41, + 0xc9, 0x61, 0x16, 0x33, 0xc3, 0x9c, 0x66, 0x69, 0xd7, 0x2e, 0x88, 0x37, 0xcc, 0xb0, 0x93, 0xfd, + 0x6f, 0x3f, 0xfa, 0xd6, 0xd7, 0x9b, 0xab, 0xa3, 0x3a, 0xe2, 0xf0, 0x25, 0xe9, 0x6e, 0xfa, 0x08, + 0x01, 0x95, 0x14, 0x08, 0xd4, 0x25, 0x6d, 0x84, 0x4f, 0x39, 0x88, 0x08, 0xca, 0x8e, 0x1a, 0xe1, + 0x06, 0x9f, 0x34, 0x0a, 0x87, 0xe1, 0x84, 0x74, 0xdf, 0x2e, 0x19, 0x57, 0x19, 0x4c, 0x59, 0x74, + 0x0e, 0xa6, 0x30, 0xdf, 0x3a, 0x86, 0x3b, 0x89, 0x76, 0xee, 0x26, 0x1a, 0xbe, 0x27, 0xfb, 0xaf, + 0xa2, 0x73, 0x21, 0x2f, 0x33, 0x88, 0x13, 0xe0, 0x20, 0x0c, 0x75, 0x48, 0x4b, 0x03, 0xe6, 0x99, + 0x71, 0x0e, 0x06, 0xf6, 0x68, 0x6f, 0x62, 0x85, 0x35, 0xa6, 0x3d, 0xd2, 0x04, 0xad, 0xa5, 0x76, + 0x7a, 0x85, 0xcb, 0xc4, 0x0a, 0x2b, 0x38, 0x26, 0xa4, 0xad, 0xeb, 0xf0, 0xcf, 0xa6, 0x64, 0xf7, + 0x14, 0x13, 0x3a, 0x26, 0xad, 0x7a, 0x3b, 0x87, 0xfe, 0xff, 0x9b, 0xf6, 0x37, 0xed, 0xba, 0xfd, + 0x2d, 0xc2, 0xed, 0x1c, 0xdc, 0xe6, 0x97, 0x9b, 0xab, 0x23, 0x7b, 0xfc, 0xee, 0xd7, 0xca, 0xb3, + 0xaf, 0x57, 0x9e, 0xfd, 0x67, 0xe5, 0xd9, 0xdf, 0xd7, 0x9e, 0x75, 0xbd, 0xf6, 0xac, 0xdf, 0x6b, + 0xcf, 0xfa, 0xf8, 0x22, 0x49, 0xcd, 0x22, 0x9f, 0xfb, 0x91, 0xe4, 0x81, 0x96, 0x59, 0x16, 0x2d, + 0x58, 0x2a, 0x30, 0x40, 0xc5, 0x2e, 0x45, 0x80, 0x29, 0x67, 0x4a, 0x05, 0xcb, 0xe0, 0xdf, 0xfd, + 0x99, 0xcf, 0x0a, 0x70, 0xde, 0x2a, 0x6f, 0xe8, 0xf9, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xed, + 0x58, 0x2c, 0x33, 0x99, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // SendTx defines a rpc handler for MsgSendTx. + SendTx(ctx context.Context, in *MsgSendTx, opts ...grpc.CallOption) (*MsgSendTxResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) SendTx(ctx context.Context, in *MsgSendTx, opts ...grpc.CallOption) (*MsgSendTxResponse, error) { + out := new(MsgSendTxResponse) + err := c.cc.Invoke(ctx, "/ibcmodule.v1.Msg/SendTx", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // SendTx defines a rpc handler for MsgSendTx. + SendTx(context.Context, *MsgSendTx) (*MsgSendTxResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) SendTx(ctx context.Context, req *MsgSendTx) (*MsgSendTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendTx not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_SendTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSendTx) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SendTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibcmodule.v1.Msg/SendTx", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SendTx(ctx, req.(*MsgSendTx)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibcmodule.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SendTx", + Handler: _Msg_SendTx_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibcmodule/v1/tx.proto", +} + +func (m *MsgSendTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSendTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSendTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SomeData) > 0 { + i -= len(m.SomeData) + copy(dAtA[i:], m.SomeData) + i = encodeVarintTx(dAtA, i, uint64(len(m.SomeData))) + i-- + dAtA[i] = 0x2a + } + if m.TimeoutTimestamp != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TimeoutTimestamp)) + i-- + dAtA[i] = 0x20 + } + if len(m.SourceChannel) > 0 { + i -= len(m.SourceChannel) + copy(dAtA[i:], m.SourceChannel) + i = encodeVarintTx(dAtA, i, uint64(len(m.SourceChannel))) + i-- + dAtA[i] = 0x1a + } + if len(m.SourcePort) > 0 { + i -= len(m.SourcePort) + copy(dAtA[i:], m.SourcePort) + i = encodeVarintTx(dAtA, i, uint64(len(m.SourcePort))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSendTxResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSendTxResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSendTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sequence != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ExamplePacketData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExamplePacketData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExamplePacketData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SomeData) > 0 { + i -= len(m.SomeData) + copy(dAtA[i:], m.SomeData) + i = encodeVarintTx(dAtA, i, uint64(len(m.SomeData))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Acknowledgement) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Acknowledgement) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Acknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Response != nil { + { + size := m.Response.Size() + i -= size + if _, err := m.Response.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *Acknowledgement_Result) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Acknowledgement_Result) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Result != nil { + i -= len(m.Result) + copy(dAtA[i:], m.Result) + i = encodeVarintTx(dAtA, i, uint64(len(m.Result))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + return len(dAtA) - i, nil +} +func (m *Acknowledgement_Error) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Acknowledgement_Error) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintTx(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + return len(dAtA) - i, nil +} +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgSendTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SourcePort) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SourceChannel) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.TimeoutTimestamp != 0 { + n += 1 + sovTx(uint64(m.TimeoutTimestamp)) + } + l = len(m.SomeData) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSendTxResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sequence != 0 { + n += 1 + sovTx(uint64(m.Sequence)) + } + return n +} + +func (m *ExamplePacketData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SomeData) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *Acknowledgement) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Response != nil { + n += m.Response.Size() + } + return n +} + +func (m *Acknowledgement_Result) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Result != nil { + l = len(m.Result) + n += 2 + l + sovTx(uint64(l)) + } + return n +} +func (m *Acknowledgement_Error) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Error) + n += 2 + l + sovTx(uint64(l)) + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgSendTx) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSendTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSendTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourcePort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourcePort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", wireType) + } + m.TimeoutTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeoutTimestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SomeData", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SomeData = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSendTxResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSendTxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSendTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExamplePacketData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExamplePacketData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExamplePacketData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SomeData", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SomeData = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Acknowledgement) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Acknowledgement: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Acknowledgement: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := make([]byte, postIndex-iNdEx) + copy(v, dAtA[iNdEx:postIndex]) + m.Response = &Acknowledgement_Result{v} + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Response = &Acknowledgement_Error{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) From 76f9d3d12a3ea4a8f6931b89ac96b4dffda1ef35 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 11 Sep 2024 15:56:36 -0500 Subject: [PATCH 02/13] further IBC module work base --- simapp/x/ibcmodule/ibc_module.go | 216 ++++++++++++++----- simapp/x/ibcmodule/keeper/genesis.go | 4 +- simapp/x/ibcmodule/keeper/keeper.go | 26 +-- simapp/x/ibcmodule/keeper/msg_server.go | 24 +-- simapp/x/ibcmodule/module.go | 9 +- simapp/x/ibcmodule/types/codec.go | 37 ++++ simapp/x/ibcmodule/types/expected_keepers.go | 2 +- simapp/x/ibcmodule/types/genesis.go | 14 +- simapp/x/ibcmodule/types/keys.go | 15 +- simapp/x/ibcmodule/types/msgs.go | 28 ++- 10 files changed, 272 insertions(+), 103 deletions(-) create mode 100644 simapp/x/ibcmodule/types/codec.go diff --git a/simapp/x/ibcmodule/ibc_module.go b/simapp/x/ibcmodule/ibc_module.go index 463bb74f..92ab5591 100644 --- a/simapp/x/ibcmodule/ibc_module.go +++ b/simapp/x/ibcmodule/ibc_module.go @@ -1,35 +1,40 @@ package ibcmodule import ( + "context" + "fmt" + "strings" + "github.com/rollchains/spawn/simapp/x/ibcmodule/keeper" sdk "github.com/cosmos/cosmos-sdk/types" capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + host "github.com/cosmos/ibc-go/v8/modules/core/24-host" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + "github.com/rollchains/spawn/simapp/x/ibcmodule/types" ) -var _ porttypes.IBCModule = &IBCModule{} +var _ porttypes.IBCModule = (*ExampleIBCModule)(nil) -// IBCModule implements the ICS26 callbacks for the middleware given the -// keeper and the underlying application. -type IBCModule struct { +// ExampleIBCModule implements all the callbacks +// that modules must define as specified in ICS-26 +type ExampleIBCModule struct { app porttypes.IBCModule keeper keeper.Keeper } -// NewIBCMiddleware creates a new IBCMiddleware given the keeper and underlying application. -func NewIBCMiddleware(app porttypes.IBCModule, k keeper.Keeper) IBCModule { - return IBCModule{ +// NewExampleIBCModule creates a new IBCModule given the keeper and underlying application. +func NewExampleIBCModule(app porttypes.IBCModule, k keeper.Keeper) ExampleIBCModule { + return ExampleIBCModule{ app: app, keeper: k, } } -// OnChanOpenInit implements the IBCMiddleware interface. -func (im IBCModule) OnChanOpenInit( +func (im ExampleIBCModule) OnChanOpenInit( ctx sdk.Context, order channeltypes.Order, connectionHops []string, @@ -39,20 +44,27 @@ func (im IBCModule) OnChanOpenInit( counterparty channeltypes.Counterparty, version string, ) (string, error) { - return im.app.OnChanOpenInit( - ctx, - order, - connectionHops, - portID, - channelID, - chanCap, - counterparty, - version, - ) + if strings.TrimSpace(version) == "" { + version = types.Version + } + + // if order != channeltypes.UNORDERED { + // return "", fmt.Errorf("invalid channel order; expected UNORDERED") + // } + + if counterparty.PortId != types.ModuleName { + return "", fmt.Errorf("invalid counterparty port ID; expected %s, got %s", types.ModuleName, counterparty.PortId) + } + + // OpenInit must claim the channelCapability that IBC passes into the callback + if err := im.keeper.ClaimCapability(ctx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { + return "", fmt.Errorf("failed to claim capability: %w", err) + } + + return version, nil } -// OnChanOpenTry implements the IBCMiddleware interface. -func (im IBCModule) OnChanOpenTry( +func (im ExampleIBCModule) OnChanOpenTry( ctx sdk.Context, order channeltypes.Order, connectionHops []string, @@ -61,67 +73,169 @@ func (im IBCModule) OnChanOpenTry( counterparty channeltypes.Counterparty, counterpartyVersion string, ) (version string, err error) { - return im.app.OnChanOpenTry( - ctx, - order, - connectionHops, - portID, - channelID, - chanCap, - counterparty, - counterpartyVersion, - ) + // OpenTry must claim the channelCapability that IBC passes into the callback + if err := im.keeper.ClaimCapability(ctx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { + return "", err + } + + if counterpartyVersion != types.Version { + fmt.Println("invalid counterparty version, proposing current app version", "counterpartyVersion", counterpartyVersion, "version", types.Version) + return types.Version, nil // TODO: err here? + } + + return types.Version, nil } -// OnChanOpenAck implements the IBCMiddleware interface. -func (im IBCModule) OnChanOpenAck( +func (im ExampleIBCModule) OnChanOpenAck( ctx sdk.Context, portID, channelID string, counterpartyChannelID string, counterpartyVersion string, ) error { - return im.app.OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) + if counterpartyVersion != types.Version { + return fmt.Errorf("invalid counterparty version: expected %s, got %s", types.Version, counterpartyVersion) + } + return nil } -// OnChanOpenConfirm implements the IBCMiddleware interface. -func (im IBCModule) OnChanOpenConfirm(ctx sdk.Context, portID, channelID string) error { - return im.app.OnChanOpenConfirm(ctx, portID, channelID) +// OnChanOpenConfirm implements the IBCModule interface. +func (im ExampleIBCModule) OnChanOpenConfirm(ctx sdk.Context, portID, channelID string) error { + return nil } -// OnChanCloseInit implements the IBCMiddleware interface. -func (im IBCModule) OnChanCloseInit(ctx sdk.Context, portID, channelID string) error { - return im.app.OnChanCloseInit(ctx, portID, channelID) +// OnChanCloseInit implements the IBCModule interface. +func (im ExampleIBCModule) OnChanCloseInit(ctx sdk.Context, portID, channelID string) error { + return fmt.Errorf("channel close is disabled for this module") } -// OnChanCloseConfirm implements the IBCMiddleware interface. -func (im IBCModule) OnChanCloseConfirm(ctx sdk.Context, portID, channelID string) error { - return im.app.OnChanCloseConfirm(ctx, portID, channelID) +// OnChanCloseConfirm implements the IBCModule interface. +func (im ExampleIBCModule) OnChanCloseConfirm(ctx sdk.Context, portID, channelID string) error { + return nil } -// OnRecvPacket implements the IBCMiddleware interface. -func (im IBCModule) OnRecvPacket( +// OnRecvPacket implements the IBCModule interface. +func (im ExampleIBCModule) OnRecvPacket( ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress, ) ibcexported.Acknowledgement { - return im.app.OnRecvPacket(ctx, packet, relayer) + logger := im.keeper.Logger(ctx) + ack := channeltypes.NewResultAcknowledgement([]byte{byte(1)}) + + var data types.ExamplePacketData + var ackErr error + if err := types.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil { + ackErr = fmt.Errorf("cannot unmarshal example packet data: %v", err) + logger.Error(fmt.Sprintf("%s sequence %d", ackErr.Error(), packet.Sequence)) + ack = channeltypes.NewErrorAcknowledgement(ackErr) + } + + // only attempt the application logic if the packet data was successfully decoded + if ack.Success() { + // TODO: perform your logic here + err := im.handleOnRecvLogic(ctx) + if err != nil { + ack = channeltypes.NewErrorAcknowledgement(err) + ackErr = err + logger.Error(fmt.Sprintf("%s sequence %d", ackErr.Error(), packet.Sequence)) + } else { + logger.Info("successfully handled example packet", "sequence", packet.Sequence) + } + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypePacket, + sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + sdk.NewAttribute(sdk.AttributeKeySender, data.Sender), + sdk.NewAttribute("some_data", data.SomeData), + sdk.NewAttribute("ack_success", fmt.Sprintf("%t", ack.Success())), + ), + ) + + return ack +} + +func (im ExampleIBCModule) handleOnRecvLogic(ctx context.Context) error { + v, err := im.keeper.ExampleStore.Get(ctx) + if err != nil { + return err + } + + err = im.keeper.ExampleStore.Set(ctx, v+1) + if err != nil { + return err + } + + return nil } -// OnAcknowledgementPacket implements the IBCMiddleware interface. -func (im IBCModule) OnAcknowledgementPacket( +// OnAcknowledgementPacket implements the IBCModule interface. +func (im ExampleIBCModule) OnAcknowledgementPacket( ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, relayer sdk.AccAddress, ) error { - return im.app.OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer) + var ack channeltypes.Acknowledgement + if err := types.ModuleCdc.UnmarshalJSON(acknowledgement, &ack); err != nil { + return fmt.Errorf("cannot unmarshal example packet acknowledgement: %v", err) + } + + var data types.ExamplePacketData + if err := types.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil { + return fmt.Errorf("cannot unmarshal example packet data: %v", err) + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypePacket, + sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + sdk.NewAttribute(sdk.AttributeKeySender, data.Sender), + sdk.NewAttribute("some_data", data.SomeData), + ), + ) + + switch resp := ack.Response.(type) { + case *channeltypes.Acknowledgement_Result: + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypePacket, + sdk.NewAttribute("success", string(resp.Result)), + ), + ) + case *channeltypes.Acknowledgement_Error: + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypePacket, + sdk.NewAttribute("error", resp.Error), + ), + ) + } + + return nil } // OnTimeoutPacket implements the IBCMiddleware interface. -func (im IBCModule) OnTimeoutPacket( +func (im ExampleIBCModule) OnTimeoutPacket( ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress, ) error { - return im.app.OnTimeoutPacket(ctx, packet, relayer) + var data types.ExamplePacketData + if err := types.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil { + return fmt.Errorf("cannot unmarshal example packet data: %v", err) + } + + // Handle timeout logic here as necessary (i.e. refunds for example) or nothing at all. + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + "timeout", + sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + sdk.NewAttribute("sender", data.Sender), + ), + ) + + return nil } diff --git a/simapp/x/ibcmodule/keeper/genesis.go b/simapp/x/ibcmodule/keeper/genesis.go index c63f31f0..ed108338 100644 --- a/simapp/x/ibcmodule/keeper/genesis.go +++ b/simapp/x/ibcmodule/keeper/genesis.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// InitGenesis initializes the middlewares state from a specified GenesisState. +// InitGenesis initializes the modules state from a specified GenesisState. func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState) { k.SetPort(ctx, types.PortID) @@ -23,7 +23,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState) { } } -// ExportGenesis exports the middlewares state. +// ExportGenesis exports the modules state. func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { port := k.GetPort(ctx) return &types.GenesisState{ diff --git a/simapp/x/ibcmodule/keeper/keeper.go b/simapp/x/ibcmodule/keeper/keeper.go index 6b08bea8..ed55fa36 100644 --- a/simapp/x/ibcmodule/keeper/keeper.go +++ b/simapp/x/ibcmodule/keeper/keeper.go @@ -13,22 +13,22 @@ import ( "cosmossdk.io/log" capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" - channelkeeper "github.com/cosmos/ibc-go/v8/modules/core/04-channel/keeper" portkeeper "github.com/cosmos/ibc-go/v8/modules/core/05-port/keeper" porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" ) -// Keeper defines the middleware keeper. +// Keeper defines the module keeper. type Keeper struct { storeKey storetypes.StoreKey cdc codec.BinaryCodec msgServiceRouter *baseapp.MsgServiceRouter - Schema collections.Schema + schema collections.Schema - ChannelKeeper channelkeeper.Keeper // TODO: this or use ics4Wrapper? - PortKeeper *portkeeper.Keeper - ScopedKeeper capabilitykeeper.ScopedKeeper + PortKeeper *portkeeper.Keeper + ScopedKeeper capabilitykeeper.ScopedKeeper + + ExampleStore collections.Item[uint64] // used to send the packet, usually the IBC channel keeper. ics4Wrapper porttypes.ICS4Wrapper @@ -42,7 +42,6 @@ func NewKeeper( ics4Wrapper porttypes.ICS4Wrapper, scopedKeeper capabilitykeeper.ScopedKeeper, portKeeper *portkeeper.Keeper, - channelKeeper channelkeeper.Keeper, ) Keeper { sb := collections.NewSchemaBuilder(storeService) @@ -51,10 +50,11 @@ func NewKeeper( msgServiceRouter: msgServiceRouter, ics4Wrapper: ics4Wrapper, - storeKey: storetypes.NewKVStoreKey(types.StoreKey), // TODO: remove me - ChannelKeeper: channelKeeper, - PortKeeper: portKeeper, - ScopedKeeper: scopedKeeper, + storeKey: storetypes.NewKVStoreKey(types.StoreKey), // TODO: remove me + PortKeeper: portKeeper, + ScopedKeeper: scopedKeeper, + + ExampleStore: collections.NewItem(sb, collections.NewPrefix(1), "example", collections.Uint64Value), } schema, err := sb.Build() @@ -62,13 +62,13 @@ func NewKeeper( panic(err) } - k.Schema = schema + k.schema = schema return k } // WithICS4Wrapper sets the ICS4Wrapper. This function may be used after -// the keeper's creation to set the middleware which is above this module +// the keeper's creation to set the module which is above this module // in the IBC application stack. func (k *Keeper) WithICS4Wrapper(wrapper porttypes.ICS4Wrapper) { k.ics4Wrapper = wrapper diff --git a/simapp/x/ibcmodule/keeper/msg_server.go b/simapp/x/ibcmodule/keeper/msg_server.go index cbe7be9f..c93b425f 100644 --- a/simapp/x/ibcmodule/keeper/msg_server.go +++ b/simapp/x/ibcmodule/keeper/msg_server.go @@ -23,14 +23,6 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { // SendTx implements types.MsgServer. func (ms msgServer) SendTx(ctx context.Context, msg *types.MsgSendTx) (*types.MsgSendTxResponse, error) { - // ctx := sdk.UnwrapSDKContext(goCtx) - // panic("SendTx is unimplemented") - - // sender, err := sdk.AccAddressFromBech32(msg.Sender) - // if err != nil { - // return nil, err - // } - sequence, err := ms.sendPacket( ctx, msg.SourcePort, msg.SourceChannel, msg.Sender, msg.SomeData, msg.TimeoutTimestamp) if err != nil { @@ -45,18 +37,6 @@ func (ms msgServer) SendTx(ctx context.Context, msg *types.MsgSendTx) (*types.Ms func (ms msgServer) sendPacket(ctx context.Context, sourcePort, sourceChannel, sender, someData string, timeoutTimestamp uint64) (sequence uint64, err error) { sdkCtx := sdk.UnwrapSDKContext(ctx) - channel, found := ms.ChannelKeeper.GetChannel(sdkCtx, sourcePort, sourceChannel) - if !found { - return 0, fmt.Errorf("channel not found: port ID (%s) channel ID (%s)", sourcePort, sourceChannel) - } - - destinationPort := channel.GetCounterparty().GetPortID() - destinationChannel := channel.GetCounterparty().GetChannelID() - - fmt.Printf("destinationPort: %s\n", destinationPort) - fmt.Printf("destinationChannel: %s\n", destinationChannel) - fmt.Printf("Channel Information: %+v\n", channel) - // begin createOutgoingPacket logic // See spec for this logic: https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#packet-relay channelCap, ok := ms.ScopedKeeper.GetCapability(sdkCtx, host.ChannelCapabilityPath(sourcePort, sourceChannel)) @@ -64,15 +44,13 @@ func (ms msgServer) sendPacket(ctx context.Context, sourcePort, sourceChannel, s return 0, fmt.Errorf("module does not own channel capability") } - // TODO(future): lock up the nameservice name in an escrow. - packetData := types.ExamplePacketData{ Sender: sender, SomeData: someData, } // packetDataBz := types.EncodePacketData(packetData) - sequence, err = ms.ics4Wrapper.SendPacket(sdkCtx, channelCap, sourcePort, sourceChannel, clienttypes.ZeroHeight(), timeoutTimestamp, packetData.GetBytes()) + sequence, err = ms.ics4Wrapper.SendPacket(sdkCtx, channelCap, sourcePort, sourceChannel, clienttypes.ZeroHeight(), timeoutTimestamp, packetData.MustGetBytes()) if err != nil { return 0, err } diff --git a/simapp/x/ibcmodule/module.go b/simapp/x/ibcmodule/module.go index 1f46fa3a..ff796491 100644 --- a/simapp/x/ibcmodule/module.go +++ b/simapp/x/ibcmodule/module.go @@ -4,6 +4,7 @@ import ( "encoding/json" "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/rollchains/spawn/simapp/x/example/client/cli" "github.com/rollchains/spawn/simapp/x/ibcmodule/keeper" "github.com/rollchains/spawn/simapp/x/ibcmodule/types" "github.com/spf13/cobra" @@ -57,7 +58,7 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *r // GetTxCmd implements AppModuleBasic interface. func (AppModuleBasic) GetTxCmd() *cobra.Command { - return nil + return cli.NewTxCmd() } // GetQueryCmd implements AppModuleBasic interface. @@ -90,7 +91,9 @@ func NewAppModule(keeper keeper.Keeper) *AppModule { func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {} // RegisterServices registers module services. -func (am AppModule) RegisterServices(cfg module.Configurator) {} +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) +} // InitGenesis performs genesis initialization for the ibc-router module. It returns // no validator updates. @@ -103,6 +106,8 @@ func (am AppModule) InitGenesis( cdc.MustUnmarshalJSON(data, &genesisState) am.keeper.InitGenesis(ctx, genesisState) + am.keeper.ExampleStore.Set(ctx, 0) + return []abci.ValidatorUpdate{} } diff --git a/simapp/x/ibcmodule/types/codec.go b/simapp/x/ibcmodule/types/codec.go new file mode 100644 index 00000000..28744da2 --- /dev/null +++ b/simapp/x/ibcmodule/types/codec.go @@ -0,0 +1,37 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" + // this line is used by starport scaffolding # 1 +) + +var ( + amino = codec.NewLegacyAmino() + AminoCdc = codec.NewAminoCodec(amino) +) + +func init() { + RegisterLegacyAminoCodec(amino) + cryptocodec.RegisterCrypto(amino) + sdk.RegisterLegacyAminoCodec(amino) +} + +// RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgSendTx{}, ModuleName+"/MsgSendTx", nil) +} + +func RegisterInterfaces(registry types.InterfaceRegistry) { + // this line is used by starport scaffolding # 3 + + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgSendTx{}, + ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} diff --git a/simapp/x/ibcmodule/types/expected_keepers.go b/simapp/x/ibcmodule/types/expected_keepers.go index 10772f1b..fd3b3800 100644 --- a/simapp/x/ibcmodule/types/expected_keepers.go +++ b/simapp/x/ibcmodule/types/expected_keepers.go @@ -1,3 +1,3 @@ package types -// Define the expected interfaces that the middleware needs in order to properly function here. +// Define the expected interfaces that the module needs in order to properly function here. diff --git a/simapp/x/ibcmodule/types/genesis.go b/simapp/x/ibcmodule/types/genesis.go index efb7d8e0..af985b1a 100644 --- a/simapp/x/ibcmodule/types/genesis.go +++ b/simapp/x/ibcmodule/types/genesis.go @@ -1,16 +1,26 @@ package types +import host "github.com/cosmos/ibc-go/v8/modules/core/24-host" + // DefaultGenesisState returns the default middleware GenesisState. func DefaultGenesisState() *GenesisState { - return &GenesisState{} + return &GenesisState{ + PortId: PortID, + } } // NewGenesisState initializes and returns a new GenesisState. func NewGenesisState() *GenesisState { - return &GenesisState{} + return &GenesisState{ + PortId: PortID, + } } // Validate performs basic validation of the GenesisState. func (gs *GenesisState) Validate() error { + if err := host.PortIdentifierValidator(gs.PortId); err != nil { + return err + } + return nil } diff --git a/simapp/x/ibcmodule/types/keys.go b/simapp/x/ibcmodule/types/keys.go index bb814f00..aefe652e 100644 --- a/simapp/x/ibcmodule/types/keys.go +++ b/simapp/x/ibcmodule/types/keys.go @@ -3,14 +3,21 @@ package types const ( // ModuleName defines the name of module. ModuleName = "ibcmodule" - PortID = ModuleName - // StoreKey is the store key string for the middleware. + // PortID defines the port ID that module module binds to. + PortID = ModuleName + + // Version defines the current version the IBC module supports + Version = ModuleName + "-1" + + // StoreKey is the store key string for the module. StoreKey = ModuleName - // RouterKey is the message route for the middleware. + // RouterKey is the message route for the module. RouterKey = ModuleName - // QuerierRoute is the querier route for the middleware. + // QuerierRoute is the querier route for the module. QuerierRoute = ModuleName + + EventTypePacket = "example_data_packet" ) diff --git a/simapp/x/ibcmodule/types/msgs.go b/simapp/x/ibcmodule/types/msgs.go index 310a6ba2..bb218e9b 100644 --- a/simapp/x/ibcmodule/types/msgs.go +++ b/simapp/x/ibcmodule/types/msgs.go @@ -1,18 +1,36 @@ package types import ( + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" ) +var ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) + var _ ibcexported.PacketData = (*ExamplePacketData)(nil) // GetPacketSender implements exported.PacketData. func (epd *ExamplePacketData) GetPacketSender(sourcePortID string) string { - panic("unimplemented") + return epd.Sender +} + +// GetBytes returns the sorted JSON encoding of the packet data. +func (epd ExamplePacketData) GetBytes() ([]byte, error) { + bz, err := codec.ProtoMarshalJSON(&epd, ModuleCdc.InterfaceRegistry()) + if err != nil { + return nil, err + } + + return sdk.MustSortJSON(bz), nil } -// GetBytes is a helper for serialising -func (epd ExamplePacketData) GetBytes() []byte { - // return sdk.MustSortJSON(mustProtoMarshalJSON(&ftpd)) - return nil +// GetBytes must return the sorted JSON encoding of the packet data. +func (epd ExamplePacketData) MustGetBytes() []byte { + bz, err := epd.GetBytes() + if err != nil { + panic(err) + } + return bz } From 0d96c25c1ca7c6e3758d84002c30948d01b68785 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 11 Sep 2024 16:03:13 -0500 Subject: [PATCH 03/13] self-ibc generation --- spawn/cfg.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/spawn/cfg.go b/spawn/cfg.go index 0057bbdc..2ef214bc 100644 --- a/spawn/cfg.go +++ b/spawn/cfg.go @@ -328,6 +328,7 @@ func (cfg *NewChainConfig) SetupLocalInterchainJSON() { }, } + // Create a chain that is thisnetwork -> cosmoshub if cfg.IsFeatureEnabled(InterchainSecurity) { c.SetICSConsumerLink("localcosmos-1") } else { @@ -339,6 +340,24 @@ func (cfg *NewChainConfig) SetupLocalInterchainJSON() { if err := cc.SaveJSON(fmt.Sprintf("%s/chains/testnet.json", cfg.ProjectName)); err != nil { panic(err) } + + // Create a testnet that is thisnetwork -> thisnetwork (great for IBC module testing) + if !cfg.IsFeatureEnabled(InterchainSecurity) { + chainB := localictypes.NewChainBuilder(cfg.ProjectName, "localchain-2", cfg.BinDaemon, cfg.Denom, cfg.Bech32Prefix). + SetBlockTime("2000ms"). + SetDockerImage(ibc.NewDockerImage(strings.ToLower(cfg.ProjectName), "local", "")). + SetTrustingPeriod("336h"). + SetDefaultSDKv47Genesis(2) + + // make this is an IBC testnet for POA/POS chains + c.SetAppendedIBCPathLink(chainB) + + cc = localictypes.NewChainsConfig(c, chainB) + if err := cc.SaveJSON(fmt.Sprintf("%s/chains/self-ibc.json", cfg.ProjectName)); err != nil { + panic(err) + } + } + } // NormalizeDisabledNames normalizes the names, removes any parent dependencies, and removes duplicates. From 60622de70c49af71c5bcfd19713d8f541f656452 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 11 Sep 2024 16:55:23 -0500 Subject: [PATCH 04/13] fix proto & stuff --- cmd/spawn/module.go | 101 ++++++++++++++++++++--- simapp/embed.go | 2 +- simapp/proto/ibcmodule/v1/tx.proto | 2 +- simapp/x/ibcmodule/client/tx.go | 2 +- simapp/x/ibcmodule/ibc_module.go | 4 +- simapp/x/ibcmodule/keeper/ibc_helpers.go | 15 +++- simapp/x/ibcmodule/keeper/keeper.go | 27 +++--- simapp/x/ibcmodule/module.go | 6 +- testmodule.sh | 7 ++ 9 files changed, 129 insertions(+), 37 deletions(-) create mode 100644 testmodule.sh diff --git a/cmd/spawn/module.go b/cmd/spawn/module.go index b3d53663..2e562aea 100644 --- a/cmd/spawn/module.go +++ b/cmd/spawn/module.go @@ -19,16 +19,28 @@ import ( const ( FlagIsIBCMiddleware = "ibc-middleware" + FlagIsIBCModule = "ibc-module" ) type features struct { ibcMiddleware bool + ibcModule bool +} + +func (f features) validate() error { + if f.ibcMiddleware && f.ibcModule { + return fmt.Errorf("cannot set both IBC Middleware and IBC Module") + } + + return nil } func normalizeModuleFlags(f *pflag.FlagSet, name string) pflag.NormalizedName { switch name { case "ibcmiddleware", "middleware": name = FlagIsIBCMiddleware + case "ibcmodule", "ibc": + name = FlagIsIBCModule } return pflag.NormalizedName(name) @@ -64,7 +76,7 @@ func NewCmd() *cobra.Command { // breaks proto-gen regex searches if strings.Contains(extName, "module") { - logger.Error("Module names cannot start with 'module'") + logger.Error("Module names cannot contain 'module'") return } @@ -78,7 +90,7 @@ func NewCmd() *cobra.Command { cwd, err := os.Getwd() if err != nil { - logger.Error("Error getting current working directory", err) + logger.Error("Error getting current working directory", "err", err) return } if _, err := os.Stat(path.Join(cwd, "x", extName)); err == nil { @@ -88,29 +100,41 @@ func NewCmd() *cobra.Command { isIBCMiddleware, err := cmd.Flags().GetBool(FlagIsIBCMiddleware) if err != nil { - logger.Error("Error getting IBC Middleware flag", err) + logger.Error("Error getting IBC Middleware flag", "err", err) + return + } + + isIBCModule, err := cmd.Flags().GetBool(FlagIsIBCModule) + if err != nil { + logger.Error("Error getting IBC Module flag", "err", err) return } feats := &features{ ibcMiddleware: isIBCMiddleware, + ibcModule: isIBCModule, + } + + if err := feats.validate(); err != nil { + logger.Error("Error validating module flags", "err", err) + return } // Setup Proto files to match the new x/ cosmos module name & go.mod module namespace (i.e. github org). if err := SetupModuleProtoBase(GetLogger(), extName, feats); err != nil { - logger.Error("Error setting up proto for module", err) + logger.Error("Error setting up proto for module", "err", err) return } // sets up the files in x/ if err := SetupModuleExtensionFiles(GetLogger(), extName, feats); err != nil { - logger.Error("Error setting up x/ module files", err) + logger.Error("Error setting up x/ module files", "err", err) return } // Import the files to app.go if err := AddModuleToAppGo(GetLogger(), extName, feats); err != nil { - logger.Error("Error adding new x/ module to app.go", err) + logger.Error("Error adding new x/ module to app.go", "err", err) return } @@ -121,7 +145,8 @@ func NewCmd() *cobra.Command { }, } - cmd.Flags().Bool(FlagIsIBCMiddleware, false, "Set the module as an IBC Middleware module") + cmd.Flags().Bool(FlagIsIBCMiddleware, false, "Set the module as an IBC Middleware") + cmd.Flags().Bool(FlagIsIBCModule, false, "Set the module as an IBC Module") cmd.Flags().SetNormalizeFunc(normalizeModuleFlags) return cmd @@ -148,6 +173,8 @@ func SetupModuleProtoBase(logger *slog.Logger, extName string, feats *features) moduleName := "example" if feats.ibcMiddleware { moduleName = "ibcmiddleware" + } else if feats.ibcModule { + moduleName = "ibcmodule" } logger.Debug("proto namespace", "goModName", goModName, "protoNamespace", protoNamespace, "moduleName", moduleName) @@ -164,11 +191,15 @@ func SetupModuleProtoBase(logger *slog.Logger, extName string, feats *features) // ignore emebeded files for modules we are not working with switch moduleName { case "example": - if strings.Contains(fc.NewPath, "ibcmiddleware") { + if !strings.Contains(fc.NewPath, "example") { return nil } case "ibcmiddleware": - if strings.Contains(fc.NewPath, "example") { + if !strings.Contains(fc.NewPath, "ibcmiddleware") { + return nil + } + case "ibcmodule": + if !strings.Contains(fc.NewPath, "ibcmodule") { return nil } } @@ -207,6 +238,8 @@ func SetupModuleExtensionFiles(logger *slog.Logger, extName string, feats *featu moduleName := "example" if feats.ibcMiddleware { moduleName = "ibcmiddleware" + } else if feats.ibcModule { + moduleName = "ibcmodule" } goModName := spawn.ReadCurrentGoModuleName(path.Join(cwd, "go.mod")) @@ -224,11 +257,15 @@ func SetupModuleExtensionFiles(logger *slog.Logger, extName string, feats *featu // ignore emebeded files for modules we are not working with switch moduleName { case "example": - if strings.Contains(fc.NewPath, "ibcmiddleware") { + if !strings.Contains(fc.NewPath, "example") { return nil } case "ibcmiddleware": - if strings.Contains(fc.NewPath, "example") { + if !strings.Contains(fc.NewPath, "ibcmiddleware") { + return nil + } + case "ibcmodule": + if !strings.Contains(fc.NewPath, "ibcmodule") { return nil } } @@ -310,6 +347,16 @@ func AddModuleToAppGo(logger *slog.Logger, extName string, feats *features) erro app.MsgServiceRouter(), app.IBCKeeper.ChannelKeeper, )`+"\n", extName, extNameTitle, extName) + } else if feats.ibcModule { + keeperText = fmt.Sprintf(` // Create the %s IBC Module Keeper + app.%sKeeper = %skeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[%stypes.StoreKey]), + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.PortKeeper, + %s, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + )`+"\n", extName, extNameTitle, extName, extName, fmt.Sprintf("scoped%s", extNameTitle)) } else { keeperText = fmt.Sprintf(` // Create the %s Keeper app.%sKeeper = %skeeper.NewKeeper( @@ -322,12 +369,42 @@ func AddModuleToAppGo(logger *slog.Logger, extName string, feats *features) erro appGoLines = append(appGoLines[:evidenceTextLine+2], append([]string{keeperText}, appGoLines[evidenceTextLine+2:]...)...) + if feats.ibcModule { + capabilityKeeperSeal := spawn.FindLineWithText(appGoLines, "app.CapabilityKeeper.Seal()") + logger.Debug("capabilityKeeperSeal", "extName", extName, "line", evidenceTextLine) + + // scopedMynsibc := app.CapabilityKeeper...s + scopedKeeperText := fmt.Sprintf(` scoped%s := app.CapabilityKeeper.ScopeToModule(%stypes.ModuleName)`, extNameTitle, extName) + appGoLines = append(appGoLines[:capabilityKeeperSeal], append([]string{scopedKeeperText}, appGoLines[capabilityKeeperSeal:]...)...) + + // find ChainApp ScopedIBCKeeper (where keepers are saved) & save this new keeper to it + scopedIBCKeeperKeeper := spawn.FindLineWithText(appGoLines, "ScopedIBCKeeper") + logger.Debug("scopedIBCKeeperKeeper", "extName", extName, "line", scopedIBCKeeperKeeper) + scopedKeeper := fmt.Sprintf("Scoped%s", extNameTitle) + + line := fmt.Sprintf(` %s capabilitykeeper.ScopedKeeper`, scopedKeeper) + appGoLines = append(appGoLines[:scopedIBCKeeperKeeper+1], append([]string{line}, appGoLines[scopedIBCKeeperKeeper+1:]...)...) + + // find app.ScopedIBCKeeper = + scopedIBCKeeper := spawn.FindLineWithText(appGoLines, "app.ScopedIBCKeeper =") + logger.Debug("scopedIBCKeeper", "extName", extName, "line", scopedIBCKeeper) + + line = fmt.Sprintf(` app.%s = scoped%s`, scopedKeeper, extNameTitle) + appGoLines = append(appGoLines[:scopedIBCKeeper], append([]string{line}, appGoLines[scopedIBCKeeper:]...)...) + + // find app.IBCKeeper.SetRouter + ibcKeeperSetRouter := spawn.FindLineWithText(appGoLines, "app.IBCKeeper.SetRouter(") + // place module above it `ibcRouter.AddRoute(nameserviceibctypes.ModuleName, nameserviceibc.NewIBCModule(app.NameserviceibcKeeper))` + newLine := fmt.Sprintf(` ibcRouter.AddRoute(%stypes.ModuleName, %s.NewExampleIBCModule(app.%sKeeper))`, extName, extName, extNameTitle) + appGoLines = append(appGoLines[:ibcKeeperSetRouter], append([]string{newLine}, appGoLines[ibcKeeperSetRouter:]...)...) + } + // Register the app module. start, end = spawn.FindLinesWithText(appGoLines, "NewManager(") logger.Debug("module manager", "extName", extName, "start", start, "end", end) var newAppModuleText string - if feats.ibcMiddleware { + if feats.ibcMiddleware || feats.ibcModule { newAppModuleText = fmt.Sprintf(` %s.NewAppModule(app.%sKeeper),`+"\n", extName, extNameTitle) } else { newAppModuleText = fmt.Sprintf(` %s.NewAppModule(appCodec, app.%sKeeper),`+"\n", extName, extNameTitle) diff --git a/simapp/embed.go b/simapp/embed.go index 96d55bc7..55dbccab 100644 --- a/simapp/embed.go +++ b/simapp/embed.go @@ -14,7 +14,7 @@ var SimAppFS embed.FS //go:embed interchaintest/* var ICTestFS embed.FS -//go:embed proto/example/* proto/ibcmiddleware/* +//go:embed proto/* var ProtoModuleFS embed.FS //go:embed x/* diff --git a/simapp/proto/ibcmodule/v1/tx.proto b/simapp/proto/ibcmodule/v1/tx.proto index 68cd7c7e..87f81c49 100644 --- a/simapp/proto/ibcmodule/v1/tx.proto +++ b/simapp/proto/ibcmodule/v1/tx.proto @@ -7,7 +7,7 @@ option go_package = "github.com/rollchains/spawn/simapp/x/ibcmodule/types"; import "gogoproto/gogo.proto"; import "cosmos/msg/v1/msg.proto"; -// Msg defines the 27-interchain-accounts/controller Msg service. +// Msg defines the Msg service. service Msg { option (cosmos.msg.v1.service) = true; diff --git a/simapp/x/ibcmodule/client/tx.go b/simapp/x/ibcmodule/client/tx.go index 02761c8f..6d13c044 100644 --- a/simapp/x/ibcmodule/client/tx.go +++ b/simapp/x/ibcmodule/client/tx.go @@ -14,7 +14,7 @@ import ( // NewTxCmd creates and returns the tx command func NewTxCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "ibcmodule", // todo: rename me on generate + Use: "ibcmodule", Short: "ibcmodule subcommands", DisableFlagParsing: true, SuggestionsMinimumDistance: 2, diff --git a/simapp/x/ibcmodule/ibc_module.go b/simapp/x/ibcmodule/ibc_module.go index 92ab5591..86754d55 100644 --- a/simapp/x/ibcmodule/ibc_module.go +++ b/simapp/x/ibcmodule/ibc_module.go @@ -22,14 +22,12 @@ var _ porttypes.IBCModule = (*ExampleIBCModule)(nil) // ExampleIBCModule implements all the callbacks // that modules must define as specified in ICS-26 type ExampleIBCModule struct { - app porttypes.IBCModule keeper keeper.Keeper } // NewExampleIBCModule creates a new IBCModule given the keeper and underlying application. -func NewExampleIBCModule(app porttypes.IBCModule, k keeper.Keeper) ExampleIBCModule { +func NewExampleIBCModule(k keeper.Keeper) ExampleIBCModule { return ExampleIBCModule{ - app: app, keeper: k, } } diff --git a/simapp/x/ibcmodule/keeper/ibc_helpers.go b/simapp/x/ibcmodule/keeper/ibc_helpers.go index 18f03658..91957828 100644 --- a/simapp/x/ibcmodule/keeper/ibc_helpers.go +++ b/simapp/x/ibcmodule/keeper/ibc_helpers.go @@ -32,14 +32,21 @@ func (k Keeper) BindPort(ctx sdk.Context, portID string) error { // GetPort returns the portID for the IBC app module. Used in ExportGenesis func (k Keeper) GetPort(ctx sdk.Context) string { - store := ctx.KVStore(k.storeKey) - return string(store.Get(types.PortKey)) + store := k.storeService.OpenKVStore(ctx) + res, err := store.Get([]byte(types.PortKey)) + if err != nil { + panic(err) + } + return string(res) } // SetPort sets the portID for the IBC app module. Used in InitGenesis func (k Keeper) SetPort(ctx sdk.Context, portID string) { - store := ctx.KVStore(k.storeKey) - store.Set(types.PortKey, []byte(portID)) + store := k.storeService.OpenKVStore(ctx) + err := store.Set([]byte(types.PortKey), []byte(portID)) + if err != nil { + panic(err) + } } // AuthenticateCapability wraps the scopedKeeper's AuthenticateCapability function diff --git a/simapp/x/ibcmodule/keeper/keeper.go b/simapp/x/ibcmodule/keeper/keeper.go index ed55fa36..50cc1f3b 100644 --- a/simapp/x/ibcmodule/keeper/keeper.go +++ b/simapp/x/ibcmodule/keeper/keeper.go @@ -5,8 +5,6 @@ import ( "cosmossdk.io/collections" "cosmossdk.io/core/store" - storetypes "cosmossdk.io/store/types" - "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -20,10 +18,9 @@ import ( // Keeper defines the module keeper. type Keeper struct { - storeKey storetypes.StoreKey - cdc codec.BinaryCodec - msgServiceRouter *baseapp.MsgServiceRouter - schema collections.Schema + storeService store.KVStoreService + cdc codec.BinaryCodec + schema collections.Schema PortKeeper *portkeeper.Keeper ScopedKeeper capabilitykeeper.ScopedKeeper @@ -32,29 +29,33 @@ type Keeper struct { // used to send the packet, usually the IBC channel keeper. ics4Wrapper porttypes.ICS4Wrapper + + authority string } // NewKeeper creates a new swap Keeper instance. func NewKeeper( - cdc codec.BinaryCodec, + appCodec codec.BinaryCodec, storeService store.KVStoreService, - msgServiceRouter *baseapp.MsgServiceRouter, + ics4Wrapper porttypes.ICS4Wrapper, - scopedKeeper capabilitykeeper.ScopedKeeper, portKeeper *portkeeper.Keeper, + scopedKeeper capabilitykeeper.ScopedKeeper, + + authority string, ) Keeper { sb := collections.NewSchemaBuilder(storeService) k := Keeper{ - cdc: cdc, - msgServiceRouter: msgServiceRouter, - ics4Wrapper: ics4Wrapper, + cdc: appCodec, + ics4Wrapper: ics4Wrapper, + storeService: storeService, - storeKey: storetypes.NewKVStoreKey(types.StoreKey), // TODO: remove me PortKeeper: portKeeper, ScopedKeeper: scopedKeeper, ExampleStore: collections.NewItem(sb, collections.NewPrefix(1), "example", collections.Uint64Value), + authority: authority, } schema, err := sb.Build() diff --git a/simapp/x/ibcmodule/module.go b/simapp/x/ibcmodule/module.go index ff796491..683abc0b 100644 --- a/simapp/x/ibcmodule/module.go +++ b/simapp/x/ibcmodule/module.go @@ -4,7 +4,7 @@ import ( "encoding/json" "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/rollchains/spawn/simapp/x/example/client/cli" + cli "github.com/rollchains/spawn/simapp/x/ibcmodule/client" "github.com/rollchains/spawn/simapp/x/ibcmodule/keeper" "github.com/rollchains/spawn/simapp/x/ibcmodule/types" "github.com/spf13/cobra" @@ -37,7 +37,9 @@ func (AppModuleBasic) Name() string { func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} // RegisterInterfaces registers module concrete types into protobuf Any. -func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) {} +func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) +} // DefaultGenesis returns default genesis state as raw bytes for the swap module. func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { diff --git a/testmodule.sh b/testmodule.sh new file mode 100644 index 00000000..0048e26b --- /dev/null +++ b/testmodule.sh @@ -0,0 +1,7 @@ +make install +# rm -rf myproject + +make template-staking +cd myproject +spawn module new mynsibc --ibc-module --log-level=debug +spawn module new mynsibc2 --ibc-module --log-level=debug From 124f05cbb2ce7baebfb8619f6c5e3e8293483e7b Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 11 Sep 2024 17:09:26 -0500 Subject: [PATCH 05/13] fix --- spawn/cfg.go | 1 + testmodule.sh | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/spawn/cfg.go b/spawn/cfg.go index 2ef214bc..e7107368 100644 --- a/spawn/cfg.go +++ b/spawn/cfg.go @@ -350,6 +350,7 @@ func (cfg *NewChainConfig) SetupLocalInterchainJSON() { SetDefaultSDKv47Genesis(2) // make this is an IBC testnet for POA/POS chains + c.SetIBCPaths([]string{}) // clear IBC paths c.SetAppendedIBCPathLink(chainB) cc = localictypes.NewChainsConfig(c, chainB) diff --git a/testmodule.sh b/testmodule.sh index 0048e26b..8649f85b 100644 --- a/testmodule.sh +++ b/testmodule.sh @@ -4,4 +4,25 @@ make install make template-staking cd myproject spawn module new mynsibc --ibc-module --log-level=debug -spawn module new mynsibc2 --ibc-module --log-level=debug +make proto-gen + +code . + +# run testnet +make local-image +local-ic start self-ibc + + +# connect via relayer +source <(curl -s https://raw.githubusercontent.com/strangelove-ventures/interchaintest/main/local-interchain/bash/source.bash) +API_ADDR="http://localhost:8080" + +ICT_POLL_FOR_START $API_ADDR 50 + +# only 1 +CHANNELS=`ICT_RELAYER_CHANNELS $API_ADDR "localchain-1"` && echo "CHANNELS: $CHANNELS" + +ICT_RELAYER_EXEC $API_ADDR "localchain-1" "rly tx connect localchain-1_localchain-2 --src-port=mynsibc --dst-port=mynsibc --order=unordered --version=mynsibc-1" + +# 2 open :D +CHANNELS=`ICT_RELAYER_CHANNELS $API_ADDR "localchain-1"` && echo "CHANNELS: $CHANNELS" From 158b42f90e4ff9c2fa9371aa499c9d65d36d5c51 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 11 Sep 2024 19:46:01 -0500 Subject: [PATCH 06/13] wip --- .../02-build-your-chain/05-testnet.md | 4 + .../02-build-your-chain/06-extra-challenge.md | 2 + .../02-build-your-chain/07-conclusion.md | 6 + .../02-build-your-chain/wipppp-ibc.md | 21 - .../version-v0.50.x/03-demos/02-ibc-module.md | 164 ++++++ simapp/api/ibcmodule/v1/tx.pulsar.go | 482 +++++++++--------- simapp/api/ibcmodule/v1/tx_grpc.pb.go | 18 +- simapp/proto/ibcmodule/v1/tx.proto | 12 +- simapp/x/ibcmodule/client/tx.go | 2 +- simapp/x/ibcmodule/ibc_module.go | 4 +- simapp/x/ibcmodule/keeper/genesis.go | 2 +- simapp/x/ibcmodule/keeper/ibc_helpers.go | 13 +- simapp/x/ibcmodule/keeper/msg_server.go | 5 +- simapp/x/ibcmodule/module.go | 8 +- simapp/x/ibcmodule/types/codec.go | 4 +- simapp/x/ibcmodule/types/keys.go | 9 - simapp/x/ibcmodule/types/tx.pb.go | 170 +++--- testmodule.sh | 4 + 18 files changed, 536 insertions(+), 394 deletions(-) delete mode 100644 docs/versioned_docs/version-v0.50.x/02-build-your-chain/wipppp-ibc.md create mode 100644 docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md diff --git a/docs/versioned_docs/version-v0.50.x/02-build-your-chain/05-testnet.md b/docs/versioned_docs/version-v0.50.x/02-build-your-chain/05-testnet.md index 3701d6a3..9742a9c0 100644 --- a/docs/versioned_docs/version-v0.50.x/02-build-your-chain/05-testnet.md +++ b/docs/versioned_docs/version-v0.50.x/02-build-your-chain/05-testnet.md @@ -59,3 +59,7 @@ The expected result should be: ``` Your network is now running and you have successfully set and resolved a name! 🎉 + +:::note +When you are ready to stop the testnet, you can use `ctrl + c` or `killall -9 rolld`. +::: diff --git a/docs/versioned_docs/version-v0.50.x/02-build-your-chain/06-extra-challenge.md b/docs/versioned_docs/version-v0.50.x/02-build-your-chain/06-extra-challenge.md index 846458de..eb91d8c6 100644 --- a/docs/versioned_docs/version-v0.50.x/02-build-your-chain/06-extra-challenge.md +++ b/docs/versioned_docs/version-v0.50.x/02-build-your-chain/06-extra-challenge.md @@ -33,3 +33,5 @@ func (ms msgServer) SetServiceName(ctx context.Context, msg *types.MsgSetService } ``` + + diff --git a/docs/versioned_docs/version-v0.50.x/02-build-your-chain/07-conclusion.md b/docs/versioned_docs/version-v0.50.x/02-build-your-chain/07-conclusion.md index 6c99c988..08c6c22d 100644 --- a/docs/versioned_docs/version-v0.50.x/02-build-your-chain/07-conclusion.md +++ b/docs/versioned_docs/version-v0.50.x/02-build-your-chain/07-conclusion.md @@ -19,4 +19,10 @@ You just crafted your first blockchain, module, and custom logic with Spawn. You * Running a local testnet * Interacting with the network + + +# What's Next? + +Extend the NameService to include IBC support with the [ibc-module](../03-demos/02-ibc-module.md) tutorial. + diff --git a/docs/versioned_docs/version-v0.50.x/02-build-your-chain/wipppp-ibc.md b/docs/versioned_docs/version-v0.50.x/02-build-your-chain/wipppp-ibc.md deleted file mode 100644 index 3e37fd6e..00000000 --- a/docs/versioned_docs/version-v0.50.x/02-build-your-chain/wipppp-ibc.md +++ /dev/null @@ -1,21 +0,0 @@ - - -spawn module new nameserviceibc --ibc-middleware - - -app.go: - - (so is spawn an --ibc-middleware or ibc.Module?) - - var nameserviceStack porttypes.IBCModule - nameserviceStack = nameserviceibc.NewIBCMiddleware(transferStack, app.NameserviceibcKeeper) - - - ibcRouter.AddRoute(nameserviceibctypes.ModuleName, nameserviceStack) - app.IBCKeeper.SetRouter(ibcRouter) - - -proto/nameserviceibc/genesis.proto - - - string port_id = 2; diff --git a/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md b/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md new file mode 100644 index 00000000..7fc803e8 --- /dev/null +++ b/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md @@ -0,0 +1,164 @@ +--- +title: "IBC Module" +sidebar_label: "IBC Module" +sidebar_position: 1 +slug: /demo/ibc-module +--- + + + +# IBC Module + +In this tutorial, we'll build on the nameservice tutorial and add an IBC module to the chain. This will allow us to sent our name on another network. + +## Prerequisites +- [System Setup](../01-setup/01-system-setup.md) +- [Install Spawn](../01-setup/02-install-spawn.md) +- [Build Your Name Service Chain](../02-build-your-chain/01-nameservice.md) + +## Create your chain + +You should already have a network called `rollchain` with the nameservice module enabled from the [nameservice tutorial](../02-build-your-chain/01-nameservice.md). If you do not, complete that tutorial now. + +## Scaffold the IBC Module + +```bash +# if not already in the rollchain directory +cd rollchain + +# scaffolds your new nameService IBC module +spawn module new nsibc --ibc-module +``` + +## Add reference to the previous Name Service keeper + +```go title="x/nsibc/keeper/keeper.go" +import ( + ... + nameservicekeeper "github.com/rollchains/rollchain/x/nameservice/keeper" +) + +// Keeper defines the module keeper. +type Keeper struct { + ... + NameServiceKeeper *nameservicekeeper.Keeper +} +``` +![View](https://github.com/user-attachments/assets/4dd3e50d-1528-4ae4-91a2-a27612bf69d7) + +```go title="x/nsibc/keeper/keeper.go" +// NewKeeper creates a new swap Keeper instance. +func NewKeeper( + ... + nsk *nameservicekeeper.Keeper, +) Keeper { + ... + + k := Keeper{ + ... + NameServiceKeeper: nsk, + } +``` +![View](https://github.com/user-attachments/assets/7639e468-a354-468d-8368-6bedd3c142a7) + +## Update it in the application + +Ensure that `app.NameserviceKeeper` comes before the `app.NsibcKeeper` in the `app/app.go` file. Then fix the `nsibckeeper.NewKeeper` function to use the nameservice keeper logic. + +```go title="app/app.go" + // If evidence needs to be handled for the app, set routes in router here and seal + app.EvidenceKeeper = *evidenceKeeper + + // Create the nameservice Keeper + app.NameserviceKeeper = nameservicekeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[nameservicetypes.StoreKey]), + logger, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + + // Create the nsibc IBC Module Keeper + app.NsibcKeeper = nsibckeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[nsibctypes.StoreKey]), + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.PortKeeper, + scopednsibc, + &app.NameserviceKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) +``` +![View](https://github.com/user-attachments/assets/af456634-d7b7-475f-b468-7c14411803da) + +## Use NameService Logic + +The `OnRecvPacket` method in this file has a placeholder for where your logic should run. Find the `OnRecvPacket` in the ibc_module.go file, then find where the `handleOnRecvLogic` method resides + +```go title="x/nsibc/ibc_module.go" +// Find this method in the file +func (im ExampleIBCModule) handleOnRecvLogic(ctx context.Context, data types.ExamplePacketData) error { + ... + return nil +} +``` +![View](https://github.com/user-attachments/assets/011cb6cb-6664-47b9-a09e-fe1b62862987) + +Once found, remove the lines within it and replace it with the following. + +```go title="x/nsibc/ibc_module.go" +func (im ExampleIBCModule) handleOnRecvLogic(ctx context.Context, data types.ExamplePacketData) error { + return im.keeper.NameServiceKeeper.NameMapping.Set(ctx, data.Sender, data.SomeData) +} +``` + +This will set the name mapping, from the sender to some data (the name) in the original nameservice module. + +::note +This is for example to show cross module interaction / extension with IBC. +You could just as easily write the NameMapping in the ibc keeper store as well. +::: + +## Running testnet + +```bash +# build chain binary +make install + +# build docker image +make local-image + +# run testnet between itself +local-ic start self-ibc +``` + +# Connect New IBC Module + +```bash +# +source <(curl -s https://raw.githubusercontent.com/strangelove-ventures/interchaintest/main/local-interchain/bash/source.bash) +API_ADDR="http://localhost:8080" + +ICT_POLL_FOR_START $API_ADDR 50 + +# only 1 channel (ics-20) is auto created on start of the testnet +CHANNELS=`ICT_RELAYER_CHANNELS $API_ADDR "localchain-1"` && echo "CHANNELS: $CHANNELS" + +# We will then create a new channel between localchain-1 and localchain-2 +# Using the new nameservice module we just created. +ICT_RELAYER_EXEC $API_ADDR "localchain-1" "rly tx connect localchain-1_localchain-2 --src-port=nsibc --dst-port=nsibc --order=unordered --version=nsibc-1" + +# We can then run the channels command again to verify the new channel was createds +CHANNELS=`ICT_RELAYER_CHANNELS $API_ADDR "localchain-1"` && echo "CHANNELS: $CHANNELS" +``` + +## Really Interaction +```bash +rolld tx nsibc some-data nsibc channel-1 testname --from acc0 --chain-id localchain-1 + +rolld q tx 38330A7C5AD4451C93F5BE9E6FF006E3CDA1EAA187B3CE02C43E783632C99C3B + +# ICT_RELAYER_EXEC $API_ADDR "loca/lchain-1" "rly tx flush" + +ICT_QUERY "http://localhost:8080" "localchain-2" "nameservice print-all" +ICT_QUERY "http://localhost:8080" "localchain-2" "nameservice resolve roll1hj5fveer5cjtn4wd6wstzugjfdxzl0xpg2te87" +``` diff --git a/simapp/api/ibcmodule/v1/tx.pulsar.go b/simapp/api/ibcmodule/v1/tx.pulsar.go index d2f7f447..88662a53 100644 --- a/simapp/api/ibcmodule/v1/tx.pulsar.go +++ b/simapp/api/ibcmodule/v1/tx.pulsar.go @@ -15,33 +15,33 @@ import ( ) var ( - md_MsgSendTx protoreflect.MessageDescriptor - fd_MsgSendTx_sender protoreflect.FieldDescriptor - fd_MsgSendTx_source_port protoreflect.FieldDescriptor - fd_MsgSendTx_source_channel protoreflect.FieldDescriptor - fd_MsgSendTx_timeout_timestamp protoreflect.FieldDescriptor - fd_MsgSendTx_some_data protoreflect.FieldDescriptor + md_MsgSendExampleTx protoreflect.MessageDescriptor + fd_MsgSendExampleTx_sender protoreflect.FieldDescriptor + fd_MsgSendExampleTx_source_port protoreflect.FieldDescriptor + fd_MsgSendExampleTx_source_channel protoreflect.FieldDescriptor + fd_MsgSendExampleTx_timeout_timestamp protoreflect.FieldDescriptor + fd_MsgSendExampleTx_some_data protoreflect.FieldDescriptor ) func init() { file_ibcmodule_v1_tx_proto_init() - md_MsgSendTx = File_ibcmodule_v1_tx_proto.Messages().ByName("MsgSendTx") - fd_MsgSendTx_sender = md_MsgSendTx.Fields().ByName("sender") - fd_MsgSendTx_source_port = md_MsgSendTx.Fields().ByName("source_port") - fd_MsgSendTx_source_channel = md_MsgSendTx.Fields().ByName("source_channel") - fd_MsgSendTx_timeout_timestamp = md_MsgSendTx.Fields().ByName("timeout_timestamp") - fd_MsgSendTx_some_data = md_MsgSendTx.Fields().ByName("some_data") + md_MsgSendExampleTx = File_ibcmodule_v1_tx_proto.Messages().ByName("MsgSendExampleTx") + fd_MsgSendExampleTx_sender = md_MsgSendExampleTx.Fields().ByName("sender") + fd_MsgSendExampleTx_source_port = md_MsgSendExampleTx.Fields().ByName("source_port") + fd_MsgSendExampleTx_source_channel = md_MsgSendExampleTx.Fields().ByName("source_channel") + fd_MsgSendExampleTx_timeout_timestamp = md_MsgSendExampleTx.Fields().ByName("timeout_timestamp") + fd_MsgSendExampleTx_some_data = md_MsgSendExampleTx.Fields().ByName("some_data") } -var _ protoreflect.Message = (*fastReflection_MsgSendTx)(nil) +var _ protoreflect.Message = (*fastReflection_MsgSendExampleTx)(nil) -type fastReflection_MsgSendTx MsgSendTx +type fastReflection_MsgSendExampleTx MsgSendExampleTx -func (x *MsgSendTx) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgSendTx)(x) +func (x *MsgSendExampleTx) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgSendExampleTx)(x) } -func (x *MsgSendTx) slowProtoReflect() protoreflect.Message { +func (x *MsgSendExampleTx) slowProtoReflect() protoreflect.Message { mi := &file_ibcmodule_v1_tx_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -53,43 +53,43 @@ func (x *MsgSendTx) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgSendTx_messageType fastReflection_MsgSendTx_messageType -var _ protoreflect.MessageType = fastReflection_MsgSendTx_messageType{} +var _fastReflection_MsgSendExampleTx_messageType fastReflection_MsgSendExampleTx_messageType +var _ protoreflect.MessageType = fastReflection_MsgSendExampleTx_messageType{} -type fastReflection_MsgSendTx_messageType struct{} +type fastReflection_MsgSendExampleTx_messageType struct{} -func (x fastReflection_MsgSendTx_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgSendTx)(nil) +func (x fastReflection_MsgSendExampleTx_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgSendExampleTx)(nil) } -func (x fastReflection_MsgSendTx_messageType) New() protoreflect.Message { - return new(fastReflection_MsgSendTx) +func (x fastReflection_MsgSendExampleTx_messageType) New() protoreflect.Message { + return new(fastReflection_MsgSendExampleTx) } -func (x fastReflection_MsgSendTx_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgSendTx +func (x fastReflection_MsgSendExampleTx_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSendExampleTx } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgSendTx) Descriptor() protoreflect.MessageDescriptor { - return md_MsgSendTx +func (x *fastReflection_MsgSendExampleTx) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSendExampleTx } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgSendTx) Type() protoreflect.MessageType { - return _fastReflection_MsgSendTx_messageType +func (x *fastReflection_MsgSendExampleTx) Type() protoreflect.MessageType { + return _fastReflection_MsgSendExampleTx_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgSendTx) New() protoreflect.Message { - return new(fastReflection_MsgSendTx) +func (x *fastReflection_MsgSendExampleTx) New() protoreflect.Message { + return new(fastReflection_MsgSendExampleTx) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgSendTx) Interface() protoreflect.ProtoMessage { - return (*MsgSendTx)(x) +func (x *fastReflection_MsgSendExampleTx) Interface() protoreflect.ProtoMessage { + return (*MsgSendExampleTx)(x) } // Range iterates over every populated field in an undefined order, @@ -97,34 +97,34 @@ func (x *fastReflection_MsgSendTx) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgSendTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_MsgSendExampleTx) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Sender != "" { value := protoreflect.ValueOfString(x.Sender) - if !f(fd_MsgSendTx_sender, value) { + if !f(fd_MsgSendExampleTx_sender, value) { return } } if x.SourcePort != "" { value := protoreflect.ValueOfString(x.SourcePort) - if !f(fd_MsgSendTx_source_port, value) { + if !f(fd_MsgSendExampleTx_source_port, value) { return } } if x.SourceChannel != "" { value := protoreflect.ValueOfString(x.SourceChannel) - if !f(fd_MsgSendTx_source_channel, value) { + if !f(fd_MsgSendExampleTx_source_channel, value) { return } } if x.TimeoutTimestamp != uint64(0) { value := protoreflect.ValueOfUint64(x.TimeoutTimestamp) - if !f(fd_MsgSendTx_timeout_timestamp, value) { + if !f(fd_MsgSendExampleTx_timeout_timestamp, value) { return } } if x.SomeData != "" { value := protoreflect.ValueOfString(x.SomeData) - if !f(fd_MsgSendTx_some_data, value) { + if !f(fd_MsgSendExampleTx_some_data, value) { return } } @@ -141,23 +141,23 @@ func (x *fastReflection_MsgSendTx) Range(f func(protoreflect.FieldDescriptor, pr // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgSendTx) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgSendExampleTx) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "ibcmodule.v1.MsgSendTx.sender": + case "ibcmodule.v1.MsgSendExampleTx.sender": return x.Sender != "" - case "ibcmodule.v1.MsgSendTx.source_port": + case "ibcmodule.v1.MsgSendExampleTx.source_port": return x.SourcePort != "" - case "ibcmodule.v1.MsgSendTx.source_channel": + case "ibcmodule.v1.MsgSendExampleTx.source_channel": return x.SourceChannel != "" - case "ibcmodule.v1.MsgSendTx.timeout_timestamp": + case "ibcmodule.v1.MsgSendExampleTx.timeout_timestamp": return x.TimeoutTimestamp != uint64(0) - case "ibcmodule.v1.MsgSendTx.some_data": + case "ibcmodule.v1.MsgSendExampleTx.some_data": return x.SomeData != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendExampleTx")) } - panic(fmt.Errorf("message ibcmodule.v1.MsgSendTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message ibcmodule.v1.MsgSendExampleTx does not contain field %s", fd.FullName())) } } @@ -167,23 +167,23 @@ func (x *fastReflection_MsgSendTx) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgSendTx) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgSendExampleTx) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "ibcmodule.v1.MsgSendTx.sender": + case "ibcmodule.v1.MsgSendExampleTx.sender": x.Sender = "" - case "ibcmodule.v1.MsgSendTx.source_port": + case "ibcmodule.v1.MsgSendExampleTx.source_port": x.SourcePort = "" - case "ibcmodule.v1.MsgSendTx.source_channel": + case "ibcmodule.v1.MsgSendExampleTx.source_channel": x.SourceChannel = "" - case "ibcmodule.v1.MsgSendTx.timeout_timestamp": + case "ibcmodule.v1.MsgSendExampleTx.timeout_timestamp": x.TimeoutTimestamp = uint64(0) - case "ibcmodule.v1.MsgSendTx.some_data": + case "ibcmodule.v1.MsgSendExampleTx.some_data": x.SomeData = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendExampleTx")) } - panic(fmt.Errorf("message ibcmodule.v1.MsgSendTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message ibcmodule.v1.MsgSendExampleTx does not contain field %s", fd.FullName())) } } @@ -193,28 +193,28 @@ func (x *fastReflection_MsgSendTx) Clear(fd protoreflect.FieldDescriptor) { // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgSendTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgSendExampleTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "ibcmodule.v1.MsgSendTx.sender": + case "ibcmodule.v1.MsgSendExampleTx.sender": value := x.Sender return protoreflect.ValueOfString(value) - case "ibcmodule.v1.MsgSendTx.source_port": + case "ibcmodule.v1.MsgSendExampleTx.source_port": value := x.SourcePort return protoreflect.ValueOfString(value) - case "ibcmodule.v1.MsgSendTx.source_channel": + case "ibcmodule.v1.MsgSendExampleTx.source_channel": value := x.SourceChannel return protoreflect.ValueOfString(value) - case "ibcmodule.v1.MsgSendTx.timeout_timestamp": + case "ibcmodule.v1.MsgSendExampleTx.timeout_timestamp": value := x.TimeoutTimestamp return protoreflect.ValueOfUint64(value) - case "ibcmodule.v1.MsgSendTx.some_data": + case "ibcmodule.v1.MsgSendExampleTx.some_data": value := x.SomeData return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendExampleTx")) } - panic(fmt.Errorf("message ibcmodule.v1.MsgSendTx does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message ibcmodule.v1.MsgSendExampleTx does not contain field %s", descriptor.FullName())) } } @@ -228,23 +228,23 @@ func (x *fastReflection_MsgSendTx) Get(descriptor protoreflect.FieldDescriptor) // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgSendTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgSendExampleTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "ibcmodule.v1.MsgSendTx.sender": + case "ibcmodule.v1.MsgSendExampleTx.sender": x.Sender = value.Interface().(string) - case "ibcmodule.v1.MsgSendTx.source_port": + case "ibcmodule.v1.MsgSendExampleTx.source_port": x.SourcePort = value.Interface().(string) - case "ibcmodule.v1.MsgSendTx.source_channel": + case "ibcmodule.v1.MsgSendExampleTx.source_channel": x.SourceChannel = value.Interface().(string) - case "ibcmodule.v1.MsgSendTx.timeout_timestamp": + case "ibcmodule.v1.MsgSendExampleTx.timeout_timestamp": x.TimeoutTimestamp = value.Uint() - case "ibcmodule.v1.MsgSendTx.some_data": + case "ibcmodule.v1.MsgSendExampleTx.some_data": x.SomeData = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendExampleTx")) } - panic(fmt.Errorf("message ibcmodule.v1.MsgSendTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message ibcmodule.v1.MsgSendExampleTx does not contain field %s", fd.FullName())) } } @@ -258,56 +258,56 @@ func (x *fastReflection_MsgSendTx) Set(fd protoreflect.FieldDescriptor, value pr // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgSendTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgSendExampleTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "ibcmodule.v1.MsgSendTx.sender": - panic(fmt.Errorf("field sender of message ibcmodule.v1.MsgSendTx is not mutable")) - case "ibcmodule.v1.MsgSendTx.source_port": - panic(fmt.Errorf("field source_port of message ibcmodule.v1.MsgSendTx is not mutable")) - case "ibcmodule.v1.MsgSendTx.source_channel": - panic(fmt.Errorf("field source_channel of message ibcmodule.v1.MsgSendTx is not mutable")) - case "ibcmodule.v1.MsgSendTx.timeout_timestamp": - panic(fmt.Errorf("field timeout_timestamp of message ibcmodule.v1.MsgSendTx is not mutable")) - case "ibcmodule.v1.MsgSendTx.some_data": - panic(fmt.Errorf("field some_data of message ibcmodule.v1.MsgSendTx is not mutable")) + case "ibcmodule.v1.MsgSendExampleTx.sender": + panic(fmt.Errorf("field sender of message ibcmodule.v1.MsgSendExampleTx is not mutable")) + case "ibcmodule.v1.MsgSendExampleTx.source_port": + panic(fmt.Errorf("field source_port of message ibcmodule.v1.MsgSendExampleTx is not mutable")) + case "ibcmodule.v1.MsgSendExampleTx.source_channel": + panic(fmt.Errorf("field source_channel of message ibcmodule.v1.MsgSendExampleTx is not mutable")) + case "ibcmodule.v1.MsgSendExampleTx.timeout_timestamp": + panic(fmt.Errorf("field timeout_timestamp of message ibcmodule.v1.MsgSendExampleTx is not mutable")) + case "ibcmodule.v1.MsgSendExampleTx.some_data": + panic(fmt.Errorf("field some_data of message ibcmodule.v1.MsgSendExampleTx is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendExampleTx")) } - panic(fmt.Errorf("message ibcmodule.v1.MsgSendTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message ibcmodule.v1.MsgSendExampleTx does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgSendTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgSendExampleTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "ibcmodule.v1.MsgSendTx.sender": + case "ibcmodule.v1.MsgSendExampleTx.sender": return protoreflect.ValueOfString("") - case "ibcmodule.v1.MsgSendTx.source_port": + case "ibcmodule.v1.MsgSendExampleTx.source_port": return protoreflect.ValueOfString("") - case "ibcmodule.v1.MsgSendTx.source_channel": + case "ibcmodule.v1.MsgSendExampleTx.source_channel": return protoreflect.ValueOfString("") - case "ibcmodule.v1.MsgSendTx.timeout_timestamp": + case "ibcmodule.v1.MsgSendExampleTx.timeout_timestamp": return protoreflect.ValueOfUint64(uint64(0)) - case "ibcmodule.v1.MsgSendTx.some_data": + case "ibcmodule.v1.MsgSendExampleTx.some_data": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendExampleTx")) } - panic(fmt.Errorf("message ibcmodule.v1.MsgSendTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message ibcmodule.v1.MsgSendExampleTx does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgSendTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgSendExampleTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in ibcmodule.v1.MsgSendTx", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in ibcmodule.v1.MsgSendExampleTx", d.FullName())) } panic("unreachable") } @@ -315,7 +315,7 @@ func (x *fastReflection_MsgSendTx) WhichOneof(d protoreflect.OneofDescriptor) pr // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgSendTx) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgSendExampleTx) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -326,7 +326,7 @@ func (x *fastReflection_MsgSendTx) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgSendTx) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgSendExampleTx) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -338,7 +338,7 @@ func (x *fastReflection_MsgSendTx) SetUnknown(fields protoreflect.RawFields) { // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgSendTx) IsValid() bool { +func (x *fastReflection_MsgSendExampleTx) IsValid() bool { return x != nil } @@ -348,9 +348,9 @@ func (x *fastReflection_MsgSendTx) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgSendTx) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgSendExampleTx) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgSendTx) + x := input.Message.Interface().(*MsgSendExampleTx) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -391,7 +391,7 @@ func (x *fastReflection_MsgSendTx) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgSendTx) + x := input.Message.Interface().(*MsgSendExampleTx) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -454,7 +454,7 @@ func (x *fastReflection_MsgSendTx) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgSendTx) + x := input.Message.Interface().(*MsgSendExampleTx) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -486,10 +486,10 @@ func (x *fastReflection_MsgSendTx) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSendTx: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSendExampleTx: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSendTx: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSendExampleTx: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -675,25 +675,25 @@ func (x *fastReflection_MsgSendTx) ProtoMethods() *protoiface.Methods { } var ( - md_MsgSendTxResponse protoreflect.MessageDescriptor - fd_MsgSendTxResponse_sequence protoreflect.FieldDescriptor + md_MsgSendExampleTxResponse protoreflect.MessageDescriptor + fd_MsgSendExampleTxResponse_sequence protoreflect.FieldDescriptor ) func init() { file_ibcmodule_v1_tx_proto_init() - md_MsgSendTxResponse = File_ibcmodule_v1_tx_proto.Messages().ByName("MsgSendTxResponse") - fd_MsgSendTxResponse_sequence = md_MsgSendTxResponse.Fields().ByName("sequence") + md_MsgSendExampleTxResponse = File_ibcmodule_v1_tx_proto.Messages().ByName("MsgSendExampleTxResponse") + fd_MsgSendExampleTxResponse_sequence = md_MsgSendExampleTxResponse.Fields().ByName("sequence") } -var _ protoreflect.Message = (*fastReflection_MsgSendTxResponse)(nil) +var _ protoreflect.Message = (*fastReflection_MsgSendExampleTxResponse)(nil) -type fastReflection_MsgSendTxResponse MsgSendTxResponse +type fastReflection_MsgSendExampleTxResponse MsgSendExampleTxResponse -func (x *MsgSendTxResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgSendTxResponse)(x) +func (x *MsgSendExampleTxResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgSendExampleTxResponse)(x) } -func (x *MsgSendTxResponse) slowProtoReflect() protoreflect.Message { +func (x *MsgSendExampleTxResponse) slowProtoReflect() protoreflect.Message { mi := &file_ibcmodule_v1_tx_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -705,43 +705,43 @@ func (x *MsgSendTxResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgSendTxResponse_messageType fastReflection_MsgSendTxResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgSendTxResponse_messageType{} +var _fastReflection_MsgSendExampleTxResponse_messageType fastReflection_MsgSendExampleTxResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgSendExampleTxResponse_messageType{} -type fastReflection_MsgSendTxResponse_messageType struct{} +type fastReflection_MsgSendExampleTxResponse_messageType struct{} -func (x fastReflection_MsgSendTxResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgSendTxResponse)(nil) +func (x fastReflection_MsgSendExampleTxResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgSendExampleTxResponse)(nil) } -func (x fastReflection_MsgSendTxResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgSendTxResponse) +func (x fastReflection_MsgSendExampleTxResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgSendExampleTxResponse) } -func (x fastReflection_MsgSendTxResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgSendTxResponse +func (x fastReflection_MsgSendExampleTxResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSendExampleTxResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgSendTxResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgSendTxResponse +func (x *fastReflection_MsgSendExampleTxResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSendExampleTxResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgSendTxResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgSendTxResponse_messageType +func (x *fastReflection_MsgSendExampleTxResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgSendExampleTxResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgSendTxResponse) New() protoreflect.Message { - return new(fastReflection_MsgSendTxResponse) +func (x *fastReflection_MsgSendExampleTxResponse) New() protoreflect.Message { + return new(fastReflection_MsgSendExampleTxResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgSendTxResponse) Interface() protoreflect.ProtoMessage { - return (*MsgSendTxResponse)(x) +func (x *fastReflection_MsgSendExampleTxResponse) Interface() protoreflect.ProtoMessage { + return (*MsgSendExampleTxResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -749,10 +749,10 @@ func (x *fastReflection_MsgSendTxResponse) Interface() protoreflect.ProtoMessage // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgSendTxResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_MsgSendExampleTxResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Sequence != uint64(0) { value := protoreflect.ValueOfUint64(x.Sequence) - if !f(fd_MsgSendTxResponse_sequence, value) { + if !f(fd_MsgSendExampleTxResponse_sequence, value) { return } } @@ -769,15 +769,15 @@ func (x *fastReflection_MsgSendTxResponse) Range(f func(protoreflect.FieldDescri // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgSendTxResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgSendExampleTxResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "ibcmodule.v1.MsgSendTxResponse.sequence": + case "ibcmodule.v1.MsgSendExampleTxResponse.sequence": return x.Sequence != uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTxResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendExampleTxResponse")) } - panic(fmt.Errorf("message ibcmodule.v1.MsgSendTxResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message ibcmodule.v1.MsgSendExampleTxResponse does not contain field %s", fd.FullName())) } } @@ -787,15 +787,15 @@ func (x *fastReflection_MsgSendTxResponse) Has(fd protoreflect.FieldDescriptor) // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgSendTxResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgSendExampleTxResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "ibcmodule.v1.MsgSendTxResponse.sequence": + case "ibcmodule.v1.MsgSendExampleTxResponse.sequence": x.Sequence = uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTxResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendExampleTxResponse")) } - panic(fmt.Errorf("message ibcmodule.v1.MsgSendTxResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message ibcmodule.v1.MsgSendExampleTxResponse does not contain field %s", fd.FullName())) } } @@ -805,16 +805,16 @@ func (x *fastReflection_MsgSendTxResponse) Clear(fd protoreflect.FieldDescriptor // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgSendTxResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgSendExampleTxResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "ibcmodule.v1.MsgSendTxResponse.sequence": + case "ibcmodule.v1.MsgSendExampleTxResponse.sequence": value := x.Sequence return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTxResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendExampleTxResponse")) } - panic(fmt.Errorf("message ibcmodule.v1.MsgSendTxResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message ibcmodule.v1.MsgSendExampleTxResponse does not contain field %s", descriptor.FullName())) } } @@ -828,15 +828,15 @@ func (x *fastReflection_MsgSendTxResponse) Get(descriptor protoreflect.FieldDesc // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgSendTxResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgSendExampleTxResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "ibcmodule.v1.MsgSendTxResponse.sequence": + case "ibcmodule.v1.MsgSendExampleTxResponse.sequence": x.Sequence = value.Uint() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTxResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendExampleTxResponse")) } - panic(fmt.Errorf("message ibcmodule.v1.MsgSendTxResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message ibcmodule.v1.MsgSendExampleTxResponse does not contain field %s", fd.FullName())) } } @@ -850,40 +850,40 @@ func (x *fastReflection_MsgSendTxResponse) Set(fd protoreflect.FieldDescriptor, // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgSendTxResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgSendExampleTxResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "ibcmodule.v1.MsgSendTxResponse.sequence": - panic(fmt.Errorf("field sequence of message ibcmodule.v1.MsgSendTxResponse is not mutable")) + case "ibcmodule.v1.MsgSendExampleTxResponse.sequence": + panic(fmt.Errorf("field sequence of message ibcmodule.v1.MsgSendExampleTxResponse is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTxResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendExampleTxResponse")) } - panic(fmt.Errorf("message ibcmodule.v1.MsgSendTxResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message ibcmodule.v1.MsgSendExampleTxResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgSendTxResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgSendExampleTxResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "ibcmodule.v1.MsgSendTxResponse.sequence": + case "ibcmodule.v1.MsgSendExampleTxResponse.sequence": return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendTxResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: ibcmodule.v1.MsgSendExampleTxResponse")) } - panic(fmt.Errorf("message ibcmodule.v1.MsgSendTxResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message ibcmodule.v1.MsgSendExampleTxResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgSendTxResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgSendExampleTxResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in ibcmodule.v1.MsgSendTxResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in ibcmodule.v1.MsgSendExampleTxResponse", d.FullName())) } panic("unreachable") } @@ -891,7 +891,7 @@ func (x *fastReflection_MsgSendTxResponse) WhichOneof(d protoreflect.OneofDescri // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgSendTxResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgSendExampleTxResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -902,7 +902,7 @@ func (x *fastReflection_MsgSendTxResponse) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgSendTxResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgSendExampleTxResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -914,7 +914,7 @@ func (x *fastReflection_MsgSendTxResponse) SetUnknown(fields protoreflect.RawFie // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_MsgSendTxResponse) IsValid() bool { +func (x *fastReflection_MsgSendExampleTxResponse) IsValid() bool { return x != nil } @@ -924,9 +924,9 @@ func (x *fastReflection_MsgSendTxResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgSendTxResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgSendExampleTxResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgSendTxResponse) + x := input.Message.Interface().(*MsgSendExampleTxResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -951,7 +951,7 @@ func (x *fastReflection_MsgSendTxResponse) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgSendTxResponse) + x := input.Message.Interface().(*MsgSendExampleTxResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -986,7 +986,7 @@ func (x *fastReflection_MsgSendTxResponse) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgSendTxResponse) + x := input.Message.Interface().(*MsgSendExampleTxResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1018,10 +1018,10 @@ func (x *fastReflection_MsgSendTxResponse) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSendTxResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSendExampleTxResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSendTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSendExampleTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2108,8 +2108,8 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// MsgSendTx defines the payload for Msg/SendTx -type MsgSendTx struct { +// MsgSendExampleTx defines the payload for Msg/SendTx +type MsgSendExampleTx struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2121,8 +2121,8 @@ type MsgSendTx struct { SomeData string `protobuf:"bytes,5,opt,name=some_data,json=someData,proto3" json:"some_data,omitempty"` } -func (x *MsgSendTx) Reset() { - *x = MsgSendTx{} +func (x *MsgSendExampleTx) Reset() { + *x = MsgSendExampleTx{} if protoimpl.UnsafeEnabled { mi := &file_ibcmodule_v1_tx_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2130,54 +2130,54 @@ func (x *MsgSendTx) Reset() { } } -func (x *MsgSendTx) String() string { +func (x *MsgSendExampleTx) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgSendTx) ProtoMessage() {} +func (*MsgSendExampleTx) ProtoMessage() {} -// Deprecated: Use MsgSendTx.ProtoReflect.Descriptor instead. -func (*MsgSendTx) Descriptor() ([]byte, []int) { +// Deprecated: Use MsgSendExampleTx.ProtoReflect.Descriptor instead. +func (*MsgSendExampleTx) Descriptor() ([]byte, []int) { return file_ibcmodule_v1_tx_proto_rawDescGZIP(), []int{0} } -func (x *MsgSendTx) GetSender() string { +func (x *MsgSendExampleTx) GetSender() string { if x != nil { return x.Sender } return "" } -func (x *MsgSendTx) GetSourcePort() string { +func (x *MsgSendExampleTx) GetSourcePort() string { if x != nil { return x.SourcePort } return "" } -func (x *MsgSendTx) GetSourceChannel() string { +func (x *MsgSendExampleTx) GetSourceChannel() string { if x != nil { return x.SourceChannel } return "" } -func (x *MsgSendTx) GetTimeoutTimestamp() uint64 { +func (x *MsgSendExampleTx) GetTimeoutTimestamp() uint64 { if x != nil { return x.TimeoutTimestamp } return 0 } -func (x *MsgSendTx) GetSomeData() string { +func (x *MsgSendExampleTx) GetSomeData() string { if x != nil { return x.SomeData } return "" } -// MsgSendTxResponse defines the response for MsgSendTx -type MsgSendTxResponse struct { +// MsgSendExampleTxResponse defines the response. +type MsgSendExampleTxResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2185,8 +2185,8 @@ type MsgSendTxResponse struct { Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` } -func (x *MsgSendTxResponse) Reset() { - *x = MsgSendTxResponse{} +func (x *MsgSendExampleTxResponse) Reset() { + *x = MsgSendExampleTxResponse{} if protoimpl.UnsafeEnabled { mi := &file_ibcmodule_v1_tx_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2194,18 +2194,18 @@ func (x *MsgSendTxResponse) Reset() { } } -func (x *MsgSendTxResponse) String() string { +func (x *MsgSendExampleTxResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgSendTxResponse) ProtoMessage() {} +func (*MsgSendExampleTxResponse) ProtoMessage() {} -// Deprecated: Use MsgSendTxResponse.ProtoReflect.Descriptor instead. -func (*MsgSendTxResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use MsgSendExampleTxResponse.ProtoReflect.Descriptor instead. +func (*MsgSendExampleTxResponse) Descriptor() ([]byte, []int) { return file_ibcmodule_v1_tx_proto_rawDescGZIP(), []int{1} } -func (x *MsgSendTxResponse) GetSequence() uint64 { +func (x *MsgSendExampleTxResponse) GetSequence() uint64 { if x != nil { return x.Sequence } @@ -2336,49 +2336,51 @@ var file_ibcmodule_v1_tx_proto_rawDesc = []byte{ 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc6, 0x01, 0x0a, 0x09, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, - 0x54, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, - 0x65, 0x6c, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x74, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, - 0x1b, 0x0a, 0x09, 0x73, 0x6f, 0x6d, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x6d, 0x65, 0x44, 0x61, 0x74, 0x61, 0x3a, 0x0f, 0x88, 0xa0, - 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, 0x35, 0x0a, - 0x11, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x3a, 0x04, - 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x48, 0x0a, 0x11, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x50, - 0x61, 0x63, 0x6b, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcd, 0x01, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, + 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x6f, 0x6d, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x6d, 0x65, 0x44, 0x61, 0x74, 0x61, 0x22, 0x4f, - 0x0a, 0x0f, 0x41, 0x63, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x12, 0x18, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, - 0x0c, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, - 0x50, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x42, 0x0a, 0x06, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x78, - 0x12, 0x17, 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x78, 0x1a, 0x1f, 0x2e, 0x69, 0x62, 0x63, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, - 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, - 0x01, 0x42, 0xad, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, - 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x2f, 0x73, - 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x76, 0x31, 0xa2, 0x02, 0x03, 0x49, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x49, 0x62, 0x63, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x0d, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x72, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, + 0x72, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x6f, 0x6d, 0x65, 0x5f, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x6d, 0x65, 0x44, + 0x61, 0x74, 0x61, 0x3a, 0x0f, 0x88, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x22, 0x3c, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x45, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x3a, 0x04, 0x88, 0xa0, + 0x1f, 0x00, 0x22, 0x48, 0x0a, 0x11, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x50, 0x61, 0x63, + 0x6b, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, + 0x1b, 0x0a, 0x09, 0x73, 0x6f, 0x6d, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x6d, 0x65, 0x44, 0x61, 0x74, 0x61, 0x22, 0x4f, 0x0a, 0x0f, + 0x41, 0x63, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, + 0x18, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0c, 0x48, + 0x00, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x5e, 0x0a, + 0x03, 0x4d, 0x73, 0x67, 0x12, 0x50, 0x0a, 0x06, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x78, 0x12, 0x1e, + 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x78, 0x1a, 0x26, + 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x78, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xad, 0x01, + 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, + 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, + 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, + 0x76, 0x31, 0x3b, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x49, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x18, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, + 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2395,14 +2397,14 @@ func file_ibcmodule_v1_tx_proto_rawDescGZIP() []byte { var file_ibcmodule_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_ibcmodule_v1_tx_proto_goTypes = []interface{}{ - (*MsgSendTx)(nil), // 0: ibcmodule.v1.MsgSendTx - (*MsgSendTxResponse)(nil), // 1: ibcmodule.v1.MsgSendTxResponse - (*ExamplePacketData)(nil), // 2: ibcmodule.v1.ExamplePacketData - (*Acknowledgement)(nil), // 3: ibcmodule.v1.Acknowledgement + (*MsgSendExampleTx)(nil), // 0: ibcmodule.v1.MsgSendExampleTx + (*MsgSendExampleTxResponse)(nil), // 1: ibcmodule.v1.MsgSendExampleTxResponse + (*ExamplePacketData)(nil), // 2: ibcmodule.v1.ExamplePacketData + (*Acknowledgement)(nil), // 3: ibcmodule.v1.Acknowledgement } var file_ibcmodule_v1_tx_proto_depIdxs = []int32{ - 0, // 0: ibcmodule.v1.Msg.SendTx:input_type -> ibcmodule.v1.MsgSendTx - 1, // 1: ibcmodule.v1.Msg.SendTx:output_type -> ibcmodule.v1.MsgSendTxResponse + 0, // 0: ibcmodule.v1.Msg.SendTx:input_type -> ibcmodule.v1.MsgSendExampleTx + 1, // 1: ibcmodule.v1.Msg.SendTx:output_type -> ibcmodule.v1.MsgSendExampleTxResponse 1, // [1:2] is the sub-list for method output_type 0, // [0:1] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -2417,7 +2419,7 @@ func file_ibcmodule_v1_tx_proto_init() { } if !protoimpl.UnsafeEnabled { file_ibcmodule_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgSendTx); i { + switch v := v.(*MsgSendExampleTx); i { case 0: return &v.state case 1: @@ -2429,7 +2431,7 @@ func file_ibcmodule_v1_tx_proto_init() { } } file_ibcmodule_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgSendTxResponse); i { + switch v := v.(*MsgSendExampleTxResponse); i { case 0: return &v.state case 1: diff --git a/simapp/api/ibcmodule/v1/tx_grpc.pb.go b/simapp/api/ibcmodule/v1/tx_grpc.pb.go index 7011a89f..b1d983ff 100644 --- a/simapp/api/ibcmodule/v1/tx_grpc.pb.go +++ b/simapp/api/ibcmodule/v1/tx_grpc.pb.go @@ -26,8 +26,8 @@ const ( // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type MsgClient interface { - // SendTx defines a rpc handler for MsgSendTx. - SendTx(ctx context.Context, in *MsgSendTx, opts ...grpc.CallOption) (*MsgSendTxResponse, error) + // SendTx defines a rpc handler for MsgSendExampleTx. + SendTx(ctx context.Context, in *MsgSendExampleTx, opts ...grpc.CallOption) (*MsgSendExampleTxResponse, error) } type msgClient struct { @@ -38,8 +38,8 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { return &msgClient{cc} } -func (c *msgClient) SendTx(ctx context.Context, in *MsgSendTx, opts ...grpc.CallOption) (*MsgSendTxResponse, error) { - out := new(MsgSendTxResponse) +func (c *msgClient) SendTx(ctx context.Context, in *MsgSendExampleTx, opts ...grpc.CallOption) (*MsgSendExampleTxResponse, error) { + out := new(MsgSendExampleTxResponse) err := c.cc.Invoke(ctx, Msg_SendTx_FullMethodName, in, out, opts...) if err != nil { return nil, err @@ -51,8 +51,8 @@ func (c *msgClient) SendTx(ctx context.Context, in *MsgSendTx, opts ...grpc.Call // All implementations must embed UnimplementedMsgServer // for forward compatibility type MsgServer interface { - // SendTx defines a rpc handler for MsgSendTx. - SendTx(context.Context, *MsgSendTx) (*MsgSendTxResponse, error) + // SendTx defines a rpc handler for MsgSendExampleTx. + SendTx(context.Context, *MsgSendExampleTx) (*MsgSendExampleTxResponse, error) mustEmbedUnimplementedMsgServer() } @@ -60,7 +60,7 @@ type MsgServer interface { type UnimplementedMsgServer struct { } -func (UnimplementedMsgServer) SendTx(context.Context, *MsgSendTx) (*MsgSendTxResponse, error) { +func (UnimplementedMsgServer) SendTx(context.Context, *MsgSendExampleTx) (*MsgSendExampleTxResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SendTx not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} @@ -77,7 +77,7 @@ func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { } func _Msg_SendTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSendTx) + in := new(MsgSendExampleTx) if err := dec(in); err != nil { return nil, err } @@ -89,7 +89,7 @@ func _Msg_SendTx_Handler(srv interface{}, ctx context.Context, dec func(interfac FullMethod: Msg_SendTx_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SendTx(ctx, req.(*MsgSendTx)) + return srv.(MsgServer).SendTx(ctx, req.(*MsgSendExampleTx)) } return interceptor(ctx, in, info, handler) } diff --git a/simapp/proto/ibcmodule/v1/tx.proto b/simapp/proto/ibcmodule/v1/tx.proto index 87f81c49..688fb390 100644 --- a/simapp/proto/ibcmodule/v1/tx.proto +++ b/simapp/proto/ibcmodule/v1/tx.proto @@ -11,12 +11,12 @@ import "cosmos/msg/v1/msg.proto"; service Msg { option (cosmos.msg.v1.service) = true; - // SendTx defines a rpc handler for MsgSendTx. - rpc SendTx(MsgSendTx) returns (MsgSendTxResponse); + // SendTx defines a rpc handler for MsgSendExampleTx. + rpc SendTx(MsgSendExampleTx) returns (MsgSendExampleTxResponse); } -// MsgSendTx defines the payload for Msg/SendTx -message MsgSendTx { +// MsgSendExampleTx defines the payload for Msg/SendTx +message MsgSendExampleTx { option (cosmos.msg.v1.signer) = "sender"; option (gogoproto.goproto_getters) = false; @@ -30,8 +30,8 @@ message MsgSendTx { string some_data = 5; } -// MsgSendTxResponse defines the response for MsgSendTx -message MsgSendTxResponse { +// MsgSendExampleTxResponse defines the response. +message MsgSendExampleTxResponse { option (gogoproto.goproto_getters) = false; uint64 sequence = 1; diff --git a/simapp/x/ibcmodule/client/tx.go b/simapp/x/ibcmodule/client/tx.go index 6d13c044..6f45fbd6 100644 --- a/simapp/x/ibcmodule/client/tx.go +++ b/simapp/x/ibcmodule/client/tx.go @@ -60,7 +60,7 @@ func NewSomeDataTxCmd() *cobra.Command { timeoutTimestamp = uint64(now + time.Duration(1*time.Hour).Nanoseconds()) } - msg := &types.MsgSendTx{ + msg := &types.MsgSendExampleTx{ Sender: sender, SourcePort: srcPort, SourceChannel: srcChannel, diff --git a/simapp/x/ibcmodule/ibc_module.go b/simapp/x/ibcmodule/ibc_module.go index 86754d55..76805551 100644 --- a/simapp/x/ibcmodule/ibc_module.go +++ b/simapp/x/ibcmodule/ibc_module.go @@ -131,7 +131,7 @@ func (im ExampleIBCModule) OnRecvPacket( // only attempt the application logic if the packet data was successfully decoded if ack.Success() { // TODO: perform your logic here - err := im.handleOnRecvLogic(ctx) + err := im.handleOnRecvLogic(ctx, data) if err != nil { ack = channeltypes.NewErrorAcknowledgement(err) ackErr = err @@ -154,7 +154,7 @@ func (im ExampleIBCModule) OnRecvPacket( return ack } -func (im ExampleIBCModule) handleOnRecvLogic(ctx context.Context) error { +func (im ExampleIBCModule) handleOnRecvLogic(ctx context.Context, data types.ExamplePacketData) error { v, err := im.keeper.ExampleStore.Get(ctx) if err != nil { return err diff --git a/simapp/x/ibcmodule/keeper/genesis.go b/simapp/x/ibcmodule/keeper/genesis.go index ed108338..bb3f3a90 100644 --- a/simapp/x/ibcmodule/keeper/genesis.go +++ b/simapp/x/ibcmodule/keeper/genesis.go @@ -14,7 +14,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState) { // Only try to bind to port if it is not already bound, since we may already own // port capability from capability InitGenesis - if !k.hasCapability(ctx, types.PortID) { + if !k.IsBound(ctx, types.PortID) { // module binds to the port on InitChain // and claims the returned capability if err := k.BindPort(ctx, types.PortID); err != nil { diff --git a/simapp/x/ibcmodule/keeper/ibc_helpers.go b/simapp/x/ibcmodule/keeper/ibc_helpers.go index 91957828..cabe76ac 100644 --- a/simapp/x/ibcmodule/keeper/ibc_helpers.go +++ b/simapp/x/ibcmodule/keeper/ibc_helpers.go @@ -1,20 +1,12 @@ package keeper import ( - "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" host "github.com/cosmos/ibc-go/v8/modules/core/24-host" ) -// hasCapability checks if the IBC app module owns the port capability for the desired port -func (k Keeper) hasCapability(ctx sdk.Context, portID string) bool { - _, ok := k.ScopedKeeper.GetCapability(ctx, host.PortPath(portID)) - return ok -} - func (k Keeper) IsBound(ctx sdk.Context, portID string) bool { return k.PortKeeper.IsBound(ctx, portID) } @@ -23,10 +15,7 @@ func (k Keeper) IsBound(ctx sdk.Context, portID string) bool { // order to expose it to module's InitGenesis function func (k Keeper) BindPort(ctx sdk.Context, portID string) error { cap := k.PortKeeper.BindPort(ctx, portID) - fmt.Printf("port binded: %s\n", portID) - err := k.ClaimCapability(ctx, cap, host.PortPath(portID)) - fmt.Printf("port capability claimed: %s\n", portID) - return err + return k.ClaimCapability(ctx, cap, host.PortPath(portID)) } diff --git a/simapp/x/ibcmodule/keeper/msg_server.go b/simapp/x/ibcmodule/keeper/msg_server.go index c93b425f..7501d43a 100644 --- a/simapp/x/ibcmodule/keeper/msg_server.go +++ b/simapp/x/ibcmodule/keeper/msg_server.go @@ -22,14 +22,14 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { } // SendTx implements types.MsgServer. -func (ms msgServer) SendTx(ctx context.Context, msg *types.MsgSendTx) (*types.MsgSendTxResponse, error) { +func (ms msgServer) SendTx(ctx context.Context, msg *types.MsgSendExampleTx) (*types.MsgSendExampleTxResponse, error) { sequence, err := ms.sendPacket( ctx, msg.SourcePort, msg.SourceChannel, msg.Sender, msg.SomeData, msg.TimeoutTimestamp) if err != nil { return nil, err } - return &types.MsgSendTxResponse{ + return &types.MsgSendExampleTxResponse{ Sequence: sequence, }, nil } @@ -48,7 +48,6 @@ func (ms msgServer) sendPacket(ctx context.Context, sourcePort, sourceChannel, s Sender: sender, SomeData: someData, } - // packetDataBz := types.EncodePacketData(packetData) sequence, err = ms.ics4Wrapper.SendPacket(sdkCtx, channelCap, sourcePort, sourceChannel, clienttypes.ZeroHeight(), timeoutTimestamp, packetData.MustGetBytes()) if err != nil { diff --git a/simapp/x/ibcmodule/module.go b/simapp/x/ibcmodule/module.go index 683abc0b..1484f6d4 100644 --- a/simapp/x/ibcmodule/module.go +++ b/simapp/x/ibcmodule/module.go @@ -34,7 +34,9 @@ func (AppModuleBasic) Name() string { } // RegisterLegacyAminoCodec implements AppModuleBasic interface. -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterLegacyAminoCodec(cdc) +} // RegisterInterfaces registers module concrete types into protobuf Any. func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { @@ -115,8 +117,8 @@ func (am AppModule) InitGenesis( // ExportGenesis returns the exported genesis state as raw bytes for the swap module. func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { - gs := am.keeper.ExportGenesis(ctx) - return cdc.MustMarshalJSON(gs) + genState := am.keeper.ExportGenesis(ctx) + return cdc.MustMarshalJSON(genState) } // ConsensusVersion returns the consensus state breaking version for the swap module. diff --git a/simapp/x/ibcmodule/types/codec.go b/simapp/x/ibcmodule/types/codec.go index 28744da2..ee6ca347 100644 --- a/simapp/x/ibcmodule/types/codec.go +++ b/simapp/x/ibcmodule/types/codec.go @@ -22,7 +22,7 @@ func init() { // RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgSendTx{}, ModuleName+"/MsgSendTx", nil) + cdc.RegisterConcrete(&MsgSendExampleTx{}, ModuleName+"/MsgSendExampleTx", nil) } func RegisterInterfaces(registry types.InterfaceRegistry) { @@ -30,7 +30,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), - &MsgSendTx{}, + &MsgSendExampleTx{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/simapp/x/ibcmodule/types/keys.go b/simapp/x/ibcmodule/types/keys.go index aefe652e..6e1cdf7a 100644 --- a/simapp/x/ibcmodule/types/keys.go +++ b/simapp/x/ibcmodule/types/keys.go @@ -10,14 +10,5 @@ const ( // Version defines the current version the IBC module supports Version = ModuleName + "-1" - // StoreKey is the store key string for the module. - StoreKey = ModuleName - - // RouterKey is the message route for the module. - RouterKey = ModuleName - - // QuerierRoute is the querier route for the module. - QuerierRoute = ModuleName - EventTypePacket = "example_data_packet" ) diff --git a/simapp/x/ibcmodule/types/tx.pb.go b/simapp/x/ibcmodule/types/tx.pb.go index 6fbb1b4c..1f5ad10c 100644 --- a/simapp/x/ibcmodule/types/tx.pb.go +++ b/simapp/x/ibcmodule/types/tx.pb.go @@ -29,8 +29,8 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// MsgSendTx defines the payload for Msg/SendTx -type MsgSendTx struct { +// MsgSendExampleTx defines the payload for Msg/SendTx +type MsgSendExampleTx struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` SourcePort string `protobuf:"bytes,2,opt,name=source_port,json=sourcePort,proto3" json:"source_port,omitempty"` SourceChannel string `protobuf:"bytes,3,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty"` @@ -38,18 +38,18 @@ type MsgSendTx struct { SomeData string `protobuf:"bytes,5,opt,name=some_data,json=someData,proto3" json:"some_data,omitempty"` } -func (m *MsgSendTx) Reset() { *m = MsgSendTx{} } -func (m *MsgSendTx) String() string { return proto.CompactTextString(m) } -func (*MsgSendTx) ProtoMessage() {} -func (*MsgSendTx) Descriptor() ([]byte, []int) { +func (m *MsgSendExampleTx) Reset() { *m = MsgSendExampleTx{} } +func (m *MsgSendExampleTx) String() string { return proto.CompactTextString(m) } +func (*MsgSendExampleTx) ProtoMessage() {} +func (*MsgSendExampleTx) Descriptor() ([]byte, []int) { return fileDescriptor_05cec4d6b8fbe27a, []int{0} } -func (m *MsgSendTx) XXX_Unmarshal(b []byte) error { +func (m *MsgSendExampleTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgSendTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgSendExampleTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgSendTx.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgSendExampleTx.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -59,35 +59,35 @@ func (m *MsgSendTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *MsgSendTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSendTx.Merge(m, src) +func (m *MsgSendExampleTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSendExampleTx.Merge(m, src) } -func (m *MsgSendTx) XXX_Size() int { +func (m *MsgSendExampleTx) XXX_Size() int { return m.Size() } -func (m *MsgSendTx) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSendTx.DiscardUnknown(m) +func (m *MsgSendExampleTx) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSendExampleTx.DiscardUnknown(m) } -var xxx_messageInfo_MsgSendTx proto.InternalMessageInfo +var xxx_messageInfo_MsgSendExampleTx proto.InternalMessageInfo -// MsgSendTxResponse defines the response for MsgSendTx -type MsgSendTxResponse struct { +// MsgSendExampleTxResponse defines the response. +type MsgSendExampleTxResponse struct { Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` } -func (m *MsgSendTxResponse) Reset() { *m = MsgSendTxResponse{} } -func (m *MsgSendTxResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSendTxResponse) ProtoMessage() {} -func (*MsgSendTxResponse) Descriptor() ([]byte, []int) { +func (m *MsgSendExampleTxResponse) Reset() { *m = MsgSendExampleTxResponse{} } +func (m *MsgSendExampleTxResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSendExampleTxResponse) ProtoMessage() {} +func (*MsgSendExampleTxResponse) Descriptor() ([]byte, []int) { return fileDescriptor_05cec4d6b8fbe27a, []int{1} } -func (m *MsgSendTxResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgSendExampleTxResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgSendTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgSendExampleTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgSendTxResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgSendExampleTxResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -97,17 +97,17 @@ func (m *MsgSendTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *MsgSendTxResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSendTxResponse.Merge(m, src) +func (m *MsgSendExampleTxResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSendExampleTxResponse.Merge(m, src) } -func (m *MsgSendTxResponse) XXX_Size() int { +func (m *MsgSendExampleTxResponse) XXX_Size() int { return m.Size() } -func (m *MsgSendTxResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSendTxResponse.DiscardUnknown(m) +func (m *MsgSendExampleTxResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSendExampleTxResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgSendTxResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgSendExampleTxResponse proto.InternalMessageInfo // ExamplePacketData type ExamplePacketData struct { @@ -252,8 +252,8 @@ func (*Acknowledgement) XXX_OneofWrappers() []interface{} { } func init() { - proto.RegisterType((*MsgSendTx)(nil), "ibcmodule.v1.MsgSendTx") - proto.RegisterType((*MsgSendTxResponse)(nil), "ibcmodule.v1.MsgSendTxResponse") + proto.RegisterType((*MsgSendExampleTx)(nil), "ibcmodule.v1.MsgSendExampleTx") + proto.RegisterType((*MsgSendExampleTxResponse)(nil), "ibcmodule.v1.MsgSendExampleTxResponse") proto.RegisterType((*ExamplePacketData)(nil), "ibcmodule.v1.ExamplePacketData") proto.RegisterType((*Acknowledgement)(nil), "ibcmodule.v1.Acknowledgement") } @@ -261,36 +261,36 @@ func init() { func init() { proto.RegisterFile("ibcmodule/v1/tx.proto", fileDescriptor_05cec4d6b8fbe27a) } var fileDescriptor_05cec4d6b8fbe27a = []byte{ - // 455 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xcb, 0x6e, 0xd3, 0x40, - 0x14, 0xb5, 0xdb, 0x24, 0x4a, 0x86, 0x42, 0xc9, 0x88, 0xa6, 0x96, 0x91, 0x9c, 0x28, 0x12, 0x52, - 0x54, 0x24, 0x5b, 0xe5, 0xb1, 0xe9, 0x8e, 0x00, 0x52, 0x36, 0x85, 0xc8, 0x74, 0xc5, 0x26, 0x9a, - 0xd8, 0x57, 0x8e, 0x55, 0xcf, 0x83, 0xb9, 0xe3, 0x36, 0xec, 0x10, 0x2b, 0x96, 0x7c, 0x02, 0x9f, - 0xd0, 0xaf, 0x40, 0x2c, 0xbb, 0x64, 0x89, 0x92, 0x45, 0x7f, 0x03, 0xf9, 0xd1, 0x40, 0x17, 0x59, - 0xd9, 0xe7, 0x9c, 0x3b, 0x47, 0xe7, 0x3e, 0xc8, 0x41, 0x3a, 0x8f, 0xb8, 0x8c, 0xf3, 0x0c, 0x82, - 0x8b, 0xe3, 0xc0, 0x2c, 0x7d, 0xa5, 0xa5, 0x91, 0x74, 0x6f, 0x43, 0xfb, 0x17, 0xc7, 0xee, 0xa3, - 0x44, 0x26, 0xb2, 0x14, 0x82, 0xe2, 0xaf, 0xaa, 0x71, 0x0f, 0x23, 0x89, 0x5c, 0x62, 0xc0, 0x31, - 0x29, 0xde, 0x72, 0x4c, 0x2a, 0x61, 0xf8, 0xd3, 0x26, 0x9d, 0x53, 0x4c, 0x3e, 0x80, 0x88, 0xcf, - 0x96, 0xb4, 0x47, 0x5a, 0x08, 0x22, 0x06, 0xed, 0xd8, 0x03, 0x7b, 0xd4, 0x09, 0x6b, 0x44, 0xfb, - 0xe4, 0x1e, 0xca, 0x5c, 0x47, 0x30, 0x53, 0x52, 0x1b, 0x67, 0xa7, 0x14, 0x49, 0x45, 0x4d, 0xa5, - 0x36, 0xf4, 0x09, 0x79, 0x50, 0x17, 0x44, 0x0b, 0x26, 0x04, 0x64, 0xce, 0x6e, 0x59, 0x73, 0xbf, - 0x62, 0x5f, 0x57, 0x24, 0x7d, 0x4a, 0xba, 0x26, 0xe5, 0x20, 0x73, 0x33, 0x2b, 0xbe, 0x68, 0x18, - 0x57, 0x4e, 0x63, 0x60, 0x8f, 0x1a, 0xe1, 0xc3, 0x5a, 0x38, 0xbb, 0xe5, 0xe9, 0x63, 0xd2, 0x41, - 0xc9, 0x61, 0x16, 0x33, 0xc3, 0x9c, 0x66, 0x69, 0xd7, 0x2e, 0x88, 0x37, 0xcc, 0xb0, 0x93, 0xfd, - 0x6f, 0x3f, 0xfa, 0xd6, 0xd7, 0x9b, 0xab, 0xa3, 0x3a, 0xe2, 0xf0, 0x25, 0xe9, 0x6e, 0xfa, 0x08, - 0x01, 0x95, 0x14, 0x08, 0xd4, 0x25, 0x6d, 0x84, 0x4f, 0x39, 0x88, 0x08, 0xca, 0x8e, 0x1a, 0xe1, - 0x06, 0x9f, 0x34, 0x0a, 0x87, 0xe1, 0x84, 0x74, 0xdf, 0x2e, 0x19, 0x57, 0x19, 0x4c, 0x59, 0x74, - 0x0e, 0xa6, 0x30, 0xdf, 0x3a, 0x86, 0x3b, 0x89, 0x76, 0xee, 0x26, 0x1a, 0xbe, 0x27, 0xfb, 0xaf, - 0xa2, 0x73, 0x21, 0x2f, 0x33, 0x88, 0x13, 0xe0, 0x20, 0x0c, 0x75, 0x48, 0x4b, 0x03, 0xe6, 0x99, - 0x71, 0x0e, 0x06, 0xf6, 0x68, 0x6f, 0x62, 0x85, 0x35, 0xa6, 0x3d, 0xd2, 0x04, 0xad, 0xa5, 0x76, - 0x7a, 0x85, 0xcb, 0xc4, 0x0a, 0x2b, 0x38, 0x26, 0xa4, 0xad, 0xeb, 0xf0, 0xcf, 0xa6, 0x64, 0xf7, - 0x14, 0x13, 0x3a, 0x26, 0xad, 0x7a, 0x3b, 0x87, 0xfe, 0xff, 0x9b, 0xf6, 0x37, 0xed, 0xba, 0xfd, - 0x2d, 0xc2, 0xed, 0x1c, 0xdc, 0xe6, 0x97, 0x9b, 0xab, 0x23, 0x7b, 0xfc, 0xee, 0xd7, 0xca, 0xb3, - 0xaf, 0x57, 0x9e, 0xfd, 0x67, 0xe5, 0xd9, 0xdf, 0xd7, 0x9e, 0x75, 0xbd, 0xf6, 0xac, 0xdf, 0x6b, - 0xcf, 0xfa, 0xf8, 0x22, 0x49, 0xcd, 0x22, 0x9f, 0xfb, 0x91, 0xe4, 0x81, 0x96, 0x59, 0x16, 0x2d, - 0x58, 0x2a, 0x30, 0x40, 0xc5, 0x2e, 0x45, 0x80, 0x29, 0x67, 0x4a, 0x05, 0xcb, 0xe0, 0xdf, 0xfd, - 0x99, 0xcf, 0x0a, 0x70, 0xde, 0x2a, 0x6f, 0xe8, 0xf9, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xed, - 0x58, 0x2c, 0x33, 0x99, 0x02, 0x00, 0x00, + // 462 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0x3d, 0x6f, 0xd3, 0x50, + 0x14, 0xb5, 0xdb, 0x24, 0x4a, 0x1f, 0x85, 0xb6, 0x4f, 0x34, 0x58, 0x46, 0x72, 0xa3, 0x48, 0xa0, + 0xa8, 0x48, 0xb6, 0x0a, 0x4c, 0x15, 0x0b, 0x05, 0xa4, 0x2c, 0x85, 0xc8, 0x64, 0x62, 0x20, 0x7a, + 0xb1, 0xaf, 0x1c, 0xab, 0x7e, 0x1f, 0xbc, 0xfb, 0xdc, 0x9a, 0x0d, 0x31, 0x31, 0xf2, 0x13, 0xf8, + 0x09, 0xfd, 0x19, 0x2c, 0x48, 0x1d, 0x19, 0x51, 0x32, 0xf4, 0x6f, 0x20, 0x7f, 0xb4, 0xd0, 0x48, + 0x30, 0xd9, 0xe7, 0x9c, 0x7b, 0xaf, 0xcf, 0xb9, 0xbe, 0x64, 0x37, 0x9d, 0x45, 0x5c, 0xc6, 0x79, + 0x06, 0xc1, 0xe9, 0x41, 0x60, 0x0a, 0x5f, 0x69, 0x69, 0x24, 0xdd, 0xbc, 0xa6, 0xfd, 0xd3, 0x03, + 0xf7, 0x6e, 0x22, 0x13, 0x59, 0x09, 0x41, 0xf9, 0x56, 0xd7, 0xb8, 0xf7, 0x22, 0x89, 0x5c, 0x62, + 0xc0, 0x31, 0x29, 0x7b, 0x39, 0x26, 0xb5, 0x30, 0xf8, 0x61, 0x93, 0xed, 0x63, 0x4c, 0xde, 0x82, + 0x88, 0x5f, 0x15, 0x8c, 0xab, 0x0c, 0x26, 0x05, 0xed, 0x91, 0x0e, 0x82, 0x88, 0x41, 0x3b, 0x76, + 0xdf, 0x1e, 0x6e, 0x84, 0x0d, 0xa2, 0x7b, 0xe4, 0x16, 0xca, 0x5c, 0x47, 0x30, 0x55, 0x52, 0x1b, + 0x67, 0xad, 0x12, 0x49, 0x4d, 0x8d, 0xa5, 0x36, 0xf4, 0x01, 0xb9, 0xd3, 0x14, 0x44, 0x73, 0x26, + 0x04, 0x64, 0xce, 0x7a, 0x55, 0x73, 0xbb, 0x66, 0x5f, 0xd4, 0x24, 0x7d, 0x44, 0x76, 0x4c, 0xca, + 0x41, 0xe6, 0x66, 0x5a, 0x3e, 0xd1, 0x30, 0xae, 0x9c, 0x56, 0xdf, 0x1e, 0xb6, 0xc2, 0xed, 0x46, + 0x98, 0x5c, 0xf1, 0xf4, 0x3e, 0xd9, 0x40, 0xc9, 0x61, 0x1a, 0x33, 0xc3, 0x9c, 0x76, 0x35, 0xae, + 0x5b, 0x12, 0x2f, 0x99, 0x61, 0x87, 0x5b, 0x5f, 0xbe, 0xed, 0x59, 0x9f, 0x2f, 0xcf, 0xf7, 0x1b, + 0x8b, 0x83, 0x67, 0xc4, 0x59, 0x8d, 0x13, 0x02, 0x2a, 0x29, 0x10, 0xa8, 0x4b, 0xba, 0x08, 0x1f, + 0x72, 0x10, 0x11, 0x54, 0xc1, 0x5a, 0xe1, 0x35, 0x3e, 0x6c, 0x95, 0x83, 0x06, 0x23, 0xb2, 0xd3, + 0xb4, 0x8d, 0x59, 0x74, 0x02, 0xa6, 0xfc, 0xc6, 0x3f, 0xb7, 0x71, 0xc3, 0xd8, 0xda, 0x4d, 0x63, + 0x83, 0x37, 0x64, 0xeb, 0x79, 0x74, 0x22, 0xe4, 0x59, 0x06, 0x71, 0x02, 0x1c, 0x84, 0xa1, 0x0e, + 0xe9, 0x68, 0xc0, 0x3c, 0x33, 0xce, 0x6e, 0xdf, 0x1e, 0x6e, 0x8e, 0xac, 0xb0, 0xc1, 0xb4, 0x47, + 0xda, 0xa0, 0xb5, 0xd4, 0x4e, 0xaf, 0x9c, 0x32, 0xb2, 0xc2, 0x1a, 0x1e, 0x11, 0xd2, 0xd5, 0x8d, + 0xf9, 0xc7, 0xef, 0xc9, 0xfa, 0x31, 0x26, 0x74, 0x4c, 0x3a, 0x65, 0xb8, 0x49, 0x41, 0x3d, 0xff, + 0xef, 0xff, 0xee, 0xaf, 0xa6, 0x76, 0x1f, 0xfe, 0x5f, 0xbf, 0xda, 0x8a, 0xdb, 0xfe, 0x74, 0x79, + 0xbe, 0x6f, 0x1f, 0xbd, 0xfe, 0xbe, 0xf0, 0xec, 0x8b, 0x85, 0x67, 0xff, 0x5a, 0x78, 0xf6, 0xd7, + 0xa5, 0x67, 0x5d, 0x2c, 0x3d, 0xeb, 0xe7, 0xd2, 0xb3, 0xde, 0x3d, 0x4d, 0x52, 0x33, 0xcf, 0x67, + 0x7e, 0x24, 0x79, 0xa0, 0x65, 0x96, 0x45, 0x73, 0x96, 0x0a, 0x0c, 0x50, 0xb1, 0x33, 0x11, 0x60, + 0xca, 0x99, 0x52, 0x41, 0x11, 0xfc, 0xb9, 0x4d, 0xf3, 0x51, 0x01, 0xce, 0x3a, 0xd5, 0x7d, 0x3d, + 0xf9, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xf7, 0xf4, 0xbb, 0x8d, 0xb5, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -305,8 +305,8 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { - // SendTx defines a rpc handler for MsgSendTx. - SendTx(ctx context.Context, in *MsgSendTx, opts ...grpc.CallOption) (*MsgSendTxResponse, error) + // SendTx defines a rpc handler for MsgSendExampleTx. + SendTx(ctx context.Context, in *MsgSendExampleTx, opts ...grpc.CallOption) (*MsgSendExampleTxResponse, error) } type msgClient struct { @@ -317,8 +317,8 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } -func (c *msgClient) SendTx(ctx context.Context, in *MsgSendTx, opts ...grpc.CallOption) (*MsgSendTxResponse, error) { - out := new(MsgSendTxResponse) +func (c *msgClient) SendTx(ctx context.Context, in *MsgSendExampleTx, opts ...grpc.CallOption) (*MsgSendExampleTxResponse, error) { + out := new(MsgSendExampleTxResponse) err := c.cc.Invoke(ctx, "/ibcmodule.v1.Msg/SendTx", in, out, opts...) if err != nil { return nil, err @@ -328,15 +328,15 @@ func (c *msgClient) SendTx(ctx context.Context, in *MsgSendTx, opts ...grpc.Call // MsgServer is the server API for Msg service. type MsgServer interface { - // SendTx defines a rpc handler for MsgSendTx. - SendTx(context.Context, *MsgSendTx) (*MsgSendTxResponse, error) + // SendTx defines a rpc handler for MsgSendExampleTx. + SendTx(context.Context, *MsgSendExampleTx) (*MsgSendExampleTxResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. type UnimplementedMsgServer struct { } -func (*UnimplementedMsgServer) SendTx(ctx context.Context, req *MsgSendTx) (*MsgSendTxResponse, error) { +func (*UnimplementedMsgServer) SendTx(ctx context.Context, req *MsgSendExampleTx) (*MsgSendExampleTxResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SendTx not implemented") } @@ -345,7 +345,7 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { } func _Msg_SendTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSendTx) + in := new(MsgSendExampleTx) if err := dec(in); err != nil { return nil, err } @@ -357,7 +357,7 @@ func _Msg_SendTx_Handler(srv interface{}, ctx context.Context, dec func(interfac FullMethod: "/ibcmodule.v1.Msg/SendTx", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SendTx(ctx, req.(*MsgSendTx)) + return srv.(MsgServer).SendTx(ctx, req.(*MsgSendExampleTx)) } return interceptor(ctx, in, info, handler) } @@ -375,7 +375,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "ibcmodule/v1/tx.proto", } -func (m *MsgSendTx) Marshal() (dAtA []byte, err error) { +func (m *MsgSendExampleTx) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -385,12 +385,12 @@ func (m *MsgSendTx) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgSendTx) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSendExampleTx) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSendTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSendExampleTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -431,7 +431,7 @@ func (m *MsgSendTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgSendTxResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgSendExampleTxResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -441,12 +441,12 @@ func (m *MsgSendTxResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgSendTxResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSendExampleTxResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSendTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSendExampleTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -573,7 +573,7 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgSendTx) Size() (n int) { +func (m *MsgSendExampleTx) Size() (n int) { if m == nil { return 0 } @@ -601,7 +601,7 @@ func (m *MsgSendTx) Size() (n int) { return n } -func (m *MsgSendTxResponse) Size() (n int) { +func (m *MsgSendExampleTxResponse) Size() (n int) { if m == nil { return 0 } @@ -671,7 +671,7 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgSendTx) Unmarshal(dAtA []byte) error { +func (m *MsgSendExampleTx) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -694,10 +694,10 @@ func (m *MsgSendTx) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSendTx: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSendExampleTx: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSendTx: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSendExampleTx: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -868,7 +868,7 @@ func (m *MsgSendTx) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSendTxResponse) Unmarshal(dAtA []byte) error { +func (m *MsgSendExampleTxResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -891,10 +891,10 @@ func (m *MsgSendTxResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSendTxResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSendExampleTxResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSendTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSendExampleTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/testmodule.sh b/testmodule.sh index 8649f85b..1a1e09c9 100644 --- a/testmodule.sh +++ b/testmodule.sh @@ -26,3 +26,7 @@ ICT_RELAYER_EXEC $API_ADDR "localchain-1" "rly tx connect localchain-1_localchai # 2 open :D CHANNELS=`ICT_RELAYER_CHANNELS $API_ADDR "localchain-1"` && echo "CHANNELS: $CHANNELS" + + +# perform ibc action + From 4e39a251c0e8e27017cef4fae598000ae65fb2b4 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 11 Sep 2024 20:08:20 -0500 Subject: [PATCH 07/13] working demo --- .../version-v0.50.x/03-demos/02-ibc-module.md | 17 ++-- simapp/api/ibcmodule/v1/tx.pulsar.go | 44 +++++----- simapp/api/ibcmodule/v1/tx_grpc.pb.go | 30 +++---- simapp/proto/ibcmodule/v1/tx.proto | 6 +- simapp/x/ibcmodule/client/tx.go | 2 +- simapp/x/ibcmodule/keeper/msg_server.go | 2 +- simapp/x/ibcmodule/types/keys.go | 2 + simapp/x/ibcmodule/types/tx.pb.go | 88 +++++++++---------- 8 files changed, 97 insertions(+), 94 deletions(-) diff --git a/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md b/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md index 7fc803e8..355fb690 100644 --- a/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md +++ b/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md @@ -83,7 +83,7 @@ Ensure that `app.NameserviceKeeper` comes before the `app.NsibcKeeper` in the `a runtime.NewKVStoreService(keys[nsibctypes.StoreKey]), app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, - scopednsibc, + scopedNsibc, &app.NameserviceKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) @@ -141,24 +141,25 @@ API_ADDR="http://localhost:8080" ICT_POLL_FOR_START $API_ADDR 50 # only 1 channel (ics-20) is auto created on start of the testnet -CHANNELS=`ICT_RELAYER_CHANNELS $API_ADDR "localchain-1"` && echo "CHANNELS: $CHANNELS" +echo `ICT_RELAYER_CHANNELS $API_ADDR "localchain-1"` # We will then create a new channel between localchain-1 and localchain-2 # Using the new nameservice module we just created. ICT_RELAYER_EXEC $API_ADDR "localchain-1" "rly tx connect localchain-1_localchain-2 --src-port=nsibc --dst-port=nsibc --order=unordered --version=nsibc-1" # We can then run the channels command again to verify the new channel was createds -CHANNELS=`ICT_RELAYER_CHANNELS $API_ADDR "localchain-1"` && echo "CHANNELS: $CHANNELS" +echo `ICT_RELAYER_CHANNELS $API_ADDR "localchain-1"` ``` ## Really Interaction ```bash -rolld tx nsibc some-data nsibc channel-1 testname --from acc0 --chain-id localchain-1 +# Set the IBC name from chain 1. +rolld tx nsibc example-tx nsibc channel-1 testname --from acc0 --chain-id localchain-1 -rolld q tx 38330A7C5AD4451C93F5BE9E6FF006E3CDA1EAA187B3CE02C43E783632C99C3B +# View the logs +rolld q tx 669744547BFD84A76D6026FAC911AB0C5695BE46641CD5884CCE19077A5DA20F -# ICT_RELAYER_EXEC $API_ADDR "loca/lchain-1" "rly tx flush" - -ICT_QUERY "http://localhost:8080" "localchain-2" "nameservice print-all" +# Verify chain 2 set the name ( +# rolld keys show -a acc0 from chain-1 ICT_QUERY "http://localhost:8080" "localchain-2" "nameservice resolve roll1hj5fveer5cjtn4wd6wstzugjfdxzl0xpg2te87" ``` diff --git a/simapp/api/ibcmodule/v1/tx.pulsar.go b/simapp/api/ibcmodule/v1/tx.pulsar.go index 88662a53..2cc229c6 100644 --- a/simapp/api/ibcmodule/v1/tx.pulsar.go +++ b/simapp/api/ibcmodule/v1/tx.pulsar.go @@ -2108,7 +2108,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// MsgSendExampleTx defines the payload for Msg/SendTx +// MsgSendExampleTx defines the payload for Msg/SendExampleTx type MsgSendExampleTx struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2362,25 +2362,25 @@ var file_ibcmodule_v1_tx_proto_rawDesc = []byte{ 0x18, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x5e, 0x0a, - 0x03, 0x4d, 0x73, 0x67, 0x12, 0x50, 0x0a, 0x06, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x78, 0x12, 0x1e, - 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x78, 0x1a, 0x26, - 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x78, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xad, 0x01, - 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, - 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x61, 0x77, 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, - 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, - 0x76, 0x31, 0x3b, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x49, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, - 0x56, 0x31, 0xe2, 0x02, 0x18, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, - 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x65, 0x0a, + 0x03, 0x4d, 0x73, 0x67, 0x12, 0x57, 0x0a, 0x0d, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x54, 0x78, 0x12, 0x1e, 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x54, 0x78, 0x1a, 0x26, 0x2e, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, + 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xad, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x62, 0x63, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x72, 0x6f, 0x6c, 0x6c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x61, 0x77, + 0x6e, 0x2f, 0x73, 0x69, 0x6d, 0x61, 0x70, 0x70, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x62, 0x63, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x69, 0x62, 0x63, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x49, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x49, 0x62, + 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x49, 0x62, 0x63, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x49, 0x62, 0x63, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x49, 0x62, 0x63, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2403,8 +2403,8 @@ var file_ibcmodule_v1_tx_proto_goTypes = []interface{}{ (*Acknowledgement)(nil), // 3: ibcmodule.v1.Acknowledgement } var file_ibcmodule_v1_tx_proto_depIdxs = []int32{ - 0, // 0: ibcmodule.v1.Msg.SendTx:input_type -> ibcmodule.v1.MsgSendExampleTx - 1, // 1: ibcmodule.v1.Msg.SendTx:output_type -> ibcmodule.v1.MsgSendExampleTxResponse + 0, // 0: ibcmodule.v1.Msg.SendExampleTx:input_type -> ibcmodule.v1.MsgSendExampleTx + 1, // 1: ibcmodule.v1.Msg.SendExampleTx:output_type -> ibcmodule.v1.MsgSendExampleTxResponse 1, // [1:2] is the sub-list for method output_type 0, // [0:1] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name diff --git a/simapp/api/ibcmodule/v1/tx_grpc.pb.go b/simapp/api/ibcmodule/v1/tx_grpc.pb.go index b1d983ff..4fe1c7bc 100644 --- a/simapp/api/ibcmodule/v1/tx_grpc.pb.go +++ b/simapp/api/ibcmodule/v1/tx_grpc.pb.go @@ -19,15 +19,15 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Msg_SendTx_FullMethodName = "/ibcmodule.v1.Msg/SendTx" + Msg_SendExampleTx_FullMethodName = "/ibcmodule.v1.Msg/SendExampleTx" ) // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type MsgClient interface { - // SendTx defines a rpc handler for MsgSendExampleTx. - SendTx(ctx context.Context, in *MsgSendExampleTx, opts ...grpc.CallOption) (*MsgSendExampleTxResponse, error) + // SendExampleTx defines a rpc handler for MsgSendExampleTx. + SendExampleTx(ctx context.Context, in *MsgSendExampleTx, opts ...grpc.CallOption) (*MsgSendExampleTxResponse, error) } type msgClient struct { @@ -38,9 +38,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { return &msgClient{cc} } -func (c *msgClient) SendTx(ctx context.Context, in *MsgSendExampleTx, opts ...grpc.CallOption) (*MsgSendExampleTxResponse, error) { +func (c *msgClient) SendExampleTx(ctx context.Context, in *MsgSendExampleTx, opts ...grpc.CallOption) (*MsgSendExampleTxResponse, error) { out := new(MsgSendExampleTxResponse) - err := c.cc.Invoke(ctx, Msg_SendTx_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_SendExampleTx_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -51,8 +51,8 @@ func (c *msgClient) SendTx(ctx context.Context, in *MsgSendExampleTx, opts ...gr // All implementations must embed UnimplementedMsgServer // for forward compatibility type MsgServer interface { - // SendTx defines a rpc handler for MsgSendExampleTx. - SendTx(context.Context, *MsgSendExampleTx) (*MsgSendExampleTxResponse, error) + // SendExampleTx defines a rpc handler for MsgSendExampleTx. + SendExampleTx(context.Context, *MsgSendExampleTx) (*MsgSendExampleTxResponse, error) mustEmbedUnimplementedMsgServer() } @@ -60,8 +60,8 @@ type MsgServer interface { type UnimplementedMsgServer struct { } -func (UnimplementedMsgServer) SendTx(context.Context, *MsgSendExampleTx) (*MsgSendExampleTxResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendTx not implemented") +func (UnimplementedMsgServer) SendExampleTx(context.Context, *MsgSendExampleTx) (*MsgSendExampleTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendExampleTx not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} @@ -76,20 +76,20 @@ func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { s.RegisterService(&Msg_ServiceDesc, srv) } -func _Msg_SendTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_SendExampleTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgSendExampleTx) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).SendTx(ctx, in) + return srv.(MsgServer).SendExampleTx(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Msg_SendTx_FullMethodName, + FullMethod: Msg_SendExampleTx_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SendTx(ctx, req.(*MsgSendExampleTx)) + return srv.(MsgServer).SendExampleTx(ctx, req.(*MsgSendExampleTx)) } return interceptor(ctx, in, info, handler) } @@ -102,8 +102,8 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "SendTx", - Handler: _Msg_SendTx_Handler, + MethodName: "SendExampleTx", + Handler: _Msg_SendExampleTx_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/simapp/proto/ibcmodule/v1/tx.proto b/simapp/proto/ibcmodule/v1/tx.proto index 688fb390..99ebf5e7 100644 --- a/simapp/proto/ibcmodule/v1/tx.proto +++ b/simapp/proto/ibcmodule/v1/tx.proto @@ -11,11 +11,11 @@ import "cosmos/msg/v1/msg.proto"; service Msg { option (cosmos.msg.v1.service) = true; - // SendTx defines a rpc handler for MsgSendExampleTx. - rpc SendTx(MsgSendExampleTx) returns (MsgSendExampleTxResponse); + // SendExampleTx defines a rpc handler for MsgSendExampleTx. + rpc SendExampleTx(MsgSendExampleTx) returns (MsgSendExampleTxResponse); } -// MsgSendExampleTx defines the payload for Msg/SendTx +// MsgSendExampleTx defines the payload for Msg/SendExampleTx message MsgSendExampleTx { option (cosmos.msg.v1.signer) = "sender"; diff --git a/simapp/x/ibcmodule/client/tx.go b/simapp/x/ibcmodule/client/tx.go index 6f45fbd6..ad880733 100644 --- a/simapp/x/ibcmodule/client/tx.go +++ b/simapp/x/ibcmodule/client/tx.go @@ -37,7 +37,7 @@ var defaultTimeout = uint64((time.Duration(10) * time.Minute).Nanoseconds()) // NewSomeDataTxCmd func NewSomeDataTxCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "some-data [src-port] [src-channel] [data]", + Use: "example-tx [src-port] [src-channel] [data]", Short: "Send a packet for some data", Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/simapp/x/ibcmodule/keeper/msg_server.go b/simapp/x/ibcmodule/keeper/msg_server.go index 7501d43a..6d0454da 100644 --- a/simapp/x/ibcmodule/keeper/msg_server.go +++ b/simapp/x/ibcmodule/keeper/msg_server.go @@ -22,7 +22,7 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { } // SendTx implements types.MsgServer. -func (ms msgServer) SendTx(ctx context.Context, msg *types.MsgSendExampleTx) (*types.MsgSendExampleTxResponse, error) { +func (ms msgServer) SendExampleTx(ctx context.Context, msg *types.MsgSendExampleTx) (*types.MsgSendExampleTxResponse, error) { sequence, err := ms.sendPacket( ctx, msg.SourcePort, msg.SourceChannel, msg.Sender, msg.SomeData, msg.TimeoutTimestamp) if err != nil { diff --git a/simapp/x/ibcmodule/types/keys.go b/simapp/x/ibcmodule/types/keys.go index 6e1cdf7a..6094414a 100644 --- a/simapp/x/ibcmodule/types/keys.go +++ b/simapp/x/ibcmodule/types/keys.go @@ -10,5 +10,7 @@ const ( // Version defines the current version the IBC module supports Version = ModuleName + "-1" + StoreKey = ModuleName + EventTypePacket = "example_data_packet" ) diff --git a/simapp/x/ibcmodule/types/tx.pb.go b/simapp/x/ibcmodule/types/tx.pb.go index 1f5ad10c..4d4caae4 100644 --- a/simapp/x/ibcmodule/types/tx.pb.go +++ b/simapp/x/ibcmodule/types/tx.pb.go @@ -29,7 +29,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// MsgSendExampleTx defines the payload for Msg/SendTx +// MsgSendExampleTx defines the payload for Msg/SendExampleTx type MsgSendExampleTx struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` SourcePort string `protobuf:"bytes,2,opt,name=source_port,json=sourcePort,proto3" json:"source_port,omitempty"` @@ -262,35 +262,35 @@ func init() { proto.RegisterFile("ibcmodule/v1/tx.proto", fileDescriptor_05cec4d var fileDescriptor_05cec4d6b8fbe27a = []byte{ // 462 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0x3d, 0x6f, 0xd3, 0x50, - 0x14, 0xb5, 0xdb, 0x24, 0x4a, 0x1f, 0x85, 0xb6, 0x4f, 0x34, 0x58, 0x46, 0x72, 0xa3, 0x48, 0xa0, - 0xa8, 0x48, 0xb6, 0x0a, 0x4c, 0x15, 0x0b, 0x05, 0xa4, 0x2c, 0x85, 0xc8, 0x64, 0x62, 0x20, 0x7a, - 0xb1, 0xaf, 0x1c, 0xab, 0x7e, 0x1f, 0xbc, 0xfb, 0xdc, 0x9a, 0x0d, 0x31, 0x31, 0xf2, 0x13, 0xf8, - 0x09, 0xfd, 0x19, 0x2c, 0x48, 0x1d, 0x19, 0x51, 0x32, 0xf4, 0x6f, 0x20, 0x7f, 0xb4, 0xd0, 0x48, - 0x30, 0xd9, 0xe7, 0x9c, 0x7b, 0xaf, 0xcf, 0xb9, 0xbe, 0x64, 0x37, 0x9d, 0x45, 0x5c, 0xc6, 0x79, - 0x06, 0xc1, 0xe9, 0x41, 0x60, 0x0a, 0x5f, 0x69, 0x69, 0x24, 0xdd, 0xbc, 0xa6, 0xfd, 0xd3, 0x03, - 0xf7, 0x6e, 0x22, 0x13, 0x59, 0x09, 0x41, 0xf9, 0x56, 0xd7, 0xb8, 0xf7, 0x22, 0x89, 0x5c, 0x62, - 0xc0, 0x31, 0x29, 0x7b, 0x39, 0x26, 0xb5, 0x30, 0xf8, 0x61, 0x93, 0xed, 0x63, 0x4c, 0xde, 0x82, - 0x88, 0x5f, 0x15, 0x8c, 0xab, 0x0c, 0x26, 0x05, 0xed, 0x91, 0x0e, 0x82, 0x88, 0x41, 0x3b, 0x76, - 0xdf, 0x1e, 0x6e, 0x84, 0x0d, 0xa2, 0x7b, 0xe4, 0x16, 0xca, 0x5c, 0x47, 0x30, 0x55, 0x52, 0x1b, - 0x67, 0xad, 0x12, 0x49, 0x4d, 0x8d, 0xa5, 0x36, 0xf4, 0x01, 0xb9, 0xd3, 0x14, 0x44, 0x73, 0x26, - 0x04, 0x64, 0xce, 0x7a, 0x55, 0x73, 0xbb, 0x66, 0x5f, 0xd4, 0x24, 0x7d, 0x44, 0x76, 0x4c, 0xca, - 0x41, 0xe6, 0x66, 0x5a, 0x3e, 0xd1, 0x30, 0xae, 0x9c, 0x56, 0xdf, 0x1e, 0xb6, 0xc2, 0xed, 0x46, - 0x98, 0x5c, 0xf1, 0xf4, 0x3e, 0xd9, 0x40, 0xc9, 0x61, 0x1a, 0x33, 0xc3, 0x9c, 0x76, 0x35, 0xae, - 0x5b, 0x12, 0x2f, 0x99, 0x61, 0x87, 0x5b, 0x5f, 0xbe, 0xed, 0x59, 0x9f, 0x2f, 0xcf, 0xf7, 0x1b, - 0x8b, 0x83, 0x67, 0xc4, 0x59, 0x8d, 0x13, 0x02, 0x2a, 0x29, 0x10, 0xa8, 0x4b, 0xba, 0x08, 0x1f, - 0x72, 0x10, 0x11, 0x54, 0xc1, 0x5a, 0xe1, 0x35, 0x3e, 0x6c, 0x95, 0x83, 0x06, 0x23, 0xb2, 0xd3, - 0xb4, 0x8d, 0x59, 0x74, 0x02, 0xa6, 0xfc, 0xc6, 0x3f, 0xb7, 0x71, 0xc3, 0xd8, 0xda, 0x4d, 0x63, - 0x83, 0x37, 0x64, 0xeb, 0x79, 0x74, 0x22, 0xe4, 0x59, 0x06, 0x71, 0x02, 0x1c, 0x84, 0xa1, 0x0e, - 0xe9, 0x68, 0xc0, 0x3c, 0x33, 0xce, 0x6e, 0xdf, 0x1e, 0x6e, 0x8e, 0xac, 0xb0, 0xc1, 0xb4, 0x47, - 0xda, 0xa0, 0xb5, 0xd4, 0x4e, 0xaf, 0x9c, 0x32, 0xb2, 0xc2, 0x1a, 0x1e, 0x11, 0xd2, 0xd5, 0x8d, - 0xf9, 0xc7, 0xef, 0xc9, 0xfa, 0x31, 0x26, 0x74, 0x4c, 0x3a, 0x65, 0xb8, 0x49, 0x41, 0x3d, 0xff, - 0xef, 0xff, 0xee, 0xaf, 0xa6, 0x76, 0x1f, 0xfe, 0x5f, 0xbf, 0xda, 0x8a, 0xdb, 0xfe, 0x74, 0x79, - 0xbe, 0x6f, 0x1f, 0xbd, 0xfe, 0xbe, 0xf0, 0xec, 0x8b, 0x85, 0x67, 0xff, 0x5a, 0x78, 0xf6, 0xd7, - 0xa5, 0x67, 0x5d, 0x2c, 0x3d, 0xeb, 0xe7, 0xd2, 0xb3, 0xde, 0x3d, 0x4d, 0x52, 0x33, 0xcf, 0x67, - 0x7e, 0x24, 0x79, 0xa0, 0x65, 0x96, 0x45, 0x73, 0x96, 0x0a, 0x0c, 0x50, 0xb1, 0x33, 0x11, 0x60, - 0xca, 0x99, 0x52, 0x41, 0x11, 0xfc, 0xb9, 0x4d, 0xf3, 0x51, 0x01, 0xce, 0x3a, 0xd5, 0x7d, 0x3d, - 0xf9, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xf7, 0xf4, 0xbb, 0x8d, 0xb5, 0x02, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0xb5, 0xdb, 0x24, 0x4a, 0xef, 0xd7, 0x7e, 0x6d, 0x47, 0x34, 0x58, 0x46, 0x72, 0xa3, 0x48, + 0xa0, 0xa8, 0x48, 0xb6, 0x0a, 0xac, 0x2a, 0x36, 0x14, 0x90, 0xb2, 0x29, 0x54, 0xa6, 0x12, 0x12, + 0x9b, 0x68, 0x62, 0x5f, 0x39, 0x56, 0x3d, 0x33, 0x66, 0xee, 0xb8, 0x0d, 0x3b, 0xc4, 0x8a, 0x25, + 0x8f, 0xc0, 0x23, 0xf4, 0x31, 0xd8, 0x20, 0x75, 0xc9, 0x12, 0x25, 0x8b, 0xbe, 0x06, 0xf2, 0x4f, + 0x0b, 0xa9, 0x04, 0x2b, 0xfb, 0x9c, 0x73, 0xef, 0x9d, 0x73, 0x7f, 0x60, 0x27, 0x9d, 0x44, 0x42, + 0xc5, 0x45, 0x86, 0xc1, 0xd9, 0x7e, 0x60, 0x66, 0x7e, 0xae, 0x95, 0x51, 0x6c, 0xfd, 0x86, 0xf6, + 0xcf, 0xf6, 0xdd, 0x3b, 0x89, 0x4a, 0x54, 0x25, 0x04, 0xe5, 0x5f, 0x1d, 0xe3, 0xde, 0x8d, 0x14, + 0x09, 0x45, 0x81, 0xa0, 0xa4, 0xcc, 0x15, 0x94, 0xd4, 0xc2, 0xe0, 0xbb, 0x0d, 0x5b, 0x47, 0x94, + 0xbc, 0x41, 0x19, 0xbf, 0x9c, 0x71, 0x91, 0x67, 0x78, 0x32, 0x63, 0x3d, 0xe8, 0x10, 0xca, 0x18, + 0xb5, 0x63, 0xf7, 0xed, 0xe1, 0x5a, 0xd8, 0x20, 0xb6, 0x0b, 0xff, 0x91, 0x2a, 0x74, 0x84, 0xe3, + 0x5c, 0x69, 0xe3, 0xac, 0x54, 0x22, 0xd4, 0xd4, 0xb1, 0xd2, 0x86, 0xdd, 0x87, 0xff, 0x9b, 0x80, + 0x68, 0xca, 0xa5, 0xc4, 0xcc, 0x59, 0xad, 0x62, 0x36, 0x6a, 0xf6, 0x79, 0x4d, 0xb2, 0x87, 0xb0, + 0x6d, 0x52, 0x81, 0xaa, 0x30, 0xe3, 0xf2, 0x4b, 0x86, 0x8b, 0xdc, 0x69, 0xf5, 0xed, 0x61, 0x2b, + 0xdc, 0x6a, 0x84, 0x93, 0x6b, 0x9e, 0xdd, 0x83, 0x35, 0x52, 0x02, 0xc7, 0x31, 0x37, 0xdc, 0x69, + 0x57, 0xe5, 0xba, 0x25, 0xf1, 0x82, 0x1b, 0x7e, 0xb0, 0xf9, 0xf9, 0xeb, 0xae, 0xf5, 0xe9, 0xea, + 0x62, 0xaf, 0xb1, 0x38, 0x78, 0x0a, 0xce, 0xed, 0x76, 0x42, 0xa4, 0x5c, 0x49, 0x42, 0xe6, 0x42, + 0x97, 0xf0, 0x7d, 0x81, 0x32, 0xc2, 0xaa, 0xb1, 0x56, 0x78, 0x83, 0x0f, 0x5a, 0x65, 0xa1, 0xc1, + 0x08, 0xb6, 0x9b, 0xb4, 0x63, 0x1e, 0x9d, 0xa2, 0x29, 0xdf, 0xf8, 0xeb, 0x34, 0x96, 0x8c, 0xad, + 0x2c, 0x1b, 0x1b, 0xbc, 0x86, 0xcd, 0x67, 0xd1, 0xa9, 0x54, 0xe7, 0x19, 0xc6, 0x09, 0x0a, 0x94, + 0x86, 0x39, 0xd0, 0xd1, 0x48, 0x45, 0x66, 0x9c, 0x9d, 0xbe, 0x3d, 0x5c, 0x1f, 0x59, 0x61, 0x83, + 0x59, 0x0f, 0xda, 0xa8, 0xb5, 0xd2, 0x4e, 0xaf, 0xac, 0x32, 0xb2, 0xc2, 0x1a, 0x1e, 0x02, 0x74, + 0x75, 0x63, 0xfe, 0x11, 0xc2, 0xea, 0x11, 0x25, 0xec, 0x2d, 0x6c, 0x2c, 0xef, 0xca, 0xf3, 0xff, + 0x5c, 0xbf, 0x7f, 0xbb, 0x79, 0xf7, 0xc1, 0xbf, 0xf5, 0xeb, 0xe1, 0xb8, 0xed, 0x8f, 0x57, 0x17, + 0x7b, 0xf6, 0xe1, 0xab, 0x6f, 0x73, 0xcf, 0xbe, 0x9c, 0x7b, 0xf6, 0xcf, 0xb9, 0x67, 0x7f, 0x59, + 0x78, 0xd6, 0xe5, 0xc2, 0xb3, 0x7e, 0x2c, 0x3c, 0xeb, 0xdd, 0x93, 0x24, 0x35, 0xd3, 0x62, 0xe2, + 0x47, 0x4a, 0x04, 0x5a, 0x65, 0x59, 0x34, 0xe5, 0xa9, 0xa4, 0x80, 0x72, 0x7e, 0x2e, 0x03, 0x4a, + 0x05, 0xcf, 0xf3, 0x60, 0x16, 0xfc, 0x3e, 0x51, 0xf3, 0x21, 0x47, 0x9a, 0x74, 0xaa, 0x33, 0x7b, + 0xfc, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x49, 0xfb, 0xe9, 0xa7, 0xbc, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -305,8 +305,8 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { - // SendTx defines a rpc handler for MsgSendExampleTx. - SendTx(ctx context.Context, in *MsgSendExampleTx, opts ...grpc.CallOption) (*MsgSendExampleTxResponse, error) + // SendExampleTx defines a rpc handler for MsgSendExampleTx. + SendExampleTx(ctx context.Context, in *MsgSendExampleTx, opts ...grpc.CallOption) (*MsgSendExampleTxResponse, error) } type msgClient struct { @@ -317,9 +317,9 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } -func (c *msgClient) SendTx(ctx context.Context, in *MsgSendExampleTx, opts ...grpc.CallOption) (*MsgSendExampleTxResponse, error) { +func (c *msgClient) SendExampleTx(ctx context.Context, in *MsgSendExampleTx, opts ...grpc.CallOption) (*MsgSendExampleTxResponse, error) { out := new(MsgSendExampleTxResponse) - err := c.cc.Invoke(ctx, "/ibcmodule.v1.Msg/SendTx", in, out, opts...) + err := c.cc.Invoke(ctx, "/ibcmodule.v1.Msg/SendExampleTx", in, out, opts...) if err != nil { return nil, err } @@ -328,36 +328,36 @@ func (c *msgClient) SendTx(ctx context.Context, in *MsgSendExampleTx, opts ...gr // MsgServer is the server API for Msg service. type MsgServer interface { - // SendTx defines a rpc handler for MsgSendExampleTx. - SendTx(context.Context, *MsgSendExampleTx) (*MsgSendExampleTxResponse, error) + // SendExampleTx defines a rpc handler for MsgSendExampleTx. + SendExampleTx(context.Context, *MsgSendExampleTx) (*MsgSendExampleTxResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. type UnimplementedMsgServer struct { } -func (*UnimplementedMsgServer) SendTx(ctx context.Context, req *MsgSendExampleTx) (*MsgSendExampleTxResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendTx not implemented") +func (*UnimplementedMsgServer) SendExampleTx(ctx context.Context, req *MsgSendExampleTx) (*MsgSendExampleTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendExampleTx not implemented") } func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } -func _Msg_SendTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_SendExampleTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgSendExampleTx) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).SendTx(ctx, in) + return srv.(MsgServer).SendExampleTx(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ibcmodule.v1.Msg/SendTx", + FullMethod: "/ibcmodule.v1.Msg/SendExampleTx", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SendTx(ctx, req.(*MsgSendExampleTx)) + return srv.(MsgServer).SendExampleTx(ctx, req.(*MsgSendExampleTx)) } return interceptor(ctx, in, info, handler) } @@ -367,8 +367,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "SendTx", - Handler: _Msg_SendTx_Handler, + MethodName: "SendExampleTx", + Handler: _Msg_SendExampleTx_Handler, }, }, Streams: []grpc.StreamDesc{}, From 12d2044ae1e79f4204aedd278e7a4f087398d7b9 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 11 Sep 2024 20:18:28 -0500 Subject: [PATCH 08/13] complete ibc demo --- .../version-v0.50.x/03-demos/02-ibc-module.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md b/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md index 355fb690..092f6f6a 100644 --- a/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md +++ b/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md @@ -5,8 +5,6 @@ sidebar_position: 1 slug: /demo/ibc-module --- - - # IBC Module In this tutorial, we'll build on the nameservice tutorial and add an IBC module to the chain. This will allow us to sent our name on another network. @@ -124,6 +122,9 @@ You could just as easily write the NameMapping in the ibc keeper store as well. # build chain binary make install +# verify the binary works +rolld + # build docker image make local-image @@ -138,7 +139,7 @@ local-ic start self-ibc source <(curl -s https://raw.githubusercontent.com/strangelove-ventures/interchaintest/main/local-interchain/bash/source.bash) API_ADDR="http://localhost:8080" -ICT_POLL_FOR_START $API_ADDR 50 +ICT_POLL_FOR_START $API_ADDR 50 && echo "Testnet started" # only 1 channel (ics-20) is auto created on start of the testnet echo `ICT_RELAYER_CHANNELS $API_ADDR "localchain-1"` @@ -154,7 +155,7 @@ echo `ICT_RELAYER_CHANNELS $API_ADDR "localchain-1"` ## Really Interaction ```bash # Set the IBC name from chain 1. -rolld tx nsibc example-tx nsibc channel-1 testname --from acc0 --chain-id localchain-1 +rolld tx nsibc example-tx nsibc channel-1 testname --from acc0 --chain-id localchain-1 --yes # View the logs rolld q tx 669744547BFD84A76D6026FAC911AB0C5695BE46641CD5884CCE19077A5DA20F From e04e3ec9c58739f75b6acbff07e1ebc8a0f8f4ae Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 11 Sep 2024 20:47:24 -0500 Subject: [PATCH 09/13] test: module generation for --- cmd/spawn/main.go | 4 ++ cmd/spawn/module_test.go | 90 +++++++++++++++++++++++++++++++++++++ cmd/spawn/new_chain_test.go | 57 +---------------------- cmd/spawn/test_helpers.go | 69 ++++++++++++++++++++++++++++ testmodule.sh | 32 ------------- 5 files changed, 164 insertions(+), 88 deletions(-) create mode 100644 cmd/spawn/module_test.go create mode 100644 cmd/spawn/test_helpers.go delete mode 100644 testmodule.sh diff --git a/cmd/spawn/main.go b/cmd/spawn/main.go index b78effc7..5b245707 100644 --- a/cmd/spawn/main.go +++ b/cmd/spawn/main.go @@ -32,6 +32,10 @@ var ( } ) +func NewRootCmd() *cobra.Command { + return rootCmd +} + func main() { outOfDateChecker() diff --git a/cmd/spawn/module_test.go b/cmd/spawn/module_test.go new file mode 100644 index 00000000..59f3eb86 --- /dev/null +++ b/cmd/spawn/module_test.go @@ -0,0 +1,90 @@ +package main_test + +import ( + "bytes" + "fmt" + "os" + "path" + "testing" + + main "github.com/rollchains/spawn/cmd/spawn" + "github.com/rollchains/spawn/spawn" + "github.com/stretchr/testify/require" +) + +func TestModuleGeneration(t *testing.T) { + cwd, err := os.Getwd() + require.NoError(t, err) + + cfg := spawn.NewChainConfig{ + ProjectName: "default", + Bech32Prefix: "cosmos", + HomeDir: ".default", + BinDaemon: main.RandStringBytes(6) + "d", + Denom: "token" + main.RandStringBytes(3), + GithubOrg: main.RandStringBytes(15), + IgnoreGitInit: false, + DisabledModules: []string{"explorer"}, + Logger: main.Logger, + } + + type mc struct { + Name string + Args []string + OutputContains string + } + + mcs := []mc{ + { + Name: "ibcmodule", + Args: []string{"new", "myibc", "--ibc-module"}, + }, + { + Name: "ibcmiddleware", + Args: []string{"new", "myibcmw", "--ibc-middleware"}, + }, + { + Name: "standard", + Args: []string{"new", "standard"}, + }, + } + + for _, c := range mcs { + c := c + t.Run(c.Name, func(t *testing.T) { + name := "spawnmoduleunittest" + c.Name + + cfg.ProjectName = name + cfg.HomeDir = "." + name + fmt.Println("=====\nName", name) + + dirPath := path.Join(cwd, name) + require.NoError(t, os.RemoveAll(name)) + + require.NoError(t, cfg.ValidateAndRun(false), "failed to generate proper chain") + + // move to new repo + require.NoError(t, os.Chdir(dirPath)) + + cmd := main.ModuleCmd() + b := bytes.NewBufferString("") + cmd.SetOut(b) + cmd.SetErr(b) + cmd.SetArgs(c.Args) + cmd.Execute() + // out, err := io.ReadAll(b) + // if err != nil { + // t.Fatal(err) + // } + + // TODO: this is not being read from. Fix. + // require.Contains(t, string(out), c.OutputContains, "output: "+string(out)) + + // validate the go source is good + main.AssertValidGeneration(t, dirPath, nil, nil, cfg) + + require.NoError(t, os.Chdir(cwd)) + require.NoError(t, os.RemoveAll(name)) + }) + } +} diff --git a/cmd/spawn/new_chain_test.go b/cmd/spawn/new_chain_test.go index 457cae07..1421bf70 100644 --- a/cmd/spawn/new_chain_test.go +++ b/cmd/spawn/new_chain_test.go @@ -2,13 +2,8 @@ package main import ( "fmt" - "go/format" - "io/fs" - "log/slog" - "math/rand" "os" "path" - "path/filepath" "strings" "testing" @@ -16,19 +11,10 @@ import ( "github.com/stretchr/testify/require" ) -var Logger = slog.New(slog.NewJSONHandler(os.Stdout, nil)) - func TestDisabledGeneration(t *testing.T) { cwd, err := os.Getwd() require.NoError(t, err) - allButStaking := make([]string, 0, len(spawn.AllFeatures)-1) - for _, f := range spawn.AllFeatures { - if f != spawn.POS { - allButStaking = append(allButStaking, f) - } - } - type disabledCase struct { Name string Disabled []string @@ -46,7 +32,7 @@ func TestDisabledGeneration(t *testing.T) { }, { Name: "everythingbutstaking", - Disabled: allButStaking, + Disabled: AllFeaturesButStaking(), }, { Name: "noibcaddons", @@ -104,44 +90,3 @@ func TestDisabledGeneration(t *testing.T) { }) } } - -const letterBytes = "abcdefghijklmnopqrstuvwxyz" - -func RandStringBytes(n int) string { - b := make([]byte, n) - for i := range b { - b[i] = letterBytes[rand.Intn(len(letterBytes))] - } - return string(b) -} - -func AssertValidGeneration(t *testing.T, dirPath string, dc []string, notContainAny []string, cfg spawn.NewChainConfig) { - fileCount := 0 - err := filepath.WalkDir(dirPath, func(p string, file fs.DirEntry, err error) error { - if err != nil { - return err - } - - fileCount++ - - if filepath.Ext(p) == ".go" { - base := path.Base(p) - - f, err := os.ReadFile(p) - require.NoError(t, err, fmt.Sprintf("can't read %s", base)) - - // ensure no disabled modules are present - for _, text := range notContainAny { - text := text - require.NotContains(t, string(f), text, fmt.Sprintf("disabled module %s found in %s (%s) with config %+v", text, base, p, cfg)) - } - - _, err = format.Source(f) - require.NoError(t, err, fmt.Sprintf("format issue: %v. using disabled: %v", base, dc)) - } - - return nil - }) - require.NoError(t, err, fmt.Sprintf("error walking directory for disabled: %v", dc)) - require.Greater(t, fileCount, 1, fmt.Sprintf("no files found in %s", dirPath)) -} diff --git a/cmd/spawn/test_helpers.go b/cmd/spawn/test_helpers.go new file mode 100644 index 00000000..dd040b57 --- /dev/null +++ b/cmd/spawn/test_helpers.go @@ -0,0 +1,69 @@ +package main + +import ( + "fmt" + "go/format" + "io/fs" + "log/slog" + "math/rand" + "os" + "path" + "path/filepath" + "testing" + + "github.com/rollchains/spawn/spawn" + "github.com/stretchr/testify/require" +) + +const letterBytes = "abcdefghijklmnopqrstuvwxyz" + +var Logger = slog.New(slog.NewJSONHandler(os.Stdout, nil)) + +func RandStringBytes(n int) string { + b := make([]byte, n) + for i := range b { + b[i] = letterBytes[rand.Intn(len(letterBytes))] + } + return string(b) +} + +func AssertValidGeneration(t *testing.T, dirPath string, dc []string, notContainAny []string, cfg spawn.NewChainConfig) { + fileCount := 0 + err := filepath.WalkDir(dirPath, func(p string, file fs.DirEntry, err error) error { + if err != nil { + return err + } + + fileCount++ + + if filepath.Ext(p) == ".go" { + base := path.Base(p) + + f, err := os.ReadFile(p) + require.NoError(t, err, fmt.Sprintf("can't read %s", base)) + + // ensure no disabled modules are present + for _, text := range notContainAny { + text := text + require.NotContains(t, string(f), text, fmt.Sprintf("disabled module %s found in %s (%s) with config %+v", text, base, p, cfg)) + } + + _, err = format.Source(f) + require.NoError(t, err, fmt.Sprintf("format issue: %v. using disabled: %v", base, dc)) + } + + return nil + }) + require.NoError(t, err, fmt.Sprintf("error walking directory for disabled: %v", dc)) + require.Greater(t, fileCount, 1, fmt.Sprintf("no files found in %s", dirPath)) +} + +func AllFeaturesButStaking() []string { + allButStaking := make([]string, 0, len(spawn.AllFeatures)-1) + for _, f := range spawn.AllFeatures { + if f != spawn.POS { + allButStaking = append(allButStaking, f) + } + } + return allButStaking +} diff --git a/testmodule.sh b/testmodule.sh deleted file mode 100644 index 1a1e09c9..00000000 --- a/testmodule.sh +++ /dev/null @@ -1,32 +0,0 @@ -make install -# rm -rf myproject - -make template-staking -cd myproject -spawn module new mynsibc --ibc-module --log-level=debug -make proto-gen - -code . - -# run testnet -make local-image -local-ic start self-ibc - - -# connect via relayer -source <(curl -s https://raw.githubusercontent.com/strangelove-ventures/interchaintest/main/local-interchain/bash/source.bash) -API_ADDR="http://localhost:8080" - -ICT_POLL_FOR_START $API_ADDR 50 - -# only 1 -CHANNELS=`ICT_RELAYER_CHANNELS $API_ADDR "localchain-1"` && echo "CHANNELS: $CHANNELS" - -ICT_RELAYER_EXEC $API_ADDR "localchain-1" "rly tx connect localchain-1_localchain-2 --src-port=mynsibc --dst-port=mynsibc --order=unordered --version=mynsibc-1" - -# 2 open :D -CHANNELS=`ICT_RELAYER_CHANNELS $API_ADDR "localchain-1"` && echo "CHANNELS: $CHANNELS" - - -# perform ibc action - From b76a6e5584d4954a36e67d2fc9f013ce80719cb8 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 11 Sep 2024 20:52:39 -0500 Subject: [PATCH 10/13] simplify module logic --- cmd/spawn/module.go | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/cmd/spawn/module.go b/cmd/spawn/module.go index 2e562aea..3b14cf12 100644 --- a/cmd/spawn/module.go +++ b/cmd/spawn/module.go @@ -35,6 +35,19 @@ func (f features) validate() error { return nil } +func (f features) getModuleType() string { + if f.ibcMiddleware { + return "ibcmiddleware" + } else if f.ibcModule { + return "ibcmodule" + } + + return "example" +} +func (f features) isIBC() bool { + return f.ibcMiddleware || f.ibcModule +} + func normalizeModuleFlags(f *pflag.FlagSet, name string) pflag.NormalizedName { switch name { case "ibcmiddleware", "middleware": @@ -170,12 +183,7 @@ func SetupModuleProtoBase(logger *slog.Logger, extName string, feats *features) goModName := spawn.ReadCurrentGoModuleName(path.Join(cwd, "go.mod")) protoNamespace := convertGoModuleNameToProtoNamespace(goModName) - moduleName := "example" - if feats.ibcMiddleware { - moduleName = "ibcmiddleware" - } else if feats.ibcModule { - moduleName = "ibcmodule" - } + moduleName := feats.getModuleType() logger.Debug("proto namespace", "goModName", goModName, "protoNamespace", protoNamespace, "moduleName", moduleName) @@ -235,13 +243,7 @@ func SetupModuleExtensionFiles(logger *slog.Logger, extName string, feats *featu return err } - moduleName := "example" - if feats.ibcMiddleware { - moduleName = "ibcmiddleware" - } else if feats.ibcModule { - moduleName = "ibcmodule" - } - + moduleName := feats.getModuleType() goModName := spawn.ReadCurrentGoModuleName(path.Join(cwd, "go.mod")) // copy x/example to x/extName @@ -369,11 +371,12 @@ func AddModuleToAppGo(logger *slog.Logger, extName string, feats *features) erro appGoLines = append(appGoLines[:evidenceTextLine+2], append([]string{keeperText}, appGoLines[evidenceTextLine+2:]...)...) + // ibcModule requires some more setup additions for scoped keepers and specific module routing within IBC. if feats.ibcModule { capabilityKeeperSeal := spawn.FindLineWithText(appGoLines, "app.CapabilityKeeper.Seal()") logger.Debug("capabilityKeeperSeal", "extName", extName, "line", evidenceTextLine) - // scopedMynsibc := app.CapabilityKeeper...s + // scopedMynsibc := app.CapabilityKeeper... scopedKeeperText := fmt.Sprintf(` scoped%s := app.CapabilityKeeper.ScopeToModule(%stypes.ModuleName)`, extNameTitle, extName) appGoLines = append(appGoLines[:capabilityKeeperSeal], append([]string{scopedKeeperText}, appGoLines[capabilityKeeperSeal:]...)...) @@ -385,7 +388,6 @@ func AddModuleToAppGo(logger *slog.Logger, extName string, feats *features) erro line := fmt.Sprintf(` %s capabilitykeeper.ScopedKeeper`, scopedKeeper) appGoLines = append(appGoLines[:scopedIBCKeeperKeeper+1], append([]string{line}, appGoLines[scopedIBCKeeperKeeper+1:]...)...) - // find app.ScopedIBCKeeper = scopedIBCKeeper := spawn.FindLineWithText(appGoLines, "app.ScopedIBCKeeper =") logger.Debug("scopedIBCKeeper", "extName", extName, "line", scopedIBCKeeper) @@ -404,12 +406,11 @@ func AddModuleToAppGo(logger *slog.Logger, extName string, feats *features) erro logger.Debug("module manager", "extName", extName, "start", start, "end", end) var newAppModuleText string - if feats.ibcMiddleware || feats.ibcModule { + if feats.isIBC() { newAppModuleText = fmt.Sprintf(` %s.NewAppModule(app.%sKeeper),`+"\n", extName, extNameTitle) } else { newAppModuleText = fmt.Sprintf(` %s.NewAppModule(appCodec, app.%sKeeper),`+"\n", extName, extNameTitle) } - appGoLines = append(appGoLines[:end-1], append([]string{newAppModuleText}, appGoLines[end-1:]...)...) // Set the begin block order of the new module. From 38958c224ad55ef02921da2ea9ae91f12d11f767 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 11 Sep 2024 21:03:34 -0500 Subject: [PATCH 11/13] fixes & typos --- cmd/spawn/module.go | 4 ++-- .../version-v0.50.x/01-setup/02-install-spawn.md | 4 ++++ simapp/x/ibcmodule/README.md | 4 ++-- simapp/x/ibcmodule/client/tx.go | 4 ++-- simapp/x/ibcmodule/keeper/keeper.go | 6 ++---- simapp/x/ibcmodule/keeper/msg_server.go | 2 -- simapp/x/ibcmodule/module.go | 6 +++--- simapp/x/ibcmodule/types/genesis.go | 2 +- spawn/cfg.go | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cmd/spawn/module.go b/cmd/spawn/module.go index 3b14cf12..afab81c2 100644 --- a/cmd/spawn/module.go +++ b/cmd/spawn/module.go @@ -356,9 +356,9 @@ func AddModuleToAppGo(logger *slog.Logger, extName string, feats *features) erro runtime.NewKVStoreService(keys[%stypes.StoreKey]), app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, - %s, + scoped%s, authtypes.NewModuleAddress(govtypes.ModuleName).String(), - )`+"\n", extName, extNameTitle, extName, extName, fmt.Sprintf("scoped%s", extNameTitle)) + )`+"\n", extName, extNameTitle, extName, extName, extNameTitle) } else { keeperText = fmt.Sprintf(` // Create the %s Keeper app.%sKeeper = %skeeper.NewKeeper( diff --git a/docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md b/docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md index d0b8b88f..54af7780 100644 --- a/docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md +++ b/docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md @@ -47,4 +47,8 @@ source ~/.zshrc # Legacy MacOS Go echo 'export PATH=$PATH:$HOME/go/bin' >> ~/.zshrc source ~/.zshrc + +# Sometimes it can be good to also clear your cache +# especially WSL users +go clean -cache ``` diff --git a/simapp/x/ibcmodule/README.md b/simapp/x/ibcmodule/README.md index a40428d7..ebb88e99 100644 --- a/simapp/x/ibcmodule/README.md +++ b/simapp/x/ibcmodule/README.md @@ -1,3 +1,3 @@ -# ibc-middleware-template +# ibc-module-template -Template for an IBC middleware compliant with the [ics-30 spec](https://github.com/cosmos/ibc/tree/a4b29b7cdae6c548eb17187545f167d5d37c23a1/spec/app/ics-030-middleware) \ No newline at end of file +Template for an IBC module compliant with [ICS-26 Spec](https://github.com/cosmos/ibc/blob/main/spec/core/ics-026-routing-module/README.md) diff --git a/simapp/x/ibcmodule/client/tx.go b/simapp/x/ibcmodule/client/tx.go index ad880733..ad741fa1 100644 --- a/simapp/x/ibcmodule/client/tx.go +++ b/simapp/x/ibcmodule/client/tx.go @@ -38,7 +38,7 @@ var defaultTimeout = uint64((time.Duration(10) * time.Minute).Nanoseconds()) func NewSomeDataTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: "example-tx [src-port] [src-channel] [data]", - Short: "Send a packet for some data", + Short: "Send a packet with some data", Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) @@ -72,7 +72,7 @@ func NewSomeDataTxCmd() *cobra.Command { }, } - cmd.Flags().Uint64(flagPacketTimeoutTimestamp, defaultTimeout, "Packet timeout timestamp in nanoseconds from now. Default is 10 minutes. The timeout is disabled when set to 0.") + cmd.Flags().Uint64(flagPacketTimeoutTimestamp, defaultTimeout, "Packet timeout timestamp in nanoseconds from now. Default is 10 minutes.") flags.AddTxFlagsToCmd(cmd) return cmd diff --git a/simapp/x/ibcmodule/keeper/keeper.go b/simapp/x/ibcmodule/keeper/keeper.go index 50cc1f3b..26ffbec9 100644 --- a/simapp/x/ibcmodule/keeper/keeper.go +++ b/simapp/x/ibcmodule/keeper/keeper.go @@ -22,14 +22,12 @@ type Keeper struct { cdc codec.BinaryCodec schema collections.Schema + ics4Wrapper porttypes.ICS4Wrapper PortKeeper *portkeeper.Keeper ScopedKeeper capabilitykeeper.ScopedKeeper ExampleStore collections.Item[uint64] - // used to send the packet, usually the IBC channel keeper. - ics4Wrapper porttypes.ICS4Wrapper - authority string } @@ -38,7 +36,7 @@ func NewKeeper( appCodec codec.BinaryCodec, storeService store.KVStoreService, - ics4Wrapper porttypes.ICS4Wrapper, + ics4Wrapper porttypes.ICS4Wrapper, // usually the IBC ChannelKeeper portKeeper *portkeeper.Keeper, scopedKeeper capabilitykeeper.ScopedKeeper, diff --git a/simapp/x/ibcmodule/keeper/msg_server.go b/simapp/x/ibcmodule/keeper/msg_server.go index 6d0454da..f4adb519 100644 --- a/simapp/x/ibcmodule/keeper/msg_server.go +++ b/simapp/x/ibcmodule/keeper/msg_server.go @@ -37,8 +37,6 @@ func (ms msgServer) SendExampleTx(ctx context.Context, msg *types.MsgSendExample func (ms msgServer) sendPacket(ctx context.Context, sourcePort, sourceChannel, sender, someData string, timeoutTimestamp uint64) (sequence uint64, err error) { sdkCtx := sdk.UnwrapSDKContext(ctx) - // begin createOutgoingPacket logic - // See spec for this logic: https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#packet-relay channelCap, ok := ms.ScopedKeeper.GetCapability(sdkCtx, host.ChannelCapabilityPath(sourcePort, sourceChannel)) if !ok { return 0, fmt.Errorf("module does not own channel capability") diff --git a/simapp/x/ibcmodule/module.go b/simapp/x/ibcmodule/module.go index 1484f6d4..0fe1294f 100644 --- a/simapp/x/ibcmodule/module.go +++ b/simapp/x/ibcmodule/module.go @@ -25,7 +25,7 @@ var ( _ module.AppModuleSimulation = AppModule{} ) -// AppModuleBasic is the middleware AppModuleBasic. +// AppModuleBasic is the module AppModuleBasic. type AppModuleBasic struct{} // Name implements AppModuleBasic interface. @@ -70,7 +70,7 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command { return nil } -// AppModule is the middleware AppModule. +// AppModule is the module AppModule. type AppModule struct { AppModuleBasic keeper keeper.Keeper @@ -84,7 +84,7 @@ func (AppModule) IsAppModule() { func (AppModule) IsOnePerModuleType() { } -// NewAppModule initializes a new AppModule for the middleware. +// NewAppModule initializes a new AppModule for the module. func NewAppModule(keeper keeper.Keeper) *AppModule { return &AppModule{ keeper: keeper, diff --git a/simapp/x/ibcmodule/types/genesis.go b/simapp/x/ibcmodule/types/genesis.go index af985b1a..23e8a118 100644 --- a/simapp/x/ibcmodule/types/genesis.go +++ b/simapp/x/ibcmodule/types/genesis.go @@ -2,7 +2,7 @@ package types import host "github.com/cosmos/ibc-go/v8/modules/core/24-host" -// DefaultGenesisState returns the default middleware GenesisState. +// DefaultGenesisState returns the default module GenesisState. func DefaultGenesisState() *GenesisState { return &GenesisState{ PortId: PortID, diff --git a/spawn/cfg.go b/spawn/cfg.go index e7107368..a2bd9a1b 100644 --- a/spawn/cfg.go +++ b/spawn/cfg.go @@ -342,6 +342,7 @@ func (cfg *NewChainConfig) SetupLocalInterchainJSON() { } // Create a testnet that is thisnetwork -> thisnetwork (great for IBC module testing) + // To complex for now to support (ICS1+Chain & ICS2+Chain2) if !cfg.IsFeatureEnabled(InterchainSecurity) { chainB := localictypes.NewChainBuilder(cfg.ProjectName, "localchain-2", cfg.BinDaemon, cfg.Denom, cfg.Bech32Prefix). SetBlockTime("2000ms"). @@ -349,7 +350,6 @@ func (cfg *NewChainConfig) SetupLocalInterchainJSON() { SetTrustingPeriod("336h"). SetDefaultSDKv47Genesis(2) - // make this is an IBC testnet for POA/POS chains c.SetIBCPaths([]string{}) // clear IBC paths c.SetAppendedIBCPathLink(chainB) From 189d48b01f30aadcdcfad5977680a39f149b16c4 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 11 Sep 2024 21:13:40 -0500 Subject: [PATCH 12/13] fix: docs --- .../02-build-your-chain/03-application-logic.md | 2 -- .../version-v0.50.x/02-build-your-chain/07-conclusion.md | 4 ++-- docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/versioned_docs/version-v0.50.x/02-build-your-chain/03-application-logic.md b/docs/versioned_docs/version-v0.50.x/02-build-your-chain/03-application-logic.md index 1664071c..472ca82e 100644 --- a/docs/versioned_docs/version-v0.50.x/02-build-your-chain/03-application-logic.md +++ b/docs/versioned_docs/version-v0.50.x/02-build-your-chain/03-application-logic.md @@ -14,8 +14,6 @@ You now need to set the data structure in the keeper to store the wallet to name type Keeper struct { ... NameMapping collections.Map[string, string] - - ... } ... diff --git a/docs/versioned_docs/version-v0.50.x/02-build-your-chain/07-conclusion.md b/docs/versioned_docs/version-v0.50.x/02-build-your-chain/07-conclusion.md index 08c6c22d..3d5e7169 100644 --- a/docs/versioned_docs/version-v0.50.x/02-build-your-chain/07-conclusion.md +++ b/docs/versioned_docs/version-v0.50.x/02-build-your-chain/07-conclusion.md @@ -19,10 +19,10 @@ You just crafted your first blockchain, module, and custom logic with Spawn. You * Running a local testnet * Interacting with the network - - # What's Next? Extend the NameService to include IBC support with the [ibc-module](../03-demos/02-ibc-module.md) tutorial. + + diff --git a/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md b/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md index 092f6f6a..91aab7ff 100644 --- a/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md +++ b/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md @@ -135,7 +135,6 @@ local-ic start self-ibc # Connect New IBC Module ```bash -# source <(curl -s https://raw.githubusercontent.com/strangelove-ventures/interchaintest/main/local-interchain/bash/source.bash) API_ADDR="http://localhost:8080" @@ -158,7 +157,7 @@ echo `ICT_RELAYER_CHANNELS $API_ADDR "localchain-1"` rolld tx nsibc example-tx nsibc channel-1 testname --from acc0 --chain-id localchain-1 --yes # View the logs -rolld q tx 669744547BFD84A76D6026FAC911AB0C5695BE46641CD5884CCE19077A5DA20F +rolld q tx 8A2009667022BE432B60158498C2256AEED0E86E9DFF79BD11CC9EA70DEC4A8A # Verify chain 2 set the name ( # rolld keys show -a acc0 from chain-1 From 07c93ded92d1b8b7ad56a70500c8fa8c888f132d Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 11 Sep 2024 21:47:12 -0500 Subject: [PATCH 13/13] update docs :D --- .../02-build-your-chain/05-testnet.md | 5 +- .../version-v0.50.x/03-demos/01-demo.md | 4 +- .../version-v0.50.x/03-demos/02-ibc-module.md | 113 +++++++++++++----- simapp/x/ibcmiddleware/keeper/keeper.go | 2 +- simapp/x/ibcmodule/keeper/keeper.go | 2 +- 5 files changed, 89 insertions(+), 37 deletions(-) diff --git a/docs/versioned_docs/version-v0.50.x/02-build-your-chain/05-testnet.md b/docs/versioned_docs/version-v0.50.x/02-build-your-chain/05-testnet.md index 9742a9c0..73642ba7 100644 --- a/docs/versioned_docs/version-v0.50.x/02-build-your-chain/05-testnet.md +++ b/docs/versioned_docs/version-v0.50.x/02-build-your-chain/05-testnet.md @@ -58,8 +58,9 @@ The expected result should be: } ``` -Your network is now running and you have successfully set and resolved a name! 🎉 - :::note When you are ready to stop the testnet, you can use `ctrl + c` or `killall -9 rolld`. ::: + + +Your network is now running and you have successfully set and resolved a name! 🎉 diff --git a/docs/versioned_docs/version-v0.50.x/03-demos/01-demo.md b/docs/versioned_docs/version-v0.50.x/03-demos/01-demo.md index 0b31176a..d3890301 100644 --- a/docs/versioned_docs/version-v0.50.x/03-demos/01-demo.md +++ b/docs/versioned_docs/version-v0.50.x/03-demos/01-demo.md @@ -1,6 +1,6 @@ --- -title: "IBC Demo" -sidebar_label: "IBC Demo" +title: "IBC Transfers" +sidebar_label: "IBC Transfer Demo" sidebar_position: 1 slug: /demo/ibc --- diff --git a/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md b/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md index 91aab7ff..ba87b067 100644 --- a/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md +++ b/docs/versioned_docs/version-v0.50.x/03-demos/02-ibc-module.md @@ -1,34 +1,41 @@ --- title: "IBC Module" -sidebar_label: "IBC Module" +sidebar_label: "IBC NameService Module" sidebar_position: 1 slug: /demo/ibc-module --- -# IBC Module +# IBC NameService Module -In this tutorial, we'll build on the nameservice tutorial and add an IBC module to the chain. This will allow us to sent our name on another network. +In this tutorial, you will build on the [nameservice tutorial](../02-build-your-chain/01-nameservice.md) to add cross chain functionality. This will allow you to sent a name from another network. ## Prerequisites - [System Setup](../01-setup/01-system-setup.md) - [Install Spawn](../01-setup/02-install-spawn.md) -- [Build Your Name Service Chain](../02-build-your-chain/01-nameservice.md) +- [Build Your Name Service Chain Turotial](../02-build-your-chain/01-nameservice.md) ## Create your chain -You should already have a network called `rollchain` with the nameservice module enabled from the [nameservice tutorial](../02-build-your-chain/01-nameservice.md). If you do not, complete that tutorial now. +You should already have a network, `rollchain`, with the nameservice module from the [nameservice tutorial](../02-build-your-chain/01-nameservice.md). If you do not, complete that tutorial now. + +:::note warning +Make sure you do not have the previous testnet still running by stopping it with: `killall -9 rolld` +::: ## Scaffold the IBC Module ```bash -# if not already in the rollchain directory +# if you are not already in the chain directory: cd rollchain -# scaffolds your new nameService IBC module +# scaffold the base IBC module for The +# cross chain name service spawn module new nsibc --ibc-module ``` -## Add reference to the previous Name Service keeper +## Import the other NameService Module + +You now reference the nameservice module you built within this new IBC module. This will allow you to save the name mapping on the name service, making it available for both IBC and native chain interactions. ```go title="x/nsibc/keeper/keeper.go" import ( @@ -36,16 +43,21 @@ import ( nameservicekeeper "github.com/rollchains/rollchain/x/nameservice/keeper" ) -// Keeper defines the module keeper. type Keeper struct { ... NameServiceKeeper *nameservicekeeper.Keeper } ``` -![View](https://github.com/user-attachments/assets/4dd3e50d-1528-4ae4-91a2-a27612bf69d7) + +
+ Keeper Setup Image + + ![View](https://github.com/user-attachments/assets/4dd3e50d-1528-4ae4-91a2-a27612bf69d7) +
+ ```go title="x/nsibc/keeper/keeper.go" -// NewKeeper creates a new swap Keeper instance. +// NewKeeper creates a new Keeper instance. func NewKeeper( ... nsk *nameservicekeeper.Keeper, @@ -57,11 +69,17 @@ func NewKeeper( NameServiceKeeper: nsk, } ``` -![View](https://github.com/user-attachments/assets/7639e468-a354-468d-8368-6bedd3c142a7) +
+ NewKeeper Image + + ![View](https://github.com/user-attachments/assets/7639e468-a354-468d-8368-6bedd3c142a7) +
-## Update it in the application +## Provide NameService to the IBC Module -Ensure that `app.NameserviceKeeper` comes before the `app.NsibcKeeper` in the `app/app.go` file. Then fix the `nsibckeeper.NewKeeper` function to use the nameservice keeper logic. +You must now give the IBC module access to nameservice keeper. It needs this reference so that the logic and connections can be shared. This is done in the `app/app.go` file. Find where the EvidenceKeeper line is, and overwrite the current lines with the following. + +This moves the `NameserviceKeeper` above the IBC keeper (since you need to set that first so you can use it), and adds the `&app.NameserviceKeeper,` to the IBC Name Service keeper. ```go title="app/app.go" // If evidence needs to be handled for the app, set routes in router here and seal @@ -86,11 +104,18 @@ Ensure that `app.NameserviceKeeper` comes before the `app.NsibcKeeper` in the `a authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) ``` -![View](https://github.com/user-attachments/assets/af456634-d7b7-475f-b468-7c14411803da) -## Use NameService Logic +
+ Application NameService Reference Image + + ![View](https://github.com/user-attachments/assets/af456634-d7b7-475f-b468-7c14411803da) +
+ -The `OnRecvPacket` method in this file has a placeholder for where your logic should run. Find the `OnRecvPacket` in the ibc_module.go file, then find where the `handleOnRecvLogic` method resides + +## Set Name on IBC Packet + +Now that the IBC module has access to the nameservice, you can add the logic to set a name received from another chain (called the counterparty). To implement, the `OnRecvPacket` method has a placeholder for where the logic should run called `handleOnRecvLogic`. Find the `OnRecvPacket` in the ibc_module.go file, then find where the `handleOnRecvLogic` method resides. ```go title="x/nsibc/ibc_module.go" // Find this method in the file @@ -99,9 +124,16 @@ func (im ExampleIBCModule) handleOnRecvLogic(ctx context.Context, data types.Exa return nil } ``` -![View](https://github.com/user-attachments/assets/011cb6cb-6664-47b9-a09e-fe1b62862987) -Once found, remove the lines within it and replace it with the following. +
+ handleOnRecvLogic location + + ![View](https://github.com/user-attachments/assets/011cb6cb-6664-47b9-a09e-fe1b62862987) +
+ + + +Once found, remove the lines within and replace with the following return. ```go title="x/nsibc/ibc_module.go" func (im ExampleIBCModule) handleOnRecvLogic(ctx context.Context, data types.ExamplePacketData) error { @@ -109,14 +141,14 @@ func (im ExampleIBCModule) handleOnRecvLogic(ctx context.Context, data types.Exa } ``` -This will set the name mapping, from the sender to some data (the name) in the original nameservice module. +This sets the name mapping from the sender to some data (the name) in the original nameservice module. -::note +:::note This is for example to show cross module interaction / extension with IBC. You could just as easily write the NameMapping in the ibc keeper store as well. ::: -## Running testnet +## Start Testnet ```bash # build chain binary @@ -128,38 +160,57 @@ rolld # build docker image make local-image -# run testnet between itself +# run testnet between itself and an IBC relayer +# this will take a minute local-ic start self-ibc ``` -# Connect New IBC Module +## Import Testnet Helpers + +Pasting the following lines in your terminal will import helper functions to interact with the testnet. +The source is publicly available on GitHub to review. ```bash +# Import the testnet interaction helper functions +# for local-interchain source <(curl -s https://raw.githubusercontent.com/strangelove-ventures/interchaintest/main/local-interchain/bash/source.bash) API_ADDR="http://localhost:8080" +# Waits for the testnet to start ICT_POLL_FOR_START $API_ADDR 50 && echo "Testnet started" +``` -# only 1 channel (ics-20) is auto created on start of the testnet -echo `ICT_RELAYER_CHANNELS $API_ADDR "localchain-1"` +## Connect Your IBC Modules -# We will then create a new channel between localchain-1 and localchain-2 -# Using the new nameservice module we just created. +You are ready to connect the two chains with your IBC module protocol. The [cosmos/relayer](https://github.com/cosmos/relayer) is already running between the 2 networks now. You will just send a command to connect the new logic. + +:::note +A Channel is a connection between two chains, like a highway. A port is a specific protocol (or logic) that can connect with itself on another chain. +For example; transfer to transfer, nsibc to nsibc, but transfer to nsibc can not be done. The version is just extra information (metadata) about the connection. + +These values are found in the keys.go file as the module name. By default version is just the module name + "-1". +::: + + +```bash +# This will take a minute. ICT_RELAYER_EXEC $API_ADDR "localchain-1" "rly tx connect localchain-1_localchain-2 --src-port=nsibc --dst-port=nsibc --order=unordered --version=nsibc-1" -# We can then run the channels command again to verify the new channel was createds +# Running the channels command now shows 2 channels, one for `transfer` +# and 1 for `nsibc`, marked as channel-1. echo `ICT_RELAYER_CHANNELS $API_ADDR "localchain-1"` ``` -## Really Interaction +## Submit Name Service Name Over IBC ```bash # Set the IBC name from chain 1. +# view this command in x/nsibc/client/tx.go rolld tx nsibc example-tx nsibc channel-1 testname --from acc0 --chain-id localchain-1 --yes # View the logs rolld q tx 8A2009667022BE432B60158498C2256AEED0E86E9DFF79BD11CC9EA70DEC4A8A # Verify chain 2 set the name ( -# rolld keys show -a acc0 from chain-1 +# `rolld keys show -a acc0` from chain-1 ICT_QUERY "http://localhost:8080" "localchain-2" "nameservice resolve roll1hj5fveer5cjtn4wd6wstzugjfdxzl0xpg2te87" ``` diff --git a/simapp/x/ibcmiddleware/keeper/keeper.go b/simapp/x/ibcmiddleware/keeper/keeper.go index b9bae4bb..69e78b5f 100644 --- a/simapp/x/ibcmiddleware/keeper/keeper.go +++ b/simapp/x/ibcmiddleware/keeper/keeper.go @@ -23,7 +23,7 @@ type Keeper struct { ics4Wrapper porttypes.ICS4Wrapper } -// NewKeeper creates a new swap Keeper instance. +// NewKeeper creates a new Keeper instance. func NewKeeper( cdc codec.BinaryCodec, msgServiceRouter *baseapp.MsgServiceRouter, diff --git a/simapp/x/ibcmodule/keeper/keeper.go b/simapp/x/ibcmodule/keeper/keeper.go index 26ffbec9..01a8802d 100644 --- a/simapp/x/ibcmodule/keeper/keeper.go +++ b/simapp/x/ibcmodule/keeper/keeper.go @@ -31,7 +31,7 @@ type Keeper struct { authority string } -// NewKeeper creates a new swap Keeper instance. +// NewKeeper creates a new Keeper instance. func NewKeeper( appCodec codec.BinaryCodec, storeService store.KVStoreService,