From e5047cdcc1a04c4f0e9b8ec73b6c4bfc325b58a8 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Mon, 22 Jul 2024 17:45:13 +0800 Subject: [PATCH 1/8] Problem: ibc 8.3.x is not used --- app/app.go | 24 ++---------------------- app/upgrades.go | 8 +++++++- go.mod | 2 +- go.sum | 4 ++-- gomod2nix.toml | 4 ++-- integration_tests/test_upgrade.py | 6 ++++++ 6 files changed, 20 insertions(+), 28 deletions(-) diff --git a/app/app.go b/app/app.go index 1f61e4104..d42337b9a 100644 --- a/app/app.go +++ b/app/app.go @@ -138,9 +138,6 @@ import ( "github.com/crypto-org-chain/chain-main/v4/x/chainmain" chainmainkeeper "github.com/crypto-org-chain/chain-main/v4/x/chainmain/keeper" chainmaintypes "github.com/crypto-org-chain/chain-main/v4/x/chainmain/types" - icaauthmodule "github.com/crypto-org-chain/chain-main/v4/x/icaauth" - icaauthmodulekeeper "github.com/crypto-org-chain/chain-main/v4/x/icaauth/keeper" - icaauthmoduletypes "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" "github.com/crypto-org-chain/chain-main/v4/x/nft" nfttransfer "github.com/crypto-org-chain/chain-main/v4/x/nft-transfer" nfttransferkeeper "github.com/crypto-org-chain/chain-main/v4/x/nft-transfer/keeper" @@ -234,7 +231,6 @@ type ChainApp struct { IBCFeeKeeper ibcfeekeeper.Keeper ICAControllerKeeper icacontrollerkeeper.Keeper ICAHostKeeper icahostkeeper.Keeper - ICAAuthKeeper icaauthmodulekeeper.Keeper AuthzKeeper authzkeeper.Keeper EvidenceKeeper evidencekeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper @@ -253,7 +249,6 @@ type ChainApp struct { ScopedIBCFeeKeeper capabilitykeeper.ScopedKeeper ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper ScopedICAHostKeeper capabilitykeeper.ScopedKeeper - ScopedICAAuthKeeper capabilitykeeper.ScopedKeeper // the module manager ModuleManager *module.Manager @@ -345,7 +340,6 @@ func New( scopedNFTTransferKeeper := app.CapabilityKeeper.ScopeToModule(nfttransfertypes.ModuleName) scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName) scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) - scopedICAAuthKeeper := app.CapabilityKeeper.ScopeToModule(icaauthmoduletypes.ModuleName) app.CapabilityKeeper.Seal() // add keepers @@ -519,17 +513,11 @@ func New( app.AccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(), authAddr, ) + app.ICAHostKeeper.WithQueryRouter(app.GRPCQueryRouter()) icaModule := ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper) - app.ICAAuthKeeper = *icaauthmodulekeeper.NewKeeper(appCodec, keys[icaauthmoduletypes.StoreKey], - keys[icaauthmoduletypes.MemStoreKey], app.GetSubspace(icaauthmoduletypes.ModuleName), app.ICAControllerKeeper, - scopedICAAuthKeeper) - - icaAuthModule := icaauthmodule.NewAppModule(appCodec, app.ICAAuthKeeper) - var icaControllerStack porttypes.IBCModule - icaControllerStack = icaauthmodule.NewIBCModule(app.ICAAuthKeeper) - icaControllerStack = icacontroller.NewIBCMiddleware(icaControllerStack, app.ICAControllerKeeper) + icaControllerStack = icacontroller.NewIBCMiddleware(nil, app.ICAControllerKeeper) icaControllerStack = ibcfee.NewIBCMiddleware(icaControllerStack, app.IBCFeeKeeper) var icaHostStack porttypes.IBCModule @@ -542,7 +530,6 @@ func New( ibcRouter.AddRoute(icahosttypes.SubModuleName, icaHostStack) ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferStack) ibcRouter.AddRoute(nfttransfertypes.ModuleName, nftTransferStack) - ibcRouter.AddRoute(icaauthmoduletypes.ModuleName, icaControllerStack) app.IBCKeeper.SetRouter(ibcRouter) // create evidence keeper with router @@ -593,7 +580,6 @@ func New( nfttransfer.NewAppModule(app.NFTTransferKeeper), feeModule, icaModule, - icaAuthModule, chainmain.NewAppModule(app.chainmainKeeper), supply.NewAppModule(app.SupplyKeeper), nft.NewAppModule(appCodec, app.NFTKeeper, app.AccountKeeper, app.BankKeeper), @@ -640,7 +626,6 @@ func New( paramstypes.ModuleName, vestingtypes.ModuleName, icatypes.ModuleName, - icaauthmoduletypes.ModuleName, ibcfeetypes.ModuleName, chainmaintypes.ModuleName, nfttypes.ModuleName, @@ -668,7 +653,6 @@ func New( upgradetypes.ModuleName, vestingtypes.ModuleName, icatypes.ModuleName, - icaauthmoduletypes.ModuleName, ibcfeetypes.ModuleName, chainmaintypes.ModuleName, nfttypes.ModuleName, @@ -699,7 +683,6 @@ func New( group.ModuleName, ibctransfertypes.ModuleName, icatypes.ModuleName, - icaauthmoduletypes.ModuleName, ibcfeetypes.ModuleName, chainmaintypes.ModuleName, supplytypes.ModuleName, @@ -808,7 +791,6 @@ func New( app.ScopedTransferKeeper = scopedTransferKeeper app.ScopedICAControllerKeeper = scopedICAControllerKeeper app.ScopedICAHostKeeper = scopedICAHostKeeper - app.ScopedICAAuthKeeper = scopedICAAuthKeeper return app } @@ -1044,7 +1026,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(ibctransfertypes.ModuleName).WithKeyTable(ibctransfertypes.ParamKeyTable()) paramsKeeper.Subspace(icacontrollertypes.SubModuleName).WithKeyTable(icacontrollertypes.ParamKeyTable()) paramsKeeper.Subspace(icahosttypes.SubModuleName).WithKeyTable(icahosttypes.ParamKeyTable()) - paramsKeeper.Subspace(icaauthmoduletypes.ModuleName) return paramsKeeper } @@ -1076,7 +1057,6 @@ func StoreKeys() ( nfttransfertypes.StoreKey, group.StoreKey, ibcfeetypes.StoreKey, - icaauthmoduletypes.StoreKey, chainmaintypes.StoreKey, supplytypes.StoreKey, nfttypes.StoreKey, diff --git a/app/upgrades.go b/app/upgrades.go index 8e0c84c15..c712c6a6d 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/module" clientkeeper "github.com/cosmos/ibc-go/v8/modules/core/02-client/keeper" + icaauthtypes "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" ) func (app *ChainApp) RegisterUpgradeHandlers(cdc codec.BinaryCodec, clientKeeper clientkeeper.Keeper) { @@ -22,7 +23,12 @@ func (app *ChainApp) RegisterUpgradeHandlers(cdc codec.BinaryCodec, clientKeeper panic(fmt.Sprintf("failed to read upgrade info from disk %s", err)) } if upgradeInfo.Name == planName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + storeUpgrades := storetypes.StoreUpgrades{ + Deleted: []string{ + icaauthtypes.StoreKey, + }, + } // configure store loader that checks if version == upgradeHeight and applies store upgrades - app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storetypes.StoreUpgrades{})) + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) } } diff --git a/go.mod b/go.mod index e900cd8d7..42d51a5bb 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/cosmos/cosmos-sdk v0.50.8 github.com/cosmos/gogoproto v1.5.0 github.com/cosmos/ibc-go/modules/capability v1.0.0 - github.com/cosmos/ibc-go/v8 v8.2.1 + github.com/cosmos/ibc-go/v8 v8.3.2 github.com/cosmos/rosetta v0.50.3-1 github.com/crypto-org-chain/cronos/store v0.0.5-0.20240716081818-7f581a697f6d github.com/crypto-org-chain/cronos/versiondb v0.0.0-20240716081818-7f581a697f6d diff --git a/go.sum b/go.sum index ddababcd5..cb33c815d 100644 --- a/go.sum +++ b/go.sum @@ -429,8 +429,8 @@ github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= -github.com/cosmos/ibc-go/v8 v8.2.1 h1:MTsnZZjxvGD4Fv5pYyx5UkELafSX0rlPt6IfsE2BpTQ= -github.com/cosmos/ibc-go/v8 v8.2.1/go.mod h1:wj3qx75iC/XNnsMqbPDCIGs0G6Y3E/lo3bdqCyoCy+8= +github.com/cosmos/ibc-go/v8 v8.3.2 h1:8X1oHHKt2Bh9hcExWS89rntLaCKZp2EjFTUSxKlPhGI= +github.com/cosmos/ibc-go/v8 v8.3.2/go.mod h1:WVVIsG39jGrF9Cjggjci6LzySyWGloz194sjTxiGNIE= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= diff --git a/gomod2nix.toml b/gomod2nix.toml index 201dda2b2..5aff1af66 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -170,8 +170,8 @@ schema = 3 version = "v1.0.0" hash = "sha256-xOeHJWUj6fTc2EUGiE4dgfY2WkvrqTg/FWewoUvQcvg=" [mod."github.com/cosmos/ibc-go/v8"] - version = "v8.2.1" - hash = "sha256-FYMkZG3dYTXkqoSSyJSSe5NDd9K+3KlMWKfQKahXz3s=" + version = "v8.3.2" + hash = "sha256-uqt1GlZ1sQ7k5b3vGiRxawGp53yeAv0RjOotOIY7Z0E=" [mod."github.com/cosmos/ics23/go"] version = "v0.10.0" hash = "sha256-KYEv727BO/ht63JO02xiKFGFAddg41Ve9l2vSSZZBq0=" diff --git a/integration_tests/test_upgrade.py b/integration_tests/test_upgrade.py index fcc4d15fe..81bdd029f 100644 --- a/integration_tests/test_upgrade.py +++ b/integration_tests/test_upgrade.py @@ -418,6 +418,12 @@ def assert_commission(adr, expected): cluster.migrate_keystore(i=i) upgrade(cluster, "v4.3.0", target_height, propose_legacy=True) + target_height = cluster.block_height() + 15 + upgrade(cluster, "v5.0", target_height, propose_legacy=True) + cli = cluster.cosmos_cli() + with pytest.raises(AssertionError): + cli.query_params("icaauth") + def test_cancel_upgrade(cluster): """ From 7653c62ae494c42f5260b2ea2079e4c101e8df88 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 24 Jul 2024 09:26:32 +0800 Subject: [PATCH 2/8] fix upgrade --- integration_tests/cosmoscli.py | 3 ++- integration_tests/test_upgrade.py | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/integration_tests/cosmoscli.py b/integration_tests/cosmoscli.py index 6d3e3ca9e..c7bb5fa59 100644 --- a/integration_tests/cosmoscli.py +++ b/integration_tests/cosmoscli.py @@ -31,6 +31,7 @@ def gov_propose_legacy( event_query_tx=True, **kwargs, ): + mode = kwargs.get("broadcast_mode") if kind == "software-upgrade": rsp = json.loads( self.raw( @@ -57,7 +58,7 @@ def gov_propose_legacy( **kwargs, ) ) - if rsp["code"] == 0 and event_query_tx: + if rsp["code"] == 0 and event_query_tx and mode == "sync": rsp = self.event_query_tx_for(rsp["txhash"]) return rsp elif kind == "cancel-software-upgrade": diff --git a/integration_tests/test_upgrade.py b/integration_tests/test_upgrade.py index 81bdd029f..5f4c543d9 100644 --- a/integration_tests/test_upgrade.py +++ b/integration_tests/test_upgrade.py @@ -158,8 +158,14 @@ def test_cosmovisor(cosmovisor_cluster): wait_for_block(cluster, target_height + 2, 480) -def upgrade(cluster, plan_name, target_height, propose_legacy=True): - print("upgrade height", target_height) +def upgrade( + cluster, + plan_name, + target_height, + propose_legacy=True, + broadcast_mode="block", +): + print("upgrade height", target_height, plan_name) kind = "software-upgrade" proposal = { "name": plan_name, @@ -168,13 +174,15 @@ def upgrade(cluster, plan_name, target_height, propose_legacy=True): "upgrade-height": target_height, "deposit": "0.1cro", } + event_query_tx = broadcast_mode == "sync" if propose_legacy: rsp = cluster.gov_propose_legacy( "community", kind, proposal, no_validate=True, - event_query_tx=False, + event_query_tx=event_query_tx, + broadcast_mode=broadcast_mode, ) else: rsp = cluster.gov_propose( @@ -198,7 +206,8 @@ def upgrade(cluster, plan_name, target_height, propose_legacy=True): proposal_id, "yes", i=i, - event_query_tx=False, + event_query_tx=event_query_tx, + broadcast_mode=broadcast_mode, ) assert rsp["code"] == 0, rsp["raw_log"] @@ -416,10 +425,10 @@ def assert_commission(adr, expected): # test migrate keystore for i in range(2): cluster.migrate_keystore(i=i) - upgrade(cluster, "v4.3.0", target_height, propose_legacy=True) + upgrade(cluster, "v4.3.0", target_height) target_height = cluster.block_height() + 15 - upgrade(cluster, "v5.0", target_height, propose_legacy=True) + upgrade(cluster, "v5.0", target_height, broadcast_mode="sync") cli = cluster.cosmos_cli() with pytest.raises(AssertionError): cli.query_params("icaauth") From 24ee5dbc2501098264882a44be5b60d1a4d288ce Mon Sep 17 00:00:00 2001 From: mmsqe Date: Tue, 23 Jul 2024 18:47:51 +0800 Subject: [PATCH 3/8] fix ica --- integration_tests/poetry.lock | 8 ++++---- integration_tests/pyproject.toml | 2 +- integration_tests/test_ica.py | 32 ++++++++++++++++---------------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/integration_tests/poetry.lock b/integration_tests/poetry.lock index 7df332fd5..a03b95174 100644 --- a/integration_tests/poetry.lock +++ b/integration_tests/poetry.lock @@ -797,9 +797,9 @@ tomlkit = "^0" [package.source] type = "git" -url = "https://github.com/crypto-com/pystarport.git" -reference = "main" -resolved_reference = "25f13344b6324157d0d0aade5ce856b027a1d442" +url = "https://github.com/mmsqe/pystarport.git" +reference = "align_ica" +resolved_reference = "7b1e404feb2e4067bbf0fef0892e2a9e71572d6a" [[package]] name = "pytest" @@ -1241,4 +1241,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "23211c2502892e3bf2af0cef1d538d95acdca9b467876bd9430e47ea1103c34e" +content-hash = "47be7725f58df009277844461420286ead1e595c0330d53f5e80d289718a0e80" diff --git a/integration_tests/pyproject.toml b/integration_tests/pyproject.toml index 1e7568a28..cca6d1db7 100644 --- a/integration_tests/pyproject.toml +++ b/integration_tests/pyproject.toml @@ -17,7 +17,7 @@ pytest-github-actions-annotate-failures = "^0.2" protobuf = "^4.25" pyyaml = "^6.0.2rc1" python-dateutil = "^2.8" -pystarport = { git = "https://github.com/crypto-com/pystarport.git", branch = "main" } +pystarport = { git = "https://github.com/mmsqe/pystarport.git", branch = "align_ica" } chainlibpy = "^2.2.0" [tool.poetry.dev-dependencies] diff --git a/integration_tests/test_ica.py b/integration_tests/test_ica.py index d8d0f8d86..f8d007ea3 100644 --- a/integration_tests/test_ica.py +++ b/integration_tests/test_ica.py @@ -107,7 +107,7 @@ def test_ica(cluster, tmp_path): # create interchain account v = json.dumps({"fee_version": "ics29-1", "app_version": ""}) - rsp = cli_controller.icaauth_register_account( + rsp = cli_controller.ica_register_account( controller_connection, from_=addr_controller, gas="400000", @@ -122,7 +122,7 @@ def test_ica(cluster, tmp_path): ica_address = cli_controller.ica_query_account( controller_connection, addr_controller, - )["interchainAccountAddress"] + )["address"] # initial balance of interchain account should be zero assert cli_host.balance(ica_address) == 0 @@ -132,25 +132,25 @@ def test_ica(cluster, tmp_path): # check if the funds are received in interchain account assert cli_host.balance(ica_address) == 100000000 - def generated_tx_txt(amt): - # generate a transaction to send to host chain - generated_tx = tmp_path / "generated_tx.txt" - generated_tx_msg = cli_host.transfer( - ica_address, addr_host, f"{amt}cro", generate_only=True - ) - print(json.dumps(generated_tx_msg)) - with open(generated_tx, "w") as opened_file: - json.dump(generated_tx_msg, opened_file) - return generated_tx + def gen_send_msg(sender, receiver, denom, amount): + return { + "@type": "/cosmos.bank.v1beta1.MsgSend", + "from_address": sender, + "to_address": receiver, + "amount": [{"denom": denom, "amount": f"{amount}"}], + } no_timeout = 60 num_txs = len(cli_host.query_all_txs(ica_address)["txs"]) def submit_msgs(amt, timeout_in_s=no_timeout, gas="200000"): + # generate a transaction to send to host chain + data = json.dumps([gen_send_msg(ica_address, addr_host, "basecro", amt)]) + packet = cli_controller.ica_generate_packet_data(data) # submit transaction on host chain on behalf of interchain account - rsp = cli_controller.icaauth_submit_tx( + rsp = cli_controller.ica_submit_tx( controller_connection, - generated_tx_txt(amt), + json.dumps(packet), timeout_duration=f"{timeout_in_s}s", gas=gas, from_=addr_controller, @@ -160,12 +160,12 @@ def submit_msgs(amt, timeout_in_s=no_timeout, gas="200000"): wait_for_check_tx(cli_host, ica_address, num_txs, timeout) return rsp["height"] - submit_msgs(0.5) + submit_msgs(50000000) # check if the transaction is submitted assert len(cli_host.query_all_txs(ica_address)["txs"]) == num_txs + 1 # check if the funds are reduced in interchain account assert cli_host.balance(ica_address) == 50000000 - height = int(submit_msgs(10000000)) + height = int(submit_msgs(1000000000000000)) ev = None type = "ibccallbackerror-ics27_packet" From 5dff44d6ea86e9b85b51a8d766357b7ff4f86bad Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 24 Jul 2024 09:29:23 +0800 Subject: [PATCH 4/8] doc --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 531dc9e12..1825c39c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - [#1044](https://github.com/crypto-org-chain/chain-main/pull/1044) Revert the protobuf package name changes introduced in #1023. - [#1060](https://github.com/crypto-org-chain/chain-main/pull/1060) Upgrade rocksdb to `v9.2.1` and bump versiondb. - [#1061](https://github.com/crypto-org-chain/chain-main/pull/1061) Integrate sdk 0.50. +- [#1068](https://github.com/crypto-org-chain/chain-main/pull/1068) Upgrade ibc-go to `v8.3.2`. *Dec 6, 2023* From f6409efb620e216265c8e40f3e3953dc35c58b33 Mon Sep 17 00:00:00 2001 From: huangyi Date: Wed, 24 Jul 2024 10:17:25 +0800 Subject: [PATCH 5/8] update pystarport --- integration_tests/poetry.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration_tests/poetry.lock b/integration_tests/poetry.lock index a03b95174..cb9237faf 100644 --- a/integration_tests/poetry.lock +++ b/integration_tests/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "attrs" @@ -799,7 +799,7 @@ tomlkit = "^0" type = "git" url = "https://github.com/mmsqe/pystarport.git" reference = "align_ica" -resolved_reference = "7b1e404feb2e4067bbf0fef0892e2a9e71572d6a" +resolved_reference = "4d2ff99c3fbc95ef21803c413b99086a0ae63417" [[package]] name = "pytest" From 21d062a82580983d6cdc8ac14ec37fe0281ecc07 Mon Sep 17 00:00:00 2001 From: huangyi Date: Wed, 24 Jul 2024 10:29:57 +0800 Subject: [PATCH 6/8] remove icaauth --- app/upgrades.go | 5 +- x/icaauth/client/cli/flags.go | 6 - x/icaauth/client/cli/query.go | 26 - .../cli/query_interchain_account_address.go | 47 - x/icaauth/client/cli/query_params.go | 34 - x/icaauth/client/cli/tx.go | 25 - x/icaauth/client/cli/tx_register_account.go | 49 - x/icaauth/client/cli/tx_submit_tx.go | 68 - x/icaauth/genesis.go | 21 - x/icaauth/keeper/grpc_query.go | 7 - .../grpc_query_interchain_account_address.go | 27 - x/icaauth/keeper/grpc_query_params.go | 19 - x/icaauth/keeper/keeper.go | 112 -- x/icaauth/keeper/msg_server.go | 17 - .../keeper/msg_server_register_account.go | 18 - x/icaauth/keeper/msg_server_submit_tx.go | 26 - x/icaauth/keeper/params.go | 26 - x/icaauth/module.go | 149 --- x/icaauth/module_ibc.go | 141 -- x/icaauth/types/codec.go | 29 - x/icaauth/types/genesis.go | 14 - x/icaauth/types/genesis.pb.go | 325 ----- x/icaauth/types/keys.go | 21 - x/icaauth/types/message_register_account.go | 48 - .../types/message_register_account_test.go | 39 - x/icaauth/types/message_submit_tx.go | 103 -- x/icaauth/types/message_submit_tx_test.go | 39 - x/icaauth/types/params.go | 69 - x/icaauth/types/params.pb.go | 328 ----- x/icaauth/types/query.pb.go | 978 -------------- x/icaauth/types/query.pb.gw.go | 276 ---- x/icaauth/types/tx.pb.go | 1160 ----------------- x/icaauth/types/types.go | 13 - 33 files changed, 1 insertion(+), 4264 deletions(-) delete mode 100644 x/icaauth/client/cli/flags.go delete mode 100644 x/icaauth/client/cli/query.go delete mode 100644 x/icaauth/client/cli/query_interchain_account_address.go delete mode 100644 x/icaauth/client/cli/query_params.go delete mode 100644 x/icaauth/client/cli/tx.go delete mode 100644 x/icaauth/client/cli/tx_register_account.go delete mode 100644 x/icaauth/client/cli/tx_submit_tx.go delete mode 100644 x/icaauth/genesis.go delete mode 100644 x/icaauth/keeper/grpc_query.go delete mode 100644 x/icaauth/keeper/grpc_query_interchain_account_address.go delete mode 100644 x/icaauth/keeper/grpc_query_params.go delete mode 100644 x/icaauth/keeper/keeper.go delete mode 100644 x/icaauth/keeper/msg_server.go delete mode 100644 x/icaauth/keeper/msg_server_register_account.go delete mode 100644 x/icaauth/keeper/msg_server_submit_tx.go delete mode 100644 x/icaauth/keeper/params.go delete mode 100644 x/icaauth/module.go delete mode 100644 x/icaauth/module_ibc.go delete mode 100644 x/icaauth/types/codec.go delete mode 100644 x/icaauth/types/genesis.go delete mode 100644 x/icaauth/types/genesis.pb.go delete mode 100644 x/icaauth/types/keys.go delete mode 100644 x/icaauth/types/message_register_account.go delete mode 100644 x/icaauth/types/message_register_account_test.go delete mode 100644 x/icaauth/types/message_submit_tx.go delete mode 100644 x/icaauth/types/message_submit_tx_test.go delete mode 100644 x/icaauth/types/params.go delete mode 100644 x/icaauth/types/params.pb.go delete mode 100644 x/icaauth/types/query.pb.go delete mode 100644 x/icaauth/types/query.pb.gw.go delete mode 100644 x/icaauth/types/tx.pb.go delete mode 100644 x/icaauth/types/types.go diff --git a/app/upgrades.go b/app/upgrades.go index c712c6a6d..824b5c73c 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -9,7 +9,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/module" clientkeeper "github.com/cosmos/ibc-go/v8/modules/core/02-client/keeper" - icaauthtypes "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" ) func (app *ChainApp) RegisterUpgradeHandlers(cdc codec.BinaryCodec, clientKeeper clientkeeper.Keeper) { @@ -24,9 +23,7 @@ func (app *ChainApp) RegisterUpgradeHandlers(cdc codec.BinaryCodec, clientKeeper } if upgradeInfo.Name == planName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { storeUpgrades := storetypes.StoreUpgrades{ - Deleted: []string{ - icaauthtypes.StoreKey, - }, + Deleted: []string{"icaauth"}, } // configure store loader that checks if version == upgradeHeight and applies store upgrades app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) diff --git a/x/icaauth/client/cli/flags.go b/x/icaauth/client/cli/flags.go deleted file mode 100644 index 48a773a1f..000000000 --- a/x/icaauth/client/cli/flags.go +++ /dev/null @@ -1,6 +0,0 @@ -package cli - -const ( - FlagTimeoutDuration = "timeout-duration" - FlagVersion = "version" -) diff --git a/x/icaauth/client/cli/query.go b/x/icaauth/client/cli/query.go deleted file mode 100644 index fbf16d29e..000000000 --- a/x/icaauth/client/cli/query.go +++ /dev/null @@ -1,26 +0,0 @@ -package cli - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" - "github.com/spf13/cobra" -) - -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd(queryRoute string) *cobra.Command { - // Group icaauth queries under a subcommand - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand(CmdQueryParams()) - cmd.AddCommand(CmdInterchainAccountAddress()) - - return cmd -} diff --git a/x/icaauth/client/cli/query_interchain_account_address.go b/x/icaauth/client/cli/query_interchain_account_address.go deleted file mode 100644 index 57fded27d..000000000 --- a/x/icaauth/client/cli/query_interchain_account_address.go +++ /dev/null @@ -1,47 +0,0 @@ -package cli - -import ( - "strconv" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdInterchainAccountAddress() *cobra.Command { - cmd := &cobra.Command{ - Use: "interchain-account-address [connection-id] [owner]", - Short: "Gets interchain account address on host chain", - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) (err error) { - reqConnectionID := args[0] - reqOwner := args[1] - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryInterchainAccountAddressRequest{ - ConnectionId: reqConnectionID, - Owner: reqOwner, - } - - res, err := queryClient.InterchainAccountAddress(cmd.Context(), params) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/icaauth/client/cli/query_params.go b/x/icaauth/client/cli/query_params.go deleted file mode 100644 index 8ada655af..000000000 --- a/x/icaauth/client/cli/query_params.go +++ /dev/null @@ -1,34 +0,0 @@ -package cli - -import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" - "github.com/spf13/cobra" -) - -func CmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "shows the parameters of the module", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/icaauth/client/cli/tx.go b/x/icaauth/client/cli/tx.go deleted file mode 100644 index d2d18d952..000000000 --- a/x/icaauth/client/cli/tx.go +++ /dev/null @@ -1,25 +0,0 @@ -package cli - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" - "github.com/spf13/cobra" -) - -// GetTxCmd returns the transaction commands for this module -func GetTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand(CmdRegisterAccount()) - cmd.AddCommand(CmdSubmitTx()) - - return cmd -} diff --git a/x/icaauth/client/cli/tx_register_account.go b/x/icaauth/client/cli/tx_register_account.go deleted file mode 100644 index c67c9bbef..000000000 --- a/x/icaauth/client/cli/tx_register_account.go +++ /dev/null @@ -1,49 +0,0 @@ -package cli - -import ( - "strconv" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdRegisterAccount() *cobra.Command { - cmd := &cobra.Command{ - Use: "register-account [connection-id]", - Short: "Registers an interchain account", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - argConnectionID := args[0] - - version, err := cmd.Flags().GetString(FlagVersion) - if err != nil { - return err - } - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgRegisterAccount( - clientCtx.GetFromAddress().String(), - argConnectionID, - version, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().String(FlagVersion, "", "version of the ICA channel") - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/icaauth/client/cli/tx_submit_tx.go b/x/icaauth/client/cli/tx_submit_tx.go deleted file mode 100644 index 8cf99dcdc..000000000 --- a/x/icaauth/client/cli/tx_submit_tx.go +++ /dev/null @@ -1,68 +0,0 @@ -package cli - -import ( - "fmt" - "strconv" - "strings" - "time" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/cosmos/cosmos-sdk/version" - authclient "github.com/cosmos/cosmos-sdk/x/auth/client" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" - "github.com/spf13/cobra" -) - -var _ = strconv.Itoa(0) - -func CmdSubmitTx() *cobra.Command { - cmd := &cobra.Command{ - Use: "submit-tx [connection-id] [msg_tx_json_file]", - Short: "Submit a transaction on host chain on behalf of the interchain account", - Long: strings.TrimSpace( - fmt.Sprintf(`Submit a transaction on host chain on behalf of the interchain account: -Example: - $ %s tx %s submit-tx connection-1 tx.json --from mykey - $ %s tx bank send --generate-only > tx.json && %s tx %s submit-tx connection-1 tx.json --from mykey - `, version.AppName, types.ModuleName, version.AppName, version.AppName, types.ModuleName), - ), - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) (err error) { - argConnectionID := args[0] - argMsg := args[1] - - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - theTx, err := authclient.ReadTxFromFile(clientCtx, argMsg) - if err != nil { - return err - } - - timeoutDuration, err := cmd.Flags().GetDuration(FlagTimeoutDuration) - if err != nil { - return err - } - - msg := types.NewMsgSubmitTx( - clientCtx.GetFromAddress().String(), - argConnectionID, - theTx.GetMsgs(), - &timeoutDuration, - ) - if err := msg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - cmd.Flags().Duration(FlagTimeoutDuration, time.Minute*5, "Timeout duration for the transaction (default: 5 minutes)") - - return cmd -} diff --git a/x/icaauth/genesis.go b/x/icaauth/genesis.go deleted file mode 100644 index 41e6d9d83..000000000 --- a/x/icaauth/genesis.go +++ /dev/null @@ -1,21 +0,0 @@ -package icaauth - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/keeper" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" -) - -// InitGenesis initializes the capability module's state from a provided genesis -// state. -func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { - k.SetParams(ctx, genState.Params) -} - -// ExportGenesis returns the capability module's exported genesis. -func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { - genesis := types.DefaultGenesis() - genesis.Params = k.GetParams(ctx) - - return genesis -} diff --git a/x/icaauth/keeper/grpc_query.go b/x/icaauth/keeper/grpc_query.go deleted file mode 100644 index b31d82d39..000000000 --- a/x/icaauth/keeper/grpc_query.go +++ /dev/null @@ -1,7 +0,0 @@ -package keeper - -import ( - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" -) - -var _ types.QueryServer = Keeper{} diff --git a/x/icaauth/keeper/grpc_query_interchain_account_address.go b/x/icaauth/keeper/grpc_query_interchain_account_address.go deleted file mode 100644 index 22afd910c..000000000 --- a/x/icaauth/keeper/grpc_query_interchain_account_address.go +++ /dev/null @@ -1,27 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) InterchainAccountAddress(goCtx context.Context, req *types.QueryInterchainAccountAddressRequest) (*types.QueryInterchainAccountAddressResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - icaAddress, err := k.GetInterchainAccountAddress(ctx, req.ConnectionId, req.Owner) - if err != nil { - return nil, err - } - - return &types.QueryInterchainAccountAddressResponse{ - InterchainAccountAddress: icaAddress, - }, nil -} diff --git a/x/icaauth/keeper/grpc_query_params.go b/x/icaauth/keeper/grpc_query_params.go deleted file mode 100644 index 7a8804c24..000000000 --- a/x/icaauth/keeper/grpc_query_params.go +++ /dev/null @@ -1,19 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil -} diff --git a/x/icaauth/keeper/keeper.go b/x/icaauth/keeper/keeper.go deleted file mode 100644 index ddf24748c..000000000 --- a/x/icaauth/keeper/keeper.go +++ /dev/null @@ -1,112 +0,0 @@ -package keeper - -import ( - "fmt" - "time" - - "cosmossdk.io/log" - storetypes "cosmossdk.io/store/types" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" - capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" - icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper" - icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -type ( - Keeper struct { - cdc codec.Codec - storeKey storetypes.StoreKey - memKey storetypes.StoreKey - paramStore paramtypes.Subspace - - icaControllerKeeper icacontrollerkeeper.Keeper - scopedKeeper capabilitykeeper.ScopedKeeper - } -) - -func NewKeeper( - cdc codec.Codec, - storeKey, - memKey storetypes.StoreKey, - paramStore paramtypes.Subspace, - icaControllerKeeper icacontrollerkeeper.Keeper, - scopedKeeper capabilitykeeper.ScopedKeeper, -) *Keeper { - // set KeyTable if it has not already been set - if !paramStore.HasKeyTable() { - paramStore = paramStore.WithKeyTable(types.ParamKeyTable()) - } - - return &Keeper{ - cdc: cdc, - storeKey: storeKey, - memKey: memKey, - paramStore: paramStore, - - icaControllerKeeper: icaControllerKeeper, - scopedKeeper: scopedKeeper, - } -} - -// DoSubmitTx submits a transaction to the host chain on behalf of interchain account -func (k *Keeper) DoSubmitTx(ctx sdk.Context, connectionID, owner string, msgs []sdk.Msg, timeoutDuration time.Duration) error { - portID, err := icatypes.NewControllerPortID(owner) - if err != nil { - return err - } - - data, err := icatypes.SerializeCosmosTx(k.cdc, msgs, icatypes.EncodingProtobuf) - if err != nil { - return err - } - - packetData := icatypes.InterchainAccountPacketData{ - Type: icatypes.EXECUTE_TX, - Data: data, - } - - timeoutTimestamp := ctx.BlockTime().Add(timeoutDuration).UnixNano() - - _, err = k.icaControllerKeeper.SendTx(ctx, nil, connectionID, portID, packetData, uint64(timeoutTimestamp)) //nolint:staticcheck - if err != nil { - return err - } - - return nil -} - -// RegisterInterchainAccount registers an interchain account with the given `connectionId` and `owner` on the host chain -func (k *Keeper) RegisterInterchainAccount(ctx sdk.Context, connectionID, owner string, version string) error { - return k.icaControllerKeeper.RegisterInterchainAccount(ctx, connectionID, owner, version) -} - -// GetInterchainAccountAddress fetches the interchain account address for given `connectionId` and `owner` -func (k *Keeper) GetInterchainAccountAddress(ctx sdk.Context, connectionID, owner string) (string, error) { - portID, err := icatypes.NewControllerPortID(owner) - if err != nil { - return "", status.Errorf(codes.InvalidArgument, "invalid owner address: %s", err) - } - - icaAddress, found := k.icaControllerKeeper.GetInterchainAccountAddress(ctx, connectionID, portID) - - if !found { - return "", status.Errorf(codes.NotFound, "could not find account") - } - - return icaAddress, nil -} - -// ClaimCapability claims the channel capability passed via the OnOpenChanInit callback -func (k *Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error { - return k.scopedKeeper.ClaimCapability(ctx, cap, name) -} - -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) -} diff --git a/x/icaauth/keeper/msg_server.go b/x/icaauth/keeper/msg_server.go deleted file mode 100644 index cdf95cb02..000000000 --- a/x/icaauth/keeper/msg_server.go +++ /dev/null @@ -1,17 +0,0 @@ -package keeper - -import ( - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" -) - -type msgServer struct { - Keeper -} - -// NewMsgServerImpl returns an implementation of the MsgServer interface -// for the provided Keeper. -func NewMsgServerImpl(keeper Keeper) types.MsgServer { - return &msgServer{Keeper: keeper} -} - -var _ types.MsgServer = msgServer{} diff --git a/x/icaauth/keeper/msg_server_register_account.go b/x/icaauth/keeper/msg_server_register_account.go deleted file mode 100644 index 1eccab760..000000000 --- a/x/icaauth/keeper/msg_server_register_account.go +++ /dev/null @@ -1,18 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" -) - -func (k msgServer) RegisterAccount(goCtx context.Context, msg *types.MsgRegisterAccount) (*types.MsgRegisterAccountResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - if err := k.RegisterInterchainAccount(ctx, msg.ConnectionId, msg.Owner, msg.Version); err != nil { - return nil, err - } - - return &types.MsgRegisterAccountResponse{}, nil -} diff --git a/x/icaauth/keeper/msg_server_submit_tx.go b/x/icaauth/keeper/msg_server_submit_tx.go deleted file mode 100644 index ebd3283cc..000000000 --- a/x/icaauth/keeper/msg_server_submit_tx.go +++ /dev/null @@ -1,26 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" -) - -func (k msgServer) SubmitTx(goCtx context.Context, msg *types.MsgSubmitTx) (*types.MsgSubmitTxResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - msgs, err := msg.GetMessages() - if err != nil { - return nil, err - } - - minTimeoutDuration := k.MinTimeoutDuration(ctx) - - err = k.DoSubmitTx(ctx, msg.ConnectionId, msg.Owner, msgs, msg.CalculateTimeoutDuration(minTimeoutDuration)) - if err != nil { - return nil, err - } - - return &types.MsgSubmitTxResponse{}, nil -} diff --git a/x/icaauth/keeper/params.go b/x/icaauth/keeper/params.go deleted file mode 100644 index 4025d7d71..000000000 --- a/x/icaauth/keeper/params.go +++ /dev/null @@ -1,26 +0,0 @@ -package keeper - -import ( - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" -) - -// GetParams get all parameters as types.Params -func (k Keeper) GetParams(ctx sdk.Context) types.Params { - return types.NewParams( - k.MinTimeoutDuration(ctx), - ) -} - -// SetParams set the params -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramStore.SetParamSet(ctx, ¶ms) -} - -// MinTimeoutDuration returns the MinTimeoutDuration param -func (k Keeper) MinTimeoutDuration(ctx sdk.Context) (res time.Duration) { - k.paramStore.Get(ctx, types.KeyMinTimeoutDuration, &res) - return -} diff --git a/x/icaauth/module.go b/x/icaauth/module.go deleted file mode 100644 index 4ff65465e..000000000 --- a/x/icaauth/module.go +++ /dev/null @@ -1,149 +0,0 @@ -package icaauth - -import ( - "context" - "encoding/json" - "fmt" - - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/client/cli" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/keeper" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/types" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" -) - -var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} -) - -// ---------------------------------------------------------------------------- -// AppModuleBasic -// ---------------------------------------------------------------------------- - -// AppModuleBasic implements the AppModuleBasic interface for the capability module. -type AppModuleBasic struct { - cdc codec.BinaryCodec -} - -func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { - return AppModuleBasic{cdc: cdc} -} - -// Name returns the capability module's name. -func (AppModuleBasic) Name() string { - return types.ModuleName -} - -func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) -} - -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) -} - -// RegisterInterfaces registers the module's interface types -func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { - types.RegisterInterfaces(reg) -} - -// DefaultGenesis returns the capability module's default genesis state. -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(types.DefaultGenesis()) -} - -// ValidateGenesis performs genesis state validation for the capability module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { - var genState types.GenesisState - if err := cdc.UnmarshalJSON(bz, &genState); err != nil { - return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) - } - return genState.Validate() -} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { - panic(err) - } -} - -// GetTxCmd returns the capability module's root tx command. -func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.GetTxCmd() -} - -// GetQueryCmd returns the capability module's root query command. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(types.StoreKey) -} - -// ---------------------------------------------------------------------------- -// AppModule -// ---------------------------------------------------------------------------- - -// AppModule implements the AppModule interface for the capability module. -type AppModule struct { - AppModuleBasic - - keeper keeper.Keeper -} - -func NewAppModule( - cdc codec.Codec, - keeper keeper.Keeper, -) AppModule { - return AppModule{ - AppModuleBasic: NewAppModuleBasic(cdc), - keeper: keeper, - } -} - -// Name returns the capability module's name. -func (am AppModule) Name() string { - return am.AppModuleBasic.Name() -} - -// RegisterServices registers a GRPC query service to respond to the -// module-specific GRPC queries. -func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterQueryServer(cfg.QueryServer(), am.keeper) - types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) -} - -// RegisterInvariants registers the capability module's invariants. -func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} - -// InitGenesis performs the capability module's genesis initialization It returns -// no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { - var genState types.GenesisState - - cdc.MustUnmarshalJSON(gs, &genState) - - InitGenesis(ctx, am.keeper, genState) - - return []abci.ValidatorUpdate{} -} - -// ExportGenesis returns the capability module's exported genesis state as raw JSON bytes. -func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { - genState := ExportGenesis(ctx, am.keeper) - return cdc.MustMarshalJSON(genState) -} - -// ConsensusVersion implements ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 1 } - -// IsAppModule implements the appmodule.AppModule interface. -func (am AppModule) IsAppModule() {} - -// IsOnePerModuleType implements the depinject.OnePerModuleType interface. -func (am AppModule) IsOnePerModuleType() {} diff --git a/x/icaauth/module_ibc.go b/x/icaauth/module_ibc.go deleted file mode 100644 index d1084c044..000000000 --- a/x/icaauth/module_ibc.go +++ /dev/null @@ -1,141 +0,0 @@ -package icaauth - -import ( - "strings" - - newsdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" - icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/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" - "github.com/crypto-org-chain/chain-main/v4/x/icaauth/keeper" -) - -var _ porttypes.IBCModule = IBCModule{} - -// IBCModule implements the ICS26 interface for interchain accounts controller chains -type IBCModule struct { - keeper keeper.Keeper -} - -// NewIBCModule creates a new IBCModule given the keeper -func NewIBCModule(k keeper.Keeper) IBCModule { - return IBCModule{ - keeper: k, - } -} - -// OnChanOpenInit implements the IBCModule interface -func (am IBCModule) OnChanOpenInit( - ctx sdk.Context, - order channeltypes.Order, - connectionHops []string, - portID string, - channelID string, - chanCap *capabilitytypes.Capability, - counterparty channeltypes.Counterparty, - version string, -) (string, error) { - if strings.TrimSpace(version) == "" { - version = icatypes.Version - } - return version, nil -} - -// OnChanOpenTry implements the IBCModule interface -func (am IBCModule) OnChanOpenTry( - ctx sdk.Context, - order channeltypes.Order, - connectionHops []string, - portID, - channelID string, - channelCap *capabilitytypes.Capability, - counterparty channeltypes.Counterparty, - counterpartyVersion string, -) (string, error) { - // https://github.com/cosmos/ibc-go/blob/v3.0.0/docs/apps/interchain-accounts/auth-modules.md#ibcmodule-implementation - return "", newsdkerrors.Wrap(icatypes.ErrInvalidChannelFlow, "channel handshake must be initiated by controller chain") -} - -// OnChanOpenAck implements the IBCModule interface -func (am IBCModule) OnChanOpenAck( - ctx sdk.Context, - portID, - channelID string, - counterpartyChannelID string, - counterpartyVersion string, -) error { - return nil -} - -// OnChanOpenConfirm implements the IBCModule interface -func (am IBCModule) OnChanOpenConfirm( - ctx sdk.Context, - portID, - channelID string, -) error { - // https://github.com/cosmos/ibc-go/blob/v3.0.0/docs/apps/interchain-accounts/auth-modules.md#ibcmodule-implementation - return newsdkerrors.Wrap(icatypes.ErrInvalidChannelFlow, "channel handshake must be initiated by controller chain") -} - -// OnChanCloseInit implements the IBCModule interface -func (am IBCModule) OnChanCloseInit( - ctx sdk.Context, - portID, - channelID string, -) error { - // https://github.com/cosmos/ibc-go/blob/v3.0.0/docs/apps/interchain-accounts/auth-modules.md#ibcmodule-implementation - return newsdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "user cannot close channel") -} - -// OnChanCloseConfirm implements the IBCModule interface -func (am IBCModule) OnChanCloseConfirm( - ctx sdk.Context, - portID, - channelID string, -) error { - return nil -} - -// OnRecvPacket implements the IBCModule interface -func (am IBCModule) OnRecvPacket( - ctx sdk.Context, - packet channeltypes.Packet, - relayer sdk.AccAddress, -) ibcexported.Acknowledgement { - // https://github.com/cosmos/ibc-go/blob/v3.0.0/docs/apps/interchain-accounts/auth-modules.md#ibcmodule-implementation - return channeltypes.NewErrorAcknowledgement(newsdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "cannot receive packet on controller chain")) -} - -// OnAcknowledgementPacket implements the IBCModule interface -func (am IBCModule) OnAcknowledgementPacket( - ctx sdk.Context, - packet channeltypes.Packet, - acknowledgement []byte, - relayer sdk.AccAddress, -) error { - return nil -} - -// OnTimeoutPacket implements the IBCModule interface -func (am IBCModule) OnTimeoutPacket( - ctx sdk.Context, - packet channeltypes.Packet, - relayer sdk.AccAddress, -) error { - return nil -} - -func (am IBCModule) NegotiateAppVersion( - ctx sdk.Context, - order channeltypes.Order, - connectionID string, - portID string, - counterparty channeltypes.Counterparty, - proposedVersion string, -) (version string, err error) { - return proposedVersion, nil -} diff --git a/x/icaauth/types/codec.go b/x/icaauth/types/codec.go deleted file mode 100644 index 46ff2552f..000000000 --- a/x/icaauth/types/codec.go +++ /dev/null @@ -1,29 +0,0 @@ -package types - -import ( - "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/msgservice" -) - -func RegisterCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgRegisterAccount{}, "icaauth/RegisterAccount", nil) - cdc.RegisterConcrete(&MsgSubmitTx{}, "icaauth/SubmitTx", nil) -} - -func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgRegisterAccount{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgSubmitTx{}, - ) - - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) -} - -var ( - Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) -) diff --git a/x/icaauth/types/genesis.go b/x/icaauth/types/genesis.go deleted file mode 100644 index ffd96d1aa..000000000 --- a/x/icaauth/types/genesis.go +++ /dev/null @@ -1,14 +0,0 @@ -package types - -// DefaultGenesis returns the default Capability genesis state -func DefaultGenesis() *GenesisState { - return &GenesisState{ - Params: DefaultParams(), - } -} - -// Validate performs basic genesis state validation returning an error upon any -// failure. -func (gs GenesisState) Validate() error { - return gs.Params.Validate() -} diff --git a/x/icaauth/types/genesis.pb.go b/x/icaauth/types/genesis.pb.go deleted file mode 100644 index ffa745ccd..000000000 --- a/x/icaauth/types/genesis.pb.go +++ /dev/null @@ -1,325 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: chainmain/icaauth/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 icaauth module's genesis state. -type GenesisState struct { - // params defines the genesis parameters - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -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_210900f6be30be08, []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) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "chainmain.icaauth.v1.GenesisState") -} - -func init() { - proto.RegisterFile("chainmain/icaauth/v1/genesis.proto", fileDescriptor_210900f6be30be08) -} - -var fileDescriptor_210900f6be30be08 = []byte{ - // 210 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0x48, 0xcc, - 0xcc, 0xcb, 0x4d, 0xcc, 0xcc, 0xd3, 0xcf, 0x4c, 0x4e, 0x4c, 0x2c, 0x2d, 0xc9, 0xd0, 0x2f, 0x33, - 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, - 0x81, 0xab, 0xd1, 0x83, 0xaa, 0xd1, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, - 0xd0, 0x07, 0xb1, 0x20, 0x6a, 0xa5, 0x14, 0xb1, 0x9a, 0x57, 0x90, 0x58, 0x94, 0x98, 0x0b, 0x35, - 0x4e, 0xc9, 0x8b, 0x8b, 0xc7, 0x1d, 0x62, 0x7e, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x15, 0x17, - 0x1b, 0x44, 0x5e, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x46, 0x0f, 0x9b, 0x7d, 0x7a, 0x01, - 0x60, 0x35, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0x75, 0x38, 0x05, 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, 0x59, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, - 0x72, 0x7e, 0xae, 0x7e, 0x72, 0x51, 0x65, 0x41, 0x49, 0xbe, 0x6e, 0x7e, 0x51, 0xba, 0x2e, 0xd8, - 0x68, 0x7d, 0x30, 0xa9, 0x0b, 0x76, 0x65, 0x05, 0xdc, 0x9d, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, - 0x6c, 0x60, 0x47, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x8a, 0xba, 0xd6, 0xec, 0x19, 0x01, - 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 - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - 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 = m.Params.Size() - 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 Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - 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/x/icaauth/types/keys.go b/x/icaauth/types/keys.go deleted file mode 100644 index 88ecddb81..000000000 --- a/x/icaauth/types/keys.go +++ /dev/null @@ -1,21 +0,0 @@ -package types - -const ( - // ModuleName defines the module name - ModuleName = "icaauth" - - // StoreKey defines the primary module store key - StoreKey = ModuleName - - // RouterKey is the message route for slashing - RouterKey = ModuleName - - // QuerierRoute defines the module's query routing key - QuerierRoute = ModuleName - - // MemStoreKey defines the in-memory store key - MemStoreKey = "mem_icaauth" - - // Version defines the current version the IBC module supports - Version = "icaauth-1" -) diff --git a/x/icaauth/types/message_register_account.go b/x/icaauth/types/message_register_account.go deleted file mode 100644 index 0dfb889e4..000000000 --- a/x/icaauth/types/message_register_account.go +++ /dev/null @@ -1,48 +0,0 @@ -package types - -import ( - newsdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -const TypeMsgRegisterAccount = "register_account" - -var _ sdk.Msg = &MsgRegisterAccount{} - -func NewMsgRegisterAccount(owner string, connectionID string, version string) *MsgRegisterAccount { - return &MsgRegisterAccount{ - Owner: owner, - ConnectionId: connectionID, - Version: version, - } -} - -func (msg *MsgRegisterAccount) Route() string { - return RouterKey -} - -func (msg *MsgRegisterAccount) Type() string { - return TypeMsgRegisterAccount -} - -func (msg *MsgRegisterAccount) GetSigners() []sdk.AccAddress { - owner, err := sdk.AccAddressFromBech32(msg.Owner) - if err != nil { - panic(err) - } - return []sdk.AccAddress{owner} -} - -func (msg *MsgRegisterAccount) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgRegisterAccount) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Owner) - if err != nil { - return newsdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid owner address (%s)", err) - } - return nil -} diff --git a/x/icaauth/types/message_register_account_test.go b/x/icaauth/types/message_register_account_test.go deleted file mode 100644 index 53ee4c929..000000000 --- a/x/icaauth/types/message_register_account_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package types - -import ( - "testing" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/stretchr/testify/require" -) - -func TestMsgRegisterAccount_ValidateBasic(t *testing.T) { - tests := []struct { - name string - msg MsgRegisterAccount - err error - }{ - { - name: "invalid address", - msg: MsgRegisterAccount{ - Owner: "invalid_address", - }, - err: sdkerrors.ErrInvalidAddress, - }, { - name: "valid address", - msg: MsgRegisterAccount{ - Owner: AccAddress(), - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - err := tt.msg.ValidateBasic() - if tt.err != nil { - require.ErrorIs(t, err, tt.err) - return - } - require.NoError(t, err) - }) - } -} diff --git a/x/icaauth/types/message_submit_tx.go b/x/icaauth/types/message_submit_tx.go deleted file mode 100644 index fae4f8a55..000000000 --- a/x/icaauth/types/message_submit_tx.go +++ /dev/null @@ -1,103 +0,0 @@ -package types - -import ( - "time" - - newsdkerrors "cosmossdk.io/errors" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -const TypeMsgSubmitTx = "submit_tx" - -var ( - _ sdk.Msg = &MsgSubmitTx{} - _ cdctypes.UnpackInterfacesMessage = &MsgSubmitTx{} -) - -func NewMsgSubmitTx(owner string, connectionID string, msgs []sdk.Msg, timeoutDuration *time.Duration) *MsgSubmitTx { - msgsAny := make([]*cdctypes.Any, len(msgs)) - for i, msg := range msgs { - any, err := cdctypes.NewAnyWithValue(msg) - if err != nil { - panic(err) - } - - msgsAny[i] = any - } - - return &MsgSubmitTx{ - Owner: owner, - ConnectionId: connectionID, - Msgs: msgsAny, - TimeoutDuration: timeoutDuration, - } -} - -func (msg MsgSubmitTx) GetMessages() ([]sdk.Msg, error) { - msgs := make([]sdk.Msg, len(msg.Msgs)) - for i, msgAny := range msg.Msgs { - msg, ok := msgAny.GetCachedValue().(sdk.Msg) - if !ok { - return nil, newsdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "messages contains %T which is not a sdk.Msg", msgAny) - } - msgs[i] = msg - } - - return msgs, nil -} - -func (msg MsgSubmitTx) CalculateTimeoutDuration(minTimeoutDuration time.Duration) time.Duration { - var timeoutDuration time.Duration - - if msg.TimeoutDuration != nil && *msg.TimeoutDuration >= minTimeoutDuration { - timeoutDuration = *msg.TimeoutDuration - } else { - timeoutDuration = minTimeoutDuration - } - - return timeoutDuration -} - -func (msg *MsgSubmitTx) Route() string { - return RouterKey -} - -func (msg *MsgSubmitTx) Type() string { - return TypeMsgSubmitTx -} - -func (msg *MsgSubmitTx) GetSigners() []sdk.AccAddress { - owner, err := sdk.AccAddressFromBech32(msg.Owner) - if err != nil { - panic(err) - } - return []sdk.AccAddress{owner} -} - -func (msg *MsgSubmitTx) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgSubmitTx) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Owner) - if err != nil { - return newsdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid owner address (%s)", err) - } - return nil -} - -// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces -func (msg MsgSubmitTx) UnpackInterfaces(unpacker cdctypes.AnyUnpacker) error { - for _, x := range msg.Msgs { - var msg sdk.Msg - err := unpacker.UnpackAny(x, &msg) - if err != nil { - return err - } - } - - return nil -} diff --git a/x/icaauth/types/message_submit_tx_test.go b/x/icaauth/types/message_submit_tx_test.go deleted file mode 100644 index 2418414be..000000000 --- a/x/icaauth/types/message_submit_tx_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package types - -import ( - "testing" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/stretchr/testify/require" -) - -func TestMsgSubmitTx_ValidateBasic(t *testing.T) { - tests := []struct { - name string - msg MsgSubmitTx - err error - }{ - { - name: "invalid address", - msg: MsgSubmitTx{ - Owner: "invalid_address", - }, - err: sdkerrors.ErrInvalidAddress, - }, { - name: "valid address", - msg: MsgSubmitTx{ - Owner: AccAddress(), - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - err := tt.msg.ValidateBasic() - if tt.err != nil { - require.ErrorIs(t, err, tt.err) - return - } - require.NoError(t, err) - }) - } -} diff --git a/x/icaauth/types/params.go b/x/icaauth/types/params.go deleted file mode 100644 index d8c06bbc4..000000000 --- a/x/icaauth/types/params.go +++ /dev/null @@ -1,69 +0,0 @@ -package types - -import ( - "fmt" - "time" - - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "gopkg.in/yaml.v2" -) - -var _ paramtypes.ParamSet = (*Params)(nil) - -var ( - KeyMinTimeoutDuration = []byte("MinTimeoutDuration") - DefaultMinTimeoutDuration = time.Hour -) - -// ParamKeyTable the param key table for launch module -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// NewParams creates a new Params instance -func NewParams( - minTimeoutDuration time.Duration, -) Params { - return Params{ - MinTimeoutDuration: minTimeoutDuration, - } -} - -// DefaultParams returns a default set of parameters -func DefaultParams() Params { - return NewParams( - DefaultMinTimeoutDuration, - ) -} - -// ParamSetPairs get the params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeyMinTimeoutDuration, &p.MinTimeoutDuration, validateMinTimeoutDuration), - } -} - -// Validate validates the set of params -func (p Params) Validate() error { - if err := validateMinTimeoutDuration(p.MinTimeoutDuration); err != nil { - return err - } - - return nil -} - -// String implements the Stringer interface. -func (p Params) String() string { - out, _ := yaml.Marshal(p) //nolint:errcheck - return string(out) -} - -// validateMinTimeoutDuration validates the MinTimeoutDuration param -func validateMinTimeoutDuration(v interface{}) error { - _, ok := v.(time.Duration) - if !ok { - return fmt.Errorf("invalid parameter type: %T", v) - } - - return nil -} diff --git a/x/icaauth/types/params.pb.go b/x/icaauth/types/params.pb.go deleted file mode 100644 index d4dc1c986..000000000 --- a/x/icaauth/types/params.pb.go +++ /dev/null @@ -1,328 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: chainmain/icaauth/v1/params.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "google.golang.org/protobuf/types/known/durationpb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -// Params defines the parameters for the module. -type Params struct { - // minTimeoutDuration defines the minimum value of packet timeout when submitting transactions to host chain on - // behalf of interchain account - MinTimeoutDuration time.Duration `protobuf:"bytes,1,opt,name=minTimeoutDuration,proto3,stdduration" json:"minTimeoutDuration" yaml:"min_timeout_duration"` -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_801cf753a872130d, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func (m *Params) GetMinTimeoutDuration() time.Duration { - if m != nil { - return m.MinTimeoutDuration - } - return 0 -} - -func init() { - proto.RegisterType((*Params)(nil), "chainmain.icaauth.v1.Params") -} - -func init() { proto.RegisterFile("chainmain/icaauth/v1/params.proto", fileDescriptor_801cf753a872130d) } - -var fileDescriptor_801cf753a872130d = []byte{ - // 264 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xce, 0x48, 0xcc, - 0xcc, 0xcb, 0x4d, 0xcc, 0xcc, 0xd3, 0xcf, 0x4c, 0x4e, 0x4c, 0x2c, 0x2d, 0xc9, 0xd0, 0x2f, 0x33, - 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, - 0x2b, 0xd1, 0x83, 0x2a, 0xd1, 0x2b, 0x33, 0x94, 0x92, 0x4b, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, - 0x07, 0xab, 0x49, 0x2a, 0x4d, 0xd3, 0x4f, 0x29, 0x2d, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0x83, 0xe8, - 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x33, 0xf5, 0x41, 0x2c, 0x88, 0xa8, 0x52, 0x13, 0x23, - 0x17, 0x5b, 0x00, 0xd8, 0x70, 0xa1, 0x22, 0x2e, 0xa1, 0xdc, 0xcc, 0xbc, 0x90, 0xcc, 0xdc, 0xd4, - 0xfc, 0xd2, 0x12, 0x17, 0xa8, 0x66, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x49, 0x3d, 0x88, - 0xe9, 0x7a, 0x30, 0xd3, 0xf5, 0x60, 0x0a, 0x9c, 0xd4, 0x4f, 0xdc, 0x93, 0x67, 0xf8, 0x74, 0x4f, - 0x5e, 0xba, 0x32, 0x31, 0x37, 0xc7, 0x4a, 0x29, 0x37, 0x33, 0x2f, 0xbe, 0x04, 0x62, 0x46, 0x3c, - 0xcc, 0x05, 0x4a, 0x33, 0xee, 0xcb, 0x33, 0x06, 0x61, 0x31, 0xdd, 0x8a, 0x65, 0xc6, 0x02, 0x79, - 0x06, 0xa7, 0x80, 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, 0x4b, 0xcf, - 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, - 0xcd, 0x2f, 0x4a, 0xd7, 0x05, 0x07, 0x80, 0x3e, 0x98, 0xd4, 0x05, 0x07, 0x55, 0x05, 0x3c, 0xb0, - 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xee, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, - 0x9a, 0x05, 0x82, 0x12, 0x4e, 0x01, 0x00, 0x00, -} - -func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.MinTimeoutDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.MinTimeoutDuration):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintParams(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.MinTimeoutDuration) - n += 1 + l + sovParams(uint64(l)) - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) 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 ErrIntOverflowParams - } - 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinTimeoutDuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.MinTimeoutDuration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/icaauth/types/query.pb.go b/x/icaauth/types/query.pb.go deleted file mode 100644 index 5b41b1c4b..000000000 --- a/x/icaauth/types/query.pb.go +++ /dev/null @@ -1,978 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: chainmain/icaauth/v1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - 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 - -// QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_84963ea4c90af99e, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryParamsResponse is response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params holds all the parameters of this module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_84963ea4c90af99e, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -// QueryInterchainAccountAddressRequest defines the request for the InterchainAccountAddress query. -type QueryInterchainAccountAddressRequest struct { - ConnectionId string `protobuf:"bytes,1,opt,name=connectionId,proto3" json:"connectionId,omitempty" yaml:"connection_id"` - Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` -} - -func (m *QueryInterchainAccountAddressRequest) Reset() { *m = QueryInterchainAccountAddressRequest{} } -func (m *QueryInterchainAccountAddressRequest) String() string { return proto.CompactTextString(m) } -func (*QueryInterchainAccountAddressRequest) ProtoMessage() {} -func (*QueryInterchainAccountAddressRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_84963ea4c90af99e, []int{2} -} -func (m *QueryInterchainAccountAddressRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryInterchainAccountAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryInterchainAccountAddressRequest.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 *QueryInterchainAccountAddressRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryInterchainAccountAddressRequest.Merge(m, src) -} -func (m *QueryInterchainAccountAddressRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryInterchainAccountAddressRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryInterchainAccountAddressRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryInterchainAccountAddressRequest proto.InternalMessageInfo - -func (m *QueryInterchainAccountAddressRequest) GetConnectionId() string { - if m != nil { - return m.ConnectionId - } - return "" -} - -func (m *QueryInterchainAccountAddressRequest) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -// QueryInterchainAccountAddressResponse defines the response for the InterchainAccountAddress query. -type QueryInterchainAccountAddressResponse struct { - InterchainAccountAddress string `protobuf:"bytes,1,opt,name=interchainAccountAddress,proto3" json:"interchainAccountAddress,omitempty"` -} - -func (m *QueryInterchainAccountAddressResponse) Reset() { *m = QueryInterchainAccountAddressResponse{} } -func (m *QueryInterchainAccountAddressResponse) String() string { return proto.CompactTextString(m) } -func (*QueryInterchainAccountAddressResponse) ProtoMessage() {} -func (*QueryInterchainAccountAddressResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_84963ea4c90af99e, []int{3} -} -func (m *QueryInterchainAccountAddressResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryInterchainAccountAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryInterchainAccountAddressResponse.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 *QueryInterchainAccountAddressResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryInterchainAccountAddressResponse.Merge(m, src) -} -func (m *QueryInterchainAccountAddressResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryInterchainAccountAddressResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryInterchainAccountAddressResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryInterchainAccountAddressResponse proto.InternalMessageInfo - -func (m *QueryInterchainAccountAddressResponse) GetInterchainAccountAddress() string { - if m != nil { - return m.InterchainAccountAddress - } - return "" -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "chainmain.icaauth.v1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "chainmain.icaauth.v1.QueryParamsResponse") - proto.RegisterType((*QueryInterchainAccountAddressRequest)(nil), "chainmain.icaauth.v1.QueryInterchainAccountAddressRequest") - proto.RegisterType((*QueryInterchainAccountAddressResponse)(nil), "chainmain.icaauth.v1.QueryInterchainAccountAddressResponse") -} - -func init() { proto.RegisterFile("chainmain/icaauth/v1/query.proto", fileDescriptor_84963ea4c90af99e) } - -var fileDescriptor_84963ea4c90af99e = []byte{ - // 460 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0x4f, 0x6b, 0x13, 0x41, - 0x14, 0xcf, 0x06, 0x1b, 0x70, 0xf4, 0x34, 0xee, 0x61, 0x09, 0x61, 0x5b, 0x97, 0x0a, 0x55, 0xc8, - 0x0e, 0xa9, 0xe0, 0x21, 0x7a, 0x69, 0x2e, 0x92, 0x93, 0xed, 0x1e, 0xbd, 0x84, 0xc9, 0x64, 0xd8, - 0x0c, 0x74, 0xe7, 0x6d, 0x67, 0x66, 0xa3, 0x6b, 0xe9, 0x45, 0xbf, 0x80, 0xe0, 0x97, 0xea, 0xb1, - 0xe0, 0xc5, 0x53, 0x91, 0xa4, 0x9f, 0x40, 0xfc, 0x00, 0xb2, 0x33, 0x6b, 0x6a, 0x71, 0xd3, 0x8a, - 0xb7, 0xdd, 0xf7, 0x7e, 0xff, 0xde, 0x7b, 0x0c, 0xda, 0x61, 0x73, 0x2a, 0x64, 0x46, 0x85, 0x24, - 0x82, 0x51, 0x5a, 0x98, 0x39, 0x59, 0x0c, 0xc8, 0x49, 0xc1, 0x55, 0x19, 0xe7, 0x0a, 0x0c, 0x60, - 0x7f, 0x8d, 0x88, 0x6b, 0x44, 0xbc, 0x18, 0x74, 0xfd, 0x14, 0x52, 0xb0, 0x00, 0x52, 0x7d, 0x39, - 0x6c, 0xb7, 0x97, 0x02, 0xa4, 0xc7, 0x9c, 0xd0, 0x5c, 0x10, 0x2a, 0x25, 0x18, 0x6a, 0x04, 0x48, - 0x5d, 0x77, 0x9f, 0x31, 0xd0, 0x19, 0x68, 0x32, 0xa5, 0x9a, 0x3b, 0x0b, 0xb2, 0x18, 0x4c, 0xb9, - 0xa1, 0x03, 0x92, 0xd3, 0x54, 0x48, 0x0b, 0xae, 0xb1, 0x8f, 0x1b, 0x73, 0xe5, 0x54, 0xd1, 0xac, - 0x96, 0x8b, 0x7c, 0x84, 0x8f, 0x2a, 0x91, 0x43, 0x5b, 0x4c, 0xf8, 0x49, 0xc1, 0xb5, 0x89, 0x8e, - 0xd0, 0xa3, 0x1b, 0x55, 0x9d, 0x83, 0xd4, 0x1c, 0x0f, 0x51, 0xc7, 0x91, 0x03, 0x6f, 0xc7, 0xdb, - 0x7b, 0xb0, 0xdf, 0x8b, 0x9b, 0xc6, 0x8a, 0x1d, 0x6b, 0x74, 0xef, 0xfc, 0x72, 0xbb, 0x95, 0xd4, - 0x8c, 0xe8, 0x03, 0xda, 0xb5, 0x92, 0x63, 0x69, 0xb8, 0xb2, 0xb4, 0x03, 0xc6, 0xa0, 0x90, 0xe6, - 0x60, 0x36, 0x53, 0x5c, 0xff, 0xb6, 0xc6, 0xaf, 0xd0, 0x43, 0x06, 0x52, 0x72, 0x56, 0xcd, 0x31, - 0x9e, 0x59, 0xa7, 0xfb, 0xa3, 0xe0, 0xc7, 0xe5, 0xb6, 0x5f, 0xd2, 0xec, 0x78, 0x18, 0x5d, 0x77, - 0x27, 0x62, 0x16, 0x25, 0x37, 0xd0, 0xd8, 0x47, 0x5b, 0xf0, 0x4e, 0x72, 0x15, 0xb4, 0x2b, 0x5a, - 0xe2, 0x7e, 0x22, 0x86, 0x9e, 0xdc, 0xe1, 0xbd, 0x1e, 0x30, 0x10, 0x1b, 0x30, 0x2e, 0x48, 0xb2, - 0xb1, 0xbf, 0xff, 0xb3, 0x8d, 0xb6, 0xac, 0x0b, 0xfe, 0xe4, 0xa1, 0x8e, 0xdb, 0x01, 0xde, 0x6b, - 0xde, 0xd0, 0xdf, 0x2b, 0xef, 0x3e, 0xfd, 0x07, 0xa4, 0x4b, 0x19, 0xed, 0x7e, 0xfc, 0x7a, 0xf5, - 0xa5, 0x1d, 0xe2, 0x1e, 0xb9, 0xe5, 0xbe, 0xf8, 0xca, 0x43, 0xc1, 0xa6, 0x81, 0xf1, 0xf0, 0x16, - 0xb7, 0x3b, 0x2e, 0xd4, 0x7d, 0xf9, 0x5f, 0xdc, 0x3a, 0xfb, 0x1b, 0x9b, 0x7d, 0x8c, 0x5f, 0x37, - 0x67, 0xbf, 0xde, 0xee, 0x84, 0x3a, 0x81, 0x09, 0x75, 0x0a, 0xe4, 0xf4, 0xcf, 0x43, 0x9f, 0x91, - 0x53, 0x7b, 0xda, 0xb3, 0xd1, 0xe1, 0xf9, 0x32, 0xf4, 0x2e, 0x96, 0xa1, 0xf7, 0x7d, 0x19, 0x7a, - 0x9f, 0x57, 0x61, 0xeb, 0x62, 0x15, 0xb6, 0xbe, 0xad, 0xc2, 0xd6, 0xdb, 0x17, 0xa9, 0x30, 0xf3, - 0x62, 0x1a, 0x33, 0xc8, 0x08, 0x53, 0x65, 0x6e, 0xa0, 0x0f, 0x2a, 0xed, 0x5b, 0x75, 0xe7, 0xde, - 0xb7, 0xf6, 0xef, 0xd7, 0x01, 0x4c, 0x99, 0x73, 0x3d, 0xed, 0xd8, 0x97, 0xf1, 0xfc, 0x57, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x34, 0xb9, 0x40, 0x6e, 0xd6, 0x03, 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 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - // Parameters queries the parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // InterchainAccountAddress queries the interchain account address for given `connectionId` and `owner` - InterchainAccountAddress(ctx context.Context, in *QueryInterchainAccountAddressRequest, opts ...grpc.CallOption) (*QueryInterchainAccountAddressResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/chainmain.icaauth.v1.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) InterchainAccountAddress(ctx context.Context, in *QueryInterchainAccountAddressRequest, opts ...grpc.CallOption) (*QueryInterchainAccountAddressResponse, error) { - out := new(QueryInterchainAccountAddressResponse) - err := c.cc.Invoke(ctx, "/chainmain.icaauth.v1.Query/InterchainAccountAddress", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // InterchainAccountAddress queries the interchain account address for given `connectionId` and `owner` - InterchainAccountAddress(context.Context, *QueryInterchainAccountAddressRequest) (*QueryInterchainAccountAddressResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (*UnimplementedQueryServer) InterchainAccountAddress(ctx context.Context, req *QueryInterchainAccountAddressRequest) (*QueryInterchainAccountAddressResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InterchainAccountAddress not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/chainmain.icaauth.v1.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_InterchainAccountAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryInterchainAccountAddressRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).InterchainAccountAddress(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/chainmain.icaauth.v1.Query/InterchainAccountAddress", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).InterchainAccountAddress(ctx, req.(*QueryInterchainAccountAddressRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "chainmain.icaauth.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "InterchainAccountAddress", - Handler: _Query_InterchainAccountAddress_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "chainmain/icaauth/v1/query.proto", -} - -func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryInterchainAccountAddressRequest) 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 *QueryInterchainAccountAddressRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryInterchainAccountAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0x12 - } - if len(m.ConnectionId) > 0 { - i -= len(m.ConnectionId) - copy(dAtA[i:], m.ConnectionId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ConnectionId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryInterchainAccountAddressResponse) 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 *QueryInterchainAccountAddressResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryInterchainAccountAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.InterchainAccountAddress) > 0 { - i -= len(m.InterchainAccountAddress) - copy(dAtA[i:], m.InterchainAccountAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.InterchainAccountAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryInterchainAccountAddressRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ConnectionId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryInterchainAccountAddressResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.InterchainAccountAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *QueryParamsRequest) 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 ErrIntOverflowQuery - } - 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: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryParamsResponse) 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 ErrIntOverflowQuery - } - 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: QueryParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryInterchainAccountAddressRequest) 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 ErrIntOverflowQuery - } - 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: QueryInterchainAccountAddressRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryInterchainAccountAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConnectionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryInterchainAccountAddressResponse) 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 ErrIntOverflowQuery - } - 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: QueryInterchainAccountAddressResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryInterchainAccountAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InterchainAccountAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InterchainAccountAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipQuery(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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/icaauth/types/query.pb.gw.go b/x/icaauth/types/query.pb.gw.go deleted file mode 100644 index 645ed0f54..000000000 --- a/x/icaauth/types/query.pb.gw.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: chainmain/icaauth/v1/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_InterchainAccountAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryInterchainAccountAddressRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["connectionId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "connectionId") - } - - protoReq.ConnectionId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "connectionId", err) - } - - val, ok = pathParams["owner"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner") - } - - protoReq.Owner, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner", err) - } - - msg, err := client.InterchainAccountAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_InterchainAccountAddress_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryInterchainAccountAddressRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["connectionId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "connectionId") - } - - protoReq.ConnectionId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "connectionId", err) - } - - val, ok = pathParams["owner"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner") - } - - protoReq.Owner, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner", err) - } - - msg, err := server.InterchainAccountAddress(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_InterchainAccountAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_InterchainAccountAddress_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_InterchainAccountAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_InterchainAccountAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_InterchainAccountAddress_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_InterchainAccountAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"chainmain", "icaauth", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_InterchainAccountAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"chainmain", "icaauth", "v1", "interchain_account_address", "connectionId", "owner"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_InterchainAccountAddress_0 = runtime.ForwardResponseMessage -) diff --git a/x/icaauth/types/tx.pb.go b/x/icaauth/types/tx.pb.go deleted file mode 100644 index f54f5a147..000000000 --- a/x/icaauth/types/tx.pb.go +++ /dev/null @@ -1,1160 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: chainmain/icaauth/v1/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - _ "google.golang.org/protobuf/types/known/durationpb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -// MsgRegisterAccount defines the request message for MsgRegisterAccount -type MsgRegisterAccount struct { - // owner represents the owner of the interchain account - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // connectionId represents the IBC `connectionId` of the host chain - ConnectionId string `protobuf:"bytes,2,opt,name=connectionId,proto3" json:"connectionId,omitempty" yaml:"connection_id"` - // version represents the version of the ICA channel - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` -} - -func (m *MsgRegisterAccount) Reset() { *m = MsgRegisterAccount{} } -func (m *MsgRegisterAccount) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterAccount) ProtoMessage() {} -func (*MsgRegisterAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_a266fcab7ff9c181, []int{0} -} -func (m *MsgRegisterAccount) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterAccount.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 *MsgRegisterAccount) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterAccount.Merge(m, src) -} -func (m *MsgRegisterAccount) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterAccount) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterAccount.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterAccount proto.InternalMessageInfo - -func (m *MsgRegisterAccount) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *MsgRegisterAccount) GetConnectionId() string { - if m != nil { - return m.ConnectionId - } - return "" -} - -func (m *MsgRegisterAccount) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -// MsgRegisterAccountResponse defines the response message for MsgRegisterAccount -type MsgRegisterAccountResponse struct { -} - -func (m *MsgRegisterAccountResponse) Reset() { *m = MsgRegisterAccountResponse{} } -func (m *MsgRegisterAccountResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterAccountResponse) ProtoMessage() {} -func (*MsgRegisterAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a266fcab7ff9c181, []int{1} -} -func (m *MsgRegisterAccountResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterAccountResponse.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 *MsgRegisterAccountResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterAccountResponse.Merge(m, src) -} -func (m *MsgRegisterAccountResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterAccountResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterAccountResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterAccountResponse proto.InternalMessageInfo - -// MsgSubmitTx defines the request message for MsgSubmitTx -type MsgSubmitTx struct { - // owner represents the owner of the interchain account - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // connectionId represents the IBC `connectionId` of the host chain - ConnectionId string `protobuf:"bytes,2,opt,name=connectionId,proto3" json:"connectionId,omitempty" yaml:"connection_id"` - // msgs represents the transactions to be submitted to the host chain - Msgs []*types.Any `protobuf:"bytes,3,rep,name=msgs,proto3" json:"msgs,omitempty"` - // timeoutDuration represents the timeout duration for the IBC packet from last block - TimeoutDuration *time.Duration `protobuf:"bytes,4,opt,name=timeoutDuration,proto3,stdduration" json:"timeoutDuration,omitempty"` -} - -func (m *MsgSubmitTx) Reset() { *m = MsgSubmitTx{} } -func (m *MsgSubmitTx) String() string { return proto.CompactTextString(m) } -func (*MsgSubmitTx) ProtoMessage() {} -func (*MsgSubmitTx) Descriptor() ([]byte, []int) { - return fileDescriptor_a266fcab7ff9c181, []int{2} -} -func (m *MsgSubmitTx) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSubmitTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSubmitTx.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 *MsgSubmitTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSubmitTx.Merge(m, src) -} -func (m *MsgSubmitTx) XXX_Size() int { - return m.Size() -} -func (m *MsgSubmitTx) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSubmitTx.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSubmitTx proto.InternalMessageInfo - -func (m *MsgSubmitTx) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *MsgSubmitTx) GetConnectionId() string { - if m != nil { - return m.ConnectionId - } - return "" -} - -func (m *MsgSubmitTx) GetMsgs() []*types.Any { - if m != nil { - return m.Msgs - } - return nil -} - -func (m *MsgSubmitTx) GetTimeoutDuration() *time.Duration { - if m != nil { - return m.TimeoutDuration - } - return nil -} - -// MsgSubmitTxResponse defines the response message for MsgSubmitTx -type MsgSubmitTxResponse struct { -} - -func (m *MsgSubmitTxResponse) Reset() { *m = MsgSubmitTxResponse{} } -func (m *MsgSubmitTxResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSubmitTxResponse) ProtoMessage() {} -func (*MsgSubmitTxResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a266fcab7ff9c181, []int{3} -} -func (m *MsgSubmitTxResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSubmitTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSubmitTxResponse.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 *MsgSubmitTxResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSubmitTxResponse.Merge(m, src) -} -func (m *MsgSubmitTxResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgSubmitTxResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSubmitTxResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSubmitTxResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgRegisterAccount)(nil), "chainmain.icaauth.v1.MsgRegisterAccount") - proto.RegisterType((*MsgRegisterAccountResponse)(nil), "chainmain.icaauth.v1.MsgRegisterAccountResponse") - proto.RegisterType((*MsgSubmitTx)(nil), "chainmain.icaauth.v1.MsgSubmitTx") - proto.RegisterType((*MsgSubmitTxResponse)(nil), "chainmain.icaauth.v1.MsgSubmitTxResponse") -} - -func init() { proto.RegisterFile("chainmain/icaauth/v1/tx.proto", fileDescriptor_a266fcab7ff9c181) } - -var fileDescriptor_a266fcab7ff9c181 = []byte{ - // 483 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0x31, 0x6f, 0xd3, 0x4c, - 0x1c, 0xc6, 0x73, 0x6f, 0xd2, 0xb7, 0x70, 0x41, 0xaa, 0x64, 0x8c, 0x70, 0x2d, 0x70, 0x83, 0xa7, - 0x50, 0x29, 0x77, 0x34, 0x08, 0x86, 0x8a, 0xa5, 0x11, 0x4b, 0x87, 0x48, 0xc8, 0x30, 0x20, 0x96, - 0xca, 0xb9, 0x1c, 0x97, 0x13, 0xbd, 0xfb, 0x47, 0xbe, 0x73, 0x88, 0x37, 0xc4, 0x07, 0x40, 0x8c, - 0x7c, 0x8c, 0x0e, 0x7c, 0x08, 0xc4, 0xd4, 0x05, 0x89, 0x09, 0x50, 0x32, 0x74, 0x44, 0xe2, 0x13, - 0x20, 0xdb, 0x71, 0xa0, 0x09, 0x08, 0x16, 0x16, 0xcb, 0x8f, 0x7f, 0xcf, 0x3d, 0xf7, 0xf7, 0x63, - 0x1f, 0xbe, 0xce, 0x46, 0xb1, 0xd4, 0x2a, 0x96, 0x9a, 0x4a, 0x16, 0xc7, 0xa9, 0x1d, 0xd1, 0xc9, - 0x1e, 0xb5, 0x53, 0x32, 0x4e, 0xc0, 0x82, 0xe3, 0x2e, 0x31, 0x59, 0x60, 0x32, 0xd9, 0xf3, 0xaf, - 0x32, 0x30, 0x0a, 0x0c, 0x55, 0x46, 0xe4, 0x6e, 0x65, 0x44, 0x69, 0xf7, 0xb7, 0x4b, 0x70, 0x54, - 0x28, 0x5a, 0x8a, 0x0a, 0x09, 0x00, 0x71, 0xcc, 0x69, 0xa1, 0x06, 0xe9, 0x53, 0x1a, 0xeb, 0x6c, - 0x81, 0x82, 0x55, 0x34, 0x4c, 0x93, 0xd8, 0x4a, 0xd0, 0x0b, 0xee, 0x0a, 0x10, 0x50, 0x46, 0xe6, - 0x77, 0xe5, 0xd3, 0xf0, 0x15, 0xc2, 0x4e, 0xdf, 0x88, 0x88, 0x0b, 0x69, 0x2c, 0x4f, 0x0e, 0x18, - 0x83, 0x54, 0x5b, 0xc7, 0xc5, 0x1b, 0xf0, 0x5c, 0xf3, 0xc4, 0x43, 0x2d, 0xd4, 0xbe, 0x18, 0x95, - 0xc2, 0xb9, 0x87, 0x2f, 0x31, 0xd0, 0x9a, 0xb3, 0x3c, 0xf6, 0x70, 0xe8, 0xfd, 0x97, 0xc3, 0x9e, - 0xf7, 0xed, 0xd3, 0x8e, 0x9b, 0xc5, 0xea, 0x78, 0x3f, 0xfc, 0x41, 0x8f, 0xe4, 0x30, 0x8c, 0xce, - 0xb9, 0x1d, 0x0f, 0x6f, 0x4e, 0x78, 0x62, 0x24, 0x68, 0xaf, 0x5e, 0xa4, 0x56, 0x72, 0x1f, 0xbf, - 0x3c, 0x3b, 0xd9, 0x2d, 0xf7, 0x08, 0xaf, 0x61, 0x7f, 0x7d, 0x9e, 0x88, 0x9b, 0x31, 0x68, 0xc3, - 0xc3, 0xaf, 0x08, 0x37, 0xfb, 0x46, 0x3c, 0x4c, 0x07, 0x4a, 0xda, 0x47, 0xd3, 0x7f, 0x32, 0xe7, - 0x1d, 0xdc, 0x50, 0x46, 0x18, 0xaf, 0xde, 0xaa, 0xb7, 0x9b, 0x5d, 0x97, 0x94, 0xbd, 0x92, 0xaa, - 0x57, 0x72, 0xa0, 0xb3, 0x5e, 0xf3, 0xfd, 0xdb, 0xce, 0xa6, 0x19, 0x3e, 0x23, 0xf9, 0xac, 0x85, - 0xdd, 0x39, 0xc4, 0x5b, 0x56, 0x2a, 0x0e, 0xa9, 0xbd, 0xbf, 0x28, 0xde, 0x6b, 0xb4, 0x50, 0xbb, - 0xd9, 0xdd, 0x5e, 0x4b, 0xa8, 0x0c, 0xbd, 0xc6, 0x9b, 0xcf, 0x3b, 0x28, 0x5a, 0x5d, 0x77, 0xae, - 0x8f, 0x2b, 0xf8, 0xf2, 0x4f, 0x2f, 0x5c, 0x15, 0xd1, 0xfd, 0x80, 0x70, 0xbd, 0x6f, 0x84, 0xa3, - 0xf0, 0xd6, 0xea, 0xb7, 0x6b, 0x93, 0x5f, 0xfd, 0x6e, 0x64, 0xbd, 0x55, 0xff, 0xd6, 0xdf, 0x3a, - 0xab, 0x6d, 0x9d, 0xc7, 0xf8, 0xc2, 0xb2, 0xfb, 0x1b, 0xbf, 0x5d, 0x5d, 0x59, 0xfc, 0x9b, 0x7f, - 0xb4, 0x54, 0xc9, 0xfe, 0xc6, 0x8b, 0xb3, 0x93, 0x5d, 0xd4, 0x7b, 0xf0, 0x6e, 0x16, 0xa0, 0xd3, - 0x59, 0x80, 0xbe, 0xcc, 0x02, 0xf4, 0x7a, 0x1e, 0xd4, 0x4e, 0xe7, 0x41, 0xed, 0xe3, 0x3c, 0xa8, - 0x3d, 0xb9, 0x2b, 0xa4, 0x1d, 0xa5, 0x03, 0xc2, 0x40, 0x51, 0x96, 0x64, 0x63, 0x0b, 0x1d, 0x48, - 0x44, 0xa7, 0xd8, 0x80, 0x16, 0xd7, 0x4e, 0x71, 0x00, 0xa7, 0xcb, 0x23, 0x68, 0xb3, 0x31, 0x37, - 0x83, 0xff, 0x8b, 0xda, 0x6f, 0x7f, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x2c, 0xbc, 0xb7, 0xa4, - 0x03, 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 { - // RegisterAccount registers an interchain account on host chain with given `connectionId` - RegisterAccount(ctx context.Context, in *MsgRegisterAccount, opts ...grpc.CallOption) (*MsgRegisterAccountResponse, error) - // SubmitTx submits a transaction to the host chain on behalf of interchain account - SubmitTx(ctx context.Context, in *MsgSubmitTx, opts ...grpc.CallOption) (*MsgSubmitTxResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) RegisterAccount(ctx context.Context, in *MsgRegisterAccount, opts ...grpc.CallOption) (*MsgRegisterAccountResponse, error) { - out := new(MsgRegisterAccountResponse) - err := c.cc.Invoke(ctx, "/chainmain.icaauth.v1.Msg/RegisterAccount", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) SubmitTx(ctx context.Context, in *MsgSubmitTx, opts ...grpc.CallOption) (*MsgSubmitTxResponse, error) { - out := new(MsgSubmitTxResponse) - err := c.cc.Invoke(ctx, "/chainmain.icaauth.v1.Msg/SubmitTx", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // RegisterAccount registers an interchain account on host chain with given `connectionId` - RegisterAccount(context.Context, *MsgRegisterAccount) (*MsgRegisterAccountResponse, error) - // SubmitTx submits a transaction to the host chain on behalf of interchain account - SubmitTx(context.Context, *MsgSubmitTx) (*MsgSubmitTxResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) RegisterAccount(ctx context.Context, req *MsgRegisterAccount) (*MsgRegisterAccountResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterAccount not implemented") -} -func (*UnimplementedMsgServer) SubmitTx(ctx context.Context, req *MsgSubmitTx) (*MsgSubmitTxResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitTx not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_RegisterAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRegisterAccount) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RegisterAccount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/chainmain.icaauth.v1.Msg/RegisterAccount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RegisterAccount(ctx, req.(*MsgRegisterAccount)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_SubmitTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSubmitTx) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SubmitTx(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/chainmain.icaauth.v1.Msg/SubmitTx", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SubmitTx(ctx, req.(*MsgSubmitTx)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "chainmain.icaauth.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "RegisterAccount", - Handler: _Msg_RegisterAccount_Handler, - }, - { - MethodName: "SubmitTx", - Handler: _Msg_SubmitTx_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "chainmain/icaauth/v1/tx.proto", -} - -func (m *MsgRegisterAccount) 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 *MsgRegisterAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRegisterAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintTx(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x1a - } - if len(m.ConnectionId) > 0 { - i -= len(m.ConnectionId) - copy(dAtA[i:], m.ConnectionId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConnectionId))) - i-- - dAtA[i] = 0x12 - } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgRegisterAccountResponse) 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 *MsgRegisterAccountResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRegisterAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgSubmitTx) 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 *MsgSubmitTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSubmitTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TimeoutDuration != nil { - n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.TimeoutDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.TimeoutDuration):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintTx(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x22 - } - if len(m.Msgs) > 0 { - for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.ConnectionId) > 0 { - i -= len(m.ConnectionId) - copy(dAtA[i:], m.ConnectionId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConnectionId))) - i-- - dAtA[i] = 0x12 - } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgSubmitTxResponse) 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 *MsgSubmitTxResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSubmitTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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 *MsgRegisterAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ConnectionId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgRegisterAccountResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgSubmitTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ConnectionId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Msgs) > 0 { - for _, e := range m.Msgs { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - if m.TimeoutDuration != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.TimeoutDuration) - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgSubmitTxResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = 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 *MsgRegisterAccount) 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: MsgRegisterAccount: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterAccount: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", 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.ConnectionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", 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.Version = 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 *MsgRegisterAccountResponse) 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: MsgRegisterAccountResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - 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 *MsgSubmitTx) 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: MsgSubmitTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", 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.ConnectionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msgs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msgs = append(m.Msgs, &types.Any{}) - if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutDuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TimeoutDuration == nil { - m.TimeoutDuration = new(time.Duration) - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.TimeoutDuration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - 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 *MsgSubmitTxResponse) 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: MsgSubmitTxResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - 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") -) diff --git a/x/icaauth/types/types.go b/x/icaauth/types/types.go deleted file mode 100644 index 0232d5317..000000000 --- a/x/icaauth/types/types.go +++ /dev/null @@ -1,13 +0,0 @@ -package types - -import ( - "github.com/cometbft/cometbft/crypto/ed25519" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// AccAddress returns a sample account address (for use in testing) -func AccAddress() string { - pk := ed25519.GenPrivKey().PubKey() - addr := pk.Address() - return sdk.AccAddress(addr).String() -} From f20a1df3a3fbf8c339482968576c65bd0f47e537 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 24 Jul 2024 10:42:34 +0800 Subject: [PATCH 7/8] cleanup --- CHANGELOG.md | 2 +- app/docs/config.json | 8 -- app/docs/swagger-ui/swagger.yaml | 132 ------------------------------- integration_tests/poetry.lock | 10 +-- integration_tests/pyproject.toml | 2 +- third_party/ibc-go | 2 +- 6 files changed, 8 insertions(+), 148 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1825c39c2..e03272f7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ - [#1044](https://github.com/crypto-org-chain/chain-main/pull/1044) Revert the protobuf package name changes introduced in #1023. - [#1060](https://github.com/crypto-org-chain/chain-main/pull/1060) Upgrade rocksdb to `v9.2.1` and bump versiondb. - [#1061](https://github.com/crypto-org-chain/chain-main/pull/1061) Integrate sdk 0.50. -- [#1068](https://github.com/crypto-org-chain/chain-main/pull/1068) Upgrade ibc-go to `v8.3.2`. +- [#1068](https://github.com/crypto-org-chain/chain-main/pull/1068) Upgrade ibc-go to `v8.3.2` and remove icaauth module. *Dec 6, 2023* diff --git a/app/docs/config.json b/app/docs/config.json index 24f5f346d..763124fa7 100644 --- a/app/docs/config.json +++ b/app/docs/config.json @@ -114,14 +114,6 @@ "TotalSupply": "TotalSupply_" } } - }, - { - "url": "./tmp-swagger-gen/chainmain/icaauth/v1/query.swagger.json", - "operationIds": { - "rename": { - "Params": "IcaauthParams" - } - } } ] } \ No newline at end of file diff --git a/app/docs/swagger-ui/swagger.yaml b/app/docs/swagger-ui/swagger.yaml index 2c6e03612..3b84ec693 100644 --- a/app/docs/swagger-ui/swagger.yaml +++ b/app/docs/swagger-ui/swagger.yaml @@ -25036,104 +25036,6 @@ paths: format: byte tags: - Query - /chainmain/icaauth/v1/interchain_account_address/{connectionId}/{owner}: - get: - summary: >- - InterchainAccountAddress queries the interchain account address for - given `connectionId` and `owner` - operationId: InterchainAccountAddress - responses: - '200': - description: A successful response. - schema: - type: object - properties: - interchainAccountAddress: - type: string - description: >- - QueryInterchainAccountAddressResponse defines the response for the - InterchainAccountAddress query. - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - value: - type: string - format: byte - parameters: - - name: connectionId - in: path - required: true - type: string - - name: owner - in: path - required: true - type: string - tags: - - Query - /chainmain/icaauth/v1/params: - get: - summary: Parameters queries the parameters of the module. - operationId: IcaauthParams - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - properties: - minTimeoutDuration: - type: string - title: >- - minTimeoutDuration defines the minimum value of packet - timeout when submitting transactions to host chain on - - behalf of interchain account - description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - value: - type: string - format: byte - tags: - - Query definitions: cosmos.auth.v1beta1.AddressBytesToStringResponse: type: object @@ -44867,37 +44769,3 @@ definitions: title: |- SupplyResponse is the response type for the Query/TotalSupply RPC method - chainmain.icaauth.v1.Params: - type: object - properties: - minTimeoutDuration: - type: string - title: >- - minTimeoutDuration defines the minimum value of packet timeout when - submitting transactions to host chain on - - behalf of interchain account - description: Params defines the parameters for the module. - chainmain.icaauth.v1.QueryInterchainAccountAddressResponse: - type: object - properties: - interchainAccountAddress: - type: string - description: >- - QueryInterchainAccountAddressResponse defines the response for the - InterchainAccountAddress query. - chainmain.icaauth.v1.QueryParamsResponse: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - properties: - minTimeoutDuration: - type: string - title: >- - minTimeoutDuration defines the minimum value of packet timeout - when submitting transactions to host chain on - - behalf of interchain account - description: QueryParamsResponse is response type for the Query/Params RPC method. diff --git a/integration_tests/poetry.lock b/integration_tests/poetry.lock index cb9237faf..e50c10f25 100644 --- a/integration_tests/poetry.lock +++ b/integration_tests/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "attrs" @@ -797,9 +797,9 @@ tomlkit = "^0" [package.source] type = "git" -url = "https://github.com/mmsqe/pystarport.git" -reference = "align_ica" -resolved_reference = "4d2ff99c3fbc95ef21803c413b99086a0ae63417" +url = "https://github.com/crypto-com/pystarport.git" +reference = "main" +resolved_reference = "ef603d05ccd6fd66459c9879d5c1be21d2665844" [[package]] name = "pytest" @@ -1241,4 +1241,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "47be7725f58df009277844461420286ead1e595c0330d53f5e80d289718a0e80" +content-hash = "23211c2502892e3bf2af0cef1d538d95acdca9b467876bd9430e47ea1103c34e" diff --git a/integration_tests/pyproject.toml b/integration_tests/pyproject.toml index cca6d1db7..1e7568a28 100644 --- a/integration_tests/pyproject.toml +++ b/integration_tests/pyproject.toml @@ -17,7 +17,7 @@ pytest-github-actions-annotate-failures = "^0.2" protobuf = "^4.25" pyyaml = "^6.0.2rc1" python-dateutil = "^2.8" -pystarport = { git = "https://github.com/mmsqe/pystarport.git", branch = "align_ica" } +pystarport = { git = "https://github.com/crypto-com/pystarport.git", branch = "main" } chainlibpy = "^2.2.0" [tool.poetry.dev-dependencies] diff --git a/third_party/ibc-go b/third_party/ibc-go index 2beec482d..91169d134 160000 --- a/third_party/ibc-go +++ b/third_party/ibc-go @@ -1 +1 @@ -Subproject commit 2beec482dc4b944be5378639cdc90433707a21bd +Subproject commit 91169d134d659b87acaf4903652cdcb1a55f5657 From 35fa9f1b21483a3ced741d75dbe49ac0fa8e5757 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 24 Jul 2024 11:49:12 +0800 Subject: [PATCH 8/8] cleanup --- proto/chainmain/icaauth/v1/genesis.proto | 13 ------ proto/chainmain/icaauth/v1/params.proto | 20 --------- proto/chainmain/icaauth/v1/query.proto | 42 ------------------ proto/chainmain/icaauth/v1/tx.proto | 55 ------------------------ 4 files changed, 130 deletions(-) delete mode 100644 proto/chainmain/icaauth/v1/genesis.proto delete mode 100644 proto/chainmain/icaauth/v1/params.proto delete mode 100644 proto/chainmain/icaauth/v1/query.proto delete mode 100644 proto/chainmain/icaauth/v1/tx.proto diff --git a/proto/chainmain/icaauth/v1/genesis.proto b/proto/chainmain/icaauth/v1/genesis.proto deleted file mode 100644 index 5031c9d00..000000000 --- a/proto/chainmain/icaauth/v1/genesis.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; -package chainmain.icaauth.v1; - -import "gogoproto/gogo.proto"; -import "chainmain/icaauth/v1/params.proto"; - -option go_package = "github.com/crypto-org-chain/chain-main/x/icaauth/types"; - -// GenesisState defines the icaauth module's genesis state. -message GenesisState { - // params defines the genesis parameters - Params params = 1 [(gogoproto.nullable) = false]; -} diff --git a/proto/chainmain/icaauth/v1/params.proto b/proto/chainmain/icaauth/v1/params.proto deleted file mode 100644 index c0119cb79..000000000 --- a/proto/chainmain/icaauth/v1/params.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; -package chainmain.icaauth.v1; - -import "google/protobuf/duration.proto"; -import "gogoproto/gogo.proto"; - -option go_package = "github.com/crypto-org-chain/chain-main/x/icaauth/types"; - -// Params defines the parameters for the module. -message Params { - option (gogoproto.goproto_stringer) = false; - - // minTimeoutDuration defines the minimum value of packet timeout when submitting transactions to host chain on - // behalf of interchain account - google.protobuf.Duration minTimeoutDuration = 1 [ - (gogoproto.moretags) = "yaml:\"min_timeout_duration\"", - (gogoproto.stdduration) = true, - (gogoproto.nullable) = false - ]; -} diff --git a/proto/chainmain/icaauth/v1/query.proto b/proto/chainmain/icaauth/v1/query.proto deleted file mode 100644 index cafdd68da..000000000 --- a/proto/chainmain/icaauth/v1/query.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; -package chainmain.icaauth.v1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "chainmain/icaauth/v1/params.proto"; - -option go_package = "github.com/crypto-org-chain/chain-main/x/icaauth/types"; - -// Query defines the gRPC querier service. -service Query { - // Parameters queries the parameters of the module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/chainmain/icaauth/v1/params"; - } - - // InterchainAccountAddress queries the interchain account address for given `connectionId` and `owner` - rpc InterchainAccountAddress(QueryInterchainAccountAddressRequest) returns (QueryInterchainAccountAddressResponse) { - option (google.api.http).get = "/chainmain/icaauth/v1/interchain_account_address/{connectionId}/{owner}"; - } -} - -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; -} - -// QueryInterchainAccountAddressRequest defines the request for the InterchainAccountAddress query. -message QueryInterchainAccountAddressRequest { - string connectionId = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - string owner = 2; -} - -// QueryInterchainAccountAddressResponse defines the response for the InterchainAccountAddress query. -message QueryInterchainAccountAddressResponse { - string interchainAccountAddress = 1; -} diff --git a/proto/chainmain/icaauth/v1/tx.proto b/proto/chainmain/icaauth/v1/tx.proto deleted file mode 100644 index f2dcf1d49..000000000 --- a/proto/chainmain/icaauth/v1/tx.proto +++ /dev/null @@ -1,55 +0,0 @@ -syntax = "proto3"; -package chainmain.icaauth.v1; - -import "cosmos/msg/v1/msg.proto"; -import "cosmos_proto/cosmos.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; -import "gogoproto/gogo.proto"; - -option go_package = "github.com/crypto-org-chain/chain-main/x/icaauth/types"; - -// Msg defines the Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - // RegisterAccount registers an interchain account on host chain with given `connectionId` - rpc RegisterAccount(MsgRegisterAccount) returns (MsgRegisterAccountResponse); - - // SubmitTx submits a transaction to the host chain on behalf of interchain account - rpc SubmitTx(MsgSubmitTx) returns (MsgSubmitTxResponse); -} - -// MsgRegisterAccount defines the request message for MsgRegisterAccount -message MsgRegisterAccount { - option (cosmos.msg.v1.signer) = "owner"; - // owner represents the owner of the interchain account - string owner = 1; - - // connectionId represents the IBC `connectionId` of the host chain - string connectionId = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - - // version represents the version of the ICA channel - string version = 3; -} - -// MsgRegisterAccountResponse defines the response message for MsgRegisterAccount -message MsgRegisterAccountResponse {} - -// MsgSubmitTx defines the request message for MsgSubmitTx -message MsgSubmitTx { - option (cosmos.msg.v1.signer) = "owner"; - // owner represents the owner of the interchain account - string owner = 1; - - // connectionId represents the IBC `connectionId` of the host chain - string connectionId = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - - // msgs represents the transactions to be submitted to the host chain - repeated google.protobuf.Any msgs = 3 [(cosmos_proto.accepts_interface) = "sdk.Msg"]; - - // timeoutDuration represents the timeout duration for the IBC packet from last block - google.protobuf.Duration timeoutDuration = 4 [(gogoproto.stdduration) = true]; -} - -// MsgSubmitTxResponse defines the response message for MsgSubmitTx -message MsgSubmitTxResponse {}