From ca1b2952e82041f1d16bd016e21c9e75aa6172b6 Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Tue, 30 Jul 2024 17:31:53 +0300 Subject: [PATCH 01/23] wip --- app/modules.go | 4 ++-- cmd/nolusd/genwasm.go | 43 +++++++++++++++++++------------------------ cmd/nolusd/root.go | 3 ++- go.mod | 8 +++++--- go.sum | 18 ++++++++++-------- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/app/modules.go b/app/modules.go index 997f5ffc..b34a63d7 100644 --- a/app/modules.go +++ b/app/modules.go @@ -149,7 +149,7 @@ func appModules( distribution.NewAppModule(appCodec, *app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), upgrade.NewAppModule(app.UpgradeKeeper, address.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix())), - wasm.NewAppModule(appCodec, &app.WasmKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)), + wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)), evidence.NewAppModule(*app.EvidenceKeeper), ibc.NewAppModule(app.IBCKeeper), sdkparams.NewAppModule(*app.ParamsKeeper), @@ -188,7 +188,7 @@ func simulationModules( slashing.NewAppModule(appCodec, *app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry), sdkparams.NewAppModule(*app.ParamsKeeper), evidence.NewAppModule(*app.EvidenceKeeper), - wasm.NewAppModule(appCodec, &app.WasmKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)), + wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)), ibc.NewAppModule(app.IBCKeeper), app.AppKeepers.TransferModule, app.AppKeepers.InterchainQueriesModule, diff --git a/cmd/nolusd/genwasm.go b/cmd/nolusd/genwasm.go index 16ab9ec4..6cf3f731 100644 --- a/cmd/nolusd/genwasm.go +++ b/cmd/nolusd/genwasm.go @@ -1,29 +1,24 @@ package main -import ( - wasmcli "github.com/CosmWasm/wasmd/x/wasm/client/cli" - "github.com/cosmos/cosmos-sdk/client" - "github.com/spf13/cobra" -) +// TODO: remove? +// func addGenesisWasmMsgCmd(defaultNodeHome string) *cobra.Command { +// txCmd := &cobra.Command{ +// Use: "add-wasm-genesis-message", +// Short: "Wasm genesis subcommands", +// DisableFlagParsing: true, +// SuggestionsMinimumDistance: 2, +// RunE: client.ValidateCmd, +// } -func addGenesisWasmMsgCmd(defaultNodeHome string) *cobra.Command { - txCmd := &cobra.Command{ - Use: "add-wasm-genesis-message", - Short: "Wasm genesis subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } +// genesisIO := wasmcli.NewDefaultGenesisIO() - genesisIO := wasmcli.NewDefaultGenesisIO() +// txCmd.AddCommand( +// wasmcli.GenesisStoreCodeCmd(defaultNodeHome, genesisIO), +// wasmcli.GenesisInstantiateContractCmd(defaultNodeHome, genesisIO), +// wasmcli.GenesisExecuteContractCmd(defaultNodeHome, genesisIO), +// wasmcli.GenesisListContractsCmd(defaultNodeHome, genesisIO), +// wasmcli.GenesisListCodesCmd(defaultNodeHome, genesisIO), +// ) - txCmd.AddCommand( - wasmcli.GenesisStoreCodeCmd(defaultNodeHome, genesisIO), - wasmcli.GenesisInstantiateContractCmd(defaultNodeHome, genesisIO), - wasmcli.GenesisExecuteContractCmd(defaultNodeHome, genesisIO), - wasmcli.GenesisListContractsCmd(defaultNodeHome, genesisIO), - wasmcli.GenesisListCodesCmd(defaultNodeHome, genesisIO), - ) - - return txCmd -} +// return txCmd +// } diff --git a/cmd/nolusd/root.go b/cmd/nolusd/root.go index ab78740b..648d21e0 100644 --- a/cmd/nolusd/root.go +++ b/cmd/nolusd/root.go @@ -270,7 +270,8 @@ func initRootCmd( ), genutilcli.ValidateGenesisCmd(app.ModuleBasics), addGenesisAccountCmd(app.DefaultNodeHome), - addGenesisWasmMsgCmd(app.DefaultNodeHome), + // TODO: remove? + // addGenesisWasmMsgCmd(app.DefaultNodeHome), tmcli.NewCompletionCmd(rootCmd, true), debug.Cmd(), confixcmd.ConfigCommand(), diff --git a/go.mod b/go.mod index 4e5f10bd..ac72ba4e 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/cometbft/cometbft v0.38.11 github.com/cosmos/cosmos-sdk v0.50.7 github.com/cosmos/gogoproto v1.5.0 - github.com/cosmos/ibc-go/v8 v8.2.1 + github.com/cosmos/ibc-go/v8 v8.3.2 github.com/golang/protobuf v1.5.4 github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -201,10 +201,11 @@ require ( github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.32.0 // indirect + github.com/rs/zerolog v1.33.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/shamaton/msgpack/v2 v2.2.0 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/skip-mev/block-sdk/v2 v2.1.2 // indirect github.com/skip-mev/feemarket v1.0.3 // indirect @@ -258,7 +259,8 @@ replace ( cosmossdk.io/client/v2 => cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79 github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - github.com/CosmWasm/wasmd => github.com/neutron-org/wasmd v0.51.0 + // github.com/CosmWasm/wasmd => github.com/neutron-org/wasmd v0.51.0 + github.com/CosmWasm/wasmd => /home/denislavivanov/go/github/wasmd-nolus-fork/wasmd // TODO: Simapp dependency, review removing when updating to SDK with backported update https://github.com/cosmos/cosmos-sdk/issues/13423 github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.2 // indirect diff --git a/go.sum b/go.sum index e229fe2b..d69a11cf 100644 --- a/go.sum +++ b/go.sum @@ -229,8 +229,8 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CosmWasm/wasmvm/v2 v2.0.0 h1:IqNCI2G0mvs7K6ej17/I28805rVqnu+Y1cWDqIdwb08= -github.com/CosmWasm/wasmvm/v2 v2.0.0/go.mod h1:su9lg5qLr7adV95eOfzjZWkGiky8WNaNIHDr7Fpu7Ck= +github.com/CosmWasm/wasmvm/v2 v2.1.0 h1:bleLhNA36hM8iPjFJsNRi9RjrQW6MtXafw2+wVjAWAE= +github.com/CosmWasm/wasmvm/v2 v2.1.0/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= @@ -389,10 +389,12 @@ github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.1 h1:BHn+JWZILxkUT9IrlP1ctUfo9ENGi+EmiZ9om1XSHIw= github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.1/go.mod h1:82hPO/tRawbuFad2gPwChvpZ0JEIoNi91LwVneAYCeM= +github.com/cosmos/ibc-go/modules/apps/callbacks v0.2.1-0.20231113120333-342c00b0f8bd h1:Lx+/5dZ/nN6qPXP2Ofog6u1fmlkCFA1ElcOconnofEM= +github.com/cosmos/ibc-go/modules/apps/callbacks v0.2.1-0.20231113120333-342c00b0f8bd/go.mod h1:JWfpWVKJKiKtd53/KbRoKfxWl8FsT2GPcNezTOk0o5Q= 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/interchain-security/v5 v5.0.0 h1:iwHu1nFbXuYfa13isEgm6hkHU+2t/t56YjcfyP3PnQA= @@ -912,8 +914,6 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/neutron-org/admin-module/v2 v2.0.0 h1:MlkSc1821sQ+G5/cYOajuqZ5/lM53xTbixpTtXnHh0A= github.com/neutron-org/admin-module/v2 v2.0.0/go.mod h1:RfOyabXsdJ5btcOKyKPZDYiZhtuKFubbJMOb8EJZtvA= -github.com/neutron-org/wasmd v0.51.0 h1:OBp5aG8xeEz199Crepwb3q6YtuJVL0sudsD7F2oyyfs= -github.com/neutron-org/wasmd v0.51.0/go.mod h1:7TSaj5HoolghujuVWeExqmcUKgpcYWEySGLSODbnnwY= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nkovacs/streamquote v1.0.0/go.mod h1:BN+NaZ2CmdKqUuTUXUEm9j95B2TRbpOWpxbJYzzgUsc= github.com/nolus-protocol/cosmos-sdk v0.50.7-nolus-rc1 h1:QK59L25el60UuVoosifSg3EVK+/n6urjln6yxNnxAI4= @@ -1037,8 +1037,8 @@ github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= -github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1053,6 +1053,8 @@ github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0 github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shamaton/msgpack/v2 v2.2.0 h1:IP1m01pHwCrMa6ZccP9B3bqxEMKMSmMVAVKk54g3L/Y= +github.com/shamaton/msgpack/v2 v2.2.0/go.mod h1:6khjYnkx73f7VQU7wjcFS9DFjs+59naVWJv1TB7qdOI= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= From 53a832e8058a74e59696f97e6032f9a5f22a8f21 Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Wed, 31 Jul 2024 15:57:46 +0300 Subject: [PATCH 02/23] wip --- app/keepers/keepers.go | 5 ++--- go.mod | 6 +++--- scripts/internal/genesis.sh | 3 ++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 0ced3ab2..a4940fb8 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -381,8 +381,7 @@ func (appKeepers *AppKeepers) NewAppKeepers( authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) appKeepers.ICAHostKeeper = &icaHostKeeper - // TODO: use this with ibc-go v8.3.0 https://github.com/cosmos/ibc-go/issues/6415 - // appKeepers.ICAHostKeeper.WithQueryRouter(grpcQueryRouter) + appKeepers.ICAHostKeeper.WithQueryRouter(grpcQueryRouter) appKeepers.IcaModule = ica.NewAppModule(appKeepers.ICAControllerKeeper, appKeepers.ICAHostKeeper) @@ -424,7 +423,7 @@ func (appKeepers *AppKeepers) NewAppKeepers( var wasmOpts []wasmkeeper.Option // The last arguments can contain custom message handlers, and custom query handlers, // if we want to allow any custom callbacks - supportedFeatures := []string{"iterator", "stargate", "staking", "neutron", "migrate", "upgrade", "cosmwasm_1_1", "cosmwasm_1_2", "cosmwasm_1_3", "cosmwasm_1_4", "cosmwasm_2_0"} + supportedFeatures := []string{"iterator", "stargate", "staking", "neutron", "migrate", "upgrade", "cosmwasm_1_1", "cosmwasm_1_2", "cosmwasm_1_3", "cosmwasm_1_4", "cosmwasm_2_0", "cosmwasm_2_1"} wasmOpts = append(wasmbinding.RegisterCustomPlugins( appKeepers.InterchainTxsKeeper, appKeepers.InterchainQueriesKeeper, diff --git a/go.mod b/go.mod index ac72ba4e..d34eef6f 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/Nolus-Protocol/nolus-core go 1.22.4 require ( - github.com/CosmWasm/wasmd v0.51.0 - github.com/CosmWasm/wasmvm/v2 v2.0.0 - github.com/cometbft/cometbft v0.38.11 + github.com/CosmWasm/wasmd v0.52.0 + github.com/CosmWasm/wasmvm/v2 v2.1.0 + github.com/cometbft/cometbft v0.38.10 github.com/cosmos/cosmos-sdk v0.50.7 github.com/cosmos/gogoproto v1.5.0 github.com/cosmos/ibc-go/v8 v8.3.2 diff --git a/scripts/internal/genesis.sh b/scripts/internal/genesis.sh index 34a4239d..442af3d2 100644 --- a/scripts/internal/genesis.sh +++ b/scripts/internal/genesis.sh @@ -75,7 +75,8 @@ generate_genesis() { _=$(__generate_proto_genesis_no_wasm "$chain_id" "$native_currency" \ "$accounts_spec" "$treasury_contract_addr" "$treasury_init_tokens_u128" "$admin_contract_addr" "$gov_voting_period" \ "$gov_max_deposit_period" "$gov_expedited_voting_period" "$staking_max_validators" "$feerefunder_ack_fee_min" "$feerefunder_timeout_fee_min" "$store_code_privileged_addr") - _=$(add_wasm_messages "$genesis_home_dir" "$wasm_code_path" "$treasury_init_tokens" "$dex_admin_address") + # TODO + #_=$(add_wasm_messages "$genesis_home_dir" "$wasm_code_path" "$treasury_init_tokens" "$dex_admin_address") create_validator_txs="$(__gen_val_txns "$genesis_file" "$node_id_and_val_pubkeys" "$val_stake")" _=$(__integrate_genesis_txs "$create_validator_txs") From 92f640969ef842bc77ecf18e2a8d93bc3717ef88 Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Tue, 6 Aug 2024 14:41:20 +0300 Subject: [PATCH 03/23] wip: remove unused code --- cmd/nolusd/genwasm.go | 24 ------------------------ cmd/nolusd/root.go | 2 -- 2 files changed, 26 deletions(-) delete mode 100644 cmd/nolusd/genwasm.go diff --git a/cmd/nolusd/genwasm.go b/cmd/nolusd/genwasm.go deleted file mode 100644 index 6cf3f731..00000000 --- a/cmd/nolusd/genwasm.go +++ /dev/null @@ -1,24 +0,0 @@ -package main - -// TODO: remove? -// func addGenesisWasmMsgCmd(defaultNodeHome string) *cobra.Command { -// txCmd := &cobra.Command{ -// Use: "add-wasm-genesis-message", -// Short: "Wasm genesis subcommands", -// DisableFlagParsing: true, -// SuggestionsMinimumDistance: 2, -// RunE: client.ValidateCmd, -// } - -// genesisIO := wasmcli.NewDefaultGenesisIO() - -// txCmd.AddCommand( -// wasmcli.GenesisStoreCodeCmd(defaultNodeHome, genesisIO), -// wasmcli.GenesisInstantiateContractCmd(defaultNodeHome, genesisIO), -// wasmcli.GenesisExecuteContractCmd(defaultNodeHome, genesisIO), -// wasmcli.GenesisListContractsCmd(defaultNodeHome, genesisIO), -// wasmcli.GenesisListCodesCmd(defaultNodeHome, genesisIO), -// ) - -// return txCmd -// } diff --git a/cmd/nolusd/root.go b/cmd/nolusd/root.go index 648d21e0..7ba6c537 100644 --- a/cmd/nolusd/root.go +++ b/cmd/nolusd/root.go @@ -270,8 +270,6 @@ func initRootCmd( ), genutilcli.ValidateGenesisCmd(app.ModuleBasics), addGenesisAccountCmd(app.DefaultNodeHome), - // TODO: remove? - // addGenesisWasmMsgCmd(app.DefaultNodeHome), tmcli.NewCompletionCmd(rootCmd, true), debug.Cmd(), confixcmd.ConfigCommand(), From bdc101beb7a08f3e57834ad5ee1798cf7f5f2eef Mon Sep 17 00:00:00 2001 From: desislavva Date: Tue, 6 Aug 2024 16:43:05 +0300 Subject: [PATCH 04/23] feat(scripts): Deploy platform to live network --- scripts/genesis.sh | 15 ++------- scripts/init-local-network.sh | 17 ++++++++-- scripts/init-network.sh | 12 ++----- scripts/internal/genesis.sh | 57 +++++++++++++++++--------------- scripts/internal/init-network.sh | 28 ++++++++-------- 5 files changed, 63 insertions(+), 66 deletions(-) diff --git a/scripts/genesis.sh b/scripts/genesis.sh index fbf9815e..80ba2bdc 100755 --- a/scripts/genesis.sh +++ b/scripts/genesis.sh @@ -19,7 +19,6 @@ __print_usage() { [--currency ] [--accounts ] [--wasm-script-path ] - [--wasm-code-path ] [--treasury-nls-u128 [--validator-node-urls-pubkeys ] [--validator-accounts-dir ] @@ -42,7 +41,6 @@ CHAIN_ID="" NATIVE_CURRENCY="unls" ACCOUNTS_SPEC="" WASM_SCRIPT_PATH="" -WASM_CODE_PATH="" TREASURY_INIT_TOKENS_U128="" VAL_NODE_URLS_AND_VAL_PUBKEYS="" VAL_ACCOUNTS_DIR="val-accounts" @@ -101,12 +99,6 @@ while [[ $# -gt 0 ]]; do shift ;; - --wasm-code-path) - WASM_CODE_PATH="$2" - shift - shift - ;; - --treasury-nls-u128) TREASURY_INIT_TOKENS_U128="$2" shift @@ -203,7 +195,6 @@ if [[ "$COMMAND" == "$COMMAND_FULL_GEN" ]]; then verify_mandatory "$CHAIN_ID" "Nolus chain identifier" verify_mandatory "$ACCOUNTS_SPEC" "Nolus genesis accounts spec" verify_mandatory "$WASM_SCRIPT_PATH" "Wasm script path" - verify_mandatory "$WASM_CODE_PATH" "Wasm code path" verify_mandatory "$TREASURY_INIT_TOKENS_U128" "Treasury init tokens" verify_mandatory "$VAL_NODE_URLS_AND_VAL_PUBKEYS" "Validator URLs and validator public keys spec" verify_mandatory "$OUTPUT_FILE" "Genesis output file" @@ -212,9 +203,9 @@ if [[ "$COMMAND" == "$COMMAND_FULL_GEN" ]]; then genesis_file=$(generate_genesis "$CHAIN_ID" "$NATIVE_CURRENCY" "$VAL_TOKENS" "$VAL_STAKE" \ "$VAL_ACCOUNTS_DIR" "$ACCOUNTS_SPEC" "$WASM_SCRIPT_PATH" \ - "$WASM_CODE_PATH" "$TREASURY_INIT_TOKENS_U128" \ - "$VAL_NODE_URLS_AND_VAL_PUBKEYS" "$GOV_VOTING_PERIOD" \ - "$GOV_MAX_DEPOSIT_PERIOD" "$GOV_EXPEDITED_VOTING_PERIOD" "$STAKING_MAX_VALIDATORS" \ + "$TREASURY_INIT_TOKENS_U128" "$VAL_NODE_URLS_AND_VAL_PUBKEYS" \ + "$GOV_VOTING_PERIOD" "$GOV_MAX_DEPOSIT_PERIOD" \ + "$GOV_EXPEDITED_VOTING_PERIOD" "$STAKING_MAX_VALIDATORS" \ "$FEEREFUNDER_ACK_FEE_MIN" "$FEEREFUNDER_TIMEOUT_FEE_MIN" \ "$DEX_ADMIN_MNEMONIC" "$STORE_CODE_PRIVILEGED_ACCOUNT_MNEMONIC" \ "$ADMINS_TOKENS") diff --git a/scripts/init-local-network.sh b/scripts/init-local-network.sh index 89951c07..8d962026 100755 --- a/scripts/init-local-network.sh +++ b/scripts/init-local-network.sh @@ -46,6 +46,9 @@ DEX_ADMIN_MNEMONIC="" HERMES_ACCOUNT_MNEMONIC="" STORE_CODE_PRIVILEGED_ACCOUNT_MNEMONIC="" +STORE_CODE_PRIVILEGED_ACCOUNT_KEY_NAME="storeAdmin" +INSTANTIATE_PRIVILEGED_ACCOUNT_KEY_NAME="wasmAdmin" + # Hermes - Nolus chain configuration RPC_TIMEOUT_SECS="10" DEFAULT_GAS="1000000" @@ -339,7 +342,6 @@ __config_client() { } verify_dir_exist "$WASM_SCRIPT_PATH" "WASM sripts path" -verify_dir_exist "$WASM_CODE_ARTIFACTS_PATH_PLATFORM" "WASM code path - platform" verify_mandatory "$HERMES_ACCOUNT_MNEMONIC" "Hermes account mnemonic" verify_mandatory "$DEX_ADMIN_MNEMONIC" "DEX-Admin account mnemonic" verify_mandatory "$STORE_CODE_PRIVILEGED_ACCOUNT_MNEMONIC" "WASM store-code privileged account mnemonic" @@ -355,8 +357,8 @@ init_setup_validator_local_sh "$INIT_LOCAL_NETWORK_SCRIPT_DIR" "$VALIDATORS_ROOT source "$INIT_LOCAL_NETWORK_SCRIPT_DIR"/internal/init-network.sh init_network "$VAL_ACCOUNTS_DIR" "$VALIDATORS" "$MINIMUM_GAS_PRICE" "$QUERY_GAS_LIMIT" "$CHAIN_ID" "$NATIVE_CURRENCY" \ - "$VAL_TOKENS" "$VAL_STAKE" "$accounts_spec" "$WASM_SCRIPT_PATH" "$WASM_CODE_ARTIFACTS_PATH_PLATFORM" \ - "$TREASURY_NLS_U128" "$GOV_VOTING_PERIOD" "$GOV_MAX_DEPOSIT_PERIOD" "$GOV_EXPEDITED_VOTING_PERIOD" "$STAKING_MAX_VALIDATORS" \ + "$VAL_TOKENS" "$VAL_STAKE" "$accounts_spec" "$WASM_SCRIPT_PATH" "$TREASURY_NLS_U128" \ + "$GOV_VOTING_PERIOD" "$GOV_MAX_DEPOSIT_PERIOD" "$GOV_EXPEDITED_VOTING_PERIOD" "$STAKING_MAX_VALIDATORS" \ "$FEEREFUNDER_ACK_FEE_MIN" "$FEEREFUNDER_TIMEOUT_FEE_MIN" \ "$DEX_ADMIN_MNEMONIC" "$STORE_CODE_PRIVILEGED_ACCOUNT_MNEMONIC" "$ADMINS_BALANCE" @@ -376,3 +378,12 @@ HERMES_BINARY_DIR="$HOME"/hermes wait_nolus_gets_ready "$USER_DIR" wait_hermes_config_gets_healthy "$HERMES_BINARY_DIR" + +source "$WASM_SCRIPT_PATH/deploy-platform.sh" +source "$INIT_LOCAL_NETWORK_SCRIPT_DIR"/internal/genesis.sh + +recover_account "$USER_DIR" "$STORE_CODE_PRIVILEGED_ACCOUNT_MNEMONIC" "$STORE_CODE_PRIVILEGED_ACCOUNT_KEY_NAME" +INSTANTIATE_PRIVILEGED_ACCOUNT_ADDRESS=$(recover_account "$USER_DIR" "$DEX_ADMIN_MNEMONIC" "$INSTANTIATE_PRIVILEGED_ACCOUNT_KEY_NAME") + +RPC="http://$NOLUS_NETWORK_ADDR:$NOLUS_NETWORK_RPC_PORT" +deploy_contracts "$RPC" "$CHAIN_ID" "$USER_DIR" "$WASM_CODE_ARTIFACTS_PATH_PLATFORM" "$INSTANTIATE_PRIVILEGED_ACCOUNT_ADDRESS" "$STORE_CODE_PRIVILEGED_ACCOUNT_KEY_NAME" diff --git a/scripts/init-network.sh b/scripts/init-network.sh index 42483069..f818c728 100755 --- a/scripts/init-network.sh +++ b/scripts/init-network.sh @@ -38,7 +38,6 @@ VAL_TOKENS="1000000000""$NATIVE_CURRENCY" VAL_STAKE="1000000""$NATIVE_CURRENCY" CHAIN_ID="" WASM_SCRIPT_PATH="" -WASM_CODE_PATH="" TREASURY_NLS_U128="1000000000000" FAUCET_MNEMONIC="" FAUCET_TOKENS="100000000000""$NATIVE_CURRENCY" @@ -172,12 +171,6 @@ while [[ $# -gt 0 ]]; do shift ;; - --wasm-code-path) - WASM_CODE_PATH="$2" - shift - shift - ;; - --treasury-nls-u128) TREASURY_NLS_U128="$2" shift @@ -261,7 +254,6 @@ done verify_mandatory "$ARTIFACT_BIN" "Nolus binary actifact" verify_mandatory "$ARTIFACT_SCRIPTS" "Nolus scipts actifact" verify_mandatory "$WASM_SCRIPT_PATH" "Wasm script path" -verify_mandatory "$WASM_CODE_PATH" "Wasm code path" verify_mandatory "$FAUCET_MNEMONIC" "Faucet mnemonic" verify_mandatory "$CHAIN_ID" "Nolus Chain ID" verify_mandatory "$SSH_USER" "Server ssh user" @@ -284,8 +276,8 @@ setup_services "$VALIDATORS" source "$SCRIPT_DIR"/internal/init-network.sh init_network "$VAL_ACCOUNTS_DIR" "$VALIDATORS" "$MINIMUM_GAS_PRICE" "$QUERY_GAS_LIMIT" "$CHAIN_ID" "$NATIVE_CURRENCY" \ - "$VAL_TOKENS" "$VAL_STAKE" "$accounts_spec" "$WASM_SCRIPT_PATH" "$WASM_CODE_PATH" \ - "$TREASURY_NLS_U128" "$GOV_VOTING_PERIOD" "$GOV_MAX_DEPOSIT_PERIOD" "$GOV_EXPEDITED_VOTING_PERIOD" "$STAKING_MAX_VALIDATORS" \ + "$VAL_TOKENS" "$VAL_STAKE" "$accounts_spec" "$WASM_SCRIPT_PATH" "$TREASURY_NLS_U128" \ + "$GOV_VOTING_PERIOD" "$GOV_MAX_DEPOSIT_PERIOD" "$GOV_EXPEDITED_VOTING_PERIOD" "$STAKING_MAX_VALIDATORS" \ "$FEEREFUNDER_ACK_FEE_MIN" "$FEEREFUNDER_TIMEOUT_FEE_MIN" \ "$DEX_ADMIN_MNEMONIC" "$STORE_CODE_PRIVILEGED_ACCOUNT_MNEMONIC" "$ADMINS_TOKENS" diff --git a/scripts/internal/genesis.sh b/scripts/internal/genesis.sh index 442af3d2..c3afc1ff 100644 --- a/scripts/internal/genesis.sh +++ b/scripts/internal/genesis.sh @@ -28,6 +28,19 @@ determine_addr() { rm_dir "$key_dir" } +__addresses_to_string() { + local -r addresses=("${@:1}") + + local addresses_to_string="[" + for address in "${addresses[@]}"; do + addresses_to_string+="\"$address\"," + done + addresses_to_string="${addresses_to_string%,}" + addresses_to_string+="]" + + echo "$addresses_to_string" +} + generate_genesis() { set -euo pipefail local -r chain_id="$1" @@ -37,19 +50,17 @@ generate_genesis() { local -r val_accounts_dir="$5" local -r accounts_spec_in="$6" local -r wasm_script_path="$7" - local -r wasm_code_path="$8" - local -r treasury_init_tokens_u128="$9" - local -r node_id_and_val_pubkeys="${10}" - local -r gov_voting_period="${11}" - local -r gov_max_deposit_period="${12}" - local -r gov_expedited_voting_period="${13}" - local -r staking_max_validators="${14}" - local -r feerefunder_ack_fee_min="${15}" - local -r feerefunder_timeout_fee_min="${16}" - local -r dex_admin_mnemonic="${17}" - local -r store_code_privileged_account_mnemonic="${18}" - local -r admins_tokens="${19}" - + local -r treasury_init_tokens_u128="$8" + local -r node_id_and_val_pubkeys="$9" + local -r gov_voting_period="${10}" + local -r gov_max_deposit_period="${11}" + local -r gov_expedited_voting_period="${12}" + local -r staking_max_validators="${13}" + local -r feerefunder_ack_fee_min="${14}" + local -r feerefunder_timeout_fee_min="${15}" + local -r dex_admin_mnemonic="${16}" + local -r store_code_privileged_account_mnemonic="${17}" + local -r admins_tokens="${18}" local -r treasury_init_tokens="$treasury_init_tokens_u128$native_currency" init_val_mngr_sh "$val_accounts_dir" "$chain_id" @@ -74,9 +85,8 @@ generate_genesis() { # use the below pattern to let the pipefail dump the failed command output _=$(__generate_proto_genesis_no_wasm "$chain_id" "$native_currency" \ "$accounts_spec" "$treasury_contract_addr" "$treasury_init_tokens_u128" "$admin_contract_addr" "$gov_voting_period" \ - "$gov_max_deposit_period" "$gov_expedited_voting_period" "$staking_max_validators" "$feerefunder_ack_fee_min" "$feerefunder_timeout_fee_min" "$store_code_privileged_addr") - # TODO - #_=$(add_wasm_messages "$genesis_home_dir" "$wasm_code_path" "$treasury_init_tokens" "$dex_admin_address") + "$gov_max_deposit_period" "$gov_expedited_voting_period" "$staking_max_validators" "$feerefunder_ack_fee_min" "$feerefunder_timeout_fee_min" \ + "$store_code_privileged_addr") create_validator_txs="$(__gen_val_txns "$genesis_file" "$node_id_and_val_pubkeys" "$val_stake")" _=$(__integrate_genesis_txs "$create_validator_txs") @@ -141,7 +151,7 @@ __generate_proto_genesis_no_wasm() { local -r feerefunder_timeout_fee_min="${12}" local -r store_code_privileged_addr="${13}" - local -a wasm_allowed_addresses=("$admin_contract_addr" "$store_code_privileged_addr") + local -a wasm_allowed_addresses_store=("$admin_contract_addr" "$store_code_privileged_addr") run_cmd "$genesis_home_dir" init genesis_manager --chain-id "$chain_id" run_cmd "$genesis_home_dir" config set client keyring-backend test @@ -149,7 +159,7 @@ __generate_proto_genesis_no_wasm() { __set_token_denominations "$genesis_file" "$native_currency" __set_tax_recipient "$genesis_file" "$treasury_addr" - __set_wasm_permission_params "$genesis_file" "${wasm_allowed_addresses[@]}" + __set_wasm_permission_params "$genesis_file" "${wasm_allowed_addresses_store[@]}" __set_gov_parameters "$genesis_file" "$gov_voting_period" "$gov_max_deposit_period" "$gov_expedited_voting_period" __modify_slashing_and_staking_params "$genesis_file" "$staking_max_validators" __modify_neutron_modules_params "$genesis_file" "$feerefunder_ack_fee_min" "$feerefunder_timeout_fee_min" "$native_currency" @@ -206,20 +216,15 @@ __set_tax_recipient() { __set_wasm_permission_params() { local -r genesis_file="$1" - local -a allowed_addresses=("${@:2}") + local -a allowed_addresses_store=("${@:2}") local genesis_tmp_file="$genesis_file".tmp - local addresses_to_string="[" - for address in "${allowed_addresses[@]}"; do - addresses_to_string+="\"$address\"," - done - addresses_to_string="${addresses_to_string%,}" - addresses_to_string+="]" + local -r allowed_addresses_store_string=$(__addresses_to_string "${allowed_addresses_store[@]}") < "$genesis_file" \ jq '.app_state["wasm"]["params"]["code_upload_access"]["permission"]="AnyOfAddresses"' \ - | jq '.app_state["wasm"]["params"]["code_upload_access"]["addresses"]='$addresses_to_string'' \ + | jq '.app_state["wasm"]["params"]["code_upload_access"]["addresses"]='$allowed_addresses_store_string'' \ | jq '.app_state["wasm"]["params"]["instantiate_default_permission"]="Everybody"' > "$genesis_tmp_file" mv "$genesis_tmp_file" "$genesis_file" diff --git a/scripts/internal/init-network.sh b/scripts/internal/init-network.sh index 8f9005e0..6537dcb9 100755 --- a/scripts/internal/init-network.sh +++ b/scripts/internal/init-network.sh @@ -19,27 +19,25 @@ init_network() { local -r val_stake="$8" local genesis_accounts_spec="$9" local -r wasm_script_path="${10}" - local -r wasm_code_path="${11}" - local -r treasury_init_tokens_u128="${12}" - local -r gov_voting_period="${13}" - local -r gov_max_deposit_period="${14}" - local -r gov_expedited_voting_period="${15}" - local -r staking_max_validators="${16}" - local -r feerefunder_ack_fee_min="${17}" - local -r feerefunder_timeout_fee_min="${18}" - local -r dex_admin_mnemonic="${19}" - local -r store_code_privileged_account_mnemonic="${20}" - local -r admins_tokens="${21}" + local -r treasury_init_tokens_u128="${11}" + local -r gov_voting_period="${12}" + local -r gov_max_deposit_period="${13}" + local -r gov_expedited_voting_period="${14}" + local -r staking_max_validators="${15}" + local -r feerefunder_ack_fee_min="${16}" + local -r feerefunder_timeout_fee_min="${17}" + local -r dex_admin_mnemonic="${18}" + local -r store_code_privileged_account_mnemonic="${19}" + local -r admins_tokens="${20}" node_id_and_val_pubkeys="$(setup_validators "$validators" "$minimum_gas_price" "$query_gas_limit")" local final_genesis_file; final_genesis_file=$(generate_genesis "$chain_id" "$native_currency" \ "$val_tokens" "$val_stake" \ "$val_accounts_dir" "$genesis_accounts_spec" \ - "$wasm_script_path" "$wasm_code_path" \ - "$treasury_init_tokens_u128" \ - "$node_id_and_val_pubkeys" \ - "$gov_voting_period" "$gov_max_deposit_period" "$gov_expedited_voting_period" "$staking_max_validators" \ + "$wasm_script_path" "$treasury_init_tokens_u128" \ + "$node_id_and_val_pubkeys" "$gov_voting_period" \ + "$gov_max_deposit_period" "$gov_expedited_voting_period" "$staking_max_validators" \ "$feerefunder_ack_fee_min" "$feerefunder_timeout_fee_min" \ "$dex_admin_mnemonic" "$store_code_privileged_account_mnemonic" "$admins_tokens") propagate_genesis "$final_genesis_file" "$validators" From 62159917315bfa586d99ce99e2198ec92f5fe4d9 Mon Sep 17 00:00:00 2001 From: desislavva Date: Thu, 8 Aug 2024 11:43:32 +0300 Subject: [PATCH 05/23] chore(scripts): Keys default values --- scripts/add-new-dex.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/add-new-dex.sh b/scripts/add-new-dex.sh index 4fd02352..ded602f2 100755 --- a/scripts/add-new-dex.sh +++ b/scripts/add-new-dex.sh @@ -13,8 +13,8 @@ NOLUS_NETWORK_RPC_PORT="26612" NOLUS_HOME_DIR="$HOME/.nolus" NOLUS_MONEY_MARKET_DIR="$SCRIPTS_DIR/../../nolus-money-market" ACCOUNT_KEY_TO_FEED_HERMES_ADDRESS="reserve" -DEX_ADMIN_KEY="" -STORE_CODE_PRIVILEGED_USER_KEY="" +DEX_ADMIN_KEY="wasmAdmin" +STORE_CODE_PRIVILEGED_USER_KEY="storeAdmin" WASM_ARTIFACTS_PATH="" HERMES_CONFIG_DIR_PATH="$HOME/.hermes" @@ -290,8 +290,6 @@ DEPLOY_CONTRACTS_SCRIPT="$NOLUS_MONEY_MARKET_DIR/scripts/deploy-contracts-live.s verify_dir_exist "$WASM_ARTIFACTS_PATH" "The WASM_ARTIFACTS_PATH dir does not exist" verify_mandatory "$DEX_NAME" "new DEX name" verify_mandatory "$DEX_TYPE_AND_PARAMS" "DEX type and parameters" -verify_mandatory "$DEX_ADMIN_KEY" "dex-admin key name" -verify_mandatory "$STORE_CODE_PRIVILEGED_USER_KEY" "sotre-code privileged user key" verify_mandatory "$DEX_NETWORK" "new DEX network" verify_mandatory "$CHAIN_ID" "new DEX chain_id" verify_mandatory "$CHAIN_IP_ADDR_RPC" "new DEX RPC addr - fully host part" From ad9064ec2d8b44edbd8315fe81294d067632dba1 Mon Sep 17 00:00:00 2001 From: desislavva Date: Thu, 8 Aug 2024 13:38:56 +0300 Subject: [PATCH 06/23] docs: Update flags --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a2716e55..fdf196a8 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ On a live network, a new DEX can be deployed using the following steps. ### Аutomated step ```sh -./scripts/add-new-dex.sh --dex-admin-key --store-code-privileged-user-key --wasm-artifacts-path --dex-name --dex-chain-id --dex-ip-addr-rpc-host --dex-ip-addr-grpc-host --dex-account-prefix --dex-price-denom --dex-trusting-period-secs --dex-if-interchain-security --protocol-currency --protocol-swap-tree +./scripts/add-new-dex.sh --wasm-artifacts-path --dex-name --dex-chain-id --dex-ip-addr-rpc-host --dex-ip-addr-grpc-host --dex-account-prefix --dex-gas-price-denom --dex-trusting-period-secs --dex-if-interchain-security --protocol-currency --protocol-swap-tree --dex-network --dex-type-and-params '' ``` The script takes care of setting up Hermes to work with the new DEX and, for now, deploying DEX-specific contracts (More about deploying contracts on a live network can be found [here](https://github.com/nolus-protocol/nolus-money-market)). From f222d8ae12cd87cafa0ed762bc473f846ecae734 Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Fri, 9 Aug 2024 15:16:30 +0300 Subject: [PATCH 07/23] chore: use wasmd nolus fork --- go.mod | 3 +-- go.sum | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index d34eef6f..bc0919db 100644 --- a/go.mod +++ b/go.mod @@ -259,8 +259,7 @@ replace ( cosmossdk.io/client/v2 => cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79 github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - // github.com/CosmWasm/wasmd => github.com/neutron-org/wasmd v0.51.0 - github.com/CosmWasm/wasmd => /home/denislavivanov/go/github/wasmd-nolus-fork/wasmd + github.com/CosmWasm/wasmd => github.com/nolus-protocol/wasmd v0.52.0-nolus // TODO: Simapp dependency, review removing when updating to SDK with backported update https://github.com/cosmos/cosmos-sdk/issues/13423 github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.2 // indirect diff --git a/go.sum b/go.sum index d69a11cf..f2145110 100644 --- a/go.sum +++ b/go.sum @@ -920,6 +920,8 @@ github.com/nolus-protocol/cosmos-sdk v0.50.7-nolus-rc1 h1:QK59L25el60UuVoosifSg3 github.com/nolus-protocol/cosmos-sdk v0.50.7-nolus-rc1/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s= github.com/nolus-protocol/neutron/v4 v4.0.1-nolus h1:21r0fWxqjfaLHkPS/y/H1WDxytisOZ3xPsvp+JHa1jU= github.com/nolus-protocol/neutron/v4 v4.0.1-nolus/go.mod h1:7TRawLFzMRs7sXuDd/R5VKHPUfNPDDMYaTcY2UjCqF0= +github.com/nolus-protocol/wasmd v0.52.0-nolus h1:SrmACftzuXy/FwCAUccSkMEMysj3StoB3Mf8pvoqzmI= +github.com/nolus-protocol/wasmd v0.52.0-nolus/go.mod h1:hyy1wt7c589Cs4kOK2cYdtphzCd2Xo20q/t7tfby7oI= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= From 8f39f52072ceabfc2c61a31e7f0c53be82240476 Mon Sep 17 00:00:00 2001 From: desislavva Date: Mon, 12 Aug 2024 09:51:43 +0300 Subject: [PATCH 08/23] fix(scripts): External script name --- scripts/add-new-dex.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/add-new-dex.sh b/scripts/add-new-dex.sh index ded602f2..88f6b254 100755 --- a/scripts/add-new-dex.sh +++ b/scripts/add-new-dex.sh @@ -285,7 +285,7 @@ TIMEALARMS_CONTRACT_ADDRESS="$(timealarms_instance_addr)" NOLUS_CHAIN_ID=$(grep -oP 'chain-id = "\K[^"]+' "$NOLUS_HOME_DIR"/config/client.toml) verify_dir_exist "$NOLUS_MONEY_MARKET_DIR" "The NOLUS_MONEY_MARKET dir does not exist" -DEPLOY_CONTRACTS_SCRIPT="$NOLUS_MONEY_MARKET_DIR/scripts/deploy-contracts-live.sh" +DEPLOY_CONTRACTS_SCRIPT="$NOLUS_MONEY_MARKET_DIR/scripts/deploy-protocol.sh" verify_dir_exist "$WASM_ARTIFACTS_PATH" "The WASM_ARTIFACTS_PATH dir does not exist" verify_mandatory "$DEX_NAME" "new DEX name" From 78c26d4b9e1d758efbaf866909c1707f05c353b5 Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Thu, 15 Aug 2024 17:03:33 +0300 Subject: [PATCH 09/23] fix: add msg.service option in tx proto files --- proto/buf.lock | 8 +- proto/nolus/mint/v1beta1/tx.proto | 1 + proto/nolus/tax/v1beta1/tx.proto | 1 + proto/nolus/vestings/v1beta1/tx.proto | 1 + wasmbinding/test/custom_message_test.go | 876 ++++++++++++------------ wasmbinding/test/custom_query_test.go | 420 ++++++------ x/mint/types/tx.pb.go | 18 +- x/tax/types/tx.pb.go | 18 +- x/vestings/types/tx.pb.go | 64 +- 9 files changed, 677 insertions(+), 730 deletions(-) diff --git a/proto/buf.lock b/proto/buf.lock index a73568a0..cb5a76ff 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -19,8 +19,8 @@ deps: - remote: buf.build owner: cosmos repository: ibc - commit: 41fbc441e4d645119d275150719c5441 - digest: shake256:a61d3e152909abddc91dcc1aec8ac997007bebd48a7921bc243681c708e6c9068f6484aa7ed4e6ff60101d3422c98744a4a5294bbda6aacdba07f1dfa4291020 + commit: c159402ffeef4c21a7f9f0643817ae0d + digest: shake256:694e3f5a1d469798bb6cb3510f6f489e10d9309d1f2e8f7a369a776947602195f13ab65972d2d586a1134978b6a6fa28a43e5d7710ef5032ba0c7fbbe6038f08 - remote: buf.build owner: cosmos repository: ics23 @@ -29,5 +29,5 @@ deps: - remote: buf.build owner: googleapis repository: googleapis - commit: e7f8d366f5264595bcc4cd4139af9973 - digest: shake256:e5e5f1c12f82e028ea696faa43b4f9dc6258a6d1226282962a8c8b282e10946281d815884f574bd279ebd9cd7588629beb3db17b892af6c33b56f92f8f67f509 + commit: 8bc2c51e08c447cd8886cdea48a73e14 + digest: shake256:a969155953a5cedc5b2df5b42c368f2bc66ff8ce1804bc96e0f14ff2ee8a893687963058909df844d1643cdbc98ff099d2daa6bc9f9f5b8886c49afdc60e19af diff --git a/proto/nolus/mint/v1beta1/tx.proto b/proto/nolus/mint/v1beta1/tx.proto index 701c2a98..d515261b 100644 --- a/proto/nolus/mint/v1beta1/tx.proto +++ b/proto/nolus/mint/v1beta1/tx.proto @@ -10,6 +10,7 @@ import "cosmos_proto/cosmos.proto"; // Msg defines the x/mint Msg service. service Msg { + option (cosmos.msg.v1.service) = true; // UpdateParams defines a governance operation for updating the x/mint module // parameters. The authority is hard-coded to the x/gov module account. // diff --git a/proto/nolus/tax/v1beta1/tx.proto b/proto/nolus/tax/v1beta1/tx.proto index 22b8f0d2..a2331342 100644 --- a/proto/nolus/tax/v1beta1/tx.proto +++ b/proto/nolus/tax/v1beta1/tx.proto @@ -11,6 +11,7 @@ import "cosmos_proto/cosmos.proto"; // Msg defines the x/tax Msg service. service Msg { + option (cosmos.msg.v1.service) = true; // UpdateParams defines a governance operation for updating the x/tax module // parameters. The authority is hard-coded to the x/gov module account. // diff --git a/proto/nolus/vestings/v1beta1/tx.proto b/proto/nolus/vestings/v1beta1/tx.proto index 989686d7..ad4d3dfa 100644 --- a/proto/nolus/vestings/v1beta1/tx.proto +++ b/proto/nolus/vestings/v1beta1/tx.proto @@ -10,6 +10,7 @@ option go_package = "github.com/Nolus-Protocol/nolus-core/x/vestings/types"; // Msg defines the vestings Msg service. service Msg { + option (cosmos.msg.v1.service) = true; // CreateVestingAccount defines a method that enables creating a vesting // account. rpc CreateVestingAccount(MsgCreateVestingAccount) diff --git a/wasmbinding/test/custom_message_test.go b/wasmbinding/test/custom_message_test.go index fd54255e..d94f0666 100644 --- a/wasmbinding/test/custom_message_test.go +++ b/wasmbinding/test/custom_message_test.go @@ -1,457 +1,423 @@ package test -import ( - "encoding/json" - "testing" - - "cosmossdk.io/math" - sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - - "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - "github.com/CosmWasm/wasmvm/v2/types" - - ibcchanneltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v8/modules/core/24-host" - ibchost "github.com/cosmos/ibc-go/v8/modules/core/exported" - - "github.com/neutron-org/neutron/v4/app" - "github.com/neutron-org/neutron/v4/app/params" - "github.com/neutron-org/neutron/v4/testutil" - contractmanagerkeeper "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" - feeburnertypes "github.com/neutron-org/neutron/v4/x/feeburner/types" - feetypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" - icqkeeper "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" - icqtypes "github.com/neutron-org/neutron/v4/x/interchainqueries/types" - ictxkeeper "github.com/neutron-org/neutron/v4/x/interchaintxs/keeper" - ictxtypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" - - "github.com/Nolus-Protocol/nolus-core/wasmbinding" - "github.com/Nolus-Protocol/nolus-core/wasmbinding/bindings" -) - -const FeeCollectorAddress = "neutron1vguuxez2h5ekltfj9gjd62fs5k4rl2zy5hfrncasykzw08rezpfsd2rhm7" - -type CustomMessengerTestSuite struct { - testutil.IBCConnectionTestSuite - neutron *app.App - ctx sdk.Context - messenger *wasmbinding.CustomMessenger - contractOwner sdk.AccAddress - contractAddress sdk.AccAddress - contractKeeper wasmtypes.ContractOpsKeeper -} - -func (suite *CustomMessengerTestSuite) SetupTest() { - suite.IBCConnectionTestSuite.SetupTest() - suite.neutron = suite.GetNeutronZoneApp(suite.ChainA) - suite.ctx = suite.ChainA.GetContext() - suite.messenger = &wasmbinding.CustomMessenger{} - suite.messenger.Ictxmsgserver = ictxkeeper.NewMsgServerImpl(suite.neutron.InterchainTxsKeeper) - suite.messenger.Keeper = suite.neutron.InterchainTxsKeeper - suite.messenger.Icqmsgserver = icqkeeper.NewMsgServerImpl(suite.neutron.InterchainQueriesKeeper) - suite.messenger.ContractmanagerKeeper = &suite.neutron.ContractManagerKeeper - suite.contractOwner = keeper.RandomAccountAddress(suite.T()) - - suite.contractKeeper = keeper.NewDefaultPermissionKeeper(&suite.neutron.WasmKeeper) - - codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") - suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) - suite.Require().NotEmpty(suite.contractAddress) -} - -func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccount() { - err := suite.neutron.FeeBurnerKeeper.SetParams(suite.ctx, feeburnertypes.Params{ - NeutronDenom: "untrn", - TreasuryAddress: "neutron13jrwrtsyjjuynlug65r76r2zvfw5xjcq6532h2", - }) - suite.Require().NoError(err) - - // Craft RegisterInterchainAccount message - msg := bindings.NeutronMsg{ - RegisterInterchainAccount: &bindings.RegisterInterchainAccount{ - ConnectionId: suite.Path.EndpointA.ConnectionID, - InterchainAccountId: testutil.TestInterchainID, - RegisterFee: sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(1_000_000))), - }, - } - - bankKeeper := suite.neutron.BankKeeper - senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() - err = bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(1_000_000)))) - suite.NoError(err) - - // Dispatch RegisterInterchainAccount message - _, err = suite.executeNeutronMsg(suite.contractAddress, msg) - suite.NoError(err) -} - -func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccountLongID() { - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") - suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) - suite.Require().NotEmpty(suite.contractAddress) - - // Craft RegisterInterchainAccount message - msg, err := json.Marshal(bindings.NeutronMsg{ - RegisterInterchainAccount: &bindings.RegisterInterchainAccount{ - ConnectionId: suite.Path.EndpointA.ConnectionID, - // the limit is 47, this line is 50 characters long - InterchainAccountId: "01234567890123456789012345678901234567890123456789", - }, - }) - suite.NoError(err) - - // Dispatch RegisterInterchainAccount message via DispatchHandler cause we want to catch an error from SDK directly, not from a contract - _, _, _, err = suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ - Custom: msg, - }) - suite.Error(err) - suite.ErrorIs(err, ictxtypes.ErrLongInterchainAccountID) -} - -func (suite *CustomMessengerTestSuite) TestRegisterInterchainQuery() { - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") - suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) - suite.Require().NotEmpty(suite.contractAddress) - - err := testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) - suite.Require().NoError(err) - - // Top up contract balance - senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() - coinsAmnt := sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, sdkmath.NewInt(int64(10_000_000)))) - bankKeeper := suite.neutron.BankKeeper - err = bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, coinsAmnt) - suite.NoError(err) - - // Craft RegisterInterchainQuery message - msg, err := json.Marshal(bindings.NeutronMsg{ - RegisterInterchainQuery: &bindings.RegisterInterchainQuery{ - QueryType: string(icqtypes.InterchainQueryTypeKV), - Keys: []*icqtypes.KVKey{ - {Path: ibchost.StoreKey, Key: host.FullClientStateKey(suite.Path.EndpointB.ClientID)}, - }, - TransactionsFilter: "{}", - ConnectionId: suite.Path.EndpointA.ConnectionID, - UpdatePeriod: 20, - }, - }) - suite.NoError(err) - - // Dispatch RegisterInterchainQuery message - events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ - Custom: msg, - }) - suite.NoError(err) - suite.Nil(events) - suite.Equal([][]byte{[]byte(`{"id":1}`)}, data) -} - -func (suite *CustomMessengerTestSuite) TestUpdateInterchainQuery() { - // reuse register interchain query test to get query registered - suite.TestRegisterInterchainQuery() - - // Craft UpdateInterchainQuery message - msg, err := json.Marshal(bindings.NeutronMsg{ - UpdateInterchainQuery: &bindings.UpdateInterchainQuery{ - QueryId: 1, - NewKeys: nil, - NewUpdatePeriod: 111, - }, - }) - suite.NoError(err) - - // Dispatch UpdateInterchainQuery message - events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ - Custom: msg, - }) - suite.NoError(err) - suite.Nil(events) - suite.Equal([][]byte{[]byte(`{}`)}, data) -} - -func (suite *CustomMessengerTestSuite) TestUpdateInterchainQueryFailed() { - // Craft UpdateInterchainQuery message - msg, err := json.Marshal(bindings.NeutronMsg{ - UpdateInterchainQuery: &bindings.UpdateInterchainQuery{ - QueryId: 1, - NewKeys: nil, - NewUpdatePeriod: 1, - }, - }) - suite.NoError(err) - - // Dispatch UpdateInterchainQuery message - owner, err := sdk.AccAddressFromBech32(testutil.TestOwnerAddress) - suite.NoError(err) - events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, owner, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ - Custom: msg, - }) - expectedErrMsg := "failed to update interchain query: failed to update interchain query: failed to get query by query id: there is no query with id: 1" - suite.Require().ErrorContains(err, expectedErrMsg) - suite.Nil(events) - suite.Nil(data) -} - -func (suite *CustomMessengerTestSuite) TestRemoveInterchainQuery() { - // Reuse register interchain query test to get query registered - suite.TestRegisterInterchainQuery() - - // Craft RemoveInterchainQuery message - msg, err := json.Marshal(bindings.NeutronMsg{ - RemoveInterchainQuery: &bindings.RemoveInterchainQuery{ - QueryId: 1, - }, - }) - suite.NoError(err) - - // Dispatch RemoveInterchainQuery message - suite.NoError(err) - events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ - Custom: msg, - }) - suite.NoError(err) - suite.Nil(events) - suite.Equal([][]byte{[]byte(`{}`)}, data) -} - -func (suite *CustomMessengerTestSuite) TestRemoveInterchainQueryFailed() { - // Craft RemoveInterchainQuery message - msg, err := json.Marshal(bindings.NeutronMsg{ - RemoveInterchainQuery: &bindings.RemoveInterchainQuery{ - QueryId: 1, - }, - }) - suite.NoError(err) - - // Dispatch RemoveInterchainQuery message - owner, err := sdk.AccAddressFromBech32(testutil.TestOwnerAddress) - suite.NoError(err) - events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, owner, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ - Custom: msg, - }) - expectedErrMsg := "failed to remove interchain query: failed to remove interchain query: failed to get query by query id: there is no query with id: 1" - suite.Require().ErrorContains(err, expectedErrMsg) - suite.Nil(events) - suite.Nil(data) -} - -func (suite *CustomMessengerTestSuite) TestSubmitTx() { - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") - suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) - suite.Require().NotEmpty(suite.contractAddress) - - senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() - coinsAmnt := sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, sdkmath.NewInt(int64(10_000_000)))) - bankKeeper := suite.neutron.BankKeeper - err := bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, coinsAmnt) - suite.NoError(err) - - err = testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) - suite.Require().NoError(err) - - events, data, _, err := suite.messenger.DispatchMsg( - suite.ctx, - suite.contractAddress, - suite.Path.EndpointA.ChannelConfig.PortID, - types.CosmosMsg{ - Custom: suite.craftMarshaledMsgSubmitTxWithNumMsgs(1), - }, - ) - suite.NoError(err) - - var response ictxtypes.MsgSubmitTxResponse - err = json.Unmarshal(data[0], &response) - suite.NoError(err) - suite.Nil(events) - suite.Equal(uint64(1), response.SequenceId) - suite.Equal("channel-2", response.Channel) -} - -func (suite *CustomMessengerTestSuite) TestSubmitTxTooMuchTxs() { - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") - suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) - suite.Require().NotEmpty(suite.contractAddress) - - err := testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) - suite.Require().NoError(err) - - _, _, _, err = suite.messenger.DispatchMsg( - suite.ctx, - suite.contractAddress, - suite.Path.EndpointA.ChannelConfig.PortID, - types.CosmosMsg{ - Custom: suite.craftMarshaledMsgSubmitTxWithNumMsgs(20), - }, - ) - suite.ErrorContains(err, "MsgSubmitTx contains more messages than allowed") -} - -func (suite *CustomMessengerTestSuite) TestResubmitFailureAck() { - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") - suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) - suite.Require().NotEmpty(suite.contractAddress) - - // Add failure - packet := ibcchanneltypes.Packet{} - ack := ibcchanneltypes.Acknowledgement{ - Response: &ibcchanneltypes.Acknowledgement_Result{Result: []byte("Result")}, - } - payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, &ack) - require.NoError(suite.T(), err) - failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, suite.contractAddress.String()) - suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, suite.contractAddress.String(), payload, "test error") - - // Craft message - msg, err := json.Marshal(bindings.NeutronMsg{ - ResubmitFailure: &bindings.ResubmitFailure{ - FailureId: failureID, - }, - }) - suite.NoError(err) - - // Dispatch - events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ - Custom: msg, - }) - suite.NoError(err) - suite.Nil(events) - expected, err := json.Marshal(&bindings.ResubmitFailureResponse{}) - suite.NoError(err) - suite.Equal([][]uint8{expected}, data) -} - -func (suite *CustomMessengerTestSuite) TestResubmitFailureTimeout() { - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") - suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) - suite.Require().NotEmpty(suite.contractAddress) - - // Add failure - packet := ibcchanneltypes.Packet{} - payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, nil) - require.NoError(suite.T(), err) - failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, suite.contractAddress.String()) - suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, suite.contractAddress.String(), payload, "test error") - - // Craft message - msg, err := json.Marshal(bindings.NeutronMsg{ - ResubmitFailure: &bindings.ResubmitFailure{ - FailureId: failureID, - }, - }) - suite.NoError(err) - - // Dispatch - events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ - Custom: msg, - }) - suite.NoError(err) - suite.Nil(events) - expected, err := json.Marshal(&bindings.ResubmitFailureResponse{FailureId: failureID}) - suite.NoError(err) - suite.Equal([][]uint8{expected}, data) -} - -func (suite *CustomMessengerTestSuite) TestResubmitFailureFromDifferentContract() { - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") - suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) - suite.Require().NotEmpty(suite.contractAddress) - - // Add failure - packet := ibcchanneltypes.Packet{} - ack := ibcchanneltypes.Acknowledgement{ - Response: &ibcchanneltypes.Acknowledgement_Error{Error: "ErrorSudoPayload"}, - } - failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, testutil.TestOwnerAddress) - payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, &ack) - require.NoError(suite.T(), err) - suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, testutil.TestOwnerAddress, payload, "test error") - - // Craft message - msg, err := json.Marshal(bindings.NeutronMsg{ - ResubmitFailure: &bindings.ResubmitFailure{ - FailureId: failureID, - }, - }) - suite.NoError(err) - - // Dispatch - _, _, _, err = suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ - Custom: msg, - }) - suite.ErrorContains(err, "no failure found to resubmit: not found") -} - -func (suite *CustomMessengerTestSuite) craftMarshaledMsgSubmitTxWithNumMsgs(numMsgs int) (result []byte) { - msg := bindings.ProtobufAny{ - TypeURL: "/cosmos.staking.v1beta1.MsgDelegate", - Value: []byte{26, 10, 10, 5, 115, 116, 97, 107, 101, 18, 1, 48}, - } - msgs := make([]bindings.ProtobufAny, 0, numMsgs) - for i := 0; i < numMsgs; i++ { - msgs = append(msgs, msg) - } - result, err := json.Marshal(struct { - SubmitTx bindings.SubmitTx `json:"submit_tx"` - }{ - SubmitTx: bindings.SubmitTx{ - ConnectionId: suite.Path.EndpointA.ConnectionID, - InterchainAccountId: testutil.TestInterchainID, - Msgs: msgs, - Memo: "Jimmy", - Timeout: 2000, - Fee: feetypes.Fee{ - RecvFee: sdk.NewCoins(), - AckFee: sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, sdkmath.NewInt(1000))), - TimeoutFee: sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, sdkmath.NewInt(1000))), - }, - }, - }) - suite.NoError(err) - return -} - -func (suite *CustomMessengerTestSuite) executeCustomMsg(contractAddress sdk.AccAddress, fullMsg json.RawMessage) (data []byte, err error) { - customMsg := types.CosmosMsg{ - Custom: fullMsg, - } - - type ExecuteMsg struct { - ReflectMsg struct { - Msgs []types.CosmosMsg `json:"msgs"` - } `json:"reflect_msg"` - } - - execMsg := ExecuteMsg{ReflectMsg: struct { - Msgs []types.CosmosMsg `json:"msgs"` - }(struct{ Msgs []types.CosmosMsg }{Msgs: []types.CosmosMsg{customMsg}})} - - msg, err := json.Marshal(execMsg) - suite.NoError(err) - - data, err = suite.contractKeeper.Execute(suite.ctx, contractAddress, suite.contractOwner, msg, nil) - - return -} - -func (suite *CustomMessengerTestSuite) executeNeutronMsg(contractAddress sdk.AccAddress, fullMsg bindings.NeutronMsg) (data []byte, err error) { - fullMsgBz, err := json.Marshal(fullMsg) - suite.NoError(err) - - return suite.executeCustomMsg(contractAddress, fullMsgBz) -} - -func TestMessengerTestSuite(t *testing.T) { - suite.Run(t, new(CustomMessengerTestSuite)) -} +// const FeeCollectorAddress = "neutron1vguuxez2h5ekltfj9gjd62fs5k4rl2zy5hfrncasykzw08rezpfsd2rhm7" + +// type CustomMessengerTestSuite struct { +// testutil.IBCConnectionTestSuite +// neutron *app.App +// ctx sdk.Context +// messenger *wasmbinding.CustomMessenger +// contractOwner sdk.AccAddress +// contractAddress sdk.AccAddress +// contractKeeper wasmtypes.ContractOpsKeeper +// } + +// func (suite *CustomMessengerTestSuite) SetupTest() { +// suite.IBCConnectionTestSuite.SetupTest() +// suite.neutron = suite.GetNeutronZoneApp(suite.ChainA) +// suite.ctx = suite.ChainA.GetContext() +// suite.messenger = &wasmbinding.CustomMessenger{} +// suite.messenger.Ictxmsgserver = ictxkeeper.NewMsgServerImpl(suite.neutron.InterchainTxsKeeper) +// suite.messenger.Keeper = suite.neutron.InterchainTxsKeeper +// suite.messenger.Icqmsgserver = icqkeeper.NewMsgServerImpl(suite.neutron.InterchainQueriesKeeper) +// suite.messenger.ContractmanagerKeeper = &suite.neutron.ContractManagerKeeper +// suite.contractOwner = keeper.RandomAccountAddress(suite.T()) + +// suite.contractKeeper = keeper.NewDefaultPermissionKeeper(&suite.neutron.WasmKeeper) + +// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// suite.Require().NotEmpty(suite.contractAddress) +// } + +// func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccount() { +// err := suite.neutron.FeeBurnerKeeper.SetParams(suite.ctx, feeburnertypes.Params{ +// NeutronDenom: "untrn", +// TreasuryAddress: "neutron13jrwrtsyjjuynlug65r76r2zvfw5xjcq6532h2", +// }) +// suite.Require().NoError(err) + +// // Craft RegisterInterchainAccount message +// msg := bindings.NeutronMsg{ +// RegisterInterchainAccount: &bindings.RegisterInterchainAccount{ +// ConnectionId: suite.Path.EndpointA.ConnectionID, +// InterchainAccountId: testutil.TestInterchainID, +// RegisterFee: sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(1_000_000))), +// }, +// } + +// bankKeeper := suite.neutron.BankKeeper +// senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() +// err = bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(1_000_000)))) +// suite.NoError(err) + +// // Dispatch RegisterInterchainAccount message +// _, err = suite.executeNeutronMsg(suite.contractAddress, msg) +// suite.NoError(err) +// } + +// func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccountLongID() { +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// suite.Require().NotEmpty(suite.contractAddress) + +// // Craft RegisterInterchainAccount message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// RegisterInterchainAccount: &bindings.RegisterInterchainAccount{ +// ConnectionId: suite.Path.EndpointA.ConnectionID, +// // the limit is 47, this line is 50 characters long +// InterchainAccountId: "01234567890123456789012345678901234567890123456789", +// }, +// }) +// suite.NoError(err) + +// // Dispatch RegisterInterchainAccount message via DispatchHandler cause we want to catch an error from SDK directly, not from a contract +// _, _, _, err = suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// suite.Error(err) +// suite.ErrorIs(err, ictxtypes.ErrLongInterchainAccountID) +// } + +// func (suite *CustomMessengerTestSuite) TestRegisterInterchainQuery() { +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// suite.Require().NotEmpty(suite.contractAddress) + +// err := testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) +// suite.Require().NoError(err) + +// // Top up contract balance +// senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() +// coinsAmnt := sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, sdkmath.NewInt(int64(10_000_000)))) +// bankKeeper := suite.neutron.BankKeeper +// err = bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, coinsAmnt) +// suite.NoError(err) + +// // Craft RegisterInterchainQuery message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// RegisterInterchainQuery: &bindings.RegisterInterchainQuery{ +// QueryType: string(icqtypes.InterchainQueryTypeKV), +// Keys: []*icqtypes.KVKey{ +// {Path: ibchost.StoreKey, Key: host.FullClientStateKey(suite.Path.EndpointB.ClientID)}, +// }, +// TransactionsFilter: "{}", +// ConnectionId: suite.Path.EndpointA.ConnectionID, +// UpdatePeriod: 20, +// }, +// }) +// suite.NoError(err) + +// // Dispatch RegisterInterchainQuery message +// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// suite.NoError(err) +// suite.Nil(events) +// suite.Equal([][]byte{[]byte(`{"id":1}`)}, data) +// } + +// func (suite *CustomMessengerTestSuite) TestUpdateInterchainQuery() { +// // reuse register interchain query test to get query registered +// suite.TestRegisterInterchainQuery() + +// // Craft UpdateInterchainQuery message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// UpdateInterchainQuery: &bindings.UpdateInterchainQuery{ +// QueryId: 1, +// NewKeys: nil, +// NewUpdatePeriod: 111, +// }, +// }) +// suite.NoError(err) + +// // Dispatch UpdateInterchainQuery message +// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// suite.NoError(err) +// suite.Nil(events) +// suite.Equal([][]byte{[]byte(`{}`)}, data) +// } + +// func (suite *CustomMessengerTestSuite) TestUpdateInterchainQueryFailed() { +// // Craft UpdateInterchainQuery message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// UpdateInterchainQuery: &bindings.UpdateInterchainQuery{ +// QueryId: 1, +// NewKeys: nil, +// NewUpdatePeriod: 1, +// }, +// }) +// suite.NoError(err) + +// // Dispatch UpdateInterchainQuery message +// owner, err := sdk.AccAddressFromBech32(testutil.TestOwnerAddress) +// suite.NoError(err) +// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, owner, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// expectedErrMsg := "failed to update interchain query: failed to update interchain query: failed to get query by query id: there is no query with id: 1" +// suite.Require().ErrorContains(err, expectedErrMsg) +// suite.Nil(events) +// suite.Nil(data) +// } + +// func (suite *CustomMessengerTestSuite) TestRemoveInterchainQuery() { +// // Reuse register interchain query test to get query registered +// suite.TestRegisterInterchainQuery() + +// // Craft RemoveInterchainQuery message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// RemoveInterchainQuery: &bindings.RemoveInterchainQuery{ +// QueryId: 1, +// }, +// }) +// suite.NoError(err) + +// // Dispatch RemoveInterchainQuery message +// suite.NoError(err) +// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// suite.NoError(err) +// suite.Nil(events) +// suite.Equal([][]byte{[]byte(`{}`)}, data) +// } + +// func (suite *CustomMessengerTestSuite) TestRemoveInterchainQueryFailed() { +// // Craft RemoveInterchainQuery message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// RemoveInterchainQuery: &bindings.RemoveInterchainQuery{ +// QueryId: 1, +// }, +// }) +// suite.NoError(err) + +// // Dispatch RemoveInterchainQuery message +// owner, err := sdk.AccAddressFromBech32(testutil.TestOwnerAddress) +// suite.NoError(err) +// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, owner, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// expectedErrMsg := "failed to remove interchain query: failed to remove interchain query: failed to get query by query id: there is no query with id: 1" +// suite.Require().ErrorContains(err, expectedErrMsg) +// suite.Nil(events) +// suite.Nil(data) +// } + +// func (suite *CustomMessengerTestSuite) TestSubmitTx() { +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// suite.Require().NotEmpty(suite.contractAddress) + +// senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() +// coinsAmnt := sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, sdkmath.NewInt(int64(10_000_000)))) +// bankKeeper := suite.neutron.BankKeeper +// err := bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, coinsAmnt) +// suite.NoError(err) + +// err = testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) +// suite.Require().NoError(err) + +// events, data, _, err := suite.messenger.DispatchMsg( +// suite.ctx, +// suite.contractAddress, +// suite.Path.EndpointA.ChannelConfig.PortID, +// types.CosmosMsg{ +// Custom: suite.craftMarshaledMsgSubmitTxWithNumMsgs(1), +// }, +// ) +// suite.NoError(err) + +// var response ictxtypes.MsgSubmitTxResponse +// err = json.Unmarshal(data[0], &response) +// suite.NoError(err) +// suite.Nil(events) +// suite.Equal(uint64(1), response.SequenceId) +// suite.Equal("channel-2", response.Channel) +// } + +// func (suite *CustomMessengerTestSuite) TestSubmitTxTooMuchTxs() { +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// suite.Require().NotEmpty(suite.contractAddress) + +// err := testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) +// suite.Require().NoError(err) + +// _, _, _, err = suite.messenger.DispatchMsg( +// suite.ctx, +// suite.contractAddress, +// suite.Path.EndpointA.ChannelConfig.PortID, +// types.CosmosMsg{ +// Custom: suite.craftMarshaledMsgSubmitTxWithNumMsgs(20), +// }, +// ) +// suite.ErrorContains(err, "MsgSubmitTx contains more messages than allowed") +// } + +// func (suite *CustomMessengerTestSuite) TestResubmitFailureAck() { +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// suite.Require().NotEmpty(suite.contractAddress) + +// // Add failure +// packet := ibcchanneltypes.Packet{} +// ack := ibcchanneltypes.Acknowledgement{ +// Response: &ibcchanneltypes.Acknowledgement_Result{Result: []byte("Result")}, +// } +// payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, &ack) +// require.NoError(suite.T(), err) +// failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, suite.contractAddress.String()) +// suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, suite.contractAddress.String(), payload, "test error") + +// // Craft message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// ResubmitFailure: &bindings.ResubmitFailure{ +// FailureId: failureID, +// }, +// }) +// suite.NoError(err) + +// // Dispatch +// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// suite.NoError(err) +// suite.Nil(events) +// expected, err := json.Marshal(&bindings.ResubmitFailureResponse{}) +// suite.NoError(err) +// suite.Equal([][]uint8{expected}, data) +// } + +// func (suite *CustomMessengerTestSuite) TestResubmitFailureTimeout() { +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// suite.Require().NotEmpty(suite.contractAddress) + +// // Add failure +// packet := ibcchanneltypes.Packet{} +// payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, nil) +// require.NoError(suite.T(), err) +// failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, suite.contractAddress.String()) +// suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, suite.contractAddress.String(), payload, "test error") + +// // Craft message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// ResubmitFailure: &bindings.ResubmitFailure{ +// FailureId: failureID, +// }, +// }) +// suite.NoError(err) + +// // Dispatch +// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// suite.NoError(err) +// suite.Nil(events) +// expected, err := json.Marshal(&bindings.ResubmitFailureResponse{FailureId: failureID}) +// suite.NoError(err) +// suite.Equal([][]uint8{expected}, data) +// } + +// func (suite *CustomMessengerTestSuite) TestResubmitFailureFromDifferentContract() { +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// suite.Require().NotEmpty(suite.contractAddress) + +// // Add failure +// packet := ibcchanneltypes.Packet{} +// ack := ibcchanneltypes.Acknowledgement{ +// Response: &ibcchanneltypes.Acknowledgement_Error{Error: "ErrorSudoPayload"}, +// } +// failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, testutil.TestOwnerAddress) +// payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, &ack) +// require.NoError(suite.T(), err) +// suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, testutil.TestOwnerAddress, payload, "test error") + +// // Craft message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// ResubmitFailure: &bindings.ResubmitFailure{ +// FailureId: failureID, +// }, +// }) +// suite.NoError(err) + +// // Dispatch +// _, _, _, err = suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// suite.ErrorContains(err, "no failure found to resubmit: not found") +// } + +// func (suite *CustomMessengerTestSuite) craftMarshaledMsgSubmitTxWithNumMsgs(numMsgs int) (result []byte) { +// msg := bindings.ProtobufAny{ +// TypeURL: "/cosmos.staking.v1beta1.MsgDelegate", +// Value: []byte{26, 10, 10, 5, 115, 116, 97, 107, 101, 18, 1, 48}, +// } +// msgs := make([]bindings.ProtobufAny, 0, numMsgs) +// for i := 0; i < numMsgs; i++ { +// msgs = append(msgs, msg) +// } +// result, err := json.Marshal(struct { +// SubmitTx bindings.SubmitTx `json:"submit_tx"` +// }{ +// SubmitTx: bindings.SubmitTx{ +// ConnectionId: suite.Path.EndpointA.ConnectionID, +// InterchainAccountId: testutil.TestInterchainID, +// Msgs: msgs, +// Memo: "Jimmy", +// Timeout: 2000, +// Fee: feetypes.Fee{ +// RecvFee: sdk.NewCoins(), +// AckFee: sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, sdkmath.NewInt(1000))), +// TimeoutFee: sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, sdkmath.NewInt(1000))), +// }, +// }, +// }) +// suite.NoError(err) +// return +// } + +// func (suite *CustomMessengerTestSuite) executeCustomMsg(contractAddress sdk.AccAddress, fullMsg json.RawMessage) (data []byte, err error) { +// customMsg := types.CosmosMsg{ +// Custom: fullMsg, +// } + +// type ExecuteMsg struct { +// ReflectMsg struct { +// Msgs []types.CosmosMsg `json:"msgs"` +// } `json:"reflect_msg"` +// } + +// execMsg := ExecuteMsg{ReflectMsg: struct { +// Msgs []types.CosmosMsg `json:"msgs"` +// }(struct{ Msgs []types.CosmosMsg }{Msgs: []types.CosmosMsg{customMsg}})} + +// msg, err := json.Marshal(execMsg) +// suite.NoError(err) + +// data, err = suite.contractKeeper.Execute(suite.ctx, contractAddress, suite.contractOwner, msg, nil) + +// return +// } + +// func (suite *CustomMessengerTestSuite) executeNeutronMsg(contractAddress sdk.AccAddress, fullMsg bindings.NeutronMsg) (data []byte, err error) { +// fullMsgBz, err := json.Marshal(fullMsg) +// suite.NoError(err) + +// return suite.executeCustomMsg(contractAddress, fullMsgBz) +// } + +// func TestMessengerTestSuite(t *testing.T) { +// suite.Run(t, new(CustomMessengerTestSuite)) +// } diff --git a/wasmbinding/test/custom_query_test.go b/wasmbinding/test/custom_query_test.go index d512c9a1..6aa11608 100644 --- a/wasmbinding/test/custom_query_test.go +++ b/wasmbinding/test/custom_query_test.go @@ -1,223 +1,201 @@ package test -import ( - "encoding/json" - "fmt" - "testing" - - "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmvmtypes "github.com/CosmWasm/wasmvm/v2/types" - abci "github.com/cometbft/cometbft/abci/types" - sdk "github.com/cosmos/cosmos-sdk/types" - host "github.com/cosmos/ibc-go/v8/modules/core/24-host" - ibchost "github.com/cosmos/ibc-go/v8/modules/core/exported" - - "github.com/stretchr/testify/suite" - - "github.com/Nolus-Protocol/nolus-core/wasmbinding/bindings" - - "github.com/neutron-org/neutron/v4/app" - "github.com/neutron-org/neutron/v4/testutil" - icqtypes "github.com/neutron-org/neutron/v4/x/interchainqueries/types" - ictxtypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" -) - -type CustomQuerierTestSuite struct { - testutil.IBCConnectionTestSuite -} - -func (suite *CustomQuerierTestSuite) TestInterchainQueryResult() { - var ( - neutron = suite.GetNeutronZoneApp(suite.ChainA) - ctx = suite.ChainA.GetContext() - owner = keeper.RandomAccountAddress(suite.T()) // We don't care what this address is - ) - - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(ctx, owner, "../testdata/reflect.wasm") - contractAddress := suite.InstantiateTestContract(ctx, owner, codeID) - suite.Require().NotEmpty(contractAddress) - - // Register and submit query result - clientKey := host.FullClientStateKey(suite.Path.EndpointB.ClientID) - lastID := neutron.InterchainQueriesKeeper.GetLastRegisteredQueryKey(ctx) + 1 - neutron.InterchainQueriesKeeper.SetLastRegisteredQueryKey(ctx, lastID) - registeredQuery := &icqtypes.RegisteredQuery{ - Id: lastID, - Keys: []*icqtypes.KVKey{ - {Path: ibchost.StoreKey, Key: clientKey}, - }, - QueryType: string(icqtypes.InterchainQueryTypeKV), - UpdatePeriod: 1, - ConnectionId: suite.Path.EndpointA.ConnectionID, - } - neutron.InterchainQueriesKeeper.SetLastRegisteredQueryKey(ctx, lastID) - err := neutron.InterchainQueriesKeeper.SaveQuery(ctx, registeredQuery) - suite.Require().NoError(err) - - chainBResp, err := suite.ChainB.App.Query(ctx, &abci.RequestQuery{ - Path: fmt.Sprintf("store/%s/key", ibchost.StoreKey), - Height: suite.ChainB.LastHeader.Header.Height - 1, - Data: clientKey, - Prove: true, - }) - suite.Require().NoError(err) - - expectedQueryResult := &icqtypes.QueryResult{ - KvResults: []*icqtypes.StorageValue{{ - Key: chainBResp.Key, - Proof: chainBResp.ProofOps, - Value: chainBResp.Value, - StoragePrefix: ibchost.StoreKey, - }}, - // we don't have tests to test transactions proofs verification since it's a tendermint layer, and we don't have access to it here - Block: nil, - Height: uint64(chainBResp.Height), - Revision: suite.ChainA.LastHeader.GetHeight().GetRevisionNumber(), - } - err = neutron.InterchainQueriesKeeper.SaveKVQueryResult(ctx, lastID, expectedQueryResult) - suite.Require().NoError(err) - - // Query interchain query result - query := bindings.NeutronQuery{ - InterchainQueryResult: &bindings.QueryRegisteredQueryResultRequest{ - QueryID: lastID, - }, - } - resp := icqtypes.QueryRegisteredQueryResultResponse{} - err = suite.queryCustom(ctx, contractAddress, query, &resp) - suite.Require().NoError(err) - - suite.Require().Equal(uint64(chainBResp.Height), resp.Result.Height) - suite.Require().Equal(suite.ChainA.LastHeader.GetHeight().GetRevisionNumber(), resp.Result.Revision) - suite.Require().Empty(resp.Result.Block) - suite.Require().NotEmpty(resp.Result.KvResults) - suite.Require().Equal([]*icqtypes.StorageValue{{ - Key: chainBResp.Key, - Proof: nil, - Value: chainBResp.Value, - StoragePrefix: ibchost.StoreKey, - }}, resp.Result.KvResults) -} - -func (suite *CustomQuerierTestSuite) TestInterchainQueryResultNotFound() { - var ( - ctx = suite.ChainA.GetContext() - owner = keeper.RandomAccountAddress(suite.T()) // We don't care what this address is - ) - - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(ctx, owner, "../testdata/reflect.wasm") - contractAddress := suite.InstantiateTestContract(ctx, owner, codeID) - suite.Require().NotEmpty(contractAddress) - - // Query interchain query result - query := bindings.NeutronQuery{ - InterchainQueryResult: &bindings.QueryRegisteredQueryResultRequest{ - QueryID: 1, - }, - } - resp := icqtypes.QueryRegisteredQueryResultResponse{} - err := suite.queryCustom(ctx, contractAddress, query, &resp) - expectedErrMsg := fmt.Sprintf("Generic error: Querier contract error: codespace: interchainqueries, code: %d: query wasm contract failed", icqtypes.ErrNoQueryResult.ABCICode()) - suite.Require().ErrorContains(err, expectedErrMsg) -} - -func (suite *CustomQuerierTestSuite) TestInterchainAccountAddress() { - var ( - ctx = suite.ChainA.GetContext() - owner = keeper.RandomAccountAddress(suite.T()) // We don't care what this address is - ) - - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(ctx, owner, "../testdata/reflect.wasm") - contractAddress := suite.InstantiateTestContract(ctx, owner, codeID) - suite.Require().NotEmpty(contractAddress) - - err := testutil.SetupICAPath(suite.Path, contractAddress.String()) - suite.Require().NoError(err) - - query := bindings.NeutronQuery{ - InterchainAccountAddress: &bindings.QueryInterchainAccountAddressRequest{ - OwnerAddress: contractAddress.String(), - InterchainAccountID: testutil.TestInterchainID, - ConnectionID: suite.Path.EndpointA.ConnectionID, - }, - } - resp := ictxtypes.QueryInterchainAccountAddressResponse{} - err = suite.queryCustom(ctx, contractAddress, query, &resp) - suite.Require().NoError(err) - - hostNeutronApp, ok := suite.ChainB.App.(*app.App) - suite.Require().True(ok) - - expected := hostNeutronApp.ICAHostKeeper.GetAllInterchainAccounts(suite.ChainB.GetContext())[0].AccountAddress // we expect only one registered ICA - suite.Require().Equal(expected, resp.InterchainAccountAddress) -} - -func (suite *CustomQuerierTestSuite) TestUnknownInterchainAcc() { - var ( - ctx = suite.ChainA.GetContext() - owner = keeper.RandomAccountAddress(suite.T()) // We don't care what this address is - ) - - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(ctx, owner, "../testdata/reflect.wasm") - contractAddress := suite.InstantiateTestContract(ctx, owner, codeID) - suite.Require().NotEmpty(contractAddress) - - err := testutil.SetupICAPath(suite.Path, contractAddress.String()) - suite.Require().NoError(err) - - query := bindings.NeutronQuery{ - InterchainAccountAddress: &bindings.QueryInterchainAccountAddressRequest{ - OwnerAddress: testutil.TestOwnerAddress, - InterchainAccountID: "wrong_account_id", - ConnectionID: suite.Path.EndpointA.ConnectionID, - }, - } - resp := ictxtypes.QueryInterchainAccountAddressResponse{} - expectedErrorMsg := "Generic error: Querier contract error: codespace: interchaintxs, code: 1102: query wasm contract failed" - - err = suite.queryCustom(ctx, contractAddress, query, &resp) - suite.Require().ErrorContains(err, expectedErrorMsg) -} - -type ChainRequest struct { - Reflect wasmvmtypes.QueryRequest `json:"reflect"` -} - -type ChainResponse struct { - Data []byte `json:"data"` -} - -func (suite *CustomQuerierTestSuite) queryCustom(ctx sdk.Context, contract sdk.AccAddress, request interface{}, response interface{}) error { - msgBz, err := json.Marshal(request) - suite.Require().NoError(err) - - query := ChainRequest{ - Reflect: wasmvmtypes.QueryRequest{Custom: msgBz}, - } - - queryBz, err := json.Marshal(query) - if err != nil { - return err - } - - resBz, err := suite.GetNeutronZoneApp(suite.ChainA).WasmKeeper.QuerySmart(ctx, contract, queryBz) - if err != nil { - return err - } - - var resp ChainResponse - err = json.Unmarshal(resBz, &resp) - if err != nil { - return err - } - - return json.Unmarshal(resp.Data, response) -} - -func TestKeeperTestSuite(t *testing.T) { - suite.Run(t, new(CustomQuerierTestSuite)) -} +// type CustomQuerierTestSuite struct { +// testutil.IBCConnectionTestSuite +// } + +// func (suite *CustomQuerierTestSuite) TestInterchainQueryResult() { +// var ( +// neutron = suite.GetNeutronZoneApp(suite.ChainA) +// ctx = suite.ChainA.GetContext() +// owner = keeper.RandomAccountAddress(suite.T()) // We don't care what this address is +// ) + +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(ctx, owner, "../testdata/reflect.wasm") +// contractAddress := suite.InstantiateTestContract(ctx, owner, codeID) +// suite.Require().NotEmpty(contractAddress) + +// // Register and submit query result +// clientKey := host.FullClientStateKey(suite.Path.EndpointB.ClientID) +// lastID := neutron.InterchainQueriesKeeper.GetLastRegisteredQueryKey(ctx) + 1 +// neutron.InterchainQueriesKeeper.SetLastRegisteredQueryKey(ctx, lastID) +// registeredQuery := &icqtypes.RegisteredQuery{ +// Id: lastID, +// Keys: []*icqtypes.KVKey{ +// {Path: ibchost.StoreKey, Key: clientKey}, +// }, +// QueryType: string(icqtypes.InterchainQueryTypeKV), +// UpdatePeriod: 1, +// ConnectionId: suite.Path.EndpointA.ConnectionID, +// } +// neutron.InterchainQueriesKeeper.SetLastRegisteredQueryKey(ctx, lastID) +// err := neutron.InterchainQueriesKeeper.SaveQuery(ctx, registeredQuery) +// suite.Require().NoError(err) + +// chainBResp, err := suite.ChainB.App.Query(ctx, &abci.RequestQuery{ +// Path: fmt.Sprintf("store/%s/key", ibchost.StoreKey), +// Height: suite.ChainB.LastHeader.Header.Height - 1, +// Data: clientKey, +// Prove: true, +// }) +// suite.Require().NoError(err) + +// expectedQueryResult := &icqtypes.QueryResult{ +// KvResults: []*icqtypes.StorageValue{{ +// Key: chainBResp.Key, +// Proof: chainBResp.ProofOps, +// Value: chainBResp.Value, +// StoragePrefix: ibchost.StoreKey, +// }}, +// // we don't have tests to test transactions proofs verification since it's a tendermint layer, and we don't have access to it here +// Block: nil, +// Height: uint64(chainBResp.Height), +// Revision: suite.ChainA.LastHeader.GetHeight().GetRevisionNumber(), +// } +// err = neutron.InterchainQueriesKeeper.SaveKVQueryResult(ctx, lastID, expectedQueryResult) +// suite.Require().NoError(err) + +// // Query interchain query result +// query := bindings.NeutronQuery{ +// InterchainQueryResult: &bindings.QueryRegisteredQueryResultRequest{ +// QueryID: lastID, +// }, +// } +// resp := icqtypes.QueryRegisteredQueryResultResponse{} +// err = suite.queryCustom(ctx, contractAddress, query, &resp) +// suite.Require().NoError(err) + +// suite.Require().Equal(uint64(chainBResp.Height), resp.Result.Height) +// suite.Require().Equal(suite.ChainA.LastHeader.GetHeight().GetRevisionNumber(), resp.Result.Revision) +// suite.Require().Empty(resp.Result.Block) +// suite.Require().NotEmpty(resp.Result.KvResults) +// suite.Require().Equal([]*icqtypes.StorageValue{{ +// Key: chainBResp.Key, +// Proof: nil, +// Value: chainBResp.Value, +// StoragePrefix: ibchost.StoreKey, +// }}, resp.Result.KvResults) +// } + +// func (suite *CustomQuerierTestSuite) TestInterchainQueryResultNotFound() { +// var ( +// ctx = suite.ChainA.GetContext() +// owner = keeper.RandomAccountAddress(suite.T()) // We don't care what this address is +// ) + +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(ctx, owner, "../testdata/reflect.wasm") +// contractAddress := suite.InstantiateTestContract(ctx, owner, codeID) +// suite.Require().NotEmpty(contractAddress) + +// // Query interchain query result +// query := bindings.NeutronQuery{ +// InterchainQueryResult: &bindings.QueryRegisteredQueryResultRequest{ +// QueryID: 1, +// }, +// } +// resp := icqtypes.QueryRegisteredQueryResultResponse{} +// err := suite.queryCustom(ctx, contractAddress, query, &resp) +// expectedErrMsg := fmt.Sprintf("Generic error: Querier contract error: codespace: interchainqueries, code: %d: query wasm contract failed", icqtypes.ErrNoQueryResult.ABCICode()) +// suite.Require().ErrorContains(err, expectedErrMsg) +// } + +// func (suite *CustomQuerierTestSuite) TestInterchainAccountAddress() { +// var ( +// ctx = suite.ChainA.GetContext() +// owner = keeper.RandomAccountAddress(suite.T()) // We don't care what this address is +// ) + +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(ctx, owner, "../testdata/reflect.wasm") +// contractAddress := suite.InstantiateTestContract(ctx, owner, codeID) +// suite.Require().NotEmpty(contractAddress) + +// err := testutil.SetupICAPath(suite.Path, contractAddress.String()) +// suite.Require().NoError(err) + +// query := bindings.NeutronQuery{ +// InterchainAccountAddress: &bindings.QueryInterchainAccountAddressRequest{ +// OwnerAddress: contractAddress.String(), +// InterchainAccountID: testutil.TestInterchainID, +// ConnectionID: suite.Path.EndpointA.ConnectionID, +// }, +// } +// resp := ictxtypes.QueryInterchainAccountAddressResponse{} +// err = suite.queryCustom(ctx, contractAddress, query, &resp) +// suite.Require().NoError(err) + +// hostNeutronApp, ok := suite.ChainB.App.(*app.App) +// suite.Require().True(ok) + +// expected := hostNeutronApp.ICAHostKeeper.GetAllInterchainAccounts(suite.ChainB.GetContext())[0].AccountAddress // we expect only one registered ICA +// suite.Require().Equal(expected, resp.InterchainAccountAddress) +// } + +// func (suite *CustomQuerierTestSuite) TestUnknownInterchainAcc() { +// var ( +// ctx = suite.ChainA.GetContext() +// owner = keeper.RandomAccountAddress(suite.T()) // We don't care what this address is +// ) + +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(ctx, owner, "../testdata/reflect.wasm") +// contractAddress := suite.InstantiateTestContract(ctx, owner, codeID) +// suite.Require().NotEmpty(contractAddress) + +// err := testutil.SetupICAPath(suite.Path, contractAddress.String()) +// suite.Require().NoError(err) + +// query := bindings.NeutronQuery{ +// InterchainAccountAddress: &bindings.QueryInterchainAccountAddressRequest{ +// OwnerAddress: testutil.TestOwnerAddress, +// InterchainAccountID: "wrong_account_id", +// ConnectionID: suite.Path.EndpointA.ConnectionID, +// }, +// } +// resp := ictxtypes.QueryInterchainAccountAddressResponse{} +// expectedErrorMsg := "Generic error: Querier contract error: codespace: interchaintxs, code: 1102: query wasm contract failed" + +// err = suite.queryCustom(ctx, contractAddress, query, &resp) +// suite.Require().ErrorContains(err, expectedErrorMsg) +// } + +// type ChainRequest struct { +// Reflect wasmvmtypes.QueryRequest `json:"reflect"` +// } + +// type ChainResponse struct { +// Data []byte `json:"data"` +// } + +// func (suite *CustomQuerierTestSuite) queryCustom(ctx sdk.Context, contract sdk.AccAddress, request interface{}, response interface{}) error { +// msgBz, err := json.Marshal(request) +// suite.Require().NoError(err) + +// query := ChainRequest{ +// Reflect: wasmvmtypes.QueryRequest{Custom: msgBz}, +// } + +// queryBz, err := json.Marshal(query) +// if err != nil { +// return err +// } + +// resBz, err := suite.GetNeutronZoneApp(suite.ChainA).WasmKeeper.QuerySmart(ctx, contract, queryBz) +// if err != nil { +// return err +// } + +// var resp ChainResponse +// err = json.Unmarshal(resBz, &resp) +// if err != nil { +// return err +// } + +// return json.Unmarshal(resp.Data, response) +// } + +// func TestKeeperTestSuite(t *testing.T) { +// suite.Run(t, new(CustomQuerierTestSuite)) +// } diff --git a/x/mint/types/tx.pb.go b/x/mint/types/tx.pb.go index 64db847b..a44c71cf 100644 --- a/x/mint/types/tx.pb.go +++ b/x/mint/types/tx.pb.go @@ -137,7 +137,7 @@ func init() { func init() { proto.RegisterFile("nolus/mint/v1beta1/tx.proto", fileDescriptor_4120de15c071c685) } var fileDescriptor_4120de15c071c685 = []byte{ - // 327 bytes of a gzipped FileDescriptorProto + // 334 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xce, 0xcb, 0xcf, 0x29, 0x2d, 0xd6, 0xcf, 0xcd, 0xcc, 0x2b, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x02, 0x4b, 0xea, 0x81, 0x24, 0xf5, 0xa0, @@ -151,14 +151,14 @@ var fileDescriptor_4120de15c071c685 = []byte{ 0x0a, 0x59, 0x70, 0xb1, 0x15, 0x80, 0x4d, 0x90, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x36, 0x92, 0xd2, 0xc3, 0xf4, 0x99, 0x1e, 0xc4, 0x0e, 0x27, 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0xa0, 0xea, 0xad, 0xf8, 0x9a, 0x9e, 0x6f, 0xd0, 0x42, 0x98, 0xa4, 0x24, 0xc9, 0x25, 0x8e, 0xe6, 0xa8, 0xa0, 0xd4, - 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0xa3, 0x74, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0xa1, 0x04, 0x2e, - 0x1e, 0x14, 0x37, 0x2b, 0x63, 0xb3, 0x0b, 0xcd, 0x0c, 0x29, 0x6d, 0x22, 0x14, 0xc1, 0x2c, 0x72, - 0xf2, 0x3e, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, - 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xc3, 0xf4, 0xcc, 0x92, - 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x3f, 0x90, 0x81, 0xba, 0x01, 0xa0, 0xb0, 0x4c, - 0xce, 0xcf, 0xd1, 0x07, 0x9b, 0xaf, 0x9b, 0x9c, 0x5f, 0x94, 0xaa, 0x5f, 0x01, 0x89, 0xa4, 0x92, - 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x68, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe0, - 0xef, 0x7a, 0xcb, 0x09, 0x02, 0x00, 0x00, + 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0xa3, 0x3c, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0xa1, 0x04, 0x2e, + 0x1e, 0x14, 0x37, 0x2b, 0x63, 0xb3, 0x0b, 0xcd, 0x0c, 0x29, 0x6d, 0x22, 0x14, 0xc1, 0x2c, 0x92, + 0x62, 0x6d, 0x78, 0xbe, 0x41, 0x8b, 0xd1, 0xc9, 0xfb, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, + 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, + 0xe5, 0x18, 0xa2, 0x0c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xfd, + 0x40, 0xe6, 0xea, 0x06, 0x80, 0x82, 0x34, 0x39, 0x3f, 0x47, 0x1f, 0x6c, 0x8d, 0x6e, 0x72, 0x7e, + 0x51, 0xaa, 0x7e, 0x05, 0x24, 0xae, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x81, 0x6e, + 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x4d, 0x61, 0x9d, 0x16, 0x10, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/tax/types/tx.pb.go b/x/tax/types/tx.pb.go index e3e2e6d2..c5037c95 100644 --- a/x/tax/types/tx.pb.go +++ b/x/tax/types/tx.pb.go @@ -137,7 +137,7 @@ func init() { func init() { proto.RegisterFile("nolus/tax/v1beta1/tx.proto", fileDescriptor_48eda6fd5ab34527) } var fileDescriptor_48eda6fd5ab34527 = []byte{ - // 327 bytes of a gzipped FileDescriptorProto + // 334 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xca, 0xcb, 0xcf, 0x29, 0x2d, 0xd6, 0x2f, 0x49, 0xac, 0xd0, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x04, 0xcb, 0xe9, 0x95, 0x24, 0x56, 0xe8, 0x41, @@ -151,14 +151,14 @@ var fileDescriptor_48eda6fd5ab34527 = []byte{ 0x28, 0x15, 0x32, 0xe7, 0x62, 0x83, 0x38, 0x46, 0x82, 0x49, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x52, 0x0f, 0xc3, 0x67, 0x7a, 0x10, 0x2b, 0x9c, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x82, 0x2a, 0xb7, 0xe2, 0x6b, 0x7a, 0xbe, 0x41, 0x0b, 0x61, 0x90, 0x92, 0x24, 0x97, 0x38, 0x9a, 0x9b, 0x82, 0x52, - 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x8d, 0x52, 0xb9, 0x98, 0x7d, 0x8b, 0xd3, 0x85, 0xe2, 0xb8, - 0x78, 0x50, 0x9c, 0xac, 0x84, 0xc5, 0x2a, 0x34, 0x23, 0xa4, 0xb4, 0x08, 0xab, 0x81, 0x59, 0xe3, - 0xe4, 0x75, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, - 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x06, 0xe9, 0x99, 0x25, - 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x7e, 0x20, 0xf3, 0x74, 0x03, 0x40, 0x01, 0x99, - 0x9c, 0x9f, 0xa3, 0x0f, 0x36, 0x5e, 0x37, 0x39, 0xbf, 0x28, 0x55, 0xbf, 0x02, 0x1c, 0x45, 0x25, - 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0x90, 0x36, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x06, - 0x75, 0x0a, 0xff, 0x04, 0x02, 0x00, 0x00, + 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x8d, 0x72, 0xb8, 0x98, 0x7d, 0x8b, 0xd3, 0x85, 0xe2, 0xb8, + 0x78, 0x50, 0x9c, 0xac, 0x84, 0xc5, 0x2a, 0x34, 0x23, 0xa4, 0xb4, 0x08, 0xab, 0x81, 0x59, 0x23, + 0xc5, 0xda, 0xf0, 0x7c, 0x83, 0x16, 0xa3, 0x93, 0xd7, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, + 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, + 0xcb, 0x31, 0x44, 0x19, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xfb, + 0x81, 0x8c, 0xd5, 0x0d, 0x00, 0x85, 0x67, 0x72, 0x7e, 0x8e, 0x3e, 0xd8, 0x16, 0xdd, 0xe4, 0xfc, + 0xa2, 0x54, 0xfd, 0x0a, 0x70, 0x4c, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x03, 0xdc, + 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x1e, 0x49, 0xee, 0x0b, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/vestings/types/tx.pb.go b/x/vestings/types/tx.pb.go index cf147ce0..8b22d19a 100644 --- a/x/vestings/types/tx.pb.go +++ b/x/vestings/types/tx.pb.go @@ -164,38 +164,38 @@ func init() { func init() { proto.RegisterFile("nolus/vestings/v1beta1/tx.proto", fileDescriptor_b5f4f1d9cbfb6f52) } var fileDescriptor_b5f4f1d9cbfb6f52 = []byte{ - // 487 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x3f, 0x6f, 0xd3, 0x4e, - 0x18, 0xce, 0xfd, 0xfc, 0x23, 0x6d, 0xae, 0x48, 0xa8, 0x6e, 0x21, 0x26, 0x83, 0x1d, 0x3c, 0x59, - 0x91, 0x7a, 0x47, 0x0a, 0x08, 0x29, 0x5b, 0x53, 0xd6, 0x02, 0xb2, 0x10, 0x03, 0x4b, 0xe5, 0xd8, - 0x87, 0xb1, 0xc8, 0xdd, 0x1b, 0xf9, 0x2e, 0x51, 0xb3, 0x21, 0x26, 0xc4, 0xc4, 0x47, 0x60, 0x66, - 0xea, 0xc4, 0x67, 0xe8, 0xd8, 0x91, 0x29, 0xa0, 0x64, 0x28, 0x73, 0x3e, 0x01, 0xf2, 0x9d, 0xdd, - 0x04, 0x29, 0x1d, 0x58, 0x7c, 0x7e, 0xef, 0x79, 0x9e, 0xf7, 0xde, 0x3f, 0x0f, 0xf6, 0x04, 0x0c, - 0xc7, 0x92, 0x4e, 0x98, 0x54, 0x99, 0x48, 0x25, 0x9d, 0x74, 0x07, 0x4c, 0x45, 0x5d, 0xaa, 0xce, - 0xc8, 0x28, 0x07, 0x05, 0xf6, 0x3d, 0x4d, 0x20, 0x15, 0x81, 0x94, 0x84, 0xd6, 0x7e, 0x0a, 0x29, - 0x68, 0x0a, 0x2d, 0xfe, 0x0c, 0xbb, 0xe5, 0xc6, 0x20, 0x39, 0x48, 0x3a, 0x88, 0x24, 0xbb, 0xce, - 0x15, 0x43, 0x26, 0x4a, 0xbc, 0x59, 0xe2, 0x5c, 0xa6, 0x74, 0xd2, 0x2d, 0x8e, 0x12, 0xd8, 0x8d, - 0x78, 0x26, 0x80, 0xea, 0xaf, 0xb9, 0xf2, 0xbf, 0x5b, 0xb8, 0x79, 0x22, 0xd3, 0xe3, 0x9c, 0x45, - 0x8a, 0xbd, 0x36, 0xef, 0x1f, 0xc5, 0x31, 0x8c, 0x85, 0xb2, 0x7b, 0xf8, 0xf6, 0xdb, 0x1c, 0xf8, - 0x69, 0x94, 0x24, 0x39, 0x93, 0xd2, 0x41, 0x6d, 0x14, 0x34, 0xfa, 0xcd, 0xe5, 0xcc, 0xdb, 0x9b, - 0x46, 0x7c, 0xd8, 0xf3, 0xd7, 0x51, 0x3f, 0xdc, 0x29, 0xc2, 0x23, 0x13, 0xd9, 0x8f, 0x31, 0x56, - 0x70, 0xad, 0xfc, 0x4f, 0x2b, 0xef, 0x2e, 0x67, 0xde, 0xae, 0x51, 0xae, 0x30, 0x3f, 0x6c, 0x28, - 0xa8, 0x54, 0x31, 0xae, 0x47, 0xbc, 0x78, 0xdb, 0xb1, 0xda, 0x56, 0xb0, 0x73, 0x78, 0x9f, 0x98, - 0x56, 0x48, 0xd1, 0x6a, 0x35, 0x15, 0x72, 0x0c, 0x99, 0xe8, 0x3f, 0xbc, 0x98, 0x79, 0xb5, 0x6f, - 0x3f, 0xbd, 0x20, 0xcd, 0xd4, 0xbb, 0xf1, 0x80, 0xc4, 0xc0, 0x69, 0xd9, 0xb7, 0x39, 0x0e, 0x64, - 0xf2, 0x9e, 0xaa, 0xe9, 0x88, 0x49, 0x2d, 0x90, 0x61, 0x99, 0xba, 0x28, 0x4d, 0xaa, 0x28, 0x57, - 0xa7, 0x2a, 0xe3, 0xcc, 0xf9, 0xbf, 0x8d, 0x02, 0x6b, 0xbd, 0xb4, 0x15, 0xe6, 0x87, 0x0d, 0x1d, - 0xbc, 0xca, 0x38, 0xb3, 0x09, 0xde, 0x66, 0x22, 0x31, 0x9a, 0x5b, 0x5a, 0xb3, 0xb7, 0x9c, 0x79, - 0x77, 0x8c, 0xa6, 0x42, 0xfc, 0x70, 0x8b, 0x89, 0x44, 0xf3, 0x1d, 0xbc, 0x95, 0xb0, 0x61, 0x34, - 0x65, 0x89, 0x53, 0x6f, 0xa3, 0x60, 0x3b, 0xac, 0xc2, 0xde, 0xb3, 0xdf, 0x5f, 0x3d, 0xf4, 0xf1, - 0xea, 0xbc, 0xf3, 0xd7, 0x74, 0x3f, 0x5f, 0x9d, 0x77, 0x3a, 0xda, 0x06, 0x07, 0x31, 0xe4, 0x8c, - 0x9e, 0xad, 0xec, 0xb2, 0x69, 0x39, 0xfe, 0x03, 0xec, 0xdd, 0xb0, 0xb7, 0x90, 0xc9, 0x11, 0x08, - 0xc9, 0x0e, 0x3f, 0x21, 0x6c, 0x9d, 0xc8, 0xd4, 0xfe, 0x80, 0xf0, 0xfe, 0xc6, 0x05, 0x53, 0xb2, - 0xd9, 0x77, 0xe4, 0x86, 0xcc, 0xad, 0xa7, 0xff, 0x28, 0xa8, 0x4a, 0xe9, 0xbf, 0xb8, 0x98, 0xbb, - 0xe8, 0x72, 0xee, 0xa2, 0x5f, 0x73, 0x17, 0x7d, 0x59, 0xb8, 0xb5, 0xcb, 0x85, 0x5b, 0xfb, 0xb1, - 0x70, 0x6b, 0x6f, 0x9e, 0xac, 0xed, 0xef, 0xb9, 0x6e, 0xff, 0x65, 0x61, 0xcc, 0x18, 0x86, 0x74, - 0xf3, 0x34, 0xf4, 0x4a, 0x07, 0x75, 0x6d, 0xdf, 0x47, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x1a, - 0x97, 0x96, 0x34, 0x5b, 0x03, 0x00, 0x00, + // 492 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0xbf, 0x6f, 0xd3, 0x40, + 0x14, 0xce, 0x61, 0x9a, 0x36, 0x57, 0x24, 0x54, 0xb7, 0x10, 0x93, 0xc1, 0x0e, 0x9e, 0xac, 0x48, + 0xbd, 0x23, 0x05, 0x84, 0x94, 0xad, 0x29, 0x6b, 0x01, 0x59, 0x88, 0x81, 0xa5, 0x72, 0xec, 0xc3, + 0x58, 0xc4, 0xf7, 0x22, 0xdf, 0x25, 0x6a, 0xb6, 0x8a, 0x91, 0x05, 0xfe, 0x04, 0x66, 0xa6, 0x4c, + 0xfc, 0x0d, 0x1d, 0x3b, 0x32, 0x05, 0x94, 0x0c, 0x61, 0xce, 0x5f, 0x80, 0x7c, 0x67, 0x37, 0x41, + 0x4a, 0x87, 0x2e, 0x3e, 0xbf, 0xfb, 0xbe, 0xef, 0xdd, 0xfb, 0xf1, 0x61, 0x87, 0x43, 0x7f, 0x28, + 0xe8, 0x88, 0x09, 0x99, 0xf0, 0x58, 0xd0, 0x51, 0xbb, 0xc7, 0x64, 0xd0, 0xa6, 0xf2, 0x9c, 0x0c, + 0x32, 0x90, 0x60, 0x3e, 0x54, 0x04, 0x52, 0x12, 0x48, 0x41, 0x68, 0x1c, 0xc4, 0x10, 0x83, 0xa2, + 0xd0, 0xfc, 0x4f, 0xb3, 0x1b, 0x76, 0x08, 0x22, 0x05, 0x41, 0x7b, 0x81, 0x60, 0xd7, 0xb9, 0x42, + 0x48, 0x78, 0x81, 0xd7, 0x0b, 0x3c, 0x15, 0x31, 0x1d, 0xb5, 0xf3, 0xa3, 0x00, 0xf6, 0x82, 0x34, + 0xe1, 0x40, 0xd5, 0x57, 0x5f, 0xb9, 0x3f, 0x0d, 0x5c, 0x3f, 0x15, 0xf1, 0x49, 0xc6, 0x02, 0xc9, + 0xde, 0xe9, 0xf7, 0x8f, 0xc3, 0x10, 0x86, 0x5c, 0x9a, 0x1d, 0x7c, 0xef, 0x43, 0x06, 0xe9, 0x59, + 0x10, 0x45, 0x19, 0x13, 0xc2, 0x42, 0x4d, 0xe4, 0xd5, 0xba, 0xf5, 0xe5, 0xd4, 0xd9, 0x1f, 0x07, + 0x69, 0xbf, 0xe3, 0xae, 0xa3, 0xae, 0xbf, 0x9b, 0x87, 0xc7, 0x3a, 0x32, 0x9f, 0x61, 0x2c, 0xe1, + 0x5a, 0x79, 0x47, 0x29, 0x1f, 0x2c, 0xa7, 0xce, 0x9e, 0x56, 0xae, 0x30, 0xd7, 0xaf, 0x49, 0x28, + 0x55, 0x21, 0xae, 0x06, 0x69, 0xfe, 0xb6, 0x65, 0x34, 0x0d, 0x6f, 0xf7, 0xe8, 0x11, 0xd1, 0xad, + 0x90, 0xbc, 0xd5, 0x72, 0x2a, 0xe4, 0x04, 0x12, 0xde, 0x7d, 0x72, 0x39, 0x75, 0x2a, 0x3f, 0x7e, + 0x3b, 0x5e, 0x9c, 0xc8, 0x8f, 0xc3, 0x1e, 0x09, 0x21, 0xa5, 0x45, 0xdf, 0xfa, 0x38, 0x14, 0xd1, + 0x27, 0x2a, 0xc7, 0x03, 0x26, 0x94, 0x40, 0xf8, 0x45, 0xea, 0xbc, 0x34, 0x21, 0x83, 0x4c, 0x9e, + 0xc9, 0x24, 0x65, 0xd6, 0xdd, 0x26, 0xf2, 0x8c, 0xf5, 0xd2, 0x56, 0x98, 0xeb, 0xd7, 0x54, 0xf0, + 0x36, 0x49, 0x99, 0x49, 0xf0, 0x0e, 0xe3, 0x91, 0xd6, 0x6c, 0x29, 0xcd, 0xfe, 0x72, 0xea, 0xdc, + 0xd7, 0x9a, 0x12, 0x71, 0xfd, 0x6d, 0xc6, 0x23, 0xc5, 0xb7, 0xf0, 0x76, 0xc4, 0xfa, 0xc1, 0x98, + 0x45, 0x56, 0xb5, 0x89, 0xbc, 0x1d, 0xbf, 0x0c, 0x3b, 0x2f, 0xff, 0x7e, 0x77, 0xd0, 0xe7, 0xc5, + 0xa4, 0xf5, 0xdf, 0x74, 0xbf, 0x2c, 0x26, 0xad, 0x96, 0xb2, 0xc1, 0x61, 0x08, 0x19, 0xa3, 0xe7, + 0x2b, 0xbb, 0x6c, 0x5a, 0x8e, 0xfb, 0x18, 0x3b, 0x37, 0xec, 0xcd, 0x67, 0x62, 0x00, 0x5c, 0xb0, + 0xa3, 0xaf, 0x08, 0x1b, 0xa7, 0x22, 0x36, 0x2f, 0x10, 0x3e, 0xd8, 0xb8, 0x60, 0x4a, 0x36, 0xfb, + 0x8e, 0xdc, 0x90, 0xb9, 0xf1, 0xe2, 0x96, 0x82, 0xb2, 0x94, 0xc6, 0xd6, 0xc5, 0x62, 0xd2, 0x42, + 0xdd, 0xd7, 0x97, 0x33, 0x1b, 0x5d, 0xcd, 0x6c, 0xf4, 0x67, 0x66, 0xa3, 0x6f, 0x73, 0xbb, 0x72, + 0x35, 0xb7, 0x2b, 0xbf, 0xe6, 0x76, 0xe5, 0xfd, 0xf3, 0xb5, 0x35, 0xbe, 0x52, 0x53, 0x78, 0x93, + 0xfb, 0x33, 0x84, 0x3e, 0xdd, 0x3c, 0x14, 0xb5, 0xd9, 0x5e, 0x55, 0xb9, 0xf8, 0xe9, 0xbf, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x7a, 0x8e, 0x90, 0xbf, 0x62, 0x03, 0x00, 0x00, } func (this *MsgCreateVestingAccount) Equal(that interface{}) bool { From 8a2e35efb73ce7416bd5566b5fe7a77f5894f40c Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Wed, 21 Aug 2024 13:28:16 +0300 Subject: [PATCH 10/23] wip --- app/app.go | 24 + go.mod | 48 +- go.sum | 97 +-- wasmbinding/test/custom_message_test.go | 831 ++++++++++++------------ x/mint/module.go | 14 +- x/tax/module.go | 12 +- x/vestings/module.go | 12 +- 7 files changed, 475 insertions(+), 563 deletions(-) diff --git a/app/app.go b/app/app.go index 1488cf0c..be8f4e5e 100644 --- a/app/app.go +++ b/app/app.go @@ -42,6 +42,10 @@ import ( "github.com/cosmos/cosmos-sdk/x/crisis" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + ibctestingtypes "github.com/cosmos/ibc-go/v8/testing/types" + "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" tmjson "github.com/cometbft/cometbft/libs/json" @@ -486,3 +490,23 @@ func GetMaccPerms() map[string][]string { func (app *App) RegisterNodeService(clientCtx client.Context, cfg config.Config) { nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter(), cfg) } + +// GetTxConfig implements the TestingApp interface. +func (app *App) GetTxConfig() client.TxConfig { + return app.encodingConfig.TxConfig +} + +// GetIBCKeeper implements the TestingApp interface. +func (app *App) GetIBCKeeper() *ibckeeper.Keeper { + return app.IBCKeeper +} + +// GetScopedIBCKeeper implements the TestingApp interface. +func (app *App) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { + return app.ScopedIBCKeeper +} + +// GetStakingKeeper implements the TestingApp interface. +func (app *App) GetStakingKeeper() ibctestingtypes.StakingKeeper { + return app.StakingKeeper +} diff --git a/go.mod b/go.mod index bc0919db..c7e4b95c 100644 --- a/go.mod +++ b/go.mod @@ -37,6 +37,7 @@ require ( github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/ibc-go/modules/capability v1.0.0 + github.com/cosmos/interchain-security/v5 v5.0.0 github.com/golang/mock v1.6.0 github.com/hashicorp/go-metrics v0.5.3 google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 @@ -59,18 +60,12 @@ require ( github.com/99designs/keyring v1.2.2 // indirect github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect - github.com/GeertJohan/go.rice v1.0.3 // indirect - github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/StackExchange/wmi v1.2.1 // indirect - github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect github.com/aws/aws-sdk-go v1.44.224 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/bits-and-blooms/bitset v1.13.0 // indirect - github.com/blendle/zapdriver v1.3.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/buger/jsonparser v1.1.1 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -82,24 +77,16 @@ require ( github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cometbft/cometbft-db v0.11.0 // indirect - github.com/consensys/bavard v0.1.13 // indirect - github.com/consensys/gnark-crypto v0.12.1 // indirect - github.com/cosmos/admin-module/v2 v2.0.0-20240430142959-8b3328d1b1a2 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.2.0 // indirect - github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.1 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/interchain-security/v5 v5.0.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect - github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect github.com/creachadair/atomicfile v0.3.3 // indirect github.com/creachadair/tomledit v0.0.26 // indirect - github.com/daaku/go.zipexe v1.0.2 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect @@ -109,21 +96,15 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.7.0 // indirect github.com/emicklei/dot v1.6.2 // indirect - github.com/ethereum/c-kzg-4844 v1.0.0 // indirect - github.com/ethereum/go-ethereum v1.14.5 // indirect github.com/fatih/color v1.17.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/gagliardetto/binary v0.8.0 // indirect - github.com/gagliardetto/solana-go v1.10.0 // indirect - github.com/gagliardetto/treeout v0.1.4 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-ole/go-ole v1.3.0 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.3 // indirect @@ -139,7 +120,6 @@ require ( github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.4 // indirect github.com/gorilla/handlers v1.5.2 // indirect - github.com/gorilla/rpc v1.2.0 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect @@ -156,21 +136,17 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect - github.com/holiman/uint256 v1.2.4 // indirect github.com/huandu/skiplist v1.2.0 // indirect - github.com/iancoleman/orderedmap v0.3.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.9 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.9 // indirect github.com/linxGnu/grocksdb v1.8.14 // indirect - github.com/logrusorgru/aurora v2.0.3+incompatible // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -179,17 +155,13 @@ require ( github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/mmcloughlin/addchain v0.4.0 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 // indirect - github.com/mr-tron/base58 v1.2.0 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/onsi/ginkgo v1.16.5 // indirect github.com/onsi/gomega v1.27.10 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/runc v1.1.12 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect @@ -206,26 +178,18 @@ require ( github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/shamaton/msgpack/v2 v2.2.0 // indirect - github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect - github.com/skip-mev/block-sdk/v2 v2.1.2 // indirect - github.com/skip-mev/feemarket v1.0.3 // indirect - github.com/skip-mev/slinky v1.0.3 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/viper v1.19.0 // indirect - github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect github.com/subosito/gotenv v1.6.0 // indirect - github.com/supranational/blst v0.3.11 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/tidwall/btree v1.7.0 // indirect - github.com/tklauser/go-sysconf v0.3.12 // indirect - github.com/tklauser/numcpus v0.6.1 // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.8 // indirect - go.mongodb.org/mongo-driver v1.11.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect @@ -233,8 +197,6 @@ require ( go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/ratelimit v0.2.0 // indirect - go.uber.org/zap v1.27.0 // indirect golang.org/x/crypto v0.24.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/net v0.26.0 // indirect @@ -251,7 +213,6 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.10 // indirect pgregory.net/rapid v1.1.0 // indirect - rsc.io/tmplfunc v0.0.3 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) @@ -266,7 +227,8 @@ replace ( github.com/cosmos/admin-module/v2 => github.com/neutron-org/admin-module/v2 v2.0.0 // cosmos-sdk-nolus fork adds --validate flag with default value 'true' on gov submit-proposal so we can validate the proposal on submission rather than directly on execution - github.com/cosmos/cosmos-sdk => github.com/nolus-protocol/cosmos-sdk v0.50.7-nolus-rc1 + // github.com/cosmos/cosmos-sdk => github.com/nolus-protocol/cosmos-sdk v0.50.7-nolus-rc1 + github.com/cosmos/cosmos-sdk => /home/denislavivanov/go/github/cosmos-sdk // explicitely replace iavl to v1.2.0 cause sometimes go mod tidy uses not right version github.com/cosmos/iavl => github.com/cosmos/iavl v1.2.0 diff --git a/go.sum b/go.sum index f2145110..51ce8aeb 100644 --- a/go.sum +++ b/go.sum @@ -223,8 +223,6 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/AlekSi/pointer v1.1.0 h1:SSDMPcXD9jSl8FPy9cRzoRaMJtm9g9ggGTxecRUbQoI= -github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -235,7 +233,6 @@ github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dX github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0= github.com/GeertJohan/go.rice v1.0.3 h1:k5viR+xGtIhF61125vCE1cmJ5957RQGXG6dmbaWZSmI= github.com/GeertJohan/go.rice v1.0.3/go.mod h1:XVdrU4pW00M4ikZed5q56tPf1v2KwnIKeIdc9CBYNt4= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= @@ -249,14 +246,11 @@ github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWX github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= -github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= -github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -310,8 +304,6 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= -github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -403,13 +395,9 @@ github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= -github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c h1:uQYC5Z1mdLRPrZhHjHxufI8+2UG/i25QG92j0Er9p6I= -github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI= github.com/crate-crypto/go-kzg-4844 v1.0.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creachadair/atomicfile v0.3.3 h1:yJlDq8qk9QmD/6ol+jq1X4bcoLNVdYq95+owOnauziE= @@ -478,16 +466,12 @@ github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHE github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.14.5 h1:szuFzO1MhJmweXjoM5nSAeDvjNUH3vIQoMzzQnfvjpw= github.com/ethereum/go-ethereum v1.14.5/go.mod h1:VEDGGhSxY7IEjn98hJRFXl/uFvpRgbIIf2PpXiyGGgc= -github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0 h1:KrE8I4reeVvf7C1tm8elRjj4BdscTYzz/WAbYyf/JI4= -github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0/go.mod h1:D9AJLVXSyZQXJQVk8oh1EwjISE+sJTn2duYIZC0dy3w= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA= -github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= @@ -500,14 +484,10 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gagliardetto/binary v0.8.0 h1:U9ahc45v9HW0d15LoN++vIXSJyqR/pWw8DDlhd7zvxg= github.com/gagliardetto/binary v0.8.0/go.mod h1:2tfj51g5o9dnvsc+fL3Jxr22MuWzYXwx9wEoN0XQ7/c= -github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= -github.com/gagliardetto/gofuzz v1.2.2/go.mod h1:bkH/3hYLZrMLbfYWA0pWzXmi5TTRZnu4pMGZBkqMKvY= github.com/gagliardetto/solana-go v1.10.0 h1:lDuHGC+XLxw9j8fCHBZM9tv4trI0PVhev1m9NAMaIdM= github.com/gagliardetto/solana-go v1.10.0/go.mod h1:afBEcIRrDLJst3lvAahTr63m6W2Ns6dajZxe2irF7Jg= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -536,7 +516,6 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= @@ -552,14 +531,10 @@ github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/E github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= @@ -600,7 +575,6 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= @@ -656,7 +630,6 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLe github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= -github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -706,8 +679,6 @@ github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NM github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= -github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= @@ -756,10 +727,6 @@ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= -github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 h1:X4egAf/gcS1zATw6wn4Ej8vjuVGxeHdan+bRb2ebyv4= -github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= -github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= -github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -768,8 +735,6 @@ github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0Jr github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= -github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc= github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= @@ -782,9 +747,6 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= -github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -811,10 +773,8 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= @@ -822,17 +782,12 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= -github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= @@ -863,8 +818,6 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= -github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= @@ -882,11 +835,8 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= -github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= -github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -894,7 +844,6 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 h1:mPMvm6X6tf4w8y7j9YIt6V9jfWhL6QlbEc7CCmeQlWk= github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1/go.mod h1:ye2e/VUEtE2BHE+G/QcKkcLQVAEJoYRFj5VUOQatCRE= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= @@ -915,7 +864,6 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS github.com/neutron-org/admin-module/v2 v2.0.0 h1:MlkSc1821sQ+G5/cYOajuqZ5/lM53xTbixpTtXnHh0A= github.com/neutron-org/admin-module/v2 v2.0.0/go.mod h1:RfOyabXsdJ5btcOKyKPZDYiZhtuKFubbJMOb8EJZtvA= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nkovacs/streamquote v1.0.0/go.mod h1:BN+NaZ2CmdKqUuTUXUEm9j95B2TRbpOWpxbJYzzgUsc= github.com/nolus-protocol/cosmos-sdk v0.50.7-nolus-rc1 h1:QK59L25el60UuVoosifSg3EVK+/n6urjln6yxNnxAI4= github.com/nolus-protocol/cosmos-sdk v0.50.7-nolus-rc1/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s= github.com/nolus-protocol/neutron/v4 v4.0.1-nolus h1:21r0fWxqjfaLHkPS/y/H1WDxytisOZ3xPsvp+JHa1jU= @@ -932,8 +880,6 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -1027,8 +973,6 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5X github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -1041,10 +985,8 @@ github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= -github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= @@ -1059,8 +1001,6 @@ github.com/shamaton/msgpack/v2 v2.2.0 h1:IP1m01pHwCrMa6ZccP9B3bqxEMKMSmMVAVKk54g github.com/shamaton/msgpack/v2 v2.2.0/go.mod h1:6khjYnkx73f7VQU7wjcFS9DFjs+59naVWJv1TB7qdOI= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= -github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -1070,8 +1010,6 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skip-mev/block-sdk/v2 v2.1.2 h1:fNKbrb+PVVzuU0JiSuWgBV4Afj5zZ1VeHQJp88wSl1g= github.com/skip-mev/block-sdk/v2 v2.1.2/go.mod h1:kIq7SMva0/eHKTCiG/oI5XGxD4HNVK0t71TrUZqHcvA= -github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610 h1:4JlsiRVt/YZOvrKH525T7sZXgEWUEjqSDMwE6fXNbdo= -github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610/go.mod h1:kB8gFZX07CyJnw8q9iEZijI3qJTIe1K/Y++P5VGkrcg= github.com/skip-mev/feemarket v1.0.3 h1:DpB1tj51MlFN5iOg1lN+fwWqSF62xdND46BqgTko0C4= github.com/skip-mev/feemarket v1.0.3/go.mod h1:lszt7zGEEActbDYq1hOKogQvfCsnLEHH5113LwgmYcE= github.com/skip-mev/slinky v1.0.3 h1:+7Yw+HHjYqJ7gb5nrG1k2bplNG+qEmn5wws+OesdY2M= @@ -1103,8 +1041,6 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= -github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= -github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -1137,21 +1073,14 @@ github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70 github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE= -github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= -github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= -github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= @@ -1159,20 +1088,9 @@ github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0o github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= -github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= -github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1217,12 +1135,7 @@ go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -1236,7 +1149,6 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1250,8 +1162,6 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1340,7 +1250,6 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1420,7 +1329,6 @@ golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1489,14 +1397,13 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= @@ -1841,8 +1748,6 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= -gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= diff --git a/wasmbinding/test/custom_message_test.go b/wasmbinding/test/custom_message_test.go index d94f0666..b814dfae 100644 --- a/wasmbinding/test/custom_message_test.go +++ b/wasmbinding/test/custom_message_test.go @@ -1,423 +1,446 @@ package test -// const FeeCollectorAddress = "neutron1vguuxez2h5ekltfj9gjd62fs5k4rl2zy5hfrncasykzw08rezpfsd2rhm7" - -// type CustomMessengerTestSuite struct { -// testutil.IBCConnectionTestSuite -// neutron *app.App -// ctx sdk.Context -// messenger *wasmbinding.CustomMessenger -// contractOwner sdk.AccAddress -// contractAddress sdk.AccAddress -// contractKeeper wasmtypes.ContractOpsKeeper -// } - -// func (suite *CustomMessengerTestSuite) SetupTest() { -// suite.IBCConnectionTestSuite.SetupTest() -// suite.neutron = suite.GetNeutronZoneApp(suite.ChainA) -// suite.ctx = suite.ChainA.GetContext() -// suite.messenger = &wasmbinding.CustomMessenger{} -// suite.messenger.Ictxmsgserver = ictxkeeper.NewMsgServerImpl(suite.neutron.InterchainTxsKeeper) -// suite.messenger.Keeper = suite.neutron.InterchainTxsKeeper -// suite.messenger.Icqmsgserver = icqkeeper.NewMsgServerImpl(suite.neutron.InterchainQueriesKeeper) -// suite.messenger.ContractmanagerKeeper = &suite.neutron.ContractManagerKeeper -// suite.contractOwner = keeper.RandomAccountAddress(suite.T()) - -// suite.contractKeeper = keeper.NewDefaultPermissionKeeper(&suite.neutron.WasmKeeper) - -// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") -// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) -// suite.Require().NotEmpty(suite.contractAddress) -// } - -// func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccount() { -// err := suite.neutron.FeeBurnerKeeper.SetParams(suite.ctx, feeburnertypes.Params{ -// NeutronDenom: "untrn", -// TreasuryAddress: "neutron13jrwrtsyjjuynlug65r76r2zvfw5xjcq6532h2", -// }) -// suite.Require().NoError(err) - -// // Craft RegisterInterchainAccount message -// msg := bindings.NeutronMsg{ -// RegisterInterchainAccount: &bindings.RegisterInterchainAccount{ -// ConnectionId: suite.Path.EndpointA.ConnectionID, -// InterchainAccountId: testutil.TestInterchainID, -// RegisterFee: sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(1_000_000))), -// }, -// } - -// bankKeeper := suite.neutron.BankKeeper -// senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() -// err = bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, math.NewInt(1_000_000)))) -// suite.NoError(err) - -// // Dispatch RegisterInterchainAccount message -// _, err = suite.executeNeutronMsg(suite.contractAddress, msg) -// suite.NoError(err) -// } - -// func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccountLongID() { -// // Store code and instantiate reflect contract -// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") -// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) -// suite.Require().NotEmpty(suite.contractAddress) - -// // Craft RegisterInterchainAccount message -// msg, err := json.Marshal(bindings.NeutronMsg{ -// RegisterInterchainAccount: &bindings.RegisterInterchainAccount{ -// ConnectionId: suite.Path.EndpointA.ConnectionID, -// // the limit is 47, this line is 50 characters long -// InterchainAccountId: "01234567890123456789012345678901234567890123456789", -// }, -// }) -// suite.NoError(err) - -// // Dispatch RegisterInterchainAccount message via DispatchHandler cause we want to catch an error from SDK directly, not from a contract -// _, _, _, err = suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ -// Custom: msg, -// }) -// suite.Error(err) -// suite.ErrorIs(err, ictxtypes.ErrLongInterchainAccountID) -// } +import ( + "encoding/json" + "testing" + + "cosmossdk.io/math" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + + ibcchanneltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + + "github.com/stretchr/testify/suite" + + ictxtypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + + "github.com/CosmWasm/wasmd/x/wasm/keeper" + "github.com/CosmWasm/wasmvm/v2/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + "github.com/Nolus-Protocol/nolus-core/app" + "github.com/Nolus-Protocol/nolus-core/app/params" + "github.com/Nolus-Protocol/nolus-core/testutil" + "github.com/Nolus-Protocol/nolus-core/wasmbinding" + "github.com/Nolus-Protocol/nolus-core/wasmbinding/bindings" + contractmanagerkeeper "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" + feetypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" + icqkeeper "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" + ictxkeeper "github.com/neutron-org/neutron/v4/x/interchaintxs/keeper" +) + +const FeeCollectorAddress = "nolus1vguuxez2h5ekltfj9gjd62fs5k4rl2zy5hfrncasykzw08rezpfsd2rhm7" + +type CustomMessengerTestSuite struct { + testutil.IBCConnectionTestSuite + nolus *app.App + ctx sdk.Context + messenger *wasmbinding.CustomMessenger + contractOwner sdk.AccAddress + contractAddress sdk.AccAddress + contractKeeper wasmtypes.ContractOpsKeeper +} + +func (suite *CustomMessengerTestSuite) SetupTest() { + suite.IBCConnectionTestSuite.SetupTest() + suite.nolus = suite.GetNolusZoneApp(suite.ChainA) + suite.ctx = suite.ChainA.GetContext() + suite.messenger = &wasmbinding.CustomMessenger{} + suite.messenger.Ictxmsgserver = ictxkeeper.NewMsgServerImpl(*suite.nolus.InterchainTxsKeeper) + suite.messenger.Keeper = *suite.nolus.InterchainTxsKeeper + suite.messenger.Icqmsgserver = icqkeeper.NewMsgServerImpl(*suite.nolus.InterchainQueriesKeeper) + suite.messenger.ContractmanagerKeeper = suite.nolus.ContractManagerKeeper + suite.contractOwner = keeper.RandomAccountAddress(suite.T()) + + suite.contractKeeper = keeper.NewDefaultPermissionKeeper(&suite.nolus.WasmKeeper) + + codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") + suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) + suite.Require().NotEmpty(suite.contractAddress) +} + +func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccount() { + // Craft RegisterInterchainAccount message + msg := bindings.NeutronMsg{ + RegisterInterchainAccount: &bindings.RegisterInterchainAccount{ + ConnectionId: suite.Path.EndpointA.ConnectionID, + InterchainAccountId: testutil.TestInterchainID, + RegisterFee: sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(1_000_000))), + }, + } + + bankKeeper := suite.nolus.BankKeeper + senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() + err := bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(1_000_000)))) + suite.NoError(err) + + // Dispatch RegisterInterchainAccount message + _, err = suite.executeNeutronMsg(suite.contractAddress, msg) + suite.NoError(err) +} + +func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccountLongID() { + // Store code and instantiate reflect contract + codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") + suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) + suite.Require().NotEmpty(suite.contractAddress) + + // Craft RegisterInterchainAccount message + msg, err := json.Marshal(bindings.NeutronMsg{ + RegisterInterchainAccount: &bindings.RegisterInterchainAccount{ + ConnectionId: suite.Path.EndpointA.ConnectionID, + // the limit is 47, this line is 50 characters long + InterchainAccountId: "01234567890123456789012345678901234567890123456789", + }, + }) + suite.NoError(err) + + // Dispatch RegisterInterchainAccount message via DispatchHandler cause we want to catch an error from SDK directly, not from a contract + _, _, _, err = suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ + Custom: msg, + }) + suite.Error(err) + suite.ErrorIs(err, ictxtypes.ErrLongInterchainAccountID) +} // func (suite *CustomMessengerTestSuite) TestRegisterInterchainQuery() { -// // Store code and instantiate reflect contract -// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") -// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) -// suite.Require().NotEmpty(suite.contractAddress) - -// err := testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) -// suite.Require().NoError(err) - -// // Top up contract balance -// senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() -// coinsAmnt := sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, sdkmath.NewInt(int64(10_000_000)))) -// bankKeeper := suite.neutron.BankKeeper -// err = bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, coinsAmnt) -// suite.NoError(err) - -// // Craft RegisterInterchainQuery message -// msg, err := json.Marshal(bindings.NeutronMsg{ -// RegisterInterchainQuery: &bindings.RegisterInterchainQuery{ -// QueryType: string(icqtypes.InterchainQueryTypeKV), -// Keys: []*icqtypes.KVKey{ -// {Path: ibchost.StoreKey, Key: host.FullClientStateKey(suite.Path.EndpointB.ClientID)}, -// }, -// TransactionsFilter: "{}", -// ConnectionId: suite.Path.EndpointA.ConnectionID, -// UpdatePeriod: 20, +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// suite.Require().NotEmpty(suite.contractAddress) + +// err := testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) +// suite.Require().NoError(err) + +// // Top up contract balance +// senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() +// coinsAmnt := sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(int64(10_000_000)))) +// bankKeeper := suite.nolus.BankKeeper +// err = bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, coinsAmnt) +// suite.NoError(err) + +// // Craft RegisterInterchainQuery message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// RegisterInterchainQuery: &bindings.RegisterInterchainQuery{ +// QueryType: string(icqtypes.InterchainQueryTypeKV), +// Keys: []*icqtypes.KVKey{ +// {Path: ibchost.StoreKey, Key: host.FullClientStateKey(suite.Path.EndpointB.ClientID)}, // }, -// }) -// suite.NoError(err) - -// // Dispatch RegisterInterchainQuery message -// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ -// Custom: msg, -// }) -// suite.NoError(err) -// suite.Nil(events) -// suite.Equal([][]byte{[]byte(`{"id":1}`)}, data) +// TransactionsFilter: "{}", +// ConnectionId: suite.Path.EndpointA.ConnectionID, +// UpdatePeriod: 20, +// }, +// }) +// suite.NoError(err) + +// // Dispatch RegisterInterchainQuery message +// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// suite.NoError(err) +// suite.Nil(events) +// suite.Equal([][]byte{[]byte(`{"id":1}`)}, data) // } // func (suite *CustomMessengerTestSuite) TestUpdateInterchainQuery() { -// // reuse register interchain query test to get query registered -// suite.TestRegisterInterchainQuery() - -// // Craft UpdateInterchainQuery message -// msg, err := json.Marshal(bindings.NeutronMsg{ -// UpdateInterchainQuery: &bindings.UpdateInterchainQuery{ -// QueryId: 1, -// NewKeys: nil, -// NewUpdatePeriod: 111, -// }, -// }) -// suite.NoError(err) - -// // Dispatch UpdateInterchainQuery message -// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ -// Custom: msg, -// }) -// suite.NoError(err) -// suite.Nil(events) -// suite.Equal([][]byte{[]byte(`{}`)}, data) +// // reuse register interchain query test to get query registered +// suite.TestRegisterInterchainQuery() + +// // Craft UpdateInterchainQuery message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// UpdateInterchainQuery: &bindings.UpdateInterchainQuery{ +// QueryId: 1, +// NewKeys: nil, +// NewUpdatePeriod: 111, +// }, +// }) +// suite.NoError(err) + +// // Dispatch UpdateInterchainQuery message +// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// suite.NoError(err) +// suite.Nil(events) +// suite.Equal([][]byte{[]byte(`{}`)}, data) // } // func (suite *CustomMessengerTestSuite) TestUpdateInterchainQueryFailed() { -// // Craft UpdateInterchainQuery message -// msg, err := json.Marshal(bindings.NeutronMsg{ -// UpdateInterchainQuery: &bindings.UpdateInterchainQuery{ -// QueryId: 1, -// NewKeys: nil, -// NewUpdatePeriod: 1, -// }, -// }) -// suite.NoError(err) - -// // Dispatch UpdateInterchainQuery message -// owner, err := sdk.AccAddressFromBech32(testutil.TestOwnerAddress) -// suite.NoError(err) -// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, owner, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ -// Custom: msg, -// }) -// expectedErrMsg := "failed to update interchain query: failed to update interchain query: failed to get query by query id: there is no query with id: 1" -// suite.Require().ErrorContains(err, expectedErrMsg) -// suite.Nil(events) -// suite.Nil(data) +// // Craft UpdateInterchainQuery message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// UpdateInterchainQuery: &bindings.UpdateInterchainQuery{ +// QueryId: 1, +// NewKeys: nil, +// NewUpdatePeriod: 1, +// }, +// }) +// suite.NoError(err) + +// // Dispatch UpdateInterchainQuery message +// owner, err := sdk.AccAddressFromBech32(testutil.TestOwnerAddress) +// suite.NoError(err) +// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, owner, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// expectedErrMsg := "failed to update interchain query: failed to update interchain query: failed to get query by query id: there is no query with id: 1" +// suite.Require().ErrorContains(err, expectedErrMsg) +// suite.Nil(events) +// suite.Nil(data) // } // func (suite *CustomMessengerTestSuite) TestRemoveInterchainQuery() { -// // Reuse register interchain query test to get query registered -// suite.TestRegisterInterchainQuery() - -// // Craft RemoveInterchainQuery message -// msg, err := json.Marshal(bindings.NeutronMsg{ -// RemoveInterchainQuery: &bindings.RemoveInterchainQuery{ -// QueryId: 1, -// }, -// }) -// suite.NoError(err) - -// // Dispatch RemoveInterchainQuery message -// suite.NoError(err) -// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ -// Custom: msg, -// }) -// suite.NoError(err) -// suite.Nil(events) -// suite.Equal([][]byte{[]byte(`{}`)}, data) +// // Reuse register interchain query test to get query registered +// suite.TestRegisterInterchainQuery() + +// // Craft RemoveInterchainQuery message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// RemoveInterchainQuery: &bindings.RemoveInterchainQuery{ +// QueryId: 1, +// }, +// }) +// suite.NoError(err) + +// // Dispatch RemoveInterchainQuery message +// suite.NoError(err) +// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// suite.NoError(err) +// suite.Nil(events) +// suite.Equal([][]byte{[]byte(`{}`)}, data) // } // func (suite *CustomMessengerTestSuite) TestRemoveInterchainQueryFailed() { -// // Craft RemoveInterchainQuery message -// msg, err := json.Marshal(bindings.NeutronMsg{ -// RemoveInterchainQuery: &bindings.RemoveInterchainQuery{ -// QueryId: 1, -// }, -// }) -// suite.NoError(err) - -// // Dispatch RemoveInterchainQuery message -// owner, err := sdk.AccAddressFromBech32(testutil.TestOwnerAddress) -// suite.NoError(err) -// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, owner, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ -// Custom: msg, -// }) -// expectedErrMsg := "failed to remove interchain query: failed to remove interchain query: failed to get query by query id: there is no query with id: 1" -// suite.Require().ErrorContains(err, expectedErrMsg) -// suite.Nil(events) -// suite.Nil(data) +// // Craft RemoveInterchainQuery message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// RemoveInterchainQuery: &bindings.RemoveInterchainQuery{ +// QueryId: 1, +// }, +// }) +// suite.NoError(err) + +// // Dispatch RemoveInterchainQuery message +// owner, err := sdk.AccAddressFromBech32(testutil.TestOwnerAddress) +// suite.NoError(err) +// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, owner, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// expectedErrMsg := "failed to remove interchain query: failed to remove interchain query: failed to get query by query id: there is no query with id: 1" +// suite.Require().ErrorContains(err, expectedErrMsg) +// suite.Nil(events) +// suite.Nil(data) // } -// func (suite *CustomMessengerTestSuite) TestSubmitTx() { -// // Store code and instantiate reflect contract -// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") -// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) -// suite.Require().NotEmpty(suite.contractAddress) - -// senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() -// coinsAmnt := sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, sdkmath.NewInt(int64(10_000_000)))) -// bankKeeper := suite.neutron.BankKeeper -// err := bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, coinsAmnt) -// suite.NoError(err) - -// err = testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) -// suite.Require().NoError(err) - -// events, data, _, err := suite.messenger.DispatchMsg( -// suite.ctx, -// suite.contractAddress, -// suite.Path.EndpointA.ChannelConfig.PortID, -// types.CosmosMsg{ -// Custom: suite.craftMarshaledMsgSubmitTxWithNumMsgs(1), -// }, -// ) -// suite.NoError(err) - -// var response ictxtypes.MsgSubmitTxResponse -// err = json.Unmarshal(data[0], &response) -// suite.NoError(err) -// suite.Nil(events) -// suite.Equal(uint64(1), response.SequenceId) -// suite.Equal("channel-2", response.Channel) -// } - -// func (suite *CustomMessengerTestSuite) TestSubmitTxTooMuchTxs() { -// // Store code and instantiate reflect contract -// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") -// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) -// suite.Require().NotEmpty(suite.contractAddress) - -// err := testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) -// suite.Require().NoError(err) - -// _, _, _, err = suite.messenger.DispatchMsg( -// suite.ctx, -// suite.contractAddress, -// suite.Path.EndpointA.ChannelConfig.PortID, -// types.CosmosMsg{ -// Custom: suite.craftMarshaledMsgSubmitTxWithNumMsgs(20), -// }, -// ) -// suite.ErrorContains(err, "MsgSubmitTx contains more messages than allowed") -// } - -// func (suite *CustomMessengerTestSuite) TestResubmitFailureAck() { -// // Store code and instantiate reflect contract -// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") -// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) -// suite.Require().NotEmpty(suite.contractAddress) - -// // Add failure -// packet := ibcchanneltypes.Packet{} -// ack := ibcchanneltypes.Acknowledgement{ -// Response: &ibcchanneltypes.Acknowledgement_Result{Result: []byte("Result")}, -// } -// payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, &ack) -// require.NoError(suite.T(), err) -// failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, suite.contractAddress.String()) -// suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, suite.contractAddress.String(), payload, "test error") - -// // Craft message -// msg, err := json.Marshal(bindings.NeutronMsg{ -// ResubmitFailure: &bindings.ResubmitFailure{ -// FailureId: failureID, -// }, -// }) -// suite.NoError(err) - -// // Dispatch -// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ -// Custom: msg, -// }) -// suite.NoError(err) -// suite.Nil(events) -// expected, err := json.Marshal(&bindings.ResubmitFailureResponse{}) -// suite.NoError(err) -// suite.Equal([][]uint8{expected}, data) -// } - -// func (suite *CustomMessengerTestSuite) TestResubmitFailureTimeout() { -// // Store code and instantiate reflect contract -// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") -// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) -// suite.Require().NotEmpty(suite.contractAddress) - -// // Add failure -// packet := ibcchanneltypes.Packet{} -// payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, nil) -// require.NoError(suite.T(), err) -// failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, suite.contractAddress.String()) -// suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, suite.contractAddress.String(), payload, "test error") - -// // Craft message -// msg, err := json.Marshal(bindings.NeutronMsg{ -// ResubmitFailure: &bindings.ResubmitFailure{ -// FailureId: failureID, -// }, -// }) -// suite.NoError(err) - -// // Dispatch -// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ -// Custom: msg, -// }) -// suite.NoError(err) -// suite.Nil(events) -// expected, err := json.Marshal(&bindings.ResubmitFailureResponse{FailureId: failureID}) -// suite.NoError(err) -// suite.Equal([][]uint8{expected}, data) -// } - -// func (suite *CustomMessengerTestSuite) TestResubmitFailureFromDifferentContract() { -// // Store code and instantiate reflect contract -// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") -// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) -// suite.Require().NotEmpty(suite.contractAddress) - -// // Add failure -// packet := ibcchanneltypes.Packet{} -// ack := ibcchanneltypes.Acknowledgement{ -// Response: &ibcchanneltypes.Acknowledgement_Error{Error: "ErrorSudoPayload"}, -// } -// failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, testutil.TestOwnerAddress) -// payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, &ack) -// require.NoError(suite.T(), err) -// suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, testutil.TestOwnerAddress, payload, "test error") - -// // Craft message -// msg, err := json.Marshal(bindings.NeutronMsg{ -// ResubmitFailure: &bindings.ResubmitFailure{ -// FailureId: failureID, -// }, -// }) -// suite.NoError(err) - -// // Dispatch -// _, _, _, err = suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ -// Custom: msg, -// }) -// suite.ErrorContains(err, "no failure found to resubmit: not found") -// } - -// func (suite *CustomMessengerTestSuite) craftMarshaledMsgSubmitTxWithNumMsgs(numMsgs int) (result []byte) { -// msg := bindings.ProtobufAny{ -// TypeURL: "/cosmos.staking.v1beta1.MsgDelegate", -// Value: []byte{26, 10, 10, 5, 115, 116, 97, 107, 101, 18, 1, 48}, -// } -// msgs := make([]bindings.ProtobufAny, 0, numMsgs) -// for i := 0; i < numMsgs; i++ { -// msgs = append(msgs, msg) -// } -// result, err := json.Marshal(struct { -// SubmitTx bindings.SubmitTx `json:"submit_tx"` -// }{ -// SubmitTx: bindings.SubmitTx{ -// ConnectionId: suite.Path.EndpointA.ConnectionID, -// InterchainAccountId: testutil.TestInterchainID, -// Msgs: msgs, -// Memo: "Jimmy", -// Timeout: 2000, -// Fee: feetypes.Fee{ -// RecvFee: sdk.NewCoins(), -// AckFee: sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, sdkmath.NewInt(1000))), -// TimeoutFee: sdk.NewCoins(sdk.NewCoin(params.DefaultDenom, sdkmath.NewInt(1000))), -// }, -// }, -// }) -// suite.NoError(err) -// return -// } - -// func (suite *CustomMessengerTestSuite) executeCustomMsg(contractAddress sdk.AccAddress, fullMsg json.RawMessage) (data []byte, err error) { -// customMsg := types.CosmosMsg{ -// Custom: fullMsg, -// } - -// type ExecuteMsg struct { -// ReflectMsg struct { -// Msgs []types.CosmosMsg `json:"msgs"` -// } `json:"reflect_msg"` -// } - -// execMsg := ExecuteMsg{ReflectMsg: struct { -// Msgs []types.CosmosMsg `json:"msgs"` -// }(struct{ Msgs []types.CosmosMsg }{Msgs: []types.CosmosMsg{customMsg}})} - -// msg, err := json.Marshal(execMsg) -// suite.NoError(err) - -// data, err = suite.contractKeeper.Execute(suite.ctx, contractAddress, suite.contractOwner, msg, nil) - -// return -// } - -// func (suite *CustomMessengerTestSuite) executeNeutronMsg(contractAddress sdk.AccAddress, fullMsg bindings.NeutronMsg) (data []byte, err error) { -// fullMsgBz, err := json.Marshal(fullMsg) -// suite.NoError(err) - -// return suite.executeCustomMsg(contractAddress, fullMsgBz) -// } - -// func TestMessengerTestSuite(t *testing.T) { -// suite.Run(t, new(CustomMessengerTestSuite)) -// } +func (suite *CustomMessengerTestSuite) TestSubmitTx() { + // Store code and instantiate reflect contract + codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") + suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) + suite.Require().NotEmpty(suite.contractAddress) + + senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() + coinsAmnt := sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(int64(10_000_000)))) + bankKeeper := suite.nolus.BankKeeper + err := bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, coinsAmnt) + suite.NoError(err) + + err = testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) + suite.Require().NoError(err) + + events, data, _, err := suite.messenger.DispatchMsg( + suite.ctx, + suite.contractAddress, + suite.Path.EndpointA.ChannelConfig.PortID, + types.CosmosMsg{ + Custom: suite.craftMarshaledMsgSubmitTxWithNumMsgs(1), + }, + ) + suite.NoError(err) + + var response ictxtypes.MsgSubmitTxResponse + err = json.Unmarshal(data[0], &response) + suite.NoError(err) + suite.Nil(events) + suite.Equal(uint64(1), response.SequenceId) + suite.Equal("channel-2", response.Channel) +} + +func (suite *CustomMessengerTestSuite) TestSubmitTxTooMuchTxs() { + // Store code and instantiate reflect contract + codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") + suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) + suite.Require().NotEmpty(suite.contractAddress) + + err := testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) + suite.Require().NoError(err) + + _, _, _, err = suite.messenger.DispatchMsg( + suite.ctx, + suite.contractAddress, + suite.Path.EndpointA.ChannelConfig.PortID, + types.CosmosMsg{ + Custom: suite.craftMarshaledMsgSubmitTxWithNumMsgs(20), + }, + ) + suite.ErrorContains(err, "MsgSubmitTx contains more messages than allowed") +} + +func (suite *CustomMessengerTestSuite) TestResubmitFailureAck() { + // Store code and instantiate reflect contract + codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") + suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) + suite.Require().NotEmpty(suite.contractAddress) + + // Add failure + packet := ibcchanneltypes.Packet{} + ack := ibcchanneltypes.Acknowledgement{ + Response: &ibcchanneltypes.Acknowledgement_Result{Result: []byte("Result")}, + } + payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, &ack) + require.NoError(suite.T(), err) + failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, suite.contractAddress.String()) + suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, suite.contractAddress.String(), payload, "test error") + + // Craft message + msg, err := json.Marshal(bindings.NeutronMsg{ + ResubmitFailure: &bindings.ResubmitFailure{ + FailureId: failureID, + }, + }) + suite.NoError(err) + + // Dispatch + events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ + Custom: msg, + }) + suite.NoError(err) + suite.Nil(events) + expected, err := json.Marshal(&bindings.ResubmitFailureResponse{}) + suite.NoError(err) + suite.Equal([][]uint8{expected}, data) +} + +func (suite *CustomMessengerTestSuite) TestResubmitFailureTimeout() { + // Store code and instantiate reflect contract + codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") + suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) + suite.Require().NotEmpty(suite.contractAddress) + + // Add failure + packet := ibcchanneltypes.Packet{} + payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, nil) + require.NoError(suite.T(), err) + failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, suite.contractAddress.String()) + suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, suite.contractAddress.String(), payload, "test error") + + // Craft message + msg, err := json.Marshal(bindings.NeutronMsg{ + ResubmitFailure: &bindings.ResubmitFailure{ + FailureId: failureID, + }, + }) + suite.NoError(err) + + // Dispatch + events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ + Custom: msg, + }) + suite.NoError(err) + suite.Nil(events) + expected, err := json.Marshal(&bindings.ResubmitFailureResponse{FailureId: failureID}) + suite.NoError(err) + suite.Equal([][]uint8{expected}, data) +} + +func (suite *CustomMessengerTestSuite) TestResubmitFailureFromDifferentContract() { + // Store code and instantiate reflect contract + codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") + suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) + suite.Require().NotEmpty(suite.contractAddress) + + // Add failure + packet := ibcchanneltypes.Packet{} + ack := ibcchanneltypes.Acknowledgement{ + Response: &ibcchanneltypes.Acknowledgement_Error{Error: "ErrorSudoPayload"}, + } + failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, testutil.TestOwnerAddress) + payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, &ack) + require.NoError(suite.T(), err) + suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, testutil.TestOwnerAddress, payload, "test error") + + // Craft message + msg, err := json.Marshal(bindings.NeutronMsg{ + ResubmitFailure: &bindings.ResubmitFailure{ + FailureId: failureID, + }, + }) + suite.NoError(err) + + // Dispatch + _, _, _, err = suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ + Custom: msg, + }) + suite.ErrorContains(err, "no failure found to resubmit: not found") +} + +func (suite *CustomMessengerTestSuite) craftMarshaledMsgSubmitTxWithNumMsgs(numMsgs int) (result []byte) { + msg := bindings.ProtobufAny{ + TypeURL: "/cosmos.staking.v1beta1.MsgDelegate", + Value: []byte{26, 10, 10, 5, 115, 116, 97, 107, 101, 18, 1, 48}, + } + msgs := make([]bindings.ProtobufAny, 0, numMsgs) + for i := 0; i < numMsgs; i++ { + msgs = append(msgs, msg) + } + result, err := json.Marshal(struct { + SubmitTx bindings.SubmitTx `json:"submit_tx"` + }{ + SubmitTx: bindings.SubmitTx{ + ConnectionId: suite.Path.EndpointA.ConnectionID, + InterchainAccountId: testutil.TestInterchainID, + Msgs: msgs, + Memo: "Jimmy", + Timeout: 2000, + Fee: feetypes.Fee{ + RecvFee: sdk.NewCoins(), + AckFee: sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(1000))), + TimeoutFee: sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(1000))), + }, + }, + }) + suite.NoError(err) + return +} + +func (suite *CustomMessengerTestSuite) executeCustomMsg(contractAddress sdk.AccAddress, fullMsg json.RawMessage) (data []byte, err error) { + customMsg := types.CosmosMsg{ + Custom: fullMsg, + } + + type ExecuteMsg struct { + ReflectMsg struct { + Msgs []types.CosmosMsg `json:"msgs"` + } `json:"reflect_msg"` + } + + execMsg := ExecuteMsg{ReflectMsg: struct { + Msgs []types.CosmosMsg `json:"msgs"` + }(struct{ Msgs []types.CosmosMsg }{Msgs: []types.CosmosMsg{customMsg}})} + + msg, err := json.Marshal(execMsg) + suite.NoError(err) + + data, err = suite.contractKeeper.Execute(suite.ctx, contractAddress, suite.contractOwner, msg, nil) + + return +} + +func (suite *CustomMessengerTestSuite) executeNeutronMsg(contractAddress sdk.AccAddress, fullMsg bindings.NeutronMsg) (data []byte, err error) { + fullMsgBz, err := json.Marshal(fullMsg) + suite.NoError(err) + + return suite.executeCustomMsg(contractAddress, fullMsgBz) +} + +func TestMessengerTestSuite(t *testing.T) { + suite.Run(t, new(CustomMessengerTestSuite)) +} diff --git a/x/mint/module.go b/x/mint/module.go index 189a0435..038a0c2c 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -28,13 +28,13 @@ import ( const ConsensusVersion = 2 var ( - _ module.AppModuleBasic = (*AppModule)(nil) - _ module.AppModuleSimulation = (*AppModule)(nil) - _ module.HasABCIGenesis = (*AppModule)(nil) + _ module.AppModuleBasic = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasABCIGenesis = AppModule{} - _ appmodule.AppModule = (*AppModule)(nil) - _ module.HasABCIEndBlock = (*AppModule)(nil) - _ appmodule.HasBeginBlocker = (*AppModule)(nil) + _ appmodule.AppModule = AppModule{} + _ module.HasABCIEndBlock = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} ) // AppModuleBasic defines the basic application module used by the mint module. @@ -42,8 +42,6 @@ type AppModuleBasic struct { cdc codec.Codec } -var _ module.AppModuleBasic = AppModuleBasic{} - // Name returns the mint module's name. func (AppModuleBasic) Name() string { return types.ModuleName diff --git a/x/tax/module.go b/x/tax/module.go index b0f196d5..a86a43ca 100644 --- a/x/tax/module.go +++ b/x/tax/module.go @@ -30,13 +30,13 @@ import ( const ConsensusVersion = 3 var ( - _ module.AppModuleBasic = (*AppModule)(nil) - _ module.AppModuleSimulation = (*AppModule)(nil) - _ module.HasABCIGenesis = (*AppModule)(nil) + _ module.AppModuleBasic = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasABCIGenesis = AppModule{} - _ appmodule.AppModule = (*AppModule)(nil) - _ appmodule.HasBeginBlocker = (*AppModule)(nil) - _ appmodule.HasEndBlocker = (*AppModule)(nil) + _ appmodule.AppModule = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} + _ appmodule.HasEndBlocker = AppModule{} ) // ---------------------------------------------------------------------------- diff --git a/x/vestings/module.go b/x/vestings/module.go index 8e2dc7d6..74af90ef 100644 --- a/x/vestings/module.go +++ b/x/vestings/module.go @@ -24,13 +24,13 @@ import ( const ConsensusVersion = 2 var ( - _ module.AppModuleBasic = (*AppModule)(nil) - _ module.AppModuleSimulation = (*AppModule)(nil) - _ module.HasGenesis = (*AppModule)(nil) + _ module.AppModuleBasic = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} - _ appmodule.AppModule = (*AppModule)(nil) - _ appmodule.HasBeginBlocker = (*AppModule)(nil) - _ appmodule.HasEndBlocker = (*AppModule)(nil) + _ appmodule.AppModule = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} + _ appmodule.HasEndBlocker = AppModule{} ) // ---------------------------------------------------------------------------- From 31100d7723fbdd43828dc0cd9d9491f27792e67a Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Fri, 23 Aug 2024 10:02:35 +0300 Subject: [PATCH 11/23] wip --- x/mint/module.go | 12 ++++++------ x/tax/module.go | 12 ++++++------ x/vestings/module.go | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/x/mint/module.go b/x/mint/module.go index 038a0c2c..ec1bae93 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -28,13 +28,13 @@ import ( const ConsensusVersion = 2 var ( - _ module.AppModuleBasic = AppModule{} - _ module.AppModuleSimulation = AppModule{} - _ module.HasABCIGenesis = AppModule{} + _ module.AppModuleBasic = (*AppModule)(nil) + _ module.AppModuleSimulation = (*AppModule)(nil) + _ module.HasABCIGenesis = (*AppModule)(nil) - _ appmodule.AppModule = AppModule{} - _ module.HasABCIEndBlock = AppModule{} - _ appmodule.HasBeginBlocker = AppModule{} + _ appmodule.AppModule = (*AppModule)(nil) + _ module.HasABCIEndBlock = (*AppModule)(nil) + _ appmodule.HasBeginBlocker = (*AppModule)(nil) ) // AppModuleBasic defines the basic application module used by the mint module. diff --git a/x/tax/module.go b/x/tax/module.go index a86a43ca..b0f196d5 100644 --- a/x/tax/module.go +++ b/x/tax/module.go @@ -30,13 +30,13 @@ import ( const ConsensusVersion = 3 var ( - _ module.AppModuleBasic = AppModule{} - _ module.AppModuleSimulation = AppModule{} - _ module.HasABCIGenesis = AppModule{} + _ module.AppModuleBasic = (*AppModule)(nil) + _ module.AppModuleSimulation = (*AppModule)(nil) + _ module.HasABCIGenesis = (*AppModule)(nil) - _ appmodule.AppModule = AppModule{} - _ appmodule.HasBeginBlocker = AppModule{} - _ appmodule.HasEndBlocker = AppModule{} + _ appmodule.AppModule = (*AppModule)(nil) + _ appmodule.HasBeginBlocker = (*AppModule)(nil) + _ appmodule.HasEndBlocker = (*AppModule)(nil) ) // ---------------------------------------------------------------------------- diff --git a/x/vestings/module.go b/x/vestings/module.go index 74af90ef..8e2dc7d6 100644 --- a/x/vestings/module.go +++ b/x/vestings/module.go @@ -24,13 +24,13 @@ import ( const ConsensusVersion = 2 var ( - _ module.AppModuleBasic = AppModule{} - _ module.AppModuleSimulation = AppModule{} - _ module.HasGenesis = AppModule{} + _ module.AppModuleBasic = (*AppModule)(nil) + _ module.AppModuleSimulation = (*AppModule)(nil) + _ module.HasGenesis = (*AppModule)(nil) - _ appmodule.AppModule = AppModule{} - _ appmodule.HasBeginBlocker = AppModule{} - _ appmodule.HasEndBlocker = AppModule{} + _ appmodule.AppModule = (*AppModule)(nil) + _ appmodule.HasBeginBlocker = (*AppModule)(nil) + _ appmodule.HasEndBlocker = (*AppModule)(nil) ) // ---------------------------------------------------------------------------- From a3d7eb15a87f58ecaf174d45fb40ce3770a72e13 Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Tue, 3 Sep 2024 14:50:08 +0300 Subject: [PATCH 12/23] wip: ibc testing --- app/app.go | 18 +++ testutil/test_helpers.go | 317 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 335 insertions(+) create mode 100644 testutil/test_helpers.go diff --git a/app/app.go b/app/app.go index be8f4e5e..375a5b06 100644 --- a/app/app.go +++ b/app/app.go @@ -510,3 +510,21 @@ func (app *App) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { func (app *App) GetStakingKeeper() ibctestingtypes.StakingKeeper { return app.StakingKeeper } + +// InitChainer application update at chain initialization +// ONLY FOR TESTING PURPOSES +func (app *App) TestInitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { + var genesisState GenesisState + if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { + panic(err) + } + + // manually set consensus params here, cause there is no way to set it using ibctesting stuff for now + // TODO: app.ConsensusParamsKeeper.Set(ctx, sims.DefaultConsensusParams) + + err := app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) + if err != nil { + return nil, fmt.Errorf("failed to set module version map: %w", err) + } + return app.mm.InitGenesis(ctx, app.appCodec, genesisState) +} diff --git a/testutil/test_helpers.go b/testutil/test_helpers.go new file mode 100644 index 00000000..2617a1e0 --- /dev/null +++ b/testutil/test_helpers.go @@ -0,0 +1,317 @@ +package testutil + +import ( + "context" + "encoding/json" + "fmt" + "os" + "time" + + "cosmossdk.io/log" + + icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" + "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibctesting "github.com/cosmos/ibc-go/v8/testing" + + "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + + db2 "github.com/cosmos/cosmos-db" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + "github.com/stretchr/testify/suite" + + "github.com/Nolus-Protocol/nolus-core/app" + "github.com/Nolus-Protocol/nolus-core/app/params" + + tmos "github.com/cometbft/cometbft/libs/os" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + + ictxstypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" +) + +var ( + // TestOwnerAddress defines a reusable bech32 address for testing purposes. + TestOwnerAddress = "nolus17dtl0mjt3t77kpuhg2edqzjpszulwhgzcdvagh" + + TestInterchainID = "owner_id" + + Connection = "connection-0" + + // TestVersion defines a reusable interchainaccounts version string for testing purposes. + TestVersion = string(icatypes.ModuleCdc.MustMarshalJSON(&icatypes.Metadata{ + Version: icatypes.Version, + ControllerConnectionId: Connection, + HostConnectionId: Connection, + Encoding: icatypes.EncodingProtobuf, + TxType: icatypes.TxTypeSDKMultiMsg, + })) +) + +func init() { + ibctesting.DefaultTestingAppInit = SetupTestingApp + params.GetDefaultConfig() + // Disable cache since enabled cache triggers test errors when `AccAddress.String()` + // gets called before setting nolus bech32 prefix + sdk.SetAddrCacheEnabled(false) +} + +type IBCConnectionTestSuite struct { + suite.Suite + Coordinator *ibctesting.Coordinator + + // testing chains used for convenience and readability + ChainA *ibctesting.TestChain + ChainB *ibctesting.TestChain + + Path *ibctesting.Path + TransferPath *ibctesting.Path +} + +func (suite *IBCConnectionTestSuite) SetupTest() { + // we need to redefine this variable to make tests work cause we use unls as default bond denom in nolus + sdk.DefaultBondDenom = params.DefaultBondDenom + + suite.Coordinator = ibctesting.NewCoordinator(suite.T(), 2) // initialize 2 test chains + suite.ChainA = suite.Coordinator.GetChain(ibctesting.GetChainID(1)) + suite.ChainB = suite.Coordinator.GetChain(ibctesting.GetChainID(2)) + + // move chains to the next block + suite.ChainA.NextBlock() + suite.ChainB.NextBlock() + + // path := ibctesting.NewPath(suite.ChainA, suite.ChainB) // clientID, connectionID, channelID empty + // suite.Coordinator.Setup(path) // clientID, connectionID, channelID filled + // suite.Require().Equal("07-tendermint-0", path.EndpointA.ClientID) + // suite.Require().Equal("connection-0", path.EndpointA.ClientID) + // suite.Require().Equal("channel-0", path.EndpointA.ClientID) + + suite.Path = NewICAPath(suite.ChainA, suite.ChainB) + + // suite.ConfigureTransferChannel() + suite.Coordinator.Setup(suite.Path) +} + +func (suite *IBCConnectionTestSuite) ConfigureTransferChannel() { + suite.TransferPath = NewTransferPath(suite.ChainA, suite.ChainB) + suite.Coordinator.SetupConnections(suite.TransferPath) + err := SetupTransferPath(suite.TransferPath) + suite.Require().NoError(err) +} + +func (suite *IBCConnectionTestSuite) GetNolusZoneApp(chain *ibctesting.TestChain) *app.App { + testApp, ok := chain.App.(*app.App) + if !ok { + panic("not NolusZone app") + } + + return testApp +} + +func (suite *IBCConnectionTestSuite) StoreTestCode(ctx sdk.Context, addr sdk.AccAddress, path string) uint64 { + // wasm file built with https://github.com/neutron-org/neutron-sdk/tree/main/contracts/reflect + // wasm file built with https://github.com/neutron-org/neutron-dev-contracts/tree/feat/ica-register-fee-update/contracts/neutron_interchain_txs + wasmCode, err := os.ReadFile(path) + suite.Require().NoError(err) + + codeID, _, err := keeper.NewDefaultPermissionKeeper(suite.GetNolusZoneApp(suite.ChainA).WasmKeeper).Create(ctx, addr, wasmCode, &wasmtypes.AccessConfig{Permission: wasmtypes.AccessTypeEverybody}) + suite.Require().NoError(err) + + return codeID +} + +func (suite *IBCConnectionTestSuite) InstantiateTestContract(ctx sdk.Context, funder sdk.AccAddress, codeID uint64) sdk.AccAddress { + initMsgBz := []byte("{}") + contractKeeper := keeper.NewDefaultPermissionKeeper(suite.GetNolusZoneApp(suite.ChainA).WasmKeeper) + addr, _, err := contractKeeper.Instantiate(ctx, codeID, funder, funder, initMsgBz, "demo contract", nil) + suite.Require().NoError(err) + + return addr +} + +func NewICAPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { + path := ibctesting.NewPath(chainA, chainB) + path.EndpointA.Counterparty = path.EndpointB + path.EndpointB.Counterparty = path.EndpointA + + path.EndpointA.ChannelConfig.PortID = icatypes.HostPortID + path.EndpointB.ChannelConfig.PortID = icatypes.HostPortID + path.EndpointA.ChannelConfig.Order = channeltypes.ORDERED + path.EndpointB.ChannelConfig.Order = channeltypes.ORDERED + path.EndpointA.ChannelConfig.Version = TestVersion + path.EndpointB.ChannelConfig.Version = TestVersion + + path.EndpointA.ClientConfig.(*ibctesting.TendermintConfig).UnbondingPeriod = 3600000000000 + path.EndpointA.ClientConfig.(*ibctesting.TendermintConfig).TrustingPeriod = 1200000000000 + + path.EndpointB.ClientConfig.(*ibctesting.TendermintConfig).UnbondingPeriod = 3600000000000 + path.EndpointB.ClientConfig.(*ibctesting.TendermintConfig).TrustingPeriod = 1200000000000 + return path +} + +// SetupICAPath invokes the InterchainAccounts entrypoint and subsequent channel handshake handlers. +func SetupICAPath(path *ibctesting.Path, owner string) error { + if err := RegisterInterchainAccount(path.EndpointA, owner); err != nil { + return err + } + + if err := path.EndpointB.ChanOpenTry(); err != nil { + return err + } + + if err := path.EndpointA.ChanOpenAck(); err != nil { + return err + } + + return path.EndpointB.ChanOpenConfirm() +} + +// RegisterInterchainAccount is a helper function for starting the channel handshake. +func RegisterInterchainAccount(endpoint *ibctesting.Endpoint, owner string) error { + icaOwner, _ := ictxstypes.NewICAOwner(owner, TestInterchainID) + portID, err := icatypes.NewControllerPortID(icaOwner.String()) + if err != nil { + return err + } + + ctx := endpoint.Chain.GetContext() + + channelSequence := endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextChannelSequence(ctx) + + a, ok := endpoint.Chain.App.(*app.App) + if !ok { + return fmt.Errorf("not NolusZoneApp") + } + + // TODO(pr0n00gler): are we sure it's okay? + if err := a.ICAControllerKeeper.RegisterInterchainAccount(ctx, endpoint.ConnectionID, icaOwner.String(), ""); err != nil { + return err + } + + // commit state changes for proof verification + endpoint.Chain.NextBlock() + + // update port/channel ids + endpoint.ChannelID = channeltypes.FormatChannelIdentifier(channelSequence) + endpoint.ChannelConfig.PortID = portID + + return nil +} + +var tempDir = func() string { + dir, err := os.MkdirTemp("", "nolusd") + if err != nil { + panic("failed to create temp dir: " + err.Error()) + } + defer os.RemoveAll(dir) + + return dir +} + +// fauxMerkleModeOpt returns a BaseApp option to use a dbStoreAdapter instead of +// an IAVLStore for faster simulation speed. +func fauxMerkleModeOpt(bapp *baseapp.BaseApp) { + bapp.SetFauxMerkleMode() +} + +// SetupTestingApp initializes the IBC-go testing application. +func SetupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage) { + encoding := app.MakeEncodingConfig(app.ModuleBasics) + db := db2.NewMemDB() + + temp := tempDir() + + testApp := app.New( + log.NewNopLogger(), + db, + nil, + false, + map[int64]bool{}, + temp, + 0, + encoding, + sims.EmptyAppOptions{}, + fauxMerkleModeOpt, + ) + + ctx := testApp.BaseApp.NewContextLegacy(false, tmproto.Header{Height: 1, ChainID: "testchain-1", Time: time.Now().UTC()}) + + // Manually set validator signing info, otherwise we panic + vals, err := testApp.StakingKeeper.GetAllValidators(context.TODO()) + if err != nil { + panic(err) + } + for _, val := range vals { + consAddr, _ := val.GetConsAddr() + signingInfo := slashingtypes.NewValidatorSigningInfo( + consAddr, + ctx.BlockHeight(), + 0, + time.Unix(0, 0), + false, + 0, + ) + err := testApp.SlashingKeeper.SetValidatorSigningInfo(ctx, consAddr, signingInfo) + if err != nil { + panic(err) + } + } + + // we need to set up a TestInitChainer where we can redefine MaxBlockGas in ConsensusParamsKeeper + testApp.SetInitChainer(testApp.TestInitChainer) + // and then we manually init baseapp and load states + if err := testApp.LoadLatestVersion(); err != nil { + tmos.Exit(err.Error()) + } + + // Initialize pinned codes in wasmvm as they are not persisted there + if err := testApp.WasmKeeper.InitializePinnedCodes(ctx); err != nil { + panic(err) + } + + genesisState := app.NewDefaultGenesisState(encoding) + + // genesisState := app.NewDefaultGenesisState(encoding) + + return testApp, genesisState +} + +func NewTransferPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { + path := ibctesting.NewPath(chainA, chainB) + path.EndpointA.ChannelConfig.PortID = types.PortID + path.EndpointB.ChannelConfig.PortID = types.PortID + path.EndpointA.ChannelConfig.Order = channeltypes.UNORDERED + path.EndpointB.ChannelConfig.Order = channeltypes.UNORDERED + path.EndpointA.ChannelConfig.Version = types.Version + path.EndpointB.ChannelConfig.Version = types.Version + + return path +} + +// SetupTransferPath. +func SetupTransferPath(path *ibctesting.Path) error { + channelSequence := path.EndpointA.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextChannelSequence(path.EndpointA.Chain.GetContext()) + channelSequenceB := path.EndpointB.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextChannelSequence(path.EndpointB.Chain.GetContext()) + + // update port/channel ids + path.EndpointA.ChannelID = channeltypes.FormatChannelIdentifier(channelSequence) + path.EndpointB.ChannelID = channeltypes.FormatChannelIdentifier(channelSequenceB) + + if err := path.EndpointA.ChanOpenInit(); err != nil { + return err + } + + if err := path.EndpointB.ChanOpenTry(); err != nil { + return err + } + + if err := path.EndpointA.ChanOpenAck(); err != nil { + return err + } + + return path.EndpointB.ChanOpenConfirm() +} From c993447dd35f9e312e3c46b1c19373c1fa3df6b8 Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Wed, 4 Sep 2024 10:23:51 +0300 Subject: [PATCH 13/23] chore: bump wasmd, cometbft, wasmvm and ibc-go --- go.mod | 67 +- go.sum | 136 ++-- wasmbinding/test/custom_message_test.go | 866 ++++++++++++------------ 3 files changed, 535 insertions(+), 534 deletions(-) diff --git a/go.mod b/go.mod index c7e4b95c..c6d76a05 100644 --- a/go.mod +++ b/go.mod @@ -3,41 +3,40 @@ module github.com/Nolus-Protocol/nolus-core go 1.22.4 require ( - github.com/CosmWasm/wasmd v0.52.0 - github.com/CosmWasm/wasmvm/v2 v2.1.0 - github.com/cometbft/cometbft v0.38.10 - github.com/cosmos/cosmos-sdk v0.50.7 - github.com/cosmos/gogoproto v1.5.0 - github.com/cosmos/ibc-go/v8 v8.3.2 + github.com/CosmWasm/wasmd v0.53.0 + github.com/CosmWasm/wasmvm/v2 v2.1.2 + github.com/cometbft/cometbft v0.38.12 + github.com/cosmos/cosmos-sdk v0.50.9 + github.com/cosmos/gogoproto v1.7.0 + github.com/cosmos/ibc-go/v8 v8.4.0 github.com/golang/protobuf v1.5.4 github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/neutron-org/neutron/v4 v4.0.0-rc1 - github.com/spf13/cast v1.6.0 + github.com/spf13/cast v1.7.0 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 - google.golang.org/grpc v1.64.0 + google.golang.org/grpc v1.64.1 gopkg.in/yaml.v2 v2.4.0 ) require ( cosmossdk.io/api v0.7.5 cosmossdk.io/client/v2 v2.0.0-beta.1 - cosmossdk.io/core v0.11.0 + cosmossdk.io/core v0.11.1 cosmossdk.io/errors v1.0.1 - cosmossdk.io/log v1.3.1 + cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.0 - cosmossdk.io/tools/confix v0.1.1 + cosmossdk.io/tools/confix v0.1.2 cosmossdk.io/x/evidence v0.1.1 cosmossdk.io/x/feegrant v0.1.1 - cosmossdk.io/x/tx v0.13.3 - cosmossdk.io/x/upgrade v0.1.3 + cosmossdk.io/x/tx v0.13.4 + cosmossdk.io/x/upgrade v0.1.4 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 - github.com/cosmos/ibc-go/modules/capability v1.0.0 - github.com/cosmos/interchain-security/v5 v5.0.0 + github.com/cosmos/ibc-go/modules/capability v1.0.1 github.com/golang/mock v1.6.0 github.com/hashicorp/go-metrics v0.5.3 google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 @@ -53,7 +52,7 @@ require ( cloud.google.com/go/iam v1.1.8 // indirect cloud.google.com/go/storage v1.41.0 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/depinject v1.0.0 // indirect cosmossdk.io/x/circuit v0.1.1 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -65,15 +64,16 @@ require ( github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/bits-and-blooms/bitset v1.13.0 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v1.1.0 // indirect + github.com/cockroachdb/pebble v1.1.1 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cometbft/cometbft-db v0.11.0 // indirect @@ -156,6 +156,7 @@ require ( github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/onsi/ginkgo v1.16.5 // indirect @@ -166,13 +167,13 @@ require ( github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.19.1 // indirect + github.com/prometheus/client_golang v1.20.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.52.2 // indirect - github.com/prometheus/procfs v0.13.0 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/rs/cors v1.8.3 // indirect + github.com/rs/cors v1.11.1 // indirect github.com/rs/zerolog v1.33.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect @@ -189,7 +190,7 @@ require ( github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect - go.etcd.io/bbolt v1.3.8 // indirect + go.etcd.io/bbolt v1.3.10 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect @@ -197,18 +198,18 @@ require ( go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.24.0 // indirect + golang.org/x/crypto v0.26.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/oauth2 v0.20.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.23.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.180.0 // indirect google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.10 // indirect @@ -220,7 +221,7 @@ replace ( cosmossdk.io/client/v2 => cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79 github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - github.com/CosmWasm/wasmd => github.com/nolus-protocol/wasmd v0.52.0-nolus + github.com/CosmWasm/wasmd => github.com/nolus-protocol/wasmd v0.53.0-nolus // TODO: Simapp dependency, review removing when updating to SDK with backported update https://github.com/cosmos/cosmos-sdk/issues/13423 github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.2 // indirect diff --git a/go.sum b/go.sum index 51ce8aeb..ad98036a 100644 --- a/go.sum +++ b/go.sum @@ -192,20 +192,20 @@ cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79 h1:Hr1t0fCq1n cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79/go.mod h1:8pN6LSVReNnIxrC2QGcvuIJ/m1pJN6FNYn2kAYtYftI= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= -cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= +cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= -cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= -cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= +cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= -cosmossdk.io/tools/confix v0.1.1 h1:aexyRv9+y15veH3Qw16lxQwo+ki7r2I+g0yNTEFEQM8= -cosmossdk.io/tools/confix v0.1.1/go.mod h1:nQVvP1tHsGXS83PonPVWJtSbddIqyjEw99L4M3rPJyQ= +cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4= +cosmossdk.io/tools/confix v0.1.2/go.mod h1:7XfcbK9sC/KNgVGxgLM0BrFbVcR/+6Dg7MFfpx7duYo= cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= @@ -214,10 +214,10 @@ cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= cosmossdk.io/x/nft v0.1.1 h1:pslAVS8P5NkW080+LWOamInjDcq+v2GSCo+BjN9sxZ8= cosmossdk.io/x/nft v0.1.1/go.mod h1:Kac6F6y2gsKvoxU+fy8uvxRTi4BIhLOor2zgCNQwVgY= -cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= -cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= -cosmossdk.io/x/upgrade v0.1.3 h1:q4XpXc6zp0dX6x74uBtfN6+J7ikaQev5Bla6Q0ADLK8= -cosmossdk.io/x/upgrade v0.1.3/go.mod h1:jOdQhnaY5B8CDUoUbed23/Lre0Dk+r6BMQE40iKlVVQ= +cosmossdk.io/x/tx v0.13.4 h1:Eg0PbJgeO0gM8p5wx6xa0fKR7hIV6+8lC56UrsvSo0Y= +cosmossdk.io/x/tx v0.13.4/go.mod h1:BkFqrnGGgW50Y6cwTy+JvgAhiffbGEKW6KF9ufcDpvk= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -227,8 +227,8 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CosmWasm/wasmvm/v2 v2.1.0 h1:bleLhNA36hM8iPjFJsNRi9RjrQW6MtXafw2+wVjAWAE= -github.com/CosmWasm/wasmvm/v2 v2.1.0/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg= +github.com/CosmWasm/wasmvm/v2 v2.1.2 h1:GkJ5bAsRlLHfIQVg/FY1VHwLyBwlCjAhDea0B8L+e20= +github.com/CosmWasm/wasmvm/v2 v2.1.2/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= @@ -287,10 +287,10 @@ github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6 github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE= github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc= github.com/btcsuite/btcd v0.22.2 h1:vBZ+lGGd1XubpOWO67ITJpAEsICWhA0YzqkcpkgNBfo= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= @@ -337,19 +337,21 @@ github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOG github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= -github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= -github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= +github.com/cockroachdb/pebble v1.1.1 h1:XnKU22oiCLy2Xn8vp1re67cXg4SAasg/WDt1NtcRFaw= +github.com/cockroachdb/pebble v1.1.1/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.11 h1:6bNDUB8/xq4uYonYwIfGc9OqK1ZH4NkdaMmR1LZIJqk= -github.com/cometbft/cometbft v0.38.11/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= +github.com/cometbft/cometbft v0.38.12 h1:OWsLZN2KcSSFe8bet9xCn07VwhBnavPea3VyPnNq1bg= +github.com/cometbft/cometbft v0.38.12/go.mod h1:GPHp3/pehPqgX1930HmK1BpBLZPxB75v/dZg8Viwy+o= github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= @@ -375,18 +377,18 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= -github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.1 h1:BHn+JWZILxkUT9IrlP1ctUfo9ENGi+EmiZ9om1XSHIw= github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.1/go.mod h1:82hPO/tRawbuFad2gPwChvpZ0JEIoNi91LwVneAYCeM= github.com/cosmos/ibc-go/modules/apps/callbacks v0.2.1-0.20231113120333-342c00b0f8bd h1:Lx+/5dZ/nN6qPXP2Ofog6u1fmlkCFA1ElcOconnofEM= github.com/cosmos/ibc-go/modules/apps/callbacks v0.2.1-0.20231113120333-342c00b0f8bd/go.mod h1:JWfpWVKJKiKtd53/KbRoKfxWl8FsT2GPcNezTOk0o5Q= -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.3.2 h1:8X1oHHKt2Bh9hcExWS89rntLaCKZp2EjFTUSxKlPhGI= -github.com/cosmos/ibc-go/v8 v8.3.2/go.mod h1:WVVIsG39jGrF9Cjggjci6LzySyWGloz194sjTxiGNIE= +github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI= +github.com/cosmos/ibc-go/modules/capability v1.0.1/go.mod h1:rquyOV262nGJplkumH+/LeYs04P3eV8oB7ZM4Ygqk4E= +github.com/cosmos/ibc-go/v8 v8.4.0 h1:K2PfX0AZ+1XKZytHGEMuSjQXG/MZshPb83RSTQt2+cE= +github.com/cosmos/ibc-go/v8 v8.4.0/go.mod h1:zh6x1osR0hNvEcFrC/lhGD08sMfQmr9wHVvZ/mRWMCs= 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/interchain-security/v5 v5.0.0 h1:iwHu1nFbXuYfa13isEgm6hkHU+2t/t56YjcfyP3PnQA= @@ -788,6 +790,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= @@ -850,6 +854,8 @@ github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -864,12 +870,10 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS github.com/neutron-org/admin-module/v2 v2.0.0 h1:MlkSc1821sQ+G5/cYOajuqZ5/lM53xTbixpTtXnHh0A= github.com/neutron-org/admin-module/v2 v2.0.0/go.mod h1:RfOyabXsdJ5btcOKyKPZDYiZhtuKFubbJMOb8EJZtvA= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nolus-protocol/cosmos-sdk v0.50.7-nolus-rc1 h1:QK59L25el60UuVoosifSg3EVK+/n6urjln6yxNnxAI4= -github.com/nolus-protocol/cosmos-sdk v0.50.7-nolus-rc1/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s= github.com/nolus-protocol/neutron/v4 v4.0.1-nolus h1:21r0fWxqjfaLHkPS/y/H1WDxytisOZ3xPsvp+JHa1jU= github.com/nolus-protocol/neutron/v4 v4.0.1-nolus/go.mod h1:7TRawLFzMRs7sXuDd/R5VKHPUfNPDDMYaTcY2UjCqF0= -github.com/nolus-protocol/wasmd v0.52.0-nolus h1:SrmACftzuXy/FwCAUccSkMEMysj3StoB3Mf8pvoqzmI= -github.com/nolus-protocol/wasmd v0.52.0-nolus/go.mod h1:hyy1wt7c589Cs4kOK2cYdtphzCd2Xo20q/t7tfby7oI= +github.com/nolus-protocol/wasmd v0.53.0-nolus h1:RRWI+6dABBCEEowPNxlEHbHYeNHamUVXaop57PF6J2I= +github.com/nolus-protocol/wasmd v0.53.0-nolus/go.mod h1:FJl/aWjdpGof3usAMFQpDe07Rkx77PUzp0cygFMOvtw= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -908,8 +912,6 @@ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= -github.com/oxyno-zeta/gomock-extra-matcher v1.2.0 h1:WPEclU0y0PMwUzdDcaKZvld4aXpa3fkzjiUMQdcBEHg= -github.com/oxyno-zeta/gomock-extra-matcher v1.2.0/go.mod h1:S0r7HmKeCGsHmvIVFMjKWwswb4+30nCNWbXRMBVPkaU= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -942,8 +944,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= -github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_golang v1.20.1 h1:IMJXHOD6eARkQpxo8KkhgEVFlBNm+nkrFUyGlIu7Na8= +github.com/prometheus/client_golang v1.20.1/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -958,16 +960,16 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= -github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= -github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -980,8 +982,8 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= @@ -1027,8 +1029,8 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= -github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= @@ -1102,8 +1104,8 @@ github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWp github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0= +go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.mongodb.org/mongo-driver v1.11.0 h1:FZKhBSTydeuffHj9CBjXlR8vQLee1cQyTWYPA6/tqiE= go.mongodb.org/mongo-driver v1.11.0/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= @@ -1136,8 +1138,6 @@ go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= -go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= @@ -1162,8 +1162,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1262,8 +1262,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1289,8 +1289,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= -golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1305,8 +1305,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1405,13 +1405,13 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1422,8 +1422,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1671,8 +1671,8 @@ google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda h1:wu/KJm9KJwpfHWh google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda/go.mod h1:g2LLCvCeCSir/JJSWosk19BR4NVxGqHUC6rxIRsd7Aw= google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3 h1:QW9+G6Fir4VcRXVH8x3LilNAb6cxBGLa6+GM4hRwexE= google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3/go.mod h1:kdrSS/OiLkPrNUpzD4aHgCq2rVuC/YRxok32HXZ4vRE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1714,8 +1714,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= +google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/wasmbinding/test/custom_message_test.go b/wasmbinding/test/custom_message_test.go index b814dfae..5f7faa93 100644 --- a/wasmbinding/test/custom_message_test.go +++ b/wasmbinding/test/custom_message_test.go @@ -1,446 +1,446 @@ package test -import ( - "encoding/json" - "testing" - - "cosmossdk.io/math" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - - ibcchanneltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - - "github.com/stretchr/testify/suite" - - ictxtypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" - - "github.com/CosmWasm/wasmd/x/wasm/keeper" - "github.com/CosmWasm/wasmvm/v2/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - - "github.com/Nolus-Protocol/nolus-core/app" - "github.com/Nolus-Protocol/nolus-core/app/params" - "github.com/Nolus-Protocol/nolus-core/testutil" - "github.com/Nolus-Protocol/nolus-core/wasmbinding" - "github.com/Nolus-Protocol/nolus-core/wasmbinding/bindings" - contractmanagerkeeper "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" - feetypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" - icqkeeper "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" - ictxkeeper "github.com/neutron-org/neutron/v4/x/interchaintxs/keeper" -) - -const FeeCollectorAddress = "nolus1vguuxez2h5ekltfj9gjd62fs5k4rl2zy5hfrncasykzw08rezpfsd2rhm7" - -type CustomMessengerTestSuite struct { - testutil.IBCConnectionTestSuite - nolus *app.App - ctx sdk.Context - messenger *wasmbinding.CustomMessenger - contractOwner sdk.AccAddress - contractAddress sdk.AccAddress - contractKeeper wasmtypes.ContractOpsKeeper -} - -func (suite *CustomMessengerTestSuite) SetupTest() { - suite.IBCConnectionTestSuite.SetupTest() - suite.nolus = suite.GetNolusZoneApp(suite.ChainA) - suite.ctx = suite.ChainA.GetContext() - suite.messenger = &wasmbinding.CustomMessenger{} - suite.messenger.Ictxmsgserver = ictxkeeper.NewMsgServerImpl(*suite.nolus.InterchainTxsKeeper) - suite.messenger.Keeper = *suite.nolus.InterchainTxsKeeper - suite.messenger.Icqmsgserver = icqkeeper.NewMsgServerImpl(*suite.nolus.InterchainQueriesKeeper) - suite.messenger.ContractmanagerKeeper = suite.nolus.ContractManagerKeeper - suite.contractOwner = keeper.RandomAccountAddress(suite.T()) - - suite.contractKeeper = keeper.NewDefaultPermissionKeeper(&suite.nolus.WasmKeeper) - - codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") - suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) - suite.Require().NotEmpty(suite.contractAddress) -} - -func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccount() { - // Craft RegisterInterchainAccount message - msg := bindings.NeutronMsg{ - RegisterInterchainAccount: &bindings.RegisterInterchainAccount{ - ConnectionId: suite.Path.EndpointA.ConnectionID, - InterchainAccountId: testutil.TestInterchainID, - RegisterFee: sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(1_000_000))), - }, - } - - bankKeeper := suite.nolus.BankKeeper - senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() - err := bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(1_000_000)))) - suite.NoError(err) - - // Dispatch RegisterInterchainAccount message - _, err = suite.executeNeutronMsg(suite.contractAddress, msg) - suite.NoError(err) -} - -func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccountLongID() { - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") - suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) - suite.Require().NotEmpty(suite.contractAddress) - - // Craft RegisterInterchainAccount message - msg, err := json.Marshal(bindings.NeutronMsg{ - RegisterInterchainAccount: &bindings.RegisterInterchainAccount{ - ConnectionId: suite.Path.EndpointA.ConnectionID, - // the limit is 47, this line is 50 characters long - InterchainAccountId: "01234567890123456789012345678901234567890123456789", - }, - }) - suite.NoError(err) - - // Dispatch RegisterInterchainAccount message via DispatchHandler cause we want to catch an error from SDK directly, not from a contract - _, _, _, err = suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ - Custom: msg, - }) - suite.Error(err) - suite.ErrorIs(err, ictxtypes.ErrLongInterchainAccountID) -} - -// func (suite *CustomMessengerTestSuite) TestRegisterInterchainQuery() { -// // Store code and instantiate reflect contract -// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") -// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) -// suite.Require().NotEmpty(suite.contractAddress) - -// err := testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) -// suite.Require().NoError(err) - -// // Top up contract balance -// senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() -// coinsAmnt := sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(int64(10_000_000)))) -// bankKeeper := suite.nolus.BankKeeper -// err = bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, coinsAmnt) -// suite.NoError(err) - -// // Craft RegisterInterchainQuery message -// msg, err := json.Marshal(bindings.NeutronMsg{ -// RegisterInterchainQuery: &bindings.RegisterInterchainQuery{ -// QueryType: string(icqtypes.InterchainQueryTypeKV), -// Keys: []*icqtypes.KVKey{ -// {Path: ibchost.StoreKey, Key: host.FullClientStateKey(suite.Path.EndpointB.ClientID)}, +// import ( +// "encoding/json" +// "testing" + +// "cosmossdk.io/math" +// wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + +// ibcchanneltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + +// "github.com/stretchr/testify/suite" + +// ictxtypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" + +// "github.com/CosmWasm/wasmd/x/wasm/keeper" +// "github.com/CosmWasm/wasmvm/v2/types" +// sdk "github.com/cosmos/cosmos-sdk/types" +// "github.com/stretchr/testify/require" + +// "github.com/Nolus-Protocol/nolus-core/app" +// "github.com/Nolus-Protocol/nolus-core/app/params" +// "github.com/Nolus-Protocol/nolus-core/testutil" +// "github.com/Nolus-Protocol/nolus-core/wasmbinding" +// "github.com/Nolus-Protocol/nolus-core/wasmbinding/bindings" +// contractmanagerkeeper "github.com/neutron-org/neutron/v4/x/contractmanager/keeper" +// feetypes "github.com/neutron-org/neutron/v4/x/feerefunder/types" +// icqkeeper "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper" +// ictxkeeper "github.com/neutron-org/neutron/v4/x/interchaintxs/keeper" +// ) + +// const FeeCollectorAddress = "nolus1vguuxez2h5ekltfj9gjd62fs5k4rl2zy5hfrncasykzw08rezpfsd2rhm7" + +// type CustomMessengerTestSuite struct { +// testutil.IBCConnectionTestSuite +// nolus *app.App +// ctx sdk.Context +// messenger *wasmbinding.CustomMessenger +// contractOwner sdk.AccAddress +// contractAddress sdk.AccAddress +// contractKeeper wasmtypes.ContractOpsKeeper +// } + +// func (suite *CustomMessengerTestSuite) SetupTest() { +// suite.IBCConnectionTestSuite.SetupTest() +// suite.nolus = suite.GetNolusZoneApp(suite.ChainA) +// suite.ctx = suite.ChainA.GetContext() +// suite.messenger = &wasmbinding.CustomMessenger{} +// suite.messenger.Ictxmsgserver = ictxkeeper.NewMsgServerImpl(*suite.nolus.InterchainTxsKeeper) +// suite.messenger.Keeper = *suite.nolus.InterchainTxsKeeper +// suite.messenger.Icqmsgserver = icqkeeper.NewMsgServerImpl(*suite.nolus.InterchainQueriesKeeper) +// suite.messenger.ContractmanagerKeeper = suite.nolus.ContractManagerKeeper +// suite.contractOwner = keeper.RandomAccountAddress(suite.T()) + +// suite.contractKeeper = keeper.NewDefaultPermissionKeeper(&suite.nolus.WasmKeeper) + +// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// suite.Require().NotEmpty(suite.contractAddress) +// } + +// func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccount() { +// // Craft RegisterInterchainAccount message +// msg := bindings.NeutronMsg{ +// RegisterInterchainAccount: &bindings.RegisterInterchainAccount{ +// ConnectionId: suite.Path.EndpointA.ConnectionID, +// InterchainAccountId: testutil.TestInterchainID, +// RegisterFee: sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(1_000_000))), +// }, +// } + +// bankKeeper := suite.nolus.BankKeeper +// senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() +// err := bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(1_000_000)))) +// suite.NoError(err) + +// // Dispatch RegisterInterchainAccount message +// _, err = suite.executeNeutronMsg(suite.contractAddress, msg) +// suite.NoError(err) +// } + +// func (suite *CustomMessengerTestSuite) TestRegisterInterchainAccountLongID() { +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// suite.Require().NotEmpty(suite.contractAddress) + +// // Craft RegisterInterchainAccount message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// RegisterInterchainAccount: &bindings.RegisterInterchainAccount{ +// ConnectionId: suite.Path.EndpointA.ConnectionID, +// // the limit is 47, this line is 50 characters long +// InterchainAccountId: "01234567890123456789012345678901234567890123456789", +// }, +// }) +// suite.NoError(err) + +// // Dispatch RegisterInterchainAccount message via DispatchHandler cause we want to catch an error from SDK directly, not from a contract +// _, _, _, err = suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// suite.Error(err) +// suite.ErrorIs(err, ictxtypes.ErrLongInterchainAccountID) +// } + +// // func (suite *CustomMessengerTestSuite) TestRegisterInterchainQuery() { +// // // Store code and instantiate reflect contract +// // codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// // suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// // suite.Require().NotEmpty(suite.contractAddress) + +// // err := testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) +// // suite.Require().NoError(err) + +// // // Top up contract balance +// // senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() +// // coinsAmnt := sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(int64(10_000_000)))) +// // bankKeeper := suite.nolus.BankKeeper +// // err = bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, coinsAmnt) +// // suite.NoError(err) + +// // // Craft RegisterInterchainQuery message +// // msg, err := json.Marshal(bindings.NeutronMsg{ +// // RegisterInterchainQuery: &bindings.RegisterInterchainQuery{ +// // QueryType: string(icqtypes.InterchainQueryTypeKV), +// // Keys: []*icqtypes.KVKey{ +// // {Path: ibchost.StoreKey, Key: host.FullClientStateKey(suite.Path.EndpointB.ClientID)}, +// // }, +// // TransactionsFilter: "{}", +// // ConnectionId: suite.Path.EndpointA.ConnectionID, +// // UpdatePeriod: 20, +// // }, +// // }) +// // suite.NoError(err) + +// // // Dispatch RegisterInterchainQuery message +// // events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// // Custom: msg, +// // }) +// // suite.NoError(err) +// // suite.Nil(events) +// // suite.Equal([][]byte{[]byte(`{"id":1}`)}, data) +// // } + +// // func (suite *CustomMessengerTestSuite) TestUpdateInterchainQuery() { +// // // reuse register interchain query test to get query registered +// // suite.TestRegisterInterchainQuery() + +// // // Craft UpdateInterchainQuery message +// // msg, err := json.Marshal(bindings.NeutronMsg{ +// // UpdateInterchainQuery: &bindings.UpdateInterchainQuery{ +// // QueryId: 1, +// // NewKeys: nil, +// // NewUpdatePeriod: 111, +// // }, +// // }) +// // suite.NoError(err) + +// // // Dispatch UpdateInterchainQuery message +// // events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// // Custom: msg, +// // }) +// // suite.NoError(err) +// // suite.Nil(events) +// // suite.Equal([][]byte{[]byte(`{}`)}, data) +// // } + +// // func (suite *CustomMessengerTestSuite) TestUpdateInterchainQueryFailed() { +// // // Craft UpdateInterchainQuery message +// // msg, err := json.Marshal(bindings.NeutronMsg{ +// // UpdateInterchainQuery: &bindings.UpdateInterchainQuery{ +// // QueryId: 1, +// // NewKeys: nil, +// // NewUpdatePeriod: 1, +// // }, +// // }) +// // suite.NoError(err) + +// // // Dispatch UpdateInterchainQuery message +// // owner, err := sdk.AccAddressFromBech32(testutil.TestOwnerAddress) +// // suite.NoError(err) +// // events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, owner, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// // Custom: msg, +// // }) +// // expectedErrMsg := "failed to update interchain query: failed to update interchain query: failed to get query by query id: there is no query with id: 1" +// // suite.Require().ErrorContains(err, expectedErrMsg) +// // suite.Nil(events) +// // suite.Nil(data) +// // } + +// // func (suite *CustomMessengerTestSuite) TestRemoveInterchainQuery() { +// // // Reuse register interchain query test to get query registered +// // suite.TestRegisterInterchainQuery() + +// // // Craft RemoveInterchainQuery message +// // msg, err := json.Marshal(bindings.NeutronMsg{ +// // RemoveInterchainQuery: &bindings.RemoveInterchainQuery{ +// // QueryId: 1, +// // }, +// // }) +// // suite.NoError(err) + +// // // Dispatch RemoveInterchainQuery message +// // suite.NoError(err) +// // events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// // Custom: msg, +// // }) +// // suite.NoError(err) +// // suite.Nil(events) +// // suite.Equal([][]byte{[]byte(`{}`)}, data) +// // } + +// // func (suite *CustomMessengerTestSuite) TestRemoveInterchainQueryFailed() { +// // // Craft RemoveInterchainQuery message +// // msg, err := json.Marshal(bindings.NeutronMsg{ +// // RemoveInterchainQuery: &bindings.RemoveInterchainQuery{ +// // QueryId: 1, +// // }, +// // }) +// // suite.NoError(err) + +// // // Dispatch RemoveInterchainQuery message +// // owner, err := sdk.AccAddressFromBech32(testutil.TestOwnerAddress) +// // suite.NoError(err) +// // events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, owner, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// // Custom: msg, +// // }) +// // expectedErrMsg := "failed to remove interchain query: failed to remove interchain query: failed to get query by query id: there is no query with id: 1" +// // suite.Require().ErrorContains(err, expectedErrMsg) +// // suite.Nil(events) +// // suite.Nil(data) +// // } + +// func (suite *CustomMessengerTestSuite) TestSubmitTx() { +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// suite.Require().NotEmpty(suite.contractAddress) + +// senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() +// coinsAmnt := sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(int64(10_000_000)))) +// bankKeeper := suite.nolus.BankKeeper +// err := bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, coinsAmnt) +// suite.NoError(err) + +// err = testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) +// suite.Require().NoError(err) + +// events, data, _, err := suite.messenger.DispatchMsg( +// suite.ctx, +// suite.contractAddress, +// suite.Path.EndpointA.ChannelConfig.PortID, +// types.CosmosMsg{ +// Custom: suite.craftMarshaledMsgSubmitTxWithNumMsgs(1), +// }, +// ) +// suite.NoError(err) + +// var response ictxtypes.MsgSubmitTxResponse +// err = json.Unmarshal(data[0], &response) +// suite.NoError(err) +// suite.Nil(events) +// suite.Equal(uint64(1), response.SequenceId) +// suite.Equal("channel-2", response.Channel) +// } + +// func (suite *CustomMessengerTestSuite) TestSubmitTxTooMuchTxs() { +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// suite.Require().NotEmpty(suite.contractAddress) + +// err := testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) +// suite.Require().NoError(err) + +// _, _, _, err = suite.messenger.DispatchMsg( +// suite.ctx, +// suite.contractAddress, +// suite.Path.EndpointA.ChannelConfig.PortID, +// types.CosmosMsg{ +// Custom: suite.craftMarshaledMsgSubmitTxWithNumMsgs(20), // }, -// TransactionsFilter: "{}", -// ConnectionId: suite.Path.EndpointA.ConnectionID, -// UpdatePeriod: 20, -// }, -// }) -// suite.NoError(err) - -// // Dispatch RegisterInterchainQuery message -// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ -// Custom: msg, -// }) -// suite.NoError(err) -// suite.Nil(events) -// suite.Equal([][]byte{[]byte(`{"id":1}`)}, data) +// ) +// suite.ErrorContains(err, "MsgSubmitTx contains more messages than allowed") // } -// func (suite *CustomMessengerTestSuite) TestUpdateInterchainQuery() { -// // reuse register interchain query test to get query registered -// suite.TestRegisterInterchainQuery() - -// // Craft UpdateInterchainQuery message -// msg, err := json.Marshal(bindings.NeutronMsg{ -// UpdateInterchainQuery: &bindings.UpdateInterchainQuery{ -// QueryId: 1, -// NewKeys: nil, -// NewUpdatePeriod: 111, -// }, -// }) -// suite.NoError(err) - -// // Dispatch UpdateInterchainQuery message -// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ -// Custom: msg, -// }) -// suite.NoError(err) -// suite.Nil(events) -// suite.Equal([][]byte{[]byte(`{}`)}, data) +// func (suite *CustomMessengerTestSuite) TestResubmitFailureAck() { +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// suite.Require().NotEmpty(suite.contractAddress) + +// // Add failure +// packet := ibcchanneltypes.Packet{} +// ack := ibcchanneltypes.Acknowledgement{ +// Response: &ibcchanneltypes.Acknowledgement_Result{Result: []byte("Result")}, +// } +// payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, &ack) +// require.NoError(suite.T(), err) +// failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, suite.contractAddress.String()) +// suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, suite.contractAddress.String(), payload, "test error") + +// // Craft message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// ResubmitFailure: &bindings.ResubmitFailure{ +// FailureId: failureID, +// }, +// }) +// suite.NoError(err) + +// // Dispatch +// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// suite.NoError(err) +// suite.Nil(events) +// expected, err := json.Marshal(&bindings.ResubmitFailureResponse{}) +// suite.NoError(err) +// suite.Equal([][]uint8{expected}, data) // } -// func (suite *CustomMessengerTestSuite) TestUpdateInterchainQueryFailed() { -// // Craft UpdateInterchainQuery message -// msg, err := json.Marshal(bindings.NeutronMsg{ -// UpdateInterchainQuery: &bindings.UpdateInterchainQuery{ -// QueryId: 1, -// NewKeys: nil, -// NewUpdatePeriod: 1, -// }, -// }) -// suite.NoError(err) - -// // Dispatch UpdateInterchainQuery message -// owner, err := sdk.AccAddressFromBech32(testutil.TestOwnerAddress) -// suite.NoError(err) -// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, owner, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ -// Custom: msg, -// }) -// expectedErrMsg := "failed to update interchain query: failed to update interchain query: failed to get query by query id: there is no query with id: 1" -// suite.Require().ErrorContains(err, expectedErrMsg) -// suite.Nil(events) -// suite.Nil(data) +// func (suite *CustomMessengerTestSuite) TestResubmitFailureTimeout() { +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// suite.Require().NotEmpty(suite.contractAddress) + +// // Add failure +// packet := ibcchanneltypes.Packet{} +// payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, nil) +// require.NoError(suite.T(), err) +// failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, suite.contractAddress.String()) +// suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, suite.contractAddress.String(), payload, "test error") + +// // Craft message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// ResubmitFailure: &bindings.ResubmitFailure{ +// FailureId: failureID, +// }, +// }) +// suite.NoError(err) + +// // Dispatch +// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// suite.NoError(err) +// suite.Nil(events) +// expected, err := json.Marshal(&bindings.ResubmitFailureResponse{FailureId: failureID}) +// suite.NoError(err) +// suite.Equal([][]uint8{expected}, data) // } -// func (suite *CustomMessengerTestSuite) TestRemoveInterchainQuery() { -// // Reuse register interchain query test to get query registered -// suite.TestRegisterInterchainQuery() - -// // Craft RemoveInterchainQuery message -// msg, err := json.Marshal(bindings.NeutronMsg{ -// RemoveInterchainQuery: &bindings.RemoveInterchainQuery{ -// QueryId: 1, -// }, -// }) -// suite.NoError(err) - -// // Dispatch RemoveInterchainQuery message -// suite.NoError(err) -// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ -// Custom: msg, -// }) -// suite.NoError(err) -// suite.Nil(events) -// suite.Equal([][]byte{[]byte(`{}`)}, data) +// func (suite *CustomMessengerTestSuite) TestResubmitFailureFromDifferentContract() { +// // Store code and instantiate reflect contract +// codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") +// suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) +// suite.Require().NotEmpty(suite.contractAddress) + +// // Add failure +// packet := ibcchanneltypes.Packet{} +// ack := ibcchanneltypes.Acknowledgement{ +// Response: &ibcchanneltypes.Acknowledgement_Error{Error: "ErrorSudoPayload"}, +// } +// failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, testutil.TestOwnerAddress) +// payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, &ack) +// require.NoError(suite.T(), err) +// suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, testutil.TestOwnerAddress, payload, "test error") + +// // Craft message +// msg, err := json.Marshal(bindings.NeutronMsg{ +// ResubmitFailure: &bindings.ResubmitFailure{ +// FailureId: failureID, +// }, +// }) +// suite.NoError(err) + +// // Dispatch +// _, _, _, err = suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ +// Custom: msg, +// }) +// suite.ErrorContains(err, "no failure found to resubmit: not found") // } -// func (suite *CustomMessengerTestSuite) TestRemoveInterchainQueryFailed() { -// // Craft RemoveInterchainQuery message -// msg, err := json.Marshal(bindings.NeutronMsg{ -// RemoveInterchainQuery: &bindings.RemoveInterchainQuery{ -// QueryId: 1, -// }, -// }) -// suite.NoError(err) - -// // Dispatch RemoveInterchainQuery message -// owner, err := sdk.AccAddressFromBech32(testutil.TestOwnerAddress) -// suite.NoError(err) -// events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, owner, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ -// Custom: msg, -// }) -// expectedErrMsg := "failed to remove interchain query: failed to remove interchain query: failed to get query by query id: there is no query with id: 1" -// suite.Require().ErrorContains(err, expectedErrMsg) -// suite.Nil(events) -// suite.Nil(data) +// func (suite *CustomMessengerTestSuite) craftMarshaledMsgSubmitTxWithNumMsgs(numMsgs int) (result []byte) { +// msg := bindings.ProtobufAny{ +// TypeURL: "/cosmos.staking.v1beta1.MsgDelegate", +// Value: []byte{26, 10, 10, 5, 115, 116, 97, 107, 101, 18, 1, 48}, +// } +// msgs := make([]bindings.ProtobufAny, 0, numMsgs) +// for i := 0; i < numMsgs; i++ { +// msgs = append(msgs, msg) +// } +// result, err := json.Marshal(struct { +// SubmitTx bindings.SubmitTx `json:"submit_tx"` +// }{ +// SubmitTx: bindings.SubmitTx{ +// ConnectionId: suite.Path.EndpointA.ConnectionID, +// InterchainAccountId: testutil.TestInterchainID, +// Msgs: msgs, +// Memo: "Jimmy", +// Timeout: 2000, +// Fee: feetypes.Fee{ +// RecvFee: sdk.NewCoins(), +// AckFee: sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(1000))), +// TimeoutFee: sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(1000))), +// }, +// }, +// }) +// suite.NoError(err) +// return // } -func (suite *CustomMessengerTestSuite) TestSubmitTx() { - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") - suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) - suite.Require().NotEmpty(suite.contractAddress) - - senderAddress := suite.ChainA.SenderAccounts[0].SenderAccount.GetAddress() - coinsAmnt := sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(int64(10_000_000)))) - bankKeeper := suite.nolus.BankKeeper - err := bankKeeper.SendCoins(suite.ctx, senderAddress, suite.contractAddress, coinsAmnt) - suite.NoError(err) - - err = testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) - suite.Require().NoError(err) - - events, data, _, err := suite.messenger.DispatchMsg( - suite.ctx, - suite.contractAddress, - suite.Path.EndpointA.ChannelConfig.PortID, - types.CosmosMsg{ - Custom: suite.craftMarshaledMsgSubmitTxWithNumMsgs(1), - }, - ) - suite.NoError(err) - - var response ictxtypes.MsgSubmitTxResponse - err = json.Unmarshal(data[0], &response) - suite.NoError(err) - suite.Nil(events) - suite.Equal(uint64(1), response.SequenceId) - suite.Equal("channel-2", response.Channel) -} - -func (suite *CustomMessengerTestSuite) TestSubmitTxTooMuchTxs() { - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") - suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) - suite.Require().NotEmpty(suite.contractAddress) - - err := testutil.SetupICAPath(suite.Path, suite.contractAddress.String()) - suite.Require().NoError(err) - - _, _, _, err = suite.messenger.DispatchMsg( - suite.ctx, - suite.contractAddress, - suite.Path.EndpointA.ChannelConfig.PortID, - types.CosmosMsg{ - Custom: suite.craftMarshaledMsgSubmitTxWithNumMsgs(20), - }, - ) - suite.ErrorContains(err, "MsgSubmitTx contains more messages than allowed") -} - -func (suite *CustomMessengerTestSuite) TestResubmitFailureAck() { - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") - suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) - suite.Require().NotEmpty(suite.contractAddress) - - // Add failure - packet := ibcchanneltypes.Packet{} - ack := ibcchanneltypes.Acknowledgement{ - Response: &ibcchanneltypes.Acknowledgement_Result{Result: []byte("Result")}, - } - payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, &ack) - require.NoError(suite.T(), err) - failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, suite.contractAddress.String()) - suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, suite.contractAddress.String(), payload, "test error") - - // Craft message - msg, err := json.Marshal(bindings.NeutronMsg{ - ResubmitFailure: &bindings.ResubmitFailure{ - FailureId: failureID, - }, - }) - suite.NoError(err) - - // Dispatch - events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ - Custom: msg, - }) - suite.NoError(err) - suite.Nil(events) - expected, err := json.Marshal(&bindings.ResubmitFailureResponse{}) - suite.NoError(err) - suite.Equal([][]uint8{expected}, data) -} - -func (suite *CustomMessengerTestSuite) TestResubmitFailureTimeout() { - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") - suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) - suite.Require().NotEmpty(suite.contractAddress) - - // Add failure - packet := ibcchanneltypes.Packet{} - payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, nil) - require.NoError(suite.T(), err) - failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, suite.contractAddress.String()) - suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, suite.contractAddress.String(), payload, "test error") - - // Craft message - msg, err := json.Marshal(bindings.NeutronMsg{ - ResubmitFailure: &bindings.ResubmitFailure{ - FailureId: failureID, - }, - }) - suite.NoError(err) - - // Dispatch - events, data, _, err := suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ - Custom: msg, - }) - suite.NoError(err) - suite.Nil(events) - expected, err := json.Marshal(&bindings.ResubmitFailureResponse{FailureId: failureID}) - suite.NoError(err) - suite.Equal([][]uint8{expected}, data) -} - -func (suite *CustomMessengerTestSuite) TestResubmitFailureFromDifferentContract() { - // Store code and instantiate reflect contract - codeID := suite.StoreTestCode(suite.ctx, suite.contractOwner, "../testdata/reflect.wasm") - suite.contractAddress = suite.InstantiateTestContract(suite.ctx, suite.contractOwner, codeID) - suite.Require().NotEmpty(suite.contractAddress) - - // Add failure - packet := ibcchanneltypes.Packet{} - ack := ibcchanneltypes.Acknowledgement{ - Response: &ibcchanneltypes.Acknowledgement_Error{Error: "ErrorSudoPayload"}, - } - failureID := suite.messenger.ContractmanagerKeeper.GetNextFailureIDKey(suite.ctx, testutil.TestOwnerAddress) - payload, err := contractmanagerkeeper.PrepareSudoCallbackMessage(packet, &ack) - require.NoError(suite.T(), err) - suite.messenger.ContractmanagerKeeper.AddContractFailure(suite.ctx, testutil.TestOwnerAddress, payload, "test error") - - // Craft message - msg, err := json.Marshal(bindings.NeutronMsg{ - ResubmitFailure: &bindings.ResubmitFailure{ - FailureId: failureID, - }, - }) - suite.NoError(err) - - // Dispatch - _, _, _, err = suite.messenger.DispatchMsg(suite.ctx, suite.contractAddress, suite.Path.EndpointA.ChannelConfig.PortID, types.CosmosMsg{ - Custom: msg, - }) - suite.ErrorContains(err, "no failure found to resubmit: not found") -} - -func (suite *CustomMessengerTestSuite) craftMarshaledMsgSubmitTxWithNumMsgs(numMsgs int) (result []byte) { - msg := bindings.ProtobufAny{ - TypeURL: "/cosmos.staking.v1beta1.MsgDelegate", - Value: []byte{26, 10, 10, 5, 115, 116, 97, 107, 101, 18, 1, 48}, - } - msgs := make([]bindings.ProtobufAny, 0, numMsgs) - for i := 0; i < numMsgs; i++ { - msgs = append(msgs, msg) - } - result, err := json.Marshal(struct { - SubmitTx bindings.SubmitTx `json:"submit_tx"` - }{ - SubmitTx: bindings.SubmitTx{ - ConnectionId: suite.Path.EndpointA.ConnectionID, - InterchainAccountId: testutil.TestInterchainID, - Msgs: msgs, - Memo: "Jimmy", - Timeout: 2000, - Fee: feetypes.Fee{ - RecvFee: sdk.NewCoins(), - AckFee: sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(1000))), - TimeoutFee: sdk.NewCoins(sdk.NewCoin(params.DefaultBondDenom, math.NewInt(1000))), - }, - }, - }) - suite.NoError(err) - return -} - -func (suite *CustomMessengerTestSuite) executeCustomMsg(contractAddress sdk.AccAddress, fullMsg json.RawMessage) (data []byte, err error) { - customMsg := types.CosmosMsg{ - Custom: fullMsg, - } - - type ExecuteMsg struct { - ReflectMsg struct { - Msgs []types.CosmosMsg `json:"msgs"` - } `json:"reflect_msg"` - } - - execMsg := ExecuteMsg{ReflectMsg: struct { - Msgs []types.CosmosMsg `json:"msgs"` - }(struct{ Msgs []types.CosmosMsg }{Msgs: []types.CosmosMsg{customMsg}})} - - msg, err := json.Marshal(execMsg) - suite.NoError(err) - - data, err = suite.contractKeeper.Execute(suite.ctx, contractAddress, suite.contractOwner, msg, nil) - - return -} - -func (suite *CustomMessengerTestSuite) executeNeutronMsg(contractAddress sdk.AccAddress, fullMsg bindings.NeutronMsg) (data []byte, err error) { - fullMsgBz, err := json.Marshal(fullMsg) - suite.NoError(err) - - return suite.executeCustomMsg(contractAddress, fullMsgBz) -} - -func TestMessengerTestSuite(t *testing.T) { - suite.Run(t, new(CustomMessengerTestSuite)) -} +// func (suite *CustomMessengerTestSuite) executeCustomMsg(contractAddress sdk.AccAddress, fullMsg json.RawMessage) (data []byte, err error) { +// customMsg := types.CosmosMsg{ +// Custom: fullMsg, +// } + +// type ExecuteMsg struct { +// ReflectMsg struct { +// Msgs []types.CosmosMsg `json:"msgs"` +// } `json:"reflect_msg"` +// } + +// execMsg := ExecuteMsg{ReflectMsg: struct { +// Msgs []types.CosmosMsg `json:"msgs"` +// }(struct{ Msgs []types.CosmosMsg }{Msgs: []types.CosmosMsg{customMsg}})} + +// msg, err := json.Marshal(execMsg) +// suite.NoError(err) + +// data, err = suite.contractKeeper.Execute(suite.ctx, contractAddress, suite.contractOwner, msg, nil) + +// return +// } + +// func (suite *CustomMessengerTestSuite) executeNeutronMsg(contractAddress sdk.AccAddress, fullMsg bindings.NeutronMsg) (data []byte, err error) { +// fullMsgBz, err := json.Marshal(fullMsg) +// suite.NoError(err) + +// return suite.executeCustomMsg(contractAddress, fullMsgBz) +// } + +// func TestMessengerTestSuite(t *testing.T) { +// suite.Run(t, new(CustomMessengerTestSuite)) +// } From cce5a6e8554e73ee11bd5d36f147fe689e560bb9 Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Tue, 17 Sep 2024 17:22:59 +0300 Subject: [PATCH 14/23] fix: linter --- app/app.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index 375a5b06..c8053c75 100644 --- a/app/app.go +++ b/app/app.go @@ -511,8 +511,8 @@ func (app *App) GetStakingKeeper() ibctestingtypes.StakingKeeper { return app.StakingKeeper } -// InitChainer application update at chain initialization -// ONLY FOR TESTING PURPOSES +// InitChainer application update at chain initialization. +// ONLY FOR TESTING PURPOSES. func (app *App) TestInitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { var genesisState GenesisState if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { From 054134b9757717114631f46fb9046c56351f319b Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Wed, 18 Sep 2024 15:31:16 +0300 Subject: [PATCH 15/23] fix: CI --- .github/workflows/nolus-core.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nolus-core.yaml b/.github/workflows/nolus-core.yaml index af1decbf..a7d1cb8c 100644 --- a/.github/workflows/nolus-core.yaml +++ b/.github/workflows/nolus-core.yaml @@ -112,7 +112,7 @@ jobs: skip-cache: true # Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'. - install-mode: "goinstall" + # install-mode: "goinstall" test-unit: name: Run unit tests From 7b1cb6b9812b39b048e751051697b2c697bc1309 Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Wed, 18 Sep 2024 15:42:01 +0300 Subject: [PATCH 16/23] fix: linter --- .github/workflows/nolus-core.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/nolus-core.yaml b/.github/workflows/nolus-core.yaml index a7d1cb8c..80dc157d 100644 --- a/.github/workflows/nolus-core.yaml +++ b/.github/workflows/nolus-core.yaml @@ -98,8 +98,7 @@ jobs: steps: - uses: actions/setup-go@v5 with: - go-version: 1.22 - cache: false + go-version: stable - uses: actions/checkout@v4 From 0f499a1e9e5abc1f4c3a72ccb94d5606a9608e23 Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Wed, 18 Sep 2024 16:22:42 +0300 Subject: [PATCH 17/23] fix: CI lint --- .github/workflows/nolus-core.yaml | 5 +++-- .golangci.yaml | 6 ++++++ go.mod | 4 ++-- go.sum | 2 ++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nolus-core.yaml b/.github/workflows/nolus-core.yaml index 80dc157d..af1decbf 100644 --- a/.github/workflows/nolus-core.yaml +++ b/.github/workflows/nolus-core.yaml @@ -98,7 +98,8 @@ jobs: steps: - uses: actions/setup-go@v5 with: - go-version: stable + go-version: 1.22 + cache: false - uses: actions/checkout@v4 @@ -111,7 +112,7 @@ jobs: skip-cache: true # Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'. - # install-mode: "goinstall" + install-mode: "goinstall" test-unit: name: Run unit tests diff --git a/.golangci.yaml b/.golangci.yaml index 415e9ba0..5a663cca 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -35,6 +35,11 @@ output: sort-results: true issues: + exclude-rules: + - text: 'has no field or method' + linters: + - typecheck + # Maximum issues count per one linter. # Set to 0 to disable. # Default: 50 @@ -43,4 +48,5 @@ issues: # Set to 0 to disable. # Default: 3 max-same-issues: 0 + \ No newline at end of file diff --git a/go.mod b/go.mod index c6d76a05..0eb73cb2 100644 --- a/go.mod +++ b/go.mod @@ -228,8 +228,8 @@ replace ( github.com/cosmos/admin-module/v2 => github.com/neutron-org/admin-module/v2 v2.0.0 // cosmos-sdk-nolus fork adds --validate flag with default value 'true' on gov submit-proposal so we can validate the proposal on submission rather than directly on execution - // github.com/cosmos/cosmos-sdk => github.com/nolus-protocol/cosmos-sdk v0.50.7-nolus-rc1 - github.com/cosmos/cosmos-sdk => /home/denislavivanov/go/github/cosmos-sdk + github.com/cosmos/cosmos-sdk => github.com/nolus-protocol/cosmos-sdk v0.50.7-nolus-rc1 + // explicitely replace iavl to v1.2.0 cause sometimes go mod tidy uses not right version github.com/cosmos/iavl => github.com/cosmos/iavl v1.2.0 diff --git a/go.sum b/go.sum index ad98036a..bfd5b486 100644 --- a/go.sum +++ b/go.sum @@ -870,6 +870,8 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS github.com/neutron-org/admin-module/v2 v2.0.0 h1:MlkSc1821sQ+G5/cYOajuqZ5/lM53xTbixpTtXnHh0A= github.com/neutron-org/admin-module/v2 v2.0.0/go.mod h1:RfOyabXsdJ5btcOKyKPZDYiZhtuKFubbJMOb8EJZtvA= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nolus-protocol/cosmos-sdk v0.50.7-nolus-rc1 h1:QK59L25el60UuVoosifSg3EVK+/n6urjln6yxNnxAI4= +github.com/nolus-protocol/cosmos-sdk v0.50.7-nolus-rc1/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s= github.com/nolus-protocol/neutron/v4 v4.0.1-nolus h1:21r0fWxqjfaLHkPS/y/H1WDxytisOZ3xPsvp+JHa1jU= github.com/nolus-protocol/neutron/v4 v4.0.1-nolus/go.mod h1:7TRawLFzMRs7sXuDd/R5VKHPUfNPDDMYaTcY2UjCqF0= github.com/nolus-protocol/wasmd v0.53.0-nolus h1:RRWI+6dABBCEEowPNxlEHbHYeNHamUVXaop57PF6J2I= From 4007659e04d3f0767c9adcc4be2526e6e6bd3161 Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Tue, 24 Sep 2024 09:27:08 +0300 Subject: [PATCH 18/23] fix: CI --- .github/images/builder.Dockerfile | 4 ++-- .github/workflows/nolus-core.yaml | 6 +++--- .golangci.yaml | 7 ------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/images/builder.Dockerfile b/.github/images/builder.Dockerfile index b866829b..fe0c6b92 100644 --- a/.github/images/builder.Dockerfile +++ b/.github/images/builder.Dockerfile @@ -2,7 +2,7 @@ # TODO: once we migrate to wasmvm 2.1.0, we can go back to using base golang image FROM alpine:3.18 -ENV PATH /usr/local/go/bin:$PATH +ENV PATH=/usr/local/go/bin:$PATH COPY --from=golang:1.22 /usr/local/go /usr/local/go ARG LEDGER_ENABLED @@ -19,7 +19,7 @@ RUN set -eux; apk add --no-cache ca-certificates build-base; RUN apk add git -ARG WASMVM_VERSION="v2.0.0" +ARG WASMVM_VERSION="v2.1.2" ARG WASMVM_LIB="libwasmvm_muslc.x86_64.a" ARG WASMVM_BASE_URL="https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION" ARG WASMVM_URL="$WASMVM_BASE_URL/$WASMVM_LIB" diff --git a/.github/workflows/nolus-core.yaml b/.github/workflows/nolus-core.yaml index af1decbf..e0a845a3 100644 --- a/.github/workflows/nolus-core.yaml +++ b/.github/workflows/nolus-core.yaml @@ -17,7 +17,7 @@ env: # docker images CONTAINER_REGISTRY: ghcr.io - BUILDER_IMAGE_TAG: "1.22.3" + BUILDER_IMAGE_TAG: "1.22.4" BUILDER_IMAGE_NAME: "builder" BUILDER_DOCKERFILE: ".github/images/builder.Dockerfile" PROTOGEN_IMAGE_TAG: "0.2.0" @@ -172,8 +172,8 @@ jobs: needs: [test-unit-coverage, builder-image] container: # image name needs to be hardcoded: https://github.com/orgs/community/discussions/26324 - image: "ghcr.io/nolus-protocol/nolus-core/builder:1.22.3" - + image: "public.ecr.aws/nolus/builder:1.22.4" + steps: - uses: actions/checkout@v4 diff --git a/.golangci.yaml b/.golangci.yaml index 5a663cca..17d72868 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -35,11 +35,6 @@ output: sort-results: true issues: - exclude-rules: - - text: 'has no field or method' - linters: - - typecheck - # Maximum issues count per one linter. # Set to 0 to disable. # Default: 50 @@ -48,5 +43,3 @@ issues: # Set to 0 to disable. # Default: 3 max-same-issues: 0 - - \ No newline at end of file From 344ec1e94bf50ded5a9d3535f9ac4a87f0624b2f Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Tue, 24 Sep 2024 09:44:38 +0300 Subject: [PATCH 19/23] wip --- .github/workflows/nolus-core.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nolus-core.yaml b/.github/workflows/nolus-core.yaml index e0a845a3..bc5b222f 100644 --- a/.github/workflows/nolus-core.yaml +++ b/.github/workflows/nolus-core.yaml @@ -172,7 +172,7 @@ jobs: needs: [test-unit-coverage, builder-image] container: # image name needs to be hardcoded: https://github.com/orgs/community/discussions/26324 - image: "public.ecr.aws/nolus/builder:1.22.4" + image: "ghcr.io/nolusprotocol/nolus-core/builder:1.22.4" steps: - uses: actions/checkout@v4 From 631d58badde65dd317162135b475535b82a3bc3b Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Tue, 24 Sep 2024 10:05:34 +0300 Subject: [PATCH 20/23] fix: CI --- .github/workflows/nolus-core.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nolus-core.yaml b/.github/workflows/nolus-core.yaml index bc5b222f..6936e933 100644 --- a/.github/workflows/nolus-core.yaml +++ b/.github/workflows/nolus-core.yaml @@ -172,7 +172,7 @@ jobs: needs: [test-unit-coverage, builder-image] container: # image name needs to be hardcoded: https://github.com/orgs/community/discussions/26324 - image: "ghcr.io/nolusprotocol/nolus-core/builder:1.22.4" + image: "ghcr.io/nolus-protocol/nolus-core/builder:1.22.4" steps: - uses: actions/checkout@v4 From 1d3d4be9ac60b1820cc3020416af6cdd27ca6b7b Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Mon, 7 Oct 2024 10:10:15 +0300 Subject: [PATCH 21/23] feat: wasmvm 2.1.3 and nolus upgrade v0.6.6 --- .github/images/builder.Dockerfile | 2 +- .github/workflows/nolus-core.yaml | 4 +-- app/upgrades/v066/constants.go | 19 ++++++++++++++ app/upgrades/v066/upgrades.go | 43 +++++++++++++++++++++++++++++++ go.mod | 2 +- go.sum | 4 +-- proto/buf.lock | 8 +++--- 7 files changed, 72 insertions(+), 10 deletions(-) create mode 100644 app/upgrades/v066/constants.go create mode 100644 app/upgrades/v066/upgrades.go diff --git a/.github/images/builder.Dockerfile b/.github/images/builder.Dockerfile index fe0c6b92..d58355e8 100644 --- a/.github/images/builder.Dockerfile +++ b/.github/images/builder.Dockerfile @@ -19,7 +19,7 @@ RUN set -eux; apk add --no-cache ca-certificates build-base; RUN apk add git -ARG WASMVM_VERSION="v2.1.2" +ARG WASMVM_VERSION="v2.1.3" ARG WASMVM_LIB="libwasmvm_muslc.x86_64.a" ARG WASMVM_BASE_URL="https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION" ARG WASMVM_URL="$WASMVM_BASE_URL/$WASMVM_LIB" diff --git a/.github/workflows/nolus-core.yaml b/.github/workflows/nolus-core.yaml index 6936e933..bbf07ef3 100644 --- a/.github/workflows/nolus-core.yaml +++ b/.github/workflows/nolus-core.yaml @@ -17,7 +17,7 @@ env: # docker images CONTAINER_REGISTRY: ghcr.io - BUILDER_IMAGE_TAG: "1.22.4" + BUILDER_IMAGE_TAG: "1.22.5" BUILDER_IMAGE_NAME: "builder" BUILDER_DOCKERFILE: ".github/images/builder.Dockerfile" PROTOGEN_IMAGE_TAG: "0.2.0" @@ -172,7 +172,7 @@ jobs: needs: [test-unit-coverage, builder-image] container: # image name needs to be hardcoded: https://github.com/orgs/community/discussions/26324 - image: "ghcr.io/nolus-protocol/nolus-core/builder:1.22.4" + image: "ghcr.io/nolus-protocol/nolus-core/builder:1.22.5" steps: - uses: actions/checkout@v4 diff --git a/app/upgrades/v066/constants.go b/app/upgrades/v066/constants.go new file mode 100644 index 00000000..3edc2138 --- /dev/null +++ b/app/upgrades/v066/constants.go @@ -0,0 +1,19 @@ +package v066 + +import ( + store "cosmossdk.io/store/types" + "github.com/Nolus-Protocol/nolus-core/app/upgrades" +) + +const ( + // UpgradeName defines the on-chain upgrades name. + UpgradeName = "v0.6.6" +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{}, + }, +} diff --git a/app/upgrades/v066/upgrades.go b/app/upgrades/v066/upgrades.go new file mode 100644 index 00000000..8d314224 --- /dev/null +++ b/app/upgrades/v066/upgrades.go @@ -0,0 +1,43 @@ +package v066 + +import ( + "context" + "fmt" + + "github.com/Nolus-Protocol/nolus-core/app/keepers" + + upgradetypes "cosmossdk.io/x/upgrade/types" + tmtypes "github.com/cometbft/cometbft/types" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + keepers *keepers.AppKeepers, + codec codec.Codec, +) upgradetypes.UpgradeHandler { + return func(c context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx := sdk.UnwrapSDKContext(c) + + ctx.Logger().Info("Starting module migrations...") + vm, err := mm.RunMigrations(ctx, configurator, vm) //nolint:contextcheck + if err != nil { + return vm, err + } + + ctx.Logger().Info(fmt.Sprintf("Migration {%s} applied", UpgradeName)) + + // Properly register consensus params. In the process, change block max bytes params: + defaultConsensusParams := tmtypes.DefaultConsensusParams().ToProto() + defaultConsensusParams.Block.MaxBytes = 5000000 // previously 10485760 + defaultConsensusParams.Block.MaxGas = 300000000 // previously 120000000 + err = keepers.ConsensusParamsKeeper.ParamsStore.Set(ctx, defaultConsensusParams) + if err != nil { + return nil, err + } + return vm, nil + } +} diff --git a/go.mod b/go.mod index 0eb73cb2..faa4dcdf 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22.4 require ( github.com/CosmWasm/wasmd v0.53.0 - github.com/CosmWasm/wasmvm/v2 v2.1.2 + github.com/CosmWasm/wasmvm/v2 v2.1.3 github.com/cometbft/cometbft v0.38.12 github.com/cosmos/cosmos-sdk v0.50.9 github.com/cosmos/gogoproto v1.7.0 diff --git a/go.sum b/go.sum index bfd5b486..68f35d93 100644 --- a/go.sum +++ b/go.sum @@ -227,8 +227,8 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CosmWasm/wasmvm/v2 v2.1.2 h1:GkJ5bAsRlLHfIQVg/FY1VHwLyBwlCjAhDea0B8L+e20= -github.com/CosmWasm/wasmvm/v2 v2.1.2/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg= +github.com/CosmWasm/wasmvm/v2 v2.1.3 h1:CSJTauZqkHyb9yic6JVYCjiGUgxI2MJV2QzfSu8m49c= +github.com/CosmWasm/wasmvm/v2 v2.1.3/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg= github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= diff --git a/proto/buf.lock b/proto/buf.lock index cb5a76ff..a73568a0 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -19,8 +19,8 @@ deps: - remote: buf.build owner: cosmos repository: ibc - commit: c159402ffeef4c21a7f9f0643817ae0d - digest: shake256:694e3f5a1d469798bb6cb3510f6f489e10d9309d1f2e8f7a369a776947602195f13ab65972d2d586a1134978b6a6fa28a43e5d7710ef5032ba0c7fbbe6038f08 + commit: 41fbc441e4d645119d275150719c5441 + digest: shake256:a61d3e152909abddc91dcc1aec8ac997007bebd48a7921bc243681c708e6c9068f6484aa7ed4e6ff60101d3422c98744a4a5294bbda6aacdba07f1dfa4291020 - remote: buf.build owner: cosmos repository: ics23 @@ -29,5 +29,5 @@ deps: - remote: buf.build owner: googleapis repository: googleapis - commit: 8bc2c51e08c447cd8886cdea48a73e14 - digest: shake256:a969155953a5cedc5b2df5b42c368f2bc66ff8ce1804bc96e0f14ff2ee8a893687963058909df844d1643cdbc98ff099d2daa6bc9f9f5b8886c49afdc60e19af + commit: e7f8d366f5264595bcc4cd4139af9973 + digest: shake256:e5e5f1c12f82e028ea696faa43b4f9dc6258a6d1226282962a8c8b282e10946281d815884f574bd279ebd9cd7588629beb3db17b892af6c33b56f92f8f67f509 From e110bf5e75bd7d1eec0a1561a4bb9b6b2db64feb Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Mon, 7 Oct 2024 10:30:12 +0300 Subject: [PATCH 22/23] fix: unused test helpers --- app/app.go | 79 +++-- testutil/test_helpers.go | 631 ++++++++++++++++++++------------------- x/mint/abci_test.go | 2 +- 3 files changed, 355 insertions(+), 357 deletions(-) diff --git a/app/app.go b/app/app.go index c8053c75..a5951e99 100644 --- a/app/app.go +++ b/app/app.go @@ -42,10 +42,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/crisis" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" - ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" - ibctestingtypes "github.com/cosmos/ibc-go/v8/testing/types" - "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" tmjson "github.com/cometbft/cometbft/libs/json" @@ -491,40 +487,41 @@ func (app *App) RegisterNodeService(clientCtx client.Context, cfg config.Config) nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter(), cfg) } -// GetTxConfig implements the TestingApp interface. -func (app *App) GetTxConfig() client.TxConfig { - return app.encodingConfig.TxConfig -} - -// GetIBCKeeper implements the TestingApp interface. -func (app *App) GetIBCKeeper() *ibckeeper.Keeper { - return app.IBCKeeper -} - -// GetScopedIBCKeeper implements the TestingApp interface. -func (app *App) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { - return app.ScopedIBCKeeper -} - -// GetStakingKeeper implements the TestingApp interface. -func (app *App) GetStakingKeeper() ibctestingtypes.StakingKeeper { - return app.StakingKeeper -} - -// InitChainer application update at chain initialization. -// ONLY FOR TESTING PURPOSES. -func (app *App) TestInitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { - var genesisState GenesisState - if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { - panic(err) - } - - // manually set consensus params here, cause there is no way to set it using ibctesting stuff for now - // TODO: app.ConsensusParamsKeeper.Set(ctx, sims.DefaultConsensusParams) - - err := app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) - if err != nil { - return nil, fmt.Errorf("failed to set module version map: %w", err) - } - return app.mm.InitGenesis(ctx, app.appCodec, genesisState) -} +// TODO +// // GetTxConfig implements the TestingApp interface. +// func (app *App) GetTxConfig() client.TxConfig { +// return app.encodingConfig.TxConfig +// } + +// // GetIBCKeeper implements the TestingApp interface. +// func (app *App) GetIBCKeeper() *ibckeeper.Keeper { +// return app.IBCKeeper +// } + +// // GetScopedIBCKeeper implements the TestingApp interface. +// func (app *App) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { +// return app.ScopedIBCKeeper +// } + +// // GetStakingKeeper implements the TestingApp interface. +// func (app *App) GetStakingKeeper() ibctestingtypes.StakingKeeper { +// return app.StakingKeeper +// } + +// // InitChainer application update at chain initialization. +// // ONLY FOR TESTING PURPOSES. +// func (app *App) TestInitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { +// var genesisState GenesisState +// if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { +// panic(err) +// } + +// // manually set consensus params here, cause there is no way to set it using ibctesting stuff for now +// // TODO: app.ConsensusParamsKeeper.Set(ctx, sims.DefaultConsensusParams) + +// err := app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) +// if err != nil { +// return nil, fmt.Errorf("failed to set module version map: %w", err) +// } +// return app.mm.InitGenesis(ctx, app.appCodec, genesisState) +// } diff --git a/testutil/test_helpers.go b/testutil/test_helpers.go index 2617a1e0..86906698 100644 --- a/testutil/test_helpers.go +++ b/testutil/test_helpers.go @@ -1,317 +1,318 @@ package testutil -import ( - "context" - "encoding/json" - "fmt" - "os" - "time" - - "cosmossdk.io/log" - - icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" - "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" - ibctesting "github.com/cosmos/ibc-go/v8/testing" - - "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - - db2 "github.com/cosmos/cosmos-db" - - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - "github.com/stretchr/testify/suite" - - "github.com/Nolus-Protocol/nolus-core/app" - "github.com/Nolus-Protocol/nolus-core/app/params" - - tmos "github.com/cometbft/cometbft/libs/os" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - - ictxstypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" -) - -var ( - // TestOwnerAddress defines a reusable bech32 address for testing purposes. - TestOwnerAddress = "nolus17dtl0mjt3t77kpuhg2edqzjpszulwhgzcdvagh" - - TestInterchainID = "owner_id" - - Connection = "connection-0" - - // TestVersion defines a reusable interchainaccounts version string for testing purposes. - TestVersion = string(icatypes.ModuleCdc.MustMarshalJSON(&icatypes.Metadata{ - Version: icatypes.Version, - ControllerConnectionId: Connection, - HostConnectionId: Connection, - Encoding: icatypes.EncodingProtobuf, - TxType: icatypes.TxTypeSDKMultiMsg, - })) -) - -func init() { - ibctesting.DefaultTestingAppInit = SetupTestingApp - params.GetDefaultConfig() - // Disable cache since enabled cache triggers test errors when `AccAddress.String()` - // gets called before setting nolus bech32 prefix - sdk.SetAddrCacheEnabled(false) -} - -type IBCConnectionTestSuite struct { - suite.Suite - Coordinator *ibctesting.Coordinator - - // testing chains used for convenience and readability - ChainA *ibctesting.TestChain - ChainB *ibctesting.TestChain - - Path *ibctesting.Path - TransferPath *ibctesting.Path -} - -func (suite *IBCConnectionTestSuite) SetupTest() { - // we need to redefine this variable to make tests work cause we use unls as default bond denom in nolus - sdk.DefaultBondDenom = params.DefaultBondDenom - - suite.Coordinator = ibctesting.NewCoordinator(suite.T(), 2) // initialize 2 test chains - suite.ChainA = suite.Coordinator.GetChain(ibctesting.GetChainID(1)) - suite.ChainB = suite.Coordinator.GetChain(ibctesting.GetChainID(2)) - - // move chains to the next block - suite.ChainA.NextBlock() - suite.ChainB.NextBlock() - - // path := ibctesting.NewPath(suite.ChainA, suite.ChainB) // clientID, connectionID, channelID empty - // suite.Coordinator.Setup(path) // clientID, connectionID, channelID filled - // suite.Require().Equal("07-tendermint-0", path.EndpointA.ClientID) - // suite.Require().Equal("connection-0", path.EndpointA.ClientID) - // suite.Require().Equal("channel-0", path.EndpointA.ClientID) - - suite.Path = NewICAPath(suite.ChainA, suite.ChainB) - - // suite.ConfigureTransferChannel() - suite.Coordinator.Setup(suite.Path) -} - -func (suite *IBCConnectionTestSuite) ConfigureTransferChannel() { - suite.TransferPath = NewTransferPath(suite.ChainA, suite.ChainB) - suite.Coordinator.SetupConnections(suite.TransferPath) - err := SetupTransferPath(suite.TransferPath) - suite.Require().NoError(err) -} - -func (suite *IBCConnectionTestSuite) GetNolusZoneApp(chain *ibctesting.TestChain) *app.App { - testApp, ok := chain.App.(*app.App) - if !ok { - panic("not NolusZone app") - } - - return testApp -} - -func (suite *IBCConnectionTestSuite) StoreTestCode(ctx sdk.Context, addr sdk.AccAddress, path string) uint64 { - // wasm file built with https://github.com/neutron-org/neutron-sdk/tree/main/contracts/reflect - // wasm file built with https://github.com/neutron-org/neutron-dev-contracts/tree/feat/ica-register-fee-update/contracts/neutron_interchain_txs - wasmCode, err := os.ReadFile(path) - suite.Require().NoError(err) - - codeID, _, err := keeper.NewDefaultPermissionKeeper(suite.GetNolusZoneApp(suite.ChainA).WasmKeeper).Create(ctx, addr, wasmCode, &wasmtypes.AccessConfig{Permission: wasmtypes.AccessTypeEverybody}) - suite.Require().NoError(err) - - return codeID -} - -func (suite *IBCConnectionTestSuite) InstantiateTestContract(ctx sdk.Context, funder sdk.AccAddress, codeID uint64) sdk.AccAddress { - initMsgBz := []byte("{}") - contractKeeper := keeper.NewDefaultPermissionKeeper(suite.GetNolusZoneApp(suite.ChainA).WasmKeeper) - addr, _, err := contractKeeper.Instantiate(ctx, codeID, funder, funder, initMsgBz, "demo contract", nil) - suite.Require().NoError(err) - - return addr -} - -func NewICAPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { - path := ibctesting.NewPath(chainA, chainB) - path.EndpointA.Counterparty = path.EndpointB - path.EndpointB.Counterparty = path.EndpointA - - path.EndpointA.ChannelConfig.PortID = icatypes.HostPortID - path.EndpointB.ChannelConfig.PortID = icatypes.HostPortID - path.EndpointA.ChannelConfig.Order = channeltypes.ORDERED - path.EndpointB.ChannelConfig.Order = channeltypes.ORDERED - path.EndpointA.ChannelConfig.Version = TestVersion - path.EndpointB.ChannelConfig.Version = TestVersion - - path.EndpointA.ClientConfig.(*ibctesting.TendermintConfig).UnbondingPeriod = 3600000000000 - path.EndpointA.ClientConfig.(*ibctesting.TendermintConfig).TrustingPeriod = 1200000000000 - - path.EndpointB.ClientConfig.(*ibctesting.TendermintConfig).UnbondingPeriod = 3600000000000 - path.EndpointB.ClientConfig.(*ibctesting.TendermintConfig).TrustingPeriod = 1200000000000 - return path -} - -// SetupICAPath invokes the InterchainAccounts entrypoint and subsequent channel handshake handlers. -func SetupICAPath(path *ibctesting.Path, owner string) error { - if err := RegisterInterchainAccount(path.EndpointA, owner); err != nil { - return err - } - - if err := path.EndpointB.ChanOpenTry(); err != nil { - return err - } - - if err := path.EndpointA.ChanOpenAck(); err != nil { - return err - } - - return path.EndpointB.ChanOpenConfirm() -} - -// RegisterInterchainAccount is a helper function for starting the channel handshake. -func RegisterInterchainAccount(endpoint *ibctesting.Endpoint, owner string) error { - icaOwner, _ := ictxstypes.NewICAOwner(owner, TestInterchainID) - portID, err := icatypes.NewControllerPortID(icaOwner.String()) - if err != nil { - return err - } - - ctx := endpoint.Chain.GetContext() - - channelSequence := endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextChannelSequence(ctx) - - a, ok := endpoint.Chain.App.(*app.App) - if !ok { - return fmt.Errorf("not NolusZoneApp") - } - - // TODO(pr0n00gler): are we sure it's okay? - if err := a.ICAControllerKeeper.RegisterInterchainAccount(ctx, endpoint.ConnectionID, icaOwner.String(), ""); err != nil { - return err - } - - // commit state changes for proof verification - endpoint.Chain.NextBlock() - - // update port/channel ids - endpoint.ChannelID = channeltypes.FormatChannelIdentifier(channelSequence) - endpoint.ChannelConfig.PortID = portID - - return nil -} - -var tempDir = func() string { - dir, err := os.MkdirTemp("", "nolusd") - if err != nil { - panic("failed to create temp dir: " + err.Error()) - } - defer os.RemoveAll(dir) - - return dir -} - -// fauxMerkleModeOpt returns a BaseApp option to use a dbStoreAdapter instead of -// an IAVLStore for faster simulation speed. -func fauxMerkleModeOpt(bapp *baseapp.BaseApp) { - bapp.SetFauxMerkleMode() -} - -// SetupTestingApp initializes the IBC-go testing application. -func SetupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage) { - encoding := app.MakeEncodingConfig(app.ModuleBasics) - db := db2.NewMemDB() - - temp := tempDir() - - testApp := app.New( - log.NewNopLogger(), - db, - nil, - false, - map[int64]bool{}, - temp, - 0, - encoding, - sims.EmptyAppOptions{}, - fauxMerkleModeOpt, - ) - - ctx := testApp.BaseApp.NewContextLegacy(false, tmproto.Header{Height: 1, ChainID: "testchain-1", Time: time.Now().UTC()}) - - // Manually set validator signing info, otherwise we panic - vals, err := testApp.StakingKeeper.GetAllValidators(context.TODO()) - if err != nil { - panic(err) - } - for _, val := range vals { - consAddr, _ := val.GetConsAddr() - signingInfo := slashingtypes.NewValidatorSigningInfo( - consAddr, - ctx.BlockHeight(), - 0, - time.Unix(0, 0), - false, - 0, - ) - err := testApp.SlashingKeeper.SetValidatorSigningInfo(ctx, consAddr, signingInfo) - if err != nil { - panic(err) - } - } - - // we need to set up a TestInitChainer where we can redefine MaxBlockGas in ConsensusParamsKeeper - testApp.SetInitChainer(testApp.TestInitChainer) - // and then we manually init baseapp and load states - if err := testApp.LoadLatestVersion(); err != nil { - tmos.Exit(err.Error()) - } - - // Initialize pinned codes in wasmvm as they are not persisted there - if err := testApp.WasmKeeper.InitializePinnedCodes(ctx); err != nil { - panic(err) - } - - genesisState := app.NewDefaultGenesisState(encoding) - - // genesisState := app.NewDefaultGenesisState(encoding) - - return testApp, genesisState -} - -func NewTransferPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { - path := ibctesting.NewPath(chainA, chainB) - path.EndpointA.ChannelConfig.PortID = types.PortID - path.EndpointB.ChannelConfig.PortID = types.PortID - path.EndpointA.ChannelConfig.Order = channeltypes.UNORDERED - path.EndpointB.ChannelConfig.Order = channeltypes.UNORDERED - path.EndpointA.ChannelConfig.Version = types.Version - path.EndpointB.ChannelConfig.Version = types.Version - - return path -} - -// SetupTransferPath. -func SetupTransferPath(path *ibctesting.Path) error { - channelSequence := path.EndpointA.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextChannelSequence(path.EndpointA.Chain.GetContext()) - channelSequenceB := path.EndpointB.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextChannelSequence(path.EndpointB.Chain.GetContext()) - - // update port/channel ids - path.EndpointA.ChannelID = channeltypes.FormatChannelIdentifier(channelSequence) - path.EndpointB.ChannelID = channeltypes.FormatChannelIdentifier(channelSequenceB) - - if err := path.EndpointA.ChanOpenInit(); err != nil { - return err - } - - if err := path.EndpointB.ChanOpenTry(); err != nil { - return err - } - - if err := path.EndpointA.ChanOpenAck(); err != nil { - return err - } - - return path.EndpointB.ChanOpenConfirm() -} +// TODO +// import ( +// "context" +// "encoding/json" +// "fmt" +// "os" +// "time" + +// "cosmossdk.io/log" + +// icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" +// "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" +// ibctesting "github.com/cosmos/ibc-go/v8/testing" + +// "github.com/CosmWasm/wasmd/x/wasm/keeper" +// wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + +// db2 "github.com/cosmos/cosmos-db" + +// "github.com/cosmos/cosmos-sdk/baseapp" +// "github.com/cosmos/cosmos-sdk/testutil/sims" +// sdk "github.com/cosmos/cosmos-sdk/types" +// slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" +// channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" +// "github.com/stretchr/testify/suite" + +// "github.com/Nolus-Protocol/nolus-core/app" +// "github.com/Nolus-Protocol/nolus-core/app/params" + +// tmos "github.com/cometbft/cometbft/libs/os" +// tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + +// ictxstypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types" +// ) + +// var ( +// // TestOwnerAddress defines a reusable bech32 address for testing purposes. +// TestOwnerAddress = "nolus17dtl0mjt3t77kpuhg2edqzjpszulwhgzcdvagh" + +// TestInterchainID = "owner_id" + +// Connection = "connection-0" + +// // TestVersion defines a reusable interchainaccounts version string for testing purposes. +// TestVersion = string(icatypes.ModuleCdc.MustMarshalJSON(&icatypes.Metadata{ +// Version: icatypes.Version, +// ControllerConnectionId: Connection, +// HostConnectionId: Connection, +// Encoding: icatypes.EncodingProtobuf, +// TxType: icatypes.TxTypeSDKMultiMsg, +// })) +// ) + +// func init() { +// ibctesting.DefaultTestingAppInit = SetupTestingApp +// params.GetDefaultConfig() +// // Disable cache since enabled cache triggers test errors when `AccAddress.String()` +// // gets called before setting nolus bech32 prefix +// sdk.SetAddrCacheEnabled(false) +// } + +// type IBCConnectionTestSuite struct { +// suite.Suite +// Coordinator *ibctesting.Coordinator + +// // testing chains used for convenience and readability +// ChainA *ibctesting.TestChain +// ChainB *ibctesting.TestChain + +// Path *ibctesting.Path +// TransferPath *ibctesting.Path +// } + +// func (suite *IBCConnectionTestSuite) SetupTest() { +// // we need to redefine this variable to make tests work cause we use unls as default bond denom in nolus +// sdk.DefaultBondDenom = params.DefaultBondDenom + +// suite.Coordinator = ibctesting.NewCoordinator(suite.T(), 2) // initialize 2 test chains +// suite.ChainA = suite.Coordinator.GetChain(ibctesting.GetChainID(1)) +// suite.ChainB = suite.Coordinator.GetChain(ibctesting.GetChainID(2)) + +// // move chains to the next block +// suite.ChainA.NextBlock() +// suite.ChainB.NextBlock() + +// // path := ibctesting.NewPath(suite.ChainA, suite.ChainB) // clientID, connectionID, channelID empty +// // suite.Coordinator.Setup(path) // clientID, connectionID, channelID filled +// // suite.Require().Equal("07-tendermint-0", path.EndpointA.ClientID) +// // suite.Require().Equal("connection-0", path.EndpointA.ClientID) +// // suite.Require().Equal("channel-0", path.EndpointA.ClientID) + +// suite.Path = NewICAPath(suite.ChainA, suite.ChainB) + +// // suite.ConfigureTransferChannel() +// suite.Coordinator.Setup(suite.Path) +// } + +// func (suite *IBCConnectionTestSuite) ConfigureTransferChannel() { +// suite.TransferPath = NewTransferPath(suite.ChainA, suite.ChainB) +// suite.Coordinator.SetupConnections(suite.TransferPath) +// err := SetupTransferPath(suite.TransferPath) +// suite.Require().NoError(err) +// } + +// func (suite *IBCConnectionTestSuite) GetNolusZoneApp(chain *ibctesting.TestChain) *app.App { +// testApp, ok := chain.App.(*app.App) +// if !ok { +// panic("not NolusZone app") +// } + +// return testApp +// } + +// func (suite *IBCConnectionTestSuite) StoreTestCode(ctx sdk.Context, addr sdk.AccAddress, path string) uint64 { +// // wasm file built with https://github.com/neutron-org/neutron-sdk/tree/main/contracts/reflect +// // wasm file built with https://github.com/neutron-org/neutron-dev-contracts/tree/feat/ica-register-fee-update/contracts/neutron_interchain_txs +// wasmCode, err := os.ReadFile(path) +// suite.Require().NoError(err) + +// codeID, _, err := keeper.NewDefaultPermissionKeeper(suite.GetNolusZoneApp(suite.ChainA).WasmKeeper).Create(ctx, addr, wasmCode, &wasmtypes.AccessConfig{Permission: wasmtypes.AccessTypeEverybody}) +// suite.Require().NoError(err) + +// return codeID +// } + +// func (suite *IBCConnectionTestSuite) InstantiateTestContract(ctx sdk.Context, funder sdk.AccAddress, codeID uint64) sdk.AccAddress { +// initMsgBz := []byte("{}") +// contractKeeper := keeper.NewDefaultPermissionKeeper(suite.GetNolusZoneApp(suite.ChainA).WasmKeeper) +// addr, _, err := contractKeeper.Instantiate(ctx, codeID, funder, funder, initMsgBz, "demo contract", nil) +// suite.Require().NoError(err) + +// return addr +// } + +// func NewICAPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { +// path := ibctesting.NewPath(chainA, chainB) +// path.EndpointA.Counterparty = path.EndpointB +// path.EndpointB.Counterparty = path.EndpointA + +// path.EndpointA.ChannelConfig.PortID = icatypes.HostPortID +// path.EndpointB.ChannelConfig.PortID = icatypes.HostPortID +// path.EndpointA.ChannelConfig.Order = channeltypes.ORDERED +// path.EndpointB.ChannelConfig.Order = channeltypes.ORDERED +// path.EndpointA.ChannelConfig.Version = TestVersion +// path.EndpointB.ChannelConfig.Version = TestVersion + +// path.EndpointA.ClientConfig.(*ibctesting.TendermintConfig).UnbondingPeriod = 3600000000000 +// path.EndpointA.ClientConfig.(*ibctesting.TendermintConfig).TrustingPeriod = 1200000000000 + +// path.EndpointB.ClientConfig.(*ibctesting.TendermintConfig).UnbondingPeriod = 3600000000000 +// path.EndpointB.ClientConfig.(*ibctesting.TendermintConfig).TrustingPeriod = 1200000000000 +// return path +// } + +// // SetupICAPath invokes the InterchainAccounts entrypoint and subsequent channel handshake handlers. +// func SetupICAPath(path *ibctesting.Path, owner string) error { +// if err := RegisterInterchainAccount(path.EndpointA, owner); err != nil { +// return err +// } + +// if err := path.EndpointB.ChanOpenTry(); err != nil { +// return err +// } + +// if err := path.EndpointA.ChanOpenAck(); err != nil { +// return err +// } + +// return path.EndpointB.ChanOpenConfirm() +// } + +// // RegisterInterchainAccount is a helper function for starting the channel handshake. +// func RegisterInterchainAccount(endpoint *ibctesting.Endpoint, owner string) error { +// icaOwner, _ := ictxstypes.NewICAOwner(owner, TestInterchainID) +// portID, err := icatypes.NewControllerPortID(icaOwner.String()) +// if err != nil { +// return err +// } + +// ctx := endpoint.Chain.GetContext() + +// channelSequence := endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextChannelSequence(ctx) + +// a, ok := endpoint.Chain.App.(*app.App) +// if !ok { +// return fmt.Errorf("not NolusZoneApp") +// } + +// // TODO(pr0n00gler): are we sure it's okay? +// if err := a.ICAControllerKeeper.RegisterInterchainAccount(ctx, endpoint.ConnectionID, icaOwner.String(), ""); err != nil { +// return err +// } + +// // commit state changes for proof verification +// endpoint.Chain.NextBlock() + +// // update port/channel ids +// endpoint.ChannelID = channeltypes.FormatChannelIdentifier(channelSequence) +// endpoint.ChannelConfig.PortID = portID + +// return nil +// } + +// var tempDir = func() string { +// dir, err := os.MkdirTemp("", "nolusd") +// if err != nil { +// panic("failed to create temp dir: " + err.Error()) +// } +// defer os.RemoveAll(dir) + +// return dir +// } + +// // fauxMerkleModeOpt returns a BaseApp option to use a dbStoreAdapter instead of +// // an IAVLStore for faster simulation speed. +// func fauxMerkleModeOpt(bapp *baseapp.BaseApp) { +// bapp.SetFauxMerkleMode() +// } + +// // SetupTestingApp initializes the IBC-go testing application. +// func SetupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage) { +// encoding := app.MakeEncodingConfig(app.ModuleBasics) +// db := db2.NewMemDB() + +// temp := tempDir() + +// testApp := app.New( +// log.NewNopLogger(), +// db, +// nil, +// false, +// map[int64]bool{}, +// temp, +// 0, +// encoding, +// sims.EmptyAppOptions{}, +// fauxMerkleModeOpt, +// ) + +// ctx := testApp.BaseApp.NewContextLegacy(false, tmproto.Header{Height: 1, ChainID: "testchain-1", Time: time.Now().UTC()}) + +// // Manually set validator signing info, otherwise we panic +// vals, err := testApp.StakingKeeper.GetAllValidators(context.TODO()) +// if err != nil { +// panic(err) +// } +// for _, val := range vals { +// consAddr, _ := val.GetConsAddr() +// signingInfo := slashingtypes.NewValidatorSigningInfo( +// consAddr, +// ctx.BlockHeight(), +// 0, +// time.Unix(0, 0), +// false, +// 0, +// ) +// err := testApp.SlashingKeeper.SetValidatorSigningInfo(ctx, consAddr, signingInfo) +// if err != nil { +// panic(err) +// } +// } + +// // we need to set up a TestInitChainer where we can redefine MaxBlockGas in ConsensusParamsKeeper +// testApp.SetInitChainer(testApp.TestInitChainer) +// // and then we manually init baseapp and load states +// if err := testApp.LoadLatestVersion(); err != nil { +// tmos.Exit(err.Error()) +// } + +// // Initialize pinned codes in wasmvm as they are not persisted there +// if err := testApp.WasmKeeper.InitializePinnedCodes(ctx); err != nil { +// panic(err) +// } + +// genesisState := app.NewDefaultGenesisState(encoding) + +// // genesisState := app.NewDefaultGenesisState(encoding) + +// return testApp, genesisState +// } + +// func NewTransferPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { +// path := ibctesting.NewPath(chainA, chainB) +// path.EndpointA.ChannelConfig.PortID = types.PortID +// path.EndpointB.ChannelConfig.PortID = types.PortID +// path.EndpointA.ChannelConfig.Order = channeltypes.UNORDERED +// path.EndpointB.ChannelConfig.Order = channeltypes.UNORDERED +// path.EndpointA.ChannelConfig.Version = types.Version +// path.EndpointB.ChannelConfig.Version = types.Version + +// return path +// } + +// // SetupTransferPath. +// func SetupTransferPath(path *ibctesting.Path) error { +// channelSequence := path.EndpointA.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextChannelSequence(path.EndpointA.Chain.GetContext()) +// channelSequenceB := path.EndpointB.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextChannelSequence(path.EndpointB.Chain.GetContext()) + +// // update port/channel ids +// path.EndpointA.ChannelID = channeltypes.FormatChannelIdentifier(channelSequence) +// path.EndpointB.ChannelID = channeltypes.FormatChannelIdentifier(channelSequenceB) + +// if err := path.EndpointA.ChanOpenInit(); err != nil { +// return err +// } + +// if err := path.EndpointB.ChanOpenTry(); err != nil { +// return err +// } + +// if err := path.EndpointA.ChanOpenAck(); err != nil { +// return err +// } + +// return path.EndpointB.ChanOpenConfirm() +// } diff --git a/x/mint/abci_test.go b/x/mint/abci_test.go index a77fb391..8f817cee 100644 --- a/x/mint/abci_test.go +++ b/x/mint/abci_test.go @@ -144,7 +144,7 @@ func Test_CalcTokensDuringFormula_WhenUsingVaryingIncrements_OutputExpectedToken timeOffset = timeOffset.Add(i) } - mintThreshold := sdkmath.NewUint(30_000_000) // 30 tokens + mintThreshold := sdkmath.NewUint(300_000_000) // 300 tokens fmt.Printf("%v Returned Total, %v Total Minted(in store), %v Norm Time \n", mintedCoins, minter.TotalMinted, minter.NormTimePassed) if types.GetAbsDiff(expectedCoins60Sec, mintedCoins).GT(mintThreshold) || types.GetAbsDiff(expectedCoins60Sec, sdkmath.Uint(minter.TotalMinted)).GT(mintThreshold) { From 88f75f26095b5dff365f7da9a989e99f83f5efb0 Mon Sep 17 00:00:00 2001 From: Lockwarr Date: Wed, 9 Oct 2024 13:34:32 +0300 Subject: [PATCH 23/23] chore: upgrade handler adjustments --- app/app.go | 4 ++-- app/upgrades/v066/upgrades.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/app.go b/app/app.go index a5951e99..4794c847 100644 --- a/app/app.go +++ b/app/app.go @@ -51,7 +51,7 @@ import ( "github.com/Nolus-Protocol/nolus-core/app/keepers" appparams "github.com/Nolus-Protocol/nolus-core/app/params" "github.com/Nolus-Protocol/nolus-core/app/upgrades" - v065 "github.com/Nolus-Protocol/nolus-core/app/upgrades/v065" + v066 "github.com/Nolus-Protocol/nolus-core/app/upgrades/v066" "github.com/Nolus-Protocol/nolus-core/docs" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" @@ -67,7 +67,7 @@ const ( var ( DefaultNodeHome string - Upgrades = []upgrades.Upgrade{v065.Upgrade} + Upgrades = []upgrades.Upgrade{v066.Upgrade} ) var ( diff --git a/app/upgrades/v066/upgrades.go b/app/upgrades/v066/upgrades.go index 8d314224..8ec76e63 100644 --- a/app/upgrades/v066/upgrades.go +++ b/app/upgrades/v066/upgrades.go @@ -32,8 +32,8 @@ func CreateUpgradeHandler( // Properly register consensus params. In the process, change block max bytes params: defaultConsensusParams := tmtypes.DefaultConsensusParams().ToProto() - defaultConsensusParams.Block.MaxBytes = 5000000 // previously 10485760 - defaultConsensusParams.Block.MaxGas = 300000000 // previously 120000000 + defaultConsensusParams.Block.MaxBytes = 4000000 // previously 22020096 + defaultConsensusParams.Block.MaxGas = 100000000 // previously 100000000 err = keepers.ConsensusParamsKeeper.ParamsStore.Set(ctx, defaultConsensusParams) if err != nil { return nil, err