From 7d30142c816cc752a68f02899208c45f924eecc0 Mon Sep 17 00:00:00 2001 From: codehans <94654388+codehans@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:56:44 +0000 Subject: [PATCH 01/27] v1.0.0 (#58) * add Ibc verify wasm binding for cosmwasm interchain queries * add cwica for cosmwasm interchain accounts * add x/batch for batch claiming and redelegation * add 08-wasm client for ibc --------- Co-authored-by: antstalepresh <36045227+antstalepresh@users.noreply.github.com> Co-authored-by: mintthemoon Co-authored-by: Starsquid Co-authored-by: Amit Prasad <13373751+AmitPr@users.noreply.github.com> Co-authored-by: antstalepresh --- .github/workflows/build.yml | 6 +- .github/workflows/lint.yml | 2 +- .gitignore | 6 +- Makefile | 4 +- app/app.go | 172 ++-- app/openapiconsole/console.go | 2 +- app/testing.go | 73 ++ app/upgrades.go | 24 +- cmd/kujirad/cmd/root.go | 2 + docs/proto/proto-docs.md | 415 ++++------ go.mod | 89 +- go.sum | 190 +++-- proto/batch/genesis.proto | 13 + proto/batch/params.proto | 7 + proto/batch/tx.proto | 47 ++ proto/kujira/cwica/callback.proto | 18 + proto/kujira/cwica/query.proto | 28 + proto/kujira/cwica/tx.proto | 12 + readme.md | 23 - scripts/lint.sh | 2 +- test/relayer/config/config.lock | 0 test/relayer/config/config.yaml | 69 ++ test/relayer/config/config_temp.yaml | 65 ++ test/setup_ibc.sh | 120 +++ wasmbinding/bindings/ibc.go | 164 ++++ wasmbinding/bindings/msg.go | 4 + wasmbinding/bindings/query.go | 8 + wasmbinding/message_plugin.go | 23 +- wasmbinding/queries.go | 13 +- wasmbinding/query_plugin.go | 33 +- wasmbinding/test/helpers_test.go | 40 + wasmbinding/test/wasm_test.go | 54 +- wasmbinding/testdata/kujira_ibc.wasm | Bin 0 -> 152399 bytes wasmbinding/wasm.go | 14 +- x/batch/client/cli/tx.go | 119 +++ x/batch/genesis.go | 16 + x/batch/keeper/delegation.go | 240 ++++++ x/batch/keeper/delegation_test.go | 242 ++++++ x/batch/keeper/keeper.go | 52 ++ x/batch/keeper/keeper_test.go | 28 + x/batch/keeper/msg_server.go | 58 ++ x/batch/module.go | 160 ++++ x/batch/types/codec.go | 42 + x/batch/types/errors.go | 14 + x/batch/types/expected_keeper.go | 51 ++ x/batch/types/genesis.go | 21 + x/batch/types/genesis.pb.go | 321 ++++++++ x/batch/types/keys.go | 22 + x/batch/types/msgs.go | 90 ++ x/batch/types/params.go | 34 + x/batch/types/params.pb.go | 262 ++++++ x/batch/types/tx.pb.go | 1051 ++++++++++++++++++++++++ x/batch/types/types.go | 1 + x/batch/wasm/interface_msg.go | 53 ++ x/cw-ica/client/cli/query.go | 48 ++ x/cw-ica/client/cli/tx.go | 22 + x/cw-ica/ibc_module.go | 125 +++ x/cw-ica/keeper/callback.go | 56 ++ x/cw-ica/keeper/grpc_query.go | 32 + x/cw-ica/keeper/ibc_handlers.go | 197 +++++ x/cw-ica/keeper/keeper.go | 51 ++ x/cw-ica/keeper/keeper_test.go | 136 +++ x/cw-ica/keeper/msg_server.go | 16 + x/cw-ica/keeper/msg_server_test.go | 1 + x/cw-ica/keeper/sudo.go | 92 +++ x/cw-ica/module.go | 143 ++++ x/cw-ica/types/callback.pb.go | 617 ++++++++++++++ x/cw-ica/types/codec.go | 25 + x/cw-ica/types/errors.go | 10 + x/cw-ica/types/keys.go | 39 + x/cw-ica/types/query.go | 17 + x/cw-ica/types/query.pb.go | 692 ++++++++++++++++ x/cw-ica/types/query.pb.gw.go | 224 +++++ x/cw-ica/types/sudo.go | 40 + x/cw-ica/types/tx.pb.go | 85 ++ x/cw-ica/types/tx_serialize.go | 26 + x/cw-ica/wasm/interface_msg.go | 180 ++++ x/cw-ica/wasm/interface_query.go | 66 ++ x/denom/client/cli/query.go | 2 +- x/denom/types/denoms.go | 2 +- x/oracle/client/cli/query.go | 4 +- x/oracle/keeper/ballot.go | 2 +- x/oracle/keeper/querier.go | 2 +- x/oracle/types/ballot_test.go | 2 +- x/scheduler/client/cli/query_hook.go | 2 +- x/scheduler/client/cli/query_params.go | 2 +- x/scheduler/keeper/grpc_query_hook.go | 2 +- 87 files changed, 7097 insertions(+), 482 deletions(-) create mode 100644 app/testing.go create mode 100644 proto/batch/genesis.proto create mode 100644 proto/batch/params.proto create mode 100644 proto/batch/tx.proto create mode 100644 proto/kujira/cwica/callback.proto create mode 100644 proto/kujira/cwica/query.proto create mode 100644 proto/kujira/cwica/tx.proto create mode 100644 test/relayer/config/config.lock create mode 100644 test/relayer/config/config.yaml create mode 100644 test/relayer/config/config_temp.yaml create mode 100644 test/setup_ibc.sh create mode 100644 wasmbinding/bindings/ibc.go create mode 100644 wasmbinding/testdata/kujira_ibc.wasm create mode 100644 x/batch/client/cli/tx.go create mode 100644 x/batch/genesis.go create mode 100644 x/batch/keeper/delegation.go create mode 100644 x/batch/keeper/delegation_test.go create mode 100644 x/batch/keeper/keeper.go create mode 100644 x/batch/keeper/keeper_test.go create mode 100644 x/batch/keeper/msg_server.go create mode 100644 x/batch/module.go create mode 100644 x/batch/types/codec.go create mode 100644 x/batch/types/errors.go create mode 100644 x/batch/types/expected_keeper.go create mode 100644 x/batch/types/genesis.go create mode 100644 x/batch/types/genesis.pb.go create mode 100644 x/batch/types/keys.go create mode 100644 x/batch/types/msgs.go create mode 100644 x/batch/types/params.go create mode 100644 x/batch/types/params.pb.go create mode 100644 x/batch/types/tx.pb.go create mode 100644 x/batch/types/types.go create mode 100644 x/batch/wasm/interface_msg.go create mode 100644 x/cw-ica/client/cli/query.go create mode 100644 x/cw-ica/client/cli/tx.go create mode 100644 x/cw-ica/ibc_module.go create mode 100644 x/cw-ica/keeper/callback.go create mode 100644 x/cw-ica/keeper/grpc_query.go create mode 100644 x/cw-ica/keeper/ibc_handlers.go create mode 100644 x/cw-ica/keeper/keeper.go create mode 100644 x/cw-ica/keeper/keeper_test.go create mode 100644 x/cw-ica/keeper/msg_server.go create mode 100644 x/cw-ica/keeper/msg_server_test.go create mode 100644 x/cw-ica/keeper/sudo.go create mode 100644 x/cw-ica/module.go create mode 100644 x/cw-ica/types/callback.pb.go create mode 100644 x/cw-ica/types/codec.go create mode 100644 x/cw-ica/types/errors.go create mode 100644 x/cw-ica/types/keys.go create mode 100644 x/cw-ica/types/query.go create mode 100644 x/cw-ica/types/query.pb.go create mode 100644 x/cw-ica/types/query.pb.gw.go create mode 100644 x/cw-ica/types/sudo.go create mode 100644 x/cw-ica/types/tx.pb.go create mode 100644 x/cw-ica/types/tx_serialize.go create mode 100644 x/cw-ica/wasm/interface_msg.go create mode 100644 x/cw-ica/wasm/interface_query.go diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da28e6ac..f6380ccf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ jobs: - name: Setup go uses: actions/setup-go@v2 with: - go-version: "1.20" + go-version: "1.21" - run: go build ./... test: @@ -19,7 +19,7 @@ jobs: - name: Install Go uses: actions/setup-go@v2 with: - go-version: "1.20" + go-version: "1.21" - name: Checkout code uses: actions/checkout@v2 - name: Test @@ -35,7 +35,7 @@ jobs: - name: Setup go uses: actions/setup-go@v2 with: - go-version: "1.20" + go-version: "1.21" - run: | go mod tidy CHANGES_IN_REPO=$(git status --porcelain) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4298b682..126a7913 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: "1.20" + go-version: "1.21" - uses: actions/checkout@v3 - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/.gitignore b/.gitignore index c79d851d..257c93e7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,8 @@ release/ .idea/ .vscode/ .DS_Store -build/ \ No newline at end of file +build/ +logs +keys +wasmbinding/test/wasm +wasmbinding/test/data \ No newline at end of file diff --git a/Makefile b/Makefile index c307aefe..06836306 100644 --- a/Makefile +++ b/Makefile @@ -59,8 +59,8 @@ BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' #### Command List #### check-go-version: - @if ! go version | grep -Eq "go1.20.[1-8]"; then \ - echo "\033[0;31mERROR:\033[0m Go version 1.20.1 through 1.20.8 is required for compiling kujirad. Installed version:" "$(shell go version)"; \ + @if ! go version | grep -Eq "go1.21.8"; then \ + echo "\033[0;31mERROR:\033[0m Go version 1.20.8 is required for compiling kujirad. Installed version:" "$(shell go version)"; \ exit 1; \ fi diff --git a/app/app.go b/app/app.go index 7ab83707..7c593dd4 100644 --- a/app/app.go +++ b/app/app.go @@ -75,6 +75,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/cosmos/cosmos-sdk/x/upgrade" bank "github.com/terra-money/alliance/custom/bank" bankkeeper "github.com/terra-money/alliance/custom/bank/keeper" alliancemodule "github.com/terra-money/alliance/x/alliance" @@ -82,11 +83,13 @@ import ( alliancemodulekeeper "github.com/terra-money/alliance/x/alliance/keeper" alliancemoduletypes "github.com/terra-money/alliance/x/alliance/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + ibcwasm "github.com/cosmos/ibc-go/modules/light-clients/08-wasm" + ibcwasmkeeper "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/keeper" + ibcwasmtypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types" ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" icacontroller "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller" icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" @@ -115,11 +118,13 @@ import ( tmjson "github.com/cometbft/cometbft/libs/json" "github.com/cometbft/cometbft/libs/log" tmos "github.com/cometbft/cometbft/libs/os" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/spf13/cast" "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + wasmvm "github.com/CosmWasm/wasmvm" "github.com/Team-Kujira/core/app/openapiconsole" appparams "github.com/Team-Kujira/core/app/params" @@ -128,6 +133,10 @@ import ( denomkeeper "github.com/Team-Kujira/core/x/denom/keeper" denomtypes "github.com/Team-Kujira/core/x/denom/types" + "github.com/Team-Kujira/core/x/batch" + batchkeeper "github.com/Team-Kujira/core/x/batch/keeper" + batchtypes "github.com/Team-Kujira/core/x/batch/types" + "github.com/Team-Kujira/core/docs" scheduler "github.com/Team-Kujira/core/x/scheduler" schedulerclient "github.com/Team-Kujira/core/x/scheduler/client" @@ -138,6 +147,10 @@ import ( oraclekeeper "github.com/Team-Kujira/core/x/oracle/keeper" oracletypes "github.com/Team-Kujira/core/x/oracle/types" + cwica "github.com/Team-Kujira/core/x/cw-ica" + cwicakeeper "github.com/Team-Kujira/core/x/cw-ica/keeper" + cwicatypes "github.com/Team-Kujira/core/x/cw-ica/types" + storetypes "github.com/cosmos/cosmos-sdk/store/types" ) @@ -198,6 +211,7 @@ var ( feegrantmodule.AppModuleBasic{}, ibc.AppModuleBasic{}, ibctm.AppModuleBasic{}, + ibcwasm.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, @@ -207,9 +221,11 @@ var ( ica.AppModuleBasic{}, ibcfee.AppModuleBasic{}, denom.AppModuleBasic{}, + batch.AppModuleBasic{}, scheduler.AppModuleBasic{}, oracle.AppModuleBasic{}, alliancemodule.AppModuleBasic{}, + cwica.AppModuleBasic{}, ) // module account permissions @@ -225,10 +241,12 @@ var ( icatypes.ModuleName: nil, wasmtypes.ModuleName: {authtypes.Burner}, denomtypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + batchtypes.ModuleName: nil, schedulertypes.ModuleName: nil, oracletypes.ModuleName: nil, alliancemoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner}, alliancemoduletypes.RewardsPoolName: nil, + cwicatypes.ModuleName: nil, } ) @@ -281,14 +299,17 @@ type App struct { ICAControllerKeeper icacontrollerkeeper.Keeper ICAHostKeeper icahostkeeper.Keeper - EvidenceKeeper evidencekeeper.Keeper - TransferKeeper ibctransferkeeper.Keeper - FeeGrantKeeper feegrantkeeper.Keeper - WasmKeeper wasmkeeper.Keeper - DenomKeeper *denomkeeper.Keeper - SchedulerKeeper schedulerkeeper.Keeper - OracleKeeper oraclekeeper.Keeper - AllianceKeeper alliancemodulekeeper.Keeper + EvidenceKeeper evidencekeeper.Keeper + TransferKeeper ibctransferkeeper.Keeper + FeeGrantKeeper feegrantkeeper.Keeper + WasmKeeper wasmkeeper.Keeper + DenomKeeper *denomkeeper.Keeper + BatchKeeper batchkeeper.Keeper + SchedulerKeeper schedulerkeeper.Keeper + OracleKeeper oraclekeeper.Keeper + AllianceKeeper alliancemodulekeeper.Keeper + CwICAKeeper cwicakeeper.Keeper + WasmClientKeeper ibcwasmkeeper.Keeper // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper @@ -297,6 +318,7 @@ type App struct { ScopedIBCFeeKeeper capabilitykeeper.ScopedKeeper ScopedICAHostKeeper capabilitykeeper.ScopedKeeper ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper + ScopedCwICAKeeper capabilitykeeper.ScopedKeeper // ModuleManager is the module manager ModuleManager *module.Manager @@ -350,6 +372,7 @@ func New( ibcexported.StoreKey, ibctransfertypes.StoreKey, ibcfeetypes.StoreKey, + ibcwasmtypes.StoreKey, wasmtypes.StoreKey, icahosttypes.StoreKey, @@ -357,7 +380,9 @@ func New( denomtypes.StoreKey, schedulertypes.StoreKey, oracletypes.StoreKey, + batchtypes.StoreKey, AllianceStoreKey, + cwicatypes.StoreKey, ) tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) @@ -561,6 +586,16 @@ func New( ) icaModule := ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper) + // Create CwIca Keeper + scopedCwICAKeeper := app.CapabilityKeeper.ScopeToModule(cwicatypes.ModuleName) + app.CwICAKeeper = cwicakeeper.NewKeeper( + appCodec, + keys[cwicatypes.StoreKey], + app.ICAControllerKeeper, + scopedCwICAKeeper, + &app.WasmKeeper, + ) + // Create Transfer Keepers app.TransferKeeper = ibctransferkeeper.NewKeeper( appCodec, @@ -605,6 +640,14 @@ func New( app.DenomKeeper = &denomKeeper + app.BatchKeeper = batchkeeper.NewKeeper( + appCodec, + app.keys[batchtypes.StoreKey], + app.BankKeeper, + app.DistrKeeper, + app.StakingKeeper, + ) + scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasmtypes.ModuleName) wasmDir := filepath.Join(homePath, "wasm") wasmConfig, err := wasm.ReadWasmConfig(appOpts) @@ -614,13 +657,31 @@ func New( // The last arguments can contain custom message handlers, and custom query handlers, // if we want to allow any custom callbacks - availableCapabilities := "iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2" + availableCapabilities := "iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4" + + wasmer, err := wasmvm.NewVM( + filepath.Join(wasmDir, "wasm"), + availableCapabilities, + 32, // wasmkeeper.contractMemoryLimit, + wasmConfig.ContractDebugMode, + wasmConfig.MemoryCacheSize, + ) + if err != nil { + panic(err) + } + wasmOpts = append(wasmbinding.RegisterCustomPlugins( app.BankKeeper, app.OracleKeeper, *app.DenomKeeper, + *app.IBCKeeper, + app.CwICAKeeper, + app.ICAControllerKeeper, + keys[ibcexported.StoreKey], ), wasmOpts...) + wasmOpts = append(wasmOpts, wasmkeeper.WithWasmEngine(wasmer)) + app.WasmKeeper = wasmkeeper.NewKeeper( appCodec, keys[wasmtypes.StoreKey], @@ -683,6 +744,15 @@ func New( ), ) + app.WasmClientKeeper = ibcwasmkeeper.NewKeeperWithVM( + appCodec, + keys[ibcwasmtypes.StoreKey], + app.IBCKeeper.ClientKeeper, + authority, + wasmer, + app.GRPCQueryRouter(), + ) + // Create Transfer Stack var transferStack ibcporttypes.IBCModule transferStack = transfer.NewIBCModule(app.TransferKeeper) @@ -694,8 +764,9 @@ func New( var icaControllerStack ibcporttypes.IBCModule // integration point for custom authentication modules // see https://medium.com/the-interchain-foundation/ibc-go-v6-changes-to-interchain-accounts-and-how-it-impacts-your-chain-806c185300d7 - var noAuthzModule ibcporttypes.IBCModule - icaControllerStack = icacontroller.NewIBCMiddleware(noAuthzModule, app.ICAControllerKeeper) + + icaControllerStack = cwica.NewIBCModule(app.CwICAKeeper) + icaControllerStack = icacontroller.NewIBCMiddleware(icaControllerStack, app.ICAControllerKeeper) icaControllerStack = ibcfee.NewIBCMiddleware(icaControllerStack, app.IBCFeeKeeper) // RecvPacket, message that originates from core IBC and goes down to app, the flow is: @@ -715,6 +786,7 @@ func New( AddRoute(ibctransfertypes.ModuleName, transferStack). AddRoute(wasmtypes.ModuleName, wasmStack). AddRoute(icacontrollertypes.SubModuleName, icaControllerStack). + AddRoute(cwicatypes.ModuleName, icaControllerStack). AddRoute(icahosttypes.SubModuleName, icaHostStack) app.IBCKeeper.SetRouter(ibcRouter) @@ -845,6 +917,13 @@ func New( app.BankKeeper, ), + batch.NewAppModule( + appCodec, + app.BatchKeeper, + app.AccountKeeper, + app.BankKeeper, + ), + icaModule, scheduler.NewAppModule( @@ -872,11 +951,15 @@ func New( app.GetSubspace(alliancemoduletypes.ModuleName), ), + cwica.NewAppModule(appCodec, app.CwICAKeeper), + crisis.NewAppModule( app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName), ), + + ibcwasm.NewAppModule(app.WasmClientKeeper), ) // During begin block slashing happens after distr.BeginBlocker so that @@ -908,9 +991,12 @@ func New( wasmtypes.ModuleName, denomtypes.ModuleName, + batchtypes.ModuleName, schedulertypes.ModuleName, oracletypes.ModuleName, alliancemoduletypes.ModuleName, + cwicatypes.ModuleName, + ibcwasmtypes.ModuleName, ) app.ModuleManager.SetOrderEndBlockers( @@ -938,9 +1024,12 @@ func New( wasmtypes.ModuleName, denomtypes.ModuleName, + batchtypes.ModuleName, schedulertypes.ModuleName, oracletypes.ModuleName, alliancemoduletypes.ModuleName, + cwicatypes.ModuleName, + ibcwasmtypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -973,12 +1062,14 @@ func New( consensusparamtypes.ModuleName, icatypes.ModuleName, ibcfeetypes.ModuleName, - + ibcwasmtypes.ModuleName, denomtypes.ModuleName, + batchtypes.ModuleName, schedulertypes.ModuleName, oracletypes.ModuleName, alliancemoduletypes.ModuleName, wasmtypes.ModuleName, + cwicatypes.ModuleName, ) app.ModuleManager.RegisterInvariants(app.CrisisKeeper) @@ -1034,6 +1125,7 @@ func New( if manager := app.SnapshotManager(); manager != nil { err := manager.RegisterExtensions( wasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), &app.WasmKeeper), + ibcwasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), &app.WasmClientKeeper), ) if err != nil { panic(fmt.Errorf("failed to register snapshot extension: %s", err)) @@ -1064,6 +1156,13 @@ func New( if err := app.LoadLatestVersion(); err != nil { tmos.Exit(err.Error()) } + + ctx := app.BaseApp.NewUncachedContext(true, tmproto.Header{}) + + // Initialize pinned codes in wasmvm as they are not persisted there + if err := app.WasmKeeper.InitializePinnedCodes(ctx); err != nil { + panic(fmt.Sprintf("failed initialize pinned codes %s", err)) + } } app.ScopedIBCKeeper = scopedIBCKeeper @@ -1071,6 +1170,7 @@ func New( app.ScopedWasmKeeper = scopedWasmKeeper app.ScopedICAHostKeeper = scopedICAHostKeeper app.ScopedICAControllerKeeper = scopedICAControllerKeeper + app.ScopedCwICAKeeper = scopedCwICAKeeper return app } @@ -1146,22 +1246,6 @@ func (app *App) ModuleAccountAddrs() map[string]bool { return modAccAddrs } -// LegacyAmino returns SimApp's amino codec. -// -// NOTE: This is solely to be used for testing purposes as it may be desirable -// for modules to register their own custom testing types. -func (app *App) LegacyAmino() *codec.LegacyAmino { - return app.cdc -} - -// AppCodec returns an app codec. -// -// NOTE: This is solely to be used for testing purposes as it may be desirable -// for modules to register their own custom testing types. -func (app *App) AppCodec() codec.Codec { - return app.appCodec -} - // InterfaceRegistry returns an InterfaceRegistry func (app *App) InterfaceRegistry() types.InterfaceRegistry { return app.interfaceRegistry @@ -1177,35 +1261,6 @@ func (app *App) DefaultGenesis() map[string]json.RawMessage { return ModuleBasics.DefaultGenesis(app.appCodec) } -// GetKey returns the KVStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetKey(storeKey string) *storetypes.KVStoreKey { - return app.keys[storeKey] -} - -// GetTKey returns the TransientStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetTKey(storeKey string) *storetypes.TransientStoreKey { - return app.tkeys[storeKey] -} - -// GetMemKey returns the MemStoreKey for the provided mem key. -// -// NOTE: This is solely used for testing purposes. -func (app *App) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { - return app.memKeys[storeKey] -} - -// GetSubspace returns a param subspace for a given module name. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetSubspace(moduleName string) paramstypes.Subspace { - subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) - return subspace -} - // RegisterAPIRoutes registers all application module routes with the provided // API server. func (app *App) RegisterAPIRoutes(apiSvr *api.Server, _ config.APIConfig) { @@ -1266,6 +1321,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(wasmtypes.ModuleName) paramsKeeper.Subspace(schedulertypes.ModuleName) paramsKeeper.Subspace(oracletypes.ModuleName) + paramsKeeper.Subspace(batchtypes.ModuleName) paramsKeeper.Subspace(alliancemoduletypes.ModuleName) return paramsKeeper diff --git a/app/openapiconsole/console.go b/app/openapiconsole/console.go index 465f5bbb..dd50faad 100644 --- a/app/openapiconsole/console.go +++ b/app/openapiconsole/console.go @@ -13,7 +13,7 @@ var index embed.FS func Handler(title, specURL string) http.HandlerFunc { t, _ := template.ParseFS(index, "index.tpl") - return func(w http.ResponseWriter, req *http.Request) { + return func(w http.ResponseWriter, _ *http.Request) { t.Execute(w, struct { //nolint:errcheck Title string URL string diff --git a/app/testing.go b/app/testing.go new file mode 100644 index 00000000..bd515546 --- /dev/null +++ b/app/testing.go @@ -0,0 +1,73 @@ +package app + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + ibctestingtypes "github.com/cosmos/ibc-go/v7/testing/types" +) + +// GetKey returns the KVStoreKey for the provided store key. +// +// NOTE: This is solely to be used for testing purposes. +func (app *App) GetKey(storeKey string) *storetypes.KVStoreKey { + return app.keys[storeKey] +} + +// GetTKey returns the TransientStoreKey for the provided store key. +// +// NOTE: This is solely to be used for testing purposes. +func (app *App) GetTKey(storeKey string) *storetypes.TransientStoreKey { + return app.tkeys[storeKey] +} + +// GetMemKey returns the MemStoreKey for the provided mem key. +// +// NOTE: This is solely used for testing purposes. +func (app *App) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { + return app.memKeys[storeKey] +} + +// GetSubspace returns a param subspace for a given module name. +// +// NOTE: This is solely to be used for testing purposes. +func (app *App) GetSubspace(moduleName string) paramstypes.Subspace { + subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) + return subspace +} + +// IBC Testing +func (app *App) GetStakingKeeper() ibctestingtypes.StakingKeeper { + return app.StakingKeeper +} + +func (app *App) GetIBCKeeper() *ibckeeper.Keeper { + return app.IBCKeeper +} + +func (app *App) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { + return app.ScopedIBCKeeper +} + +func (app *App) GetTxConfig() client.TxConfig { + return app.txConfig +} + +// LegacyAmino returns SimApp's amino codec. +// +// NOTE: This is solely to be used for testing purposes as it may be desirable +// for modules to register their own custom testing types. +func (app *App) LegacyAmino() *codec.LegacyAmino { + return app.cdc +} + +// AppCodec returns an app codec. +// +// NOTE: This is solely to be used for testing purposes as it may be desirable +// for modules to register their own custom testing types. +func (app *App) AppCodec() codec.Codec { + return app.appCodec +} diff --git a/app/upgrades.go b/app/upgrades.go index 86a50e3a..ceb618b0 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -1,14 +1,36 @@ package app import ( + batchtypes "github.com/Team-Kujira/core/x/batch/types" + cwicatypes "github.com/Team-Kujira/core/x/cw-ica/types" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + ibcwasmtypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types" ) -const UpgradeName = "v0.9.3" +const UpgradeName = "v1.0.0" func (app App) RegisterUpgradeHandlers() { + upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() + if err != nil { + panic(err) + } + + if upgradeInfo.Name == UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + storeUpgrades := storetypes.StoreUpgrades{ + Added: []string{ + ibcwasmtypes.ModuleName, + batchtypes.ModuleName, + cwicatypes.ModuleName, + }, + } + + // configure store loader that checks if version == upgradeHeight and applies store upgrades + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) + } + app.UpgradeKeeper.SetUpgradeHandler( UpgradeName, func(ctx sdk.Context, diff --git a/cmd/kujirad/cmd/root.go b/cmd/kujirad/cmd/root.go index b18f0f0b..067e12e0 100644 --- a/cmd/kujirad/cmd/root.go +++ b/cmd/kujirad/cmd/root.go @@ -31,6 +31,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" + ibcwasmcli "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/client/cli" "github.com/spf13/cobra" ) @@ -229,6 +230,7 @@ func txCommand() *cobra.Command { ) app.ModuleBasics.AddTxCommands(cmd) + cmd.AddCommand(ibcwasmcli.NewTxCmd()) cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") return cmd diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index 23fbc66b..50b0c9dd 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -1,52 +1,44 @@ - # Protobuf Documentation - - - ## Table of Contents - - - [kujira/scheduler/params.proto](#kujira/scheduler/params.proto) - - [Params](#kujira.scheduler.Params) - - - [kujira/scheduler/hook.proto](#kujira/scheduler/hook.proto) - - [Hook](#kujira.scheduler.Hook) - - - [kujira/scheduler/genesis.proto](#kujira/scheduler/genesis.proto) - - [GenesisState](#kujira.scheduler.GenesisState) - - - [kujira/scheduler/proposal.proto](#kujira/scheduler/proposal.proto) - - [CreateHookProposal](#kujira.scheduler.CreateHookProposal) - - [DeleteHookProposal](#kujira.scheduler.DeleteHookProposal) - - [UpdateHookProposal](#kujira.scheduler.UpdateHookProposal) - - - [kujira/scheduler/query.proto](#kujira/scheduler/query.proto) - - [QueryAllHookRequest](#kujira.scheduler.QueryAllHookRequest) - - [QueryAllHookResponse](#kujira.scheduler.QueryAllHookResponse) - - [QueryGetHookRequest](#kujira.scheduler.QueryGetHookRequest) - - [QueryGetHookResponse](#kujira.scheduler.QueryGetHookResponse) - - [QueryParamsRequest](#kujira.scheduler.QueryParamsRequest) - - [QueryParamsResponse](#kujira.scheduler.QueryParamsResponse) - - - [Query](#kujira.scheduler.Query) - - - [Scalar Value Types](#scalar-value-types) - - - - -

Top

- ## kujira/scheduler/params.proto - +# Protobuf Documentation + + + +## Table of Contents + +- [Protobuf Documentation](#protobuf-documentation) + - [Table of Contents](#table-of-contents) + - [kujira/scheduler/params.proto](#kujiraschedulerparamsproto) + - [Params](#params) + - [kujira/scheduler/hook.proto](#kujiraschedulerhookproto) + - [Hook](#hook) + - [kujira/scheduler/genesis.proto](#kujiraschedulergenesisproto) + - [GenesisState](#genesisstate) + - [kujira/scheduler/proposal.proto](#kujiraschedulerproposalproto) + - [CreateHookProposal](#createhookproposal) + - [DeleteHookProposal](#deletehookproposal) + - [UpdateHookProposal](#updatehookproposal) + - [kujira/scheduler/query.proto](#kujiraschedulerqueryproto) + - [QueryAllHookRequest](#queryallhookrequest) + - [QueryAllHookResponse](#queryallhookresponse) + - [QueryGetHookRequest](#querygethookrequest) + - [QueryGetHookResponse](#querygethookresponse) + - [QueryParamsRequest](#queryparamsrequest) + - [QueryParamsResponse](#queryparamsresponse) + - [Query](#query) + - [Scalar Value Types](#scalar-value-types) + + + +

Top

- - +## kujira/scheduler/params.proto - ### Params - Params defines the parameters for the module. + - +### Params - +Params defines the parameters for the module. @@ -56,33 +48,24 @@ - - - -

Top

+ - ## kujira/scheduler/hook.proto - +

Top

- - +## kujira/scheduler/hook.proto - ### Hook - + - - | Field | Type | Label | Description | - | ----- | ---- | ----- | ----------- | - | `id` | [uint64](#uint64) | | | - | `executor` | [string](#string) | | | - | `contract` | [string](#string) | | | - | `msg` | [bytes](#bytes) | | | - | `frequency` | [int64](#int64) | | | - | `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | - - +### Hook - +| Field | Type | Label | Description | +| ----------- | ----------------------------------------------------- | -------- | ----------- | +| `id` | [uint64](#uint64) | | | +| `executor` | [string](#string) | | | +| `contract` | [string](#string) | | | +| `msg` | [bytes](#bytes) | | | +| `frequency` | [int64](#int64) | | | +| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | @@ -92,30 +75,23 @@ - - - + +

Top

- ## kujira/scheduler/genesis.proto - +## kujira/scheduler/genesis.proto - - + - ### GenesisState - GenesisState defines the scheduler module's genesis state. +### GenesisState - - | Field | Type | Label | Description | - | ----- | ---- | ----- | ----------- | - | `params` | [Params](#kujira.scheduler.Params) | | | - | `hookList` | [Hook](#kujira.scheduler.Hook) | repeated | | - | `hookCount` | [uint64](#uint64) | | | - - +GenesisState defines the scheduler module's genesis state. - +| Field | Type | Label | Description | +| ----------- | ---------------------------------- | -------- | ----------- | +| `params` | [Params](#kujira.scheduler.Params) | | | +| `hookList` | [Hook](#kujira.scheduler.Hook) | repeated | | +| `hookCount` | [uint64](#uint64) | | | @@ -125,175 +101,113 @@ - - - + +

Top

- ## kujira/scheduler/proposal.proto - - - - - - ### CreateHookProposal - - - - | Field | Type | Label | Description | - | ----- | ---- | ----- | ----------- | - | `title` | [string](#string) | | Title is a short summary | - | `description` | [string](#string) | | Description is a human readable text | - | `executor` | [string](#string) | | The account that will execute the msg on the schedule | - | `contract` | [string](#string) | | The contract that the msg is called on | - | `msg` | [bytes](#bytes) | | | - | `frequency` | [int64](#int64) | | | - | `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | - - - - - - - - - ### DeleteHookProposal - - - - | Field | Type | Label | Description | - | ----- | ---- | ----- | ----------- | - | `title` | [string](#string) | | Title is a short summary | - | `description` | [string](#string) | | Description is a human readable text | - | `id` | [uint64](#uint64) | | | - - - - - - - - - ### UpdateHookProposal - - - - | Field | Type | Label | Description | - | ----- | ---- | ----- | ----------- | - | `title` | [string](#string) | | Title is a short summary | - | `description` | [string](#string) | | Description is a human readable text | - | `id` | [uint64](#uint64) | | | - | `executor` | [string](#string) | | | - | `contract` | [string](#string) | | | - | `msg` | [bytes](#bytes) | | | - | `frequency` | [int64](#int64) | | | - | `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | - - - - +## kujira/scheduler/proposal.proto - + - +### CreateHookProposal - +| Field | Type | Label | Description | +| ------------- | ----------------------------------------------------- | -------- | ----------------------------------------------------- | +| `title` | [string](#string) | | Title is a short summary | +| `description` | [string](#string) | | Description is a human readable text | +| `executor` | [string](#string) | | The account that will execute the msg on the schedule | +| `contract` | [string](#string) | | The contract that the msg is called on | +| `msg` | [bytes](#bytes) | | | +| `frequency` | [int64](#int64) | | | +| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | - + - - - -

Top

+### DeleteHookProposal - ## kujira/scheduler/query.proto - +| Field | Type | Label | Description | +| ------------- | ----------------- | ----- | ------------------------------------ | +| `title` | [string](#string) | | Title is a short summary | +| `description` | [string](#string) | | Description is a human readable text | +| `id` | [uint64](#uint64) | | | - - + - ### QueryAllHookRequest - +### UpdateHookProposal - - | Field | Type | Label | Description | - | ----- | ---- | ----- | ----------- | - | `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | | - - +| Field | Type | Label | Description | +| ------------- | ----------------------------------------------------- | -------- | ------------------------------------ | +| `title` | [string](#string) | | Title is a short summary | +| `description` | [string](#string) | | Description is a human readable text | +| `id` | [uint64](#uint64) | | | +| `executor` | [string](#string) | | | +| `contract` | [string](#string) | | | +| `msg` | [bytes](#bytes) | | | +| `frequency` | [int64](#int64) | | | +| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | - + + + + + + + + + + +

Top

- - +## kujira/scheduler/query.proto - ### QueryAllHookResponse - + - - | Field | Type | Label | Description | - | ----- | ---- | ----- | ----------- | - | `Hook` | [Hook](#kujira.scheduler.Hook) | repeated | | - | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | | - - +### QueryAllHookRequest - +| Field | Type | Label | Description | +| ------------ | ------------------------------------------------------------------------------- | ----- | ----------- | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | | - - + - ### QueryGetHookRequest - +### QueryAllHookResponse - - | Field | Type | Label | Description | - | ----- | ---- | ----- | ----------- | - | `id` | [uint64](#uint64) | | | - - +| Field | Type | Label | Description | +| ------------ | --------------------------------------------------------------------------------- | -------- | ----------- | +| `Hook` | [Hook](#kujira.scheduler.Hook) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | | - + - - +### QueryGetHookRequest - ### QueryGetHookResponse - +| Field | Type | Label | Description | +| ----- | ----------------- | ----- | ----------- | +| `id` | [uint64](#uint64) | | | - - | Field | Type | Label | Description | - | ----- | ---- | ----- | ----------- | - | `Hook` | [Hook](#kujira.scheduler.Hook) | | | - - + - +### QueryGetHookResponse - - +| Field | Type | Label | Description | +| ------ | ------------------------------ | ----- | ----------- | +| `Hook` | [Hook](#kujira.scheduler.Hook) | | | - ### QueryParamsRequest - QueryParamsRequest is request type for the Query/Params RPC method. + - +### QueryParamsRequest - +QueryParamsRequest is request type for the Query/Params RPC method. - - + - ### QueryParamsResponse - QueryParamsResponse is response type for the Query/Params RPC method. +### QueryParamsResponse - - | Field | Type | Label | Description | - | ----- | ---- | ----- | ----------- | - | `params` | [Params](#kujira.scheduler.Params) | | params holds all the parameters of this module. | - - +QueryParamsResponse is response type for the Query/Params RPC method. - +| Field | Type | Label | Description | +| -------- | ---------------------------------- | ----- | ----------------------------------------------- | +| `params` | [Params](#kujira.scheduler.Params) | | params holds all the parameters of this module. | @@ -301,39 +215,36 @@ - - + + +### Query + +Query defines the gRPC querier service. - ### Query - Query defines the gRPC querier service. +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------------------------------------------------------ | -------------------------------------------------------------- | ------------------------------------------------ | --------- | --------------------------- | +| `Params` | [QueryParamsRequest](#kujira.scheduler.QueryParamsRequest) | [QueryParamsResponse](#kujira.scheduler.QueryParamsResponse) | Parameters queries the parameters of the module. | GET | /kujira/scheduler/params | +| `Hook` | [QueryGetHookRequest](#kujira.scheduler.QueryGetHookRequest) | [QueryGetHookResponse](#kujira.scheduler.QueryGetHookResponse) | Queries a Hook by id. | GET | /kujira/scheduler/hook/{id} | +| `HookAll` | [QueryAllHookRequest](#kujira.scheduler.QueryAllHookRequest) | [QueryAllHookResponse](#kujira.scheduler.QueryAllHookResponse) | Queries a list of Hook items. | GET | /kujira/scheduler/hook | - | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | - | ----------- | ------------ | ------------- | ------------| ------- | -------- | - | `Params` | [QueryParamsRequest](#kujira.scheduler.QueryParamsRequest) | [QueryParamsResponse](#kujira.scheduler.QueryParamsResponse) | Parameters queries the parameters of the module. | GET|/kujira/scheduler/params| - | `Hook` | [QueryGetHookRequest](#kujira.scheduler.QueryGetHookRequest) | [QueryGetHookResponse](#kujira.scheduler.QueryGetHookResponse) | Queries a Hook by id. | GET|/kujira/scheduler/hook/{id}| - | `HookAll` | [QueryAllHookRequest](#kujira.scheduler.QueryAllHookRequest) | [QueryAllHookResponse](#kujira.scheduler.QueryAllHookResponse) | Queries a list of Hook items. | GET|/kujira/scheduler/hook| - - - - ## Scalar Value Types - - | .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | - | ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | - | double | | double | double | float | float64 | double | float | Float | - | float | | float | float | float | float32 | float | float | Float | - | int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | - | int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | - | uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | - | uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | - | sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | - | sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | - | fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | - | fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | - | sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | - | sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | - | bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | - | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | - | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | - \ No newline at end of file +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------- | ----------- | ------- | ---------- | -------------- | ------------------------------ | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | diff --git a/go.mod b/go.mod index 69424514..39a9c8f9 100644 --- a/go.mod +++ b/go.mod @@ -1,20 +1,24 @@ module github.com/Team-Kujira/core -go 1.20 +go 1.21 + +toolchain go1.21.8 require ( - cosmossdk.io/errors v1.0.0 - cosmossdk.io/math v1.1.2 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/math v1.2.0 cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462 cosmossdk.io/tools/rosetta v0.2.1 github.com/CosmWasm/wasmd v0.45.0 - github.com/CosmWasm/wasmvm v1.5.1 - github.com/cometbft/cometbft v0.37.2 + github.com/CosmWasm/wasmvm v1.5.2 + github.com/armon/go-metrics v0.4.1 + github.com/cometbft/cometbft v0.37.4 github.com/cometbft/cometbft-db v0.8.0 github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.47.5 + github.com/cosmos/cosmos-sdk v0.47.8 github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ibc-go/v7 v7.3.0 + github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20231213092633-b306e7a706e1 + github.com/cosmos/ibc-go/v7 v7.3.2 github.com/golang/protobuf v1.5.3 github.com/google/gofuzz v1.2.0 github.com/gorilla/mux v1.8.0 @@ -24,28 +28,27 @@ require ( github.com/spf13/cast v1.5.1 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 - github.com/terra-money/alliance v0.3.2 - google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e - google.golang.org/grpc v1.57.0 + github.com/terra-money/alliance v0.3.5 + google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 + google.golang.org/grpc v1.60.1 gopkg.in/yaml.v2 v2.4.0 ) require ( - cloud.google.com/go v0.110.6 // indirect - cloud.google.com/go/compute v1.23.0 // indirect + cloud.google.com/go v0.111.0 // indirect + cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.1 // indirect + cloud.google.com/go/iam v1.1.5 // indirect cloud.google.com/go/storage v1.30.1 // indirect cosmossdk.io/api v0.3.1 // indirect cosmossdk.io/core v0.6.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect - cosmossdk.io/log v1.2.1 // indirect + cosmossdk.io/log v1.3.0 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect - github.com/armon/go-metrics v0.4.1 // indirect + github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect github.com/aws/aws-sdk-go v1.44.203 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect @@ -66,7 +69,7 @@ require ( github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v0.20.1 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect + github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect github.com/creachadair/taskgroup v0.4.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect @@ -85,20 +88,22 @@ require ( github.com/go-kit/kit v0.12.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.2.4 // indirect + github.com/go-logr/stdr v1.2.2 // 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 - github.com/golang/glog v1.1.0 // indirect + github.com/golang/glog v1.1.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/google/s2a-go v0.1.4 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect - github.com/googleapis/gax-go/v2 v2.11.0 // indirect + github.com/google/s2a-go v0.1.7 // indirect + github.com/google/uuid v1.4.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect + github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect @@ -118,7 +123,7 @@ require ( 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/klauspost/compress v1.16.3 // indirect + github.com/klauspost/compress v1.16.7 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -127,7 +132,7 @@ require ( 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 - github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect @@ -146,7 +151,7 @@ require ( github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.30.0 // indirect + github.com/rs/zerolog v1.31.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect @@ -157,24 +162,26 @@ require ( github.com/tendermint/go-amino v0.16.0 // indirect github.com/tidwall/btree v1.6.0 // indirect github.com/ulikunitz/xz v0.5.11 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.12.0 // indirect + go.opentelemetry.io/otel v1.19.0 // indirect + go.opentelemetry.io/otel/metric v1.19.0 // indirect + go.opentelemetry.io/otel/trace v1.19.0 // indirect + golang.org/x/crypto v0.16.0 // indirect golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // indirect - golang.org/x/net v0.14.0 // indirect - golang.org/x/oauth2 v0.8.0 // indirect - golang.org/x/sync v0.2.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/term v0.11.0 // indirect - golang.org/x/text v0.12.0 // indirect - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.126.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 // indirect - google.golang.org/protobuf v1.31.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/oauth2 v0.13.0 // indirect + golang.org/x/sync v0.4.0 // indirect + golang.org/x/sys v0.16.0 // indirect + golang.org/x/term v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/api v0.149.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect + google.golang.org/protobuf v1.32.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/go.sum b/go.sum index c34dc30d..19d41073 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.110.6 h1:8uYAkj3YHTP/1iwReuHPxLSbdcyc+dSBbzFMrVwDR6Q= -cloud.google.com/go v0.110.6/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= +cloud.google.com/go v0.111.0 h1:YHLKNupSD1KqjDbQ3+LVdQ81h/UJbJyZG203cEfnQgM= +cloud.google.com/go v0.111.0/go.mod h1:0mibmpKP1TyOOFYQY5izo0LnT+ecvOQ0Sg3OdmMiNRU= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -73,8 +73,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= -cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= +cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= @@ -114,8 +114,8 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v1.1.1 h1:lW7fzj15aVIXYHREOqjRBV9PsH0Z6u8Y46a1YGvQP4Y= -cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= +cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= +cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= @@ -197,12 +197,12 @@ cosmossdk.io/core v0.6.1 h1:OBy7TI2W+/gyn2z40vVvruK3di+cAluinA6cybFbE7s= cosmossdk.io/core v0.6.1/go.mod h1:g3MMBCBXtxbDWBURDVnJE7XML4BG5qENhs0gzkcpuFA= 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/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= -cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= -cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk= -cosmossdk.io/log v1.2.1/go.mod h1:GNSCc/6+DhFIj1aLn/j7Id7PaO8DzNylUZoOYBL9+I4= -cosmossdk.io/math v1.1.2 h1:ORZetZCTyWkI5GlZ6CZS28fMHi83ZYf+A2vVnHNzZBM= -cosmossdk.io/math v1.1.2/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= +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.0 h1:L0Z0XstClo2kOU4h3V1iDoE5Ji64sg5HLOogzGg67Oo= +cosmossdk.io/log v1.3.0/go.mod h1:HIDyvWLqZe2ovlWabsDN4aPMpY/nUEquAhgfTf2ZzB8= +cosmossdk.io/math v1.2.0 h1:8gudhTkkD3NxOP2YyyJIYYmt6dQ55ZfJkDOaxXpy7Ig= +cosmossdk.io/math v1.2.0/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462 h1:g8muUHnXL8vhld2Sjilyhb1UQObc+x9GVuDK43TYZns= cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462/go.mod h1:4Dd3NLoLYoN90kZ0uyHoTHzVVk9+J0v4HhZRBNTAq2c= cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= @@ -219,20 +219,23 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3 github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/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/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= +github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= +github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= github.com/CosmWasm/wasmd v0.45.0 h1:9zBqrturKJwC2kVsfHvbrA++EN0PS7UTXCffCGbg6JI= github.com/CosmWasm/wasmd v0.45.0/go.mod h1:RnSAiqbNIZu4QhO+0pd7qGZgnYAMBPGmXpzTADag944= -github.com/CosmWasm/wasmvm v1.5.1 h1:2MHN9uFyHP6pxfvpBJ0JW6ujvAIBk9kQk283zyri0Ro= -github.com/CosmWasm/wasmvm v1.5.1/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc= +github.com/CosmWasm/wasmvm v1.5.2 h1:+pKB1Mz9GZVt1vadxB+EDdD1FOz3dMNjIKq/58/lrag= +github.com/CosmWasm/wasmvm v1.5.2/go.mod h1:Q0bSEtlktzh7W2hhEaifrFp1Erx11ckQZmjq8FLCyys= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -245,6 +248,7 @@ github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrd github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -301,6 +305,7 @@ github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJ 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.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= +github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= 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= @@ -317,6 +322,7 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= +github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= @@ -375,8 +381,8 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= -github.com/cometbft/cometbft v0.37.2 h1:XB0yyHGT0lwmJlFmM4+rsRnczPlHoAKFX6K8Zgc2/Jc= -github.com/cometbft/cometbft v0.37.2/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= +github.com/cometbft/cometbft v0.37.4 h1:xyvvEqlyfK8MgNIIKVJaMsuIp03wxOcFmVkT26+Ikpg= +github.com/cometbft/cometbft v0.37.4/go.mod h1:Cmg5Hp4sNpapm7j+x0xRyt2g0juQfmB752ous+pA0G8= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= @@ -386,6 +392,7 @@ github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a/go.mod h1:9ItSM github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= github.com/consensys/gnark-crypto v0.5.3/go.mod h1:hOdPlWQV1gDLp7faZVeg8Y0iEPFaOUnCc4XeCCk96p0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -396,8 +403,8 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.47.5 h1:n1+WjP/VM/gAEOx3TqU2/Ny734rj/MX1kpUnn7zVJP8= -github.com/cosmos/cosmos-sdk v0.47.5/go.mod h1:EHwCeN9IXonsjKcjpS12MqeStdZvIdxt3VYXhus3G3c= +github.com/cosmos/cosmos-sdk v0.47.8 h1:kzYF2xhnfi8dy15t2VVS24tc2KcuU4JBgjh9yCFx4y4= +github.com/cosmos/cosmos-sdk v0.47.8/go.mod h1:VTAtthIsmfplanhFfUTfT6ED4F+kkJxT7nmvmKXRthI= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -408,12 +415,14 @@ github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoK github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20231213092633-b306e7a706e1 h1:fCtG9qasnNzhgxGR1jM9eBufZ5WQVpy0KdaOpKRfg8Y= +github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20231213092633-b306e7a706e1/go.mod h1:h114vYKBtI5zKBeSyr8y5JZ8ZtpQJInO4TYww2IQr6o= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= -github.com/cosmos/ledger-cosmos-go v0.12.2/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= +github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= +github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= @@ -460,7 +469,9 @@ github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m3 github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -494,9 +505,11 @@ github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= 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= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -515,6 +528,7 @@ github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -530,6 +544,11 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +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.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= @@ -567,8 +586,8 @@ github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= +github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -629,8 +648,9 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -642,6 +662,7 @@ github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIG github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -660,19 +681,20 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= -github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +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/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/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.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= -github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -682,8 +704,8 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4= -github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= +github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= +github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -789,6 +811,7 @@ github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1C github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -823,8 +846,8 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs 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.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY= -github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= +github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5 h1:2U0HzY8BJ8hVwDKIzp7y4voR9CX/nvcfymLmg2UiOio= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= @@ -874,7 +897,6 @@ github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -885,8 +907,9 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +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.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -946,6 +969,7 @@ github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= 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= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -956,16 +980,20 @@ github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= +github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -976,6 +1004,7 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= 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/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= @@ -996,6 +1025,7 @@ github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1061,8 +1091,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.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c= -github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w= +github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= +github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= 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/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1082,6 +1112,7 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -1137,8 +1168,8 @@ 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/terra-money/alliance v0.3.2 h1:MuL3RBw+jXFv4io5PhaBn7jRUBvlJLUzgpD6gx4GCug= -github.com/terra-money/alliance v0.3.2/go.mod h1:HDiUexeXRUkLkLRw5jLQcHuVt1Sx43HfyVl0kfwW3JM= +github.com/terra-money/alliance v0.3.5 h1:7bLlw9ZUNaFFxGYiKyJKB7x2SV2+6lVvMYbmBm3OORU= +github.com/terra-money/alliance v0.3.5/go.mod h1:HDiUexeXRUkLkLRw5jLQcHuVt1Sx43HfyVl0kfwW3JM= github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= @@ -1180,10 +1211,10 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +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.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= @@ -1199,6 +1230,14 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= +go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= +go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= +go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= +go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= +go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= +go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= +go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= 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= @@ -1233,11 +1272,10 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1282,6 +1320,7 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1350,8 +1389,8 @@ golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfS golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= 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= @@ -1377,8 +1416,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.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= 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= @@ -1393,8 +1432,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.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= 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= @@ -1478,7 +1517,6 @@ golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1505,16 +1543,17 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -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.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= 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.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= 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= @@ -1528,8 +1567,8 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= 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= @@ -1600,6 +1639,7 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1664,8 +1704,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o= -google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= +google.golang.org/api v0.149.0 h1:b2CqT6kG+zqJIVKRQ3ELJVLN1PwHZ6DJ3dW8yl82rgY= +google.golang.org/api v0.149.0/go.mod h1:Mwn1B7JTXrzXtnvmzQE2BD6bYZQ8DShKZDZbeN9I7qI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1673,8 +1713,9 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1785,12 +1826,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 h1:L6iMMGrtzgHsWofoFcihmDEMYeDR9KN/ThbPWGrh++g= -google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8= -google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e h1:z3vDksarJxsAKM5dmEGv0GHwE2hKJ096wZra71Vs4sw= -google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 h1:lv6/DhyiFFGsmzxbsUUTOkN29II+zeWHxvT8Lpdxsv0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg= +google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917/go.mod h1:pZqR+glSb11aJ+JQcczCvgf47+duRuzNSKqE8YAQnV0= +google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 h1:s1w3X6gQxwrLEpxnLd/qXTVLgQE2yXwaOaoa6IlY/+o= +google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0/go.mod h1:CAny0tYF+0/9rmDB9fahA9YLzX3+AEVl1qXbv5hhj6c= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 h1:gphdwh0npgs8elJ4T6J+DQJHPVF7RsuJHCfwztUb4J4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= 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= @@ -1832,8 +1873,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.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= @@ -1850,8 +1891,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1889,7 +1930,8 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/proto/batch/genesis.proto b/proto/batch/genesis.proto new file mode 100644 index 00000000..b7e40e8c --- /dev/null +++ b/proto/batch/genesis.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package batch; + +import "gogoproto/gogo.proto"; +import "batch/params.proto"; + +option go_package = "github.com/Team-Kujira/core/x/batch/types"; + +// GenesisState defines the batch module's genesis state. +message GenesisState { + // params defines the paramaters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/proto/batch/params.proto b/proto/batch/params.proto new file mode 100644 index 00000000..61e3515b --- /dev/null +++ b/proto/batch/params.proto @@ -0,0 +1,7 @@ +syntax = "proto3"; +package batch; + +option go_package = "github.com/Team-Kujira/core/x/batch/types"; + +// Params holds parameters for the batch module +message Params {} diff --git a/proto/batch/tx.proto b/proto/batch/tx.proto new file mode 100644 index 00000000..8ed9c2e3 --- /dev/null +++ b/proto/batch/tx.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; +package batch; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; + +option go_package = "github.com/Team-Kujira/core/x/batch/types"; + +// Msg defines the batch Msg service. +service Msg { + // WithdrawAllDelegatorRewards defines a method to withdraw rewards of delegator + // from all staked validators. + rpc WithdrawAllDelegatorRewards(MsgWithdrawAllDelegatorRewards) returns (MsgWithdrawAllDelegatorRewardsResponse); + // BatchResetDelegation defines a method to delegate or undelegate in batches + // from existing delegation and target delegation amount + rpc BatchResetDelegation(MsgBatchResetDelegation) returns (MsgBatchResetDelegationResponse); +} + +// MsgWithdrawAllDelegatorRewards represents delegation withdrawal to a delegator +// from all staked validators. +message MsgWithdrawAllDelegatorRewards { + option (cosmos.msg.v1.signer) = "delegator_address"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgWithdrawAllDelegatorRewardsResponse defines the Msg/WithdrawAllDelegatorRewards response type. +message MsgWithdrawAllDelegatorRewardsResponse { + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +message MsgBatchResetDelegation { + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated string validators = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + repeated string amounts = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int" + ]; +} + +message MsgBatchResetDelegationResponse {} diff --git a/proto/kujira/cwica/callback.proto b/proto/kujira/cwica/callback.proto new file mode 100644 index 00000000..4cb2bd3f --- /dev/null +++ b/proto/kujira/cwica/callback.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package kujira.cwica; + +option go_package = "github.com/Team-Kujira/core/x/cw-ica/types"; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; + +message CallbackData { + string port_id = 1; + string channel_id = 2; + uint64 sequence = 3; + string contract = 4; + string connection_id = 5; + string account_id = 6; + bytes callback = 7; +} diff --git a/proto/kujira/cwica/query.proto b/proto/kujira/cwica/query.proto new file mode 100644 index 00000000..215141c9 --- /dev/null +++ b/proto/kujira/cwica/query.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package kujira.cwica; + +option go_package = "github.com/Team-Kujira/core/x/cw-ica/types"; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; + +// Query defines the gRPC querier service. +service Query { + // QueryInterchainAccount returns the interchain account for given owner address on a given connection pair + rpc InterchainAccount(QueryInterchainAccountRequest) returns (QueryInterchainAccountResponse) { + option (google.api.http).get = "/cw-ica/interchain_account/owner/{owner}/connection/{connection_id}"; + } +} + +// QueryInterchainAccountRequest is the request type for the Query/InterchainAccountAddress RPC +message QueryInterchainAccountRequest { + string owner = 1; + string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string account_id = 3 [(gogoproto.moretags) = "yaml:\"account_id\""]; +} + +// QueryInterchainAccountResponse the response type for the Query/InterchainAccountAddress RPC +message QueryInterchainAccountResponse { + string interchain_account_address = 1 [(gogoproto.moretags) = "yaml:\"interchain_account_address\""]; +} diff --git a/proto/kujira/cwica/tx.proto b/proto/kujira/cwica/tx.proto new file mode 100644 index 00000000..479457ec --- /dev/null +++ b/proto/kujira/cwica/tx.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package kujira.cwica; + +option go_package = "github.com/Team-Kujira/core/x/cw-ica/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +// Msg defines the cwica Msg service. +service Msg { +} diff --git a/readme.md b/readme.md index 409ea181..48cd97a5 100644 --- a/readme.md +++ b/readme.md @@ -3,26 +3,3 @@ **kujira** is a blockchain built using Cosmos SDK and Tendermint and created with [Ignite CLI](https://ignite.com/cli). Please refer to [docs.kujira.app](https://docs.kujira.app/) and join our [Discord](https://t.co/kur923FTZk) for guidance in getting set up. - -## Get started - -Ensure your ignite version is 0.26.1 - -``` -ignite version -``` - -If not, you can download the latest. See [the docs](https://docs.ignite.com/welcome/install#verify-your-ignite-cli-version) for more info - -``` -curl https://get.ignite.com/cli | bash -sudo mv ignite /usr/local/bin/ -``` - -Then start the chain - -``` -ignite chain serve -``` - -`serve` command installs dependencies, builds, initializes, and starts your blockchain in development. diff --git a/scripts/lint.sh b/scripts/lint.sh index 482c942e..d3064c00 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -1 +1 @@ -docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.53.3 golangci-lint run -v +docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.56.2 golangci-lint run -v diff --git a/test/relayer/config/config.lock b/test/relayer/config/config.lock new file mode 100644 index 00000000..e69de29b diff --git a/test/relayer/config/config.yaml b/test/relayer/config/config.yaml new file mode 100644 index 00000000..31c18148 --- /dev/null +++ b/test/relayer/config/config.yaml @@ -0,0 +1,69 @@ +global: + api-listen-addr: :5183 + timeout: 10s + memo: "" + light-cache-size: 20 +chains: + kujira: + type: cosmos + value: + key-directory: test/relayer/keys/kujira + key: rly1 + chain-id: kujira + rpc-addr: http://127.0.0.1:26657 + account-prefix: kujira + keyring-backend: test + gas-adjustment: 1.3 + gas-prices: 0.02ukuji + min-gas-amount: 0 + max-gas-amount: 0 + debug: false + timeout: 20s + block-timeout: "" + output-format: json + sign-mode: direct + extra-codecs: [] + coin-type: null + signing-algorithm: "" + broadcast-mode: batch + min-loop-duration: 0s + extension-options: [] + feegrants: null + terra: + type: cosmos + value: + key-directory: test/relayer/keys/terra + key: rly3 + chain-id: terra + rpc-addr: http://127.0.0.1:26658 + account-prefix: terra + keyring-backend: test + gas-adjustment: 1.3 + gas-prices: 0.02uluna + min-gas-amount: 0 + max-gas-amount: 0 + debug: false + timeout: 20s + block-timeout: "" + output-format: json + sign-mode: direct + extra-codecs: [] + coin-type: null + signing-algorithm: "" + broadcast-mode: batch + min-loop-duration: 0s + extension-options: [] + feegrants: null +paths: + kujira-terra: + src: + chain-id: kujira + client-id: 07-tendermint-0 + connection-id: connection-0 + dst: + chain-id: terra + client-id: 07-tendermint-0 + connection-id: connection-0 + src-channel-filter: + rule: "" + channel-list: [] diff --git a/test/relayer/config/config_temp.yaml b/test/relayer/config/config_temp.yaml new file mode 100644 index 00000000..5a2d0bf2 --- /dev/null +++ b/test/relayer/config/config_temp.yaml @@ -0,0 +1,65 @@ +global: + api-listen-addr: :5183 + timeout: 10s + memo: "" + light-cache-size: 20 +chains: + kujira: + type: cosmos + value: + key-directory: test/relayer/keys/kujira + key: rly1 + chain-id: kujira + rpc-addr: http://127.0.0.1:26657 + account-prefix: kujira + keyring-backend: test + gas-adjustment: 1.3 + gas-prices: 0.02ukuji + min-gas-amount: 0 + max-gas-amount: 0 + debug: false + timeout: 20s + block-timeout: "" + output-format: json + sign-mode: direct + extra-codecs: [] + coin-type: null + signing-algorithm: "" + broadcast-mode: batch + min-loop-duration: 0s + extension-options: [] + feegrants: null + terra: + type: cosmos + value: + key-directory: test/relayer/keys/terra + key: rly3 + chain-id: terra + rpc-addr: http://127.0.0.1:26658 + account-prefix: terra + keyring-backend: test + gas-adjustment: 1.3 + gas-prices: 0.02uluna + min-gas-amount: 0 + max-gas-amount: 0 + debug: false + timeout: 20s + block-timeout: "" + output-format: json + sign-mode: direct + extra-codecs: [] + coin-type: null + signing-algorithm: "" + broadcast-mode: batch + min-loop-duration: 0s + extension-options: [] + feegrants: null +paths: + kujira-terra: + src: + chain-id: kujira + dst: + chain-id: terra + src-channel-filter: + rule: "" + channel-list: [] diff --git a/test/setup_ibc.sh b/test/setup_ibc.sh new file mode 100644 index 00000000..1aaad3a4 --- /dev/null +++ b/test/setup_ibc.sh @@ -0,0 +1,120 @@ +#!/bin/bash + +####################### Config variables & functions ####################### +# Common +VALIDATOR="validator" +NODE_IP="localhost" + +# Main configs +MAIN_CHAIN_ID="kujira" +MAIN_MONIKER="kujira" +MAIN_HOME="$HOME/.kujirad" +MAIN_BINARY="kujirad --home=$MAIN_HOME" +MAIN_TX_FLAGS="--keyring-backend test --chain-id $MAIN_CHAIN_ID --from $VALIDATOR -y --fees=1000ukuji" +MAIN_RPC_LADDR="$NODE_IP:26657" +MAIN_P2P_LADDR="$NODE_IP:26656" +MAIN_GRPC_ADDR="$NODE_IP:9090" + +# Counter configs +COUNTER_CHAIN_ID="terra" +COUNTER_MONIKER="terra" +COUNTER_HOME="$HOME/.terrad" +COUNTER_BINARY="terrad --home=$COUNTER_HOME" +COUNTER_TX_FLAGS="--keyring-backend test --chain-id $COUNTER_CHAIN_ID --from $VALIDATOR -y --fees=1000uluna" +COUNTER_RPC_LADDR="$NODE_IP:26658" +COUNTER_P2P_LADDR="$NODE_IP:26646" +COUNTER_GRPC_ADDR="$NODE_IP:9091" + + +####################### Initializate chains ####################### +echo "==============> Starting chain initialization...<==============" +# Clean start +killall $MAIN_BINARY &> /dev/null || true +killall $COUNTER_BINARY &> /dev/null || true +killall rly 2> /dev/null || true +rm -rf $MAIN_HOME +rm -rf $COUNTER_HOME +rm -rf ./test/relayer/keys +rm -rf ./test/logs +mkdir ./test/logs +cp ./test/relayer/config/config_temp.yaml ./test/relayer/config/config.yaml + +# Main chain init +$MAIN_BINARY init --chain-id $MAIN_CHAIN_ID $MAIN_MONIKER +sed -i '' 's/"voting_period": "172800s"/"voting_period": "30s"/g' $MAIN_HOME/config/genesis.json +sed -i '' 's/"max_deposit_period": "172800s"/"max_deposit_period": "30s"/g' $MAIN_HOME/config/genesis.json +sed -i '' 's/stake/ukuji/g' $MAIN_HOME/config/genesis.json +sed -i -E "s|keyring-backend = \".*\"|keyring-backend = \"test\"|g" $MAIN_HOME/config/client.toml +sed -i -E "s|minimum-gas-prices = \".*\"|minimum-gas-prices = \"0ukuji\"|g" $MAIN_HOME/config/app.toml + +$MAIN_BINARY keys add $VALIDATOR --keyring-backend=test +$MAIN_BINARY genesis add-genesis-account $($MAIN_BINARY keys show $VALIDATOR --keyring-backend=test -a) 1000000000000000000ukuji +$MAIN_BINARY genesis gentx validator 10000000000ukuji --keyring-backend=test --chain-id=$MAIN_CHAIN_ID +$MAIN_BINARY genesis collect-gentxs + +# Counter chain init +$COUNTER_BINARY init --chain-id $COUNTER_CHAIN_ID $COUNTER_MONIKER +sed -i '' 's/"voting_period": "172800s"/"voting_period": "30s"/g' $COUNTER_HOME/config/genesis.json +sed -i '' 's/"max_deposit_period": "172800s"/"max_deposit_period": "30s"/g' $COUNTER_HOME/config/genesis.json +sed -i '' 's/stake/uluna/g' $COUNTER_HOME/config/genesis.json +sed -i -E "s|keyring-backend = \".*\"|keyring-backend = \"test\"|g" $COUNTER_HOME/config/client.toml +sed -i -E "s|minimum-gas-prices = \".*\"|minimum-gas-prices = \"0uluna\"|g" $COUNTER_HOME/config/app.toml +sed -i -E "s|chain-id = \"\"|chain-id = \"${COUNTER_CHAIN_ID}\"|g" $COUNTER_HOME/config/client.toml +sed -i -E "s|node = \".*\"|node = \"tcp://${COUNTER_RPC_LADDR}\"|g" $COUNTER_HOME/config/client.toml + +$COUNTER_BINARY keys add $VALIDATOR --keyring-backend=test +$COUNTER_BINARY add-genesis-account $($COUNTER_BINARY keys show $VALIDATOR --keyring-backend=test -a) 1000000000000000000uluna +$COUNTER_BINARY gentx validator 10000000000uluna --keyring-backend=test --chain-id=$COUNTER_CHAIN_ID +$COUNTER_BINARY collect-gentxs + + +####################### Start chains ####################### +echo "==============> Starting kujira...<==============" +$MAIN_BINARY start \ + --rpc.laddr tcp://${MAIN_RPC_LADDR} \ + --grpc.address ${MAIN_GRPC_ADDR} \ + --p2p.laddr tcp://${MAIN_P2P_LADDR} \ + --grpc-web.enable=false \ + --log_level trace \ + --trace \ + &> ./test/logs/kujira & +( tail -f -n0 ./test/logs/kujira & ) | grep -q "finalizing commit of block" +echo "Chain started" + +echo "==============> Starting terra...<==============" +$COUNTER_BINARY start \ + --rpc.laddr tcp://${COUNTER_RPC_LADDR} \ + --grpc.address ${COUNTER_GRPC_ADDR} \ + --p2p.laddr tcp://${COUNTER_P2P_LADDR} \ + --grpc-web.enable=false \ + --log_level trace \ + --trace \ + &> ./test/logs/terra & +( tail -f -n0 ./test/logs/terra & ) | grep -q "finalizing commit of block" +echo "Chain started" + +####################### Start relayer ####################### + +echo "==============> Funding relayers...<==============" +RELAYER_DIR="./test/relayer" +# kujira1pqs8apaa94ejf2etsgv7fkdv6c69jv4l0q74gh +MNEMONIC_1="space hobby carbon shiver genius snap limit clump castle wish silent scan tuition hill aisle senior luxury million beauty now artist solar subject street" +# terra1jy6td9r477fwr4q60adr7lz4anye5y89p5cq7q +MNEMONIC_2="panther trial minimum congress note sense immune bounce muscle tray still island hub awful style square gospel fragile eight report game leaf move category" + +# send tokens to relayers +$MAIN_BINARY tx bank send $VALIDATOR kujira1pqs8apaa94ejf2etsgv7fkdv6c69jv4l0q74gh 1000000ukuji $MAIN_TX_FLAGS +sleep 5 +$COUNTER_BINARY tx bank send $VALIDATOR terra1jy6td9r477fwr4q60adr7lz4anye5y89p5cq7q 1000000uluna $COUNTER_TX_FLAGS +sleep 5 + + + +echo "==============> Restoring relayer accounts...<==============" +rly keys restore kujira rly1 "$MNEMONIC_1" --home $RELAYER_DIR +rly keys restore terra rly3 "$MNEMONIC_2" --coin-type 330 --home $RELAYER_DIR +rly transact link kujira-terra --home $RELAYER_DIR + +echo "==============> Starting relayers...<==============" +sleep 5 +rly start kujira-terra --home $RELAYER_DIR &> ./test/logs/rly \ No newline at end of file diff --git a/wasmbinding/bindings/ibc.go b/wasmbinding/bindings/ibc.go new file mode 100644 index 00000000..3d9454c1 --- /dev/null +++ b/wasmbinding/bindings/ibc.go @@ -0,0 +1,164 @@ +package bindings + +import ( + "cosmossdk.io/errors" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types" + "github.com/cosmos/ibc-go/v7/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" +) + +type VerifyMembershipQuery struct { + Connection string `json:"connection"` + RevisionNumber uint64 `json:"revision_number"` + RevisionHeight uint64 `json:"revision_height"` + Proof []byte `json:"proof"` + Value []byte `json:"value"` + PathPrefix string `json:"path_prefix"` + PathKey string `json:"path_key"` +} + +type VerifyNonMembershipQuery struct { + Connection string `json:"connection"` + RevisionNumber uint64 `json:"revision_number"` + RevisionHeight uint64 `json:"revision_height"` + Proof []byte `json:"proof"` + PathPrefix string `json:"path_prefix"` + PathKey string `json:"path_key"` +} + +type IbcVerifyResponse struct{} + +// ----- moved from ibc-go/modules/core/03-connection ----- +// getClientStateAndVerificationStore returns the client state and associated KVStore for the provided client identifier. +// If the client type is localhost then the core IBC KVStore is returned, otherwise the client prefixed store is returned. +func getClientStateAndVerificationStore(ctx sdk.Context, keeper ibckeeper.Keeper, clientID string, ibcStoreKey *storetypes.KVStoreKey) (exported.ClientState, sdk.KVStore, error) { + clientState, found := keeper.ClientKeeper.GetClientState(ctx, clientID) + if !found { + return nil, nil, errors.Wrap(clienttypes.ErrClientNotFound, clientID) + } + + store := keeper.ClientKeeper.ClientStore(ctx, clientID) + if clientID == exported.Localhost { + store = ctx.KVStore(ibcStoreKey) + } + + return clientState, store, nil +} + +// getClientStateAndStore checks the client and connection status and returns the client state and associated KVStore +func getClientStateAndStore(ctx sdk.Context, keeper ibckeeper.Keeper, ibcStoreKey *storetypes.KVStoreKey, connection types.ConnectionEnd) (exported.ClientState, storetypes.KVStore, error) { + // verify the client is ACTIVE + clientID := connection.GetClientID() + clientState, clientStore, err := getClientStateAndVerificationStore(ctx, keeper, clientID, ibcStoreKey) + if err != nil { + return clientState, clientStore, err + } + + _, ok := clientState.(*ibctmtypes.ClientState) + if !ok { + return clientState, clientStore, errors.Wrapf(clienttypes.ErrInvalidClient, "invalid client type %T, expected %T", clientState, &ibctmtypes.ClientState{}) + } + + if status := clientState.Status(ctx, clientStore, keeper.Codec()); status != exported.Active { + return clientState, clientStore, errors.Wrapf(clienttypes.ErrClientNotActive, "client (%s) status is %s", clientID, status) + } + + // verify the connection state is OPEN + if connection.State != types.OPEN { + return clientState, clientStore, errors.Wrapf( + types.ErrInvalidConnectionState, + "connection state is not OPEN (got %s)", connection.State.String(), + ) + } + + return clientState, clientStore, nil +} + +// getConsStateAndMerklePath generates merkle path using path and get consensus state using height from the client store +func getConsStateAndMerklePath(keeper ibckeeper.Keeper, clientState exported.ClientState, clientStore storetypes.KVStore, height clienttypes.Height, pathPrefix string, pathKey string) (*ibctmtypes.ConsensusState, *commitmenttypes.MerklePath, error) { + if clientState.GetLatestHeight().LT(height) { + return nil, nil, errors.Wrapf( + sdkerrors.ErrInvalidHeight, + "client state height < proof height (%d < %d), please ensure the client has been updated", clientState.GetLatestHeight(), height, + ) + } + + merklePath := commitmenttypes.NewMerklePath(pathPrefix, pathKey) + + consensusState, found := ibctmtypes.GetConsensusState(clientStore, keeper.Codec(), height) + if !found { + return nil, nil, errors.Wrap(clienttypes.ErrConsensusStateNotFound, "please ensure the proof was constructed against a height that exists on the client") + } + + return consensusState, &merklePath, nil +} + +func HandleIBCQuery(ctx sdk.Context, keeper ibckeeper.Keeper, ibcStoreKey *storetypes.KVStoreKey, q *IbcQuery) error { + switch { + case q.VerifyMembership != nil: + connectionID := q.VerifyMembership.Connection + connection, found := keeper.ConnectionKeeper.GetConnection(ctx, connectionID) + if !found { + return errors.Wrap(types.ErrConnectionNotFound, connectionID) + } + + clientState, clientStore, err := getClientStateAndStore(ctx, keeper, ibcStoreKey, connection) + if err != nil { + return err + } + + var merkleProof commitmenttypes.MerkleProof + if err := keeper.Codec().Unmarshal(q.VerifyMembership.Proof, &merkleProof); err != nil { + return errors.Wrap(commitmenttypes.ErrInvalidProof, "failed to unmarshal proof into ICS 23 commitment merkle proof") + } + + height := clienttypes.NewHeight(q.VerifyMembership.RevisionNumber, q.VerifyMembership.RevisionHeight) + consState, merklePath, err := getConsStateAndMerklePath(keeper, clientState, clientStore, height, q.VerifyMembership.PathPrefix, q.VerifyMembership.PathKey) + if err != nil { + return err + } + + if err := merkleProof.VerifyMembership(clientState.(*ibctmtypes.ClientState).ProofSpecs, consState.GetRoot(), *merklePath, q.VerifyMembership.Value); err != nil { //nolint + return err + } + + return nil + + case q.VerifyNonMembership != nil: + connectionID := q.VerifyNonMembership.Connection + connection, found := keeper.ConnectionKeeper.GetConnection(ctx, connectionID) + if !found { + return errors.Wrap(types.ErrConnectionNotFound, connectionID) + } + + clientState, clientStore, err := getClientStateAndStore(ctx, keeper, ibcStoreKey, connection) + if err != nil { + return err + } + + var merkleProof commitmenttypes.MerkleProof + if err := keeper.Codec().Unmarshal(q.VerifyNonMembership.Proof, &merkleProof); err != nil { + return errors.Wrap(commitmenttypes.ErrInvalidProof, "failed to unmarshal proof into ICS 23 commitment merkle proof") + } + + height := clienttypes.NewHeight(q.VerifyNonMembership.RevisionNumber, q.VerifyNonMembership.RevisionHeight) + consState, merklePath, err := getConsStateAndMerklePath(keeper, clientState, clientStore, height, q.VerifyMembership.PathPrefix, q.VerifyMembership.PathKey) + if err != nil { + return err + } + + if err := merkleProof.VerifyNonMembership(clientState.(*ibctmtypes.ClientState).ProofSpecs, consState.GetRoot(), merklePath); err != nil { //nolint + return err + } + + return nil + default: + return errors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized query request") + } +} diff --git a/wasmbinding/bindings/msg.go b/wasmbinding/bindings/msg.go index efe47a12..fe48b0e7 100644 --- a/wasmbinding/bindings/msg.go +++ b/wasmbinding/bindings/msg.go @@ -1,9 +1,13 @@ package bindings import ( + batch "github.com/Team-Kujira/core/x/batch/wasm" + cwica "github.com/Team-Kujira/core/x/cw-ica/wasm" denom "github.com/Team-Kujira/core/x/denom/wasm" ) type CosmosMsg struct { Denom *denom.DenomMsg + Batch *batch.BatchMsg + CwIca *cwica.CwIcaMsg `json:"ica,omitempty"` } diff --git a/wasmbinding/bindings/query.go b/wasmbinding/bindings/query.go index 41071fad..29c0beb6 100644 --- a/wasmbinding/bindings/query.go +++ b/wasmbinding/bindings/query.go @@ -1,6 +1,7 @@ package bindings import ( + cwica "github.com/Team-Kujira/core/x/cw-ica/wasm" denom "github.com/Team-Kujira/core/x/denom/wasm" oracle "github.com/Team-Kujira/core/x/oracle/wasm" @@ -13,9 +14,16 @@ type CosmosQuery struct { Denom *denom.DenomQuery Bank *BankQuery Oracle *oracle.OracleQuery + Ibc *IbcQuery + CwIca *cwica.CwIcaQuery `json:"ica,omitempty"` } type BankQuery struct { DenomMetadata *banktypes.QueryDenomMetadataRequest `json:"denom_metadata,omitempty"` Supply *banktypes.QuerySupplyOfRequest `json:"supply,omitempty"` } + +type IbcQuery struct { + VerifyMembership *VerifyMembershipQuery `json:"verify_membership,omitempty"` + VerifyNonMembership *VerifyNonMembershipQuery `json:"verify_non_membership,omitempty"` +} diff --git a/wasmbinding/message_plugin.go b/wasmbinding/message_plugin.go index 46fdb8b1..ce914f85 100644 --- a/wasmbinding/message_plugin.go +++ b/wasmbinding/message_plugin.go @@ -11,21 +11,29 @@ import ( "github.com/Team-Kujira/core/wasmbinding/bindings" - denom "github.com/Team-Kujira/core/x/denom/wasm" - + batchkeeper "github.com/Team-Kujira/core/x/batch/keeper" + batch "github.com/Team-Kujira/core/x/batch/wasm" + cwicakeeper "github.com/Team-Kujira/core/x/cw-ica/keeper" + cwica "github.com/Team-Kujira/core/x/cw-ica/wasm" denomkeeper "github.com/Team-Kujira/core/x/denom/keeper" + denom "github.com/Team-Kujira/core/x/denom/wasm" + icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" ) // CustomMessageDecorator returns decorator for custom CosmWasm bindings messages func CustomMessageDecorator( bank bankkeeper.Keeper, denom denomkeeper.Keeper, + cwica cwicakeeper.Keeper, + ica icacontrollerkeeper.Keeper, ) func(wasmkeeper.Messenger) wasmkeeper.Messenger { return func(old wasmkeeper.Messenger) wasmkeeper.Messenger { return &CustomMessenger{ wrapped: old, bank: bank, denom: denom, + cwica: cwica, + ica: ica, } } } @@ -34,6 +42,9 @@ type CustomMessenger struct { wrapped wasmkeeper.Messenger bank bankkeeper.Keeper denom denomkeeper.Keeper + cwica cwicakeeper.Keeper + ica icacontrollerkeeper.Keeper + batch batchkeeper.Keeper } var _ wasmkeeper.Messenger = (*CustomMessenger)(nil) @@ -57,6 +68,14 @@ func (m *CustomMessenger) DispatchMsg( return denom.HandleMsg(m.denom, m.bank, contractAddr, ctx, contractMsg.Denom) } + if contractMsg.Batch != nil { + return batch.HandleMsg(m.batch, contractAddr, ctx, contractMsg.Batch) + } + + if contractMsg.CwIca != nil { + return cwica.HandleMsg(ctx, m.cwica, m.ica, contractAddr, contractMsg.CwIca) + } + return nil, nil, wasmvmtypes.UnsupportedRequest{Kind: "unknown Custom variant"} } return m.wrapped.DispatchMsg(ctx, contractAddr, contractIBCPortID, msg) diff --git a/wasmbinding/queries.go b/wasmbinding/queries.go index 6331b0ef..8702eb39 100644 --- a/wasmbinding/queries.go +++ b/wasmbinding/queries.go @@ -1,24 +1,31 @@ package wasmbinding import ( + cwicakeeper "github.com/Team-Kujira/core/x/cw-ica/keeper" denomkeeper "github.com/Team-Kujira/core/x/denom/keeper" - oraclekeeper "github.com/Team-Kujira/core/x/oracle/keeper" - + storetypes "github.com/cosmos/cosmos-sdk/store/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" ) type QueryPlugin struct { denomKeeper denomkeeper.Keeper bankkeeper bankkeeper.Keeper oraclekeeper oraclekeeper.Keeper + ibckeeper ibckeeper.Keeper + cwicakeeper cwicakeeper.Keeper + ibcstorekey *storetypes.KVStoreKey } // NewQueryPlugin returns a reference to a new QueryPlugin. -func NewQueryPlugin(bk bankkeeper.Keeper, ok oraclekeeper.Keeper, dk denomkeeper.Keeper) *QueryPlugin { +func NewQueryPlugin(bk bankkeeper.Keeper, ok oraclekeeper.Keeper, dk denomkeeper.Keeper, ik ibckeeper.Keeper, cwicak cwicakeeper.Keeper, isk *storetypes.KVStoreKey) *QueryPlugin { return &QueryPlugin{ denomKeeper: dk, bankkeeper: bk, oraclekeeper: ok, + ibckeeper: ik, + cwicakeeper: cwicak, + ibcstorekey: isk, } } diff --git a/wasmbinding/query_plugin.go b/wasmbinding/query_plugin.go index fe2c64ff..3d6beb45 100644 --- a/wasmbinding/query_plugin.go +++ b/wasmbinding/query_plugin.go @@ -4,6 +4,7 @@ import ( "encoding/json" "github.com/Team-Kujira/core/wasmbinding/bindings" + cwica "github.com/Team-Kujira/core/x/cw-ica/wasm" denom "github.com/Team-Kujira/core/x/denom/wasm" oracle "github.com/Team-Kujira/core/x/oracle/wasm" @@ -35,7 +36,9 @@ func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessag } return bz, nil - } else if contractQuery.Bank != nil { + } + + if contractQuery.Bank != nil { if contractQuery.Bank.DenomMetadata != nil { metadata, _ := qp.bankkeeper.GetDenomMetaData(ctx, contractQuery.Bank.DenomMetadata.Denom) res := banktypes.QueryDenomMetadataResponse{ @@ -61,7 +64,9 @@ func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessag } return bz, nil - } else if contractQuery.Denom != nil { + } + + if contractQuery.Denom != nil { res, err := denom.HandleQuery(qp.denomKeeper, ctx, contractQuery.Denom) if err != nil { return nil, err @@ -73,8 +78,28 @@ func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessag } return bz, nil - } else { - return nil, wasmvmtypes.UnsupportedRequest{Kind: "unknown Custom variant"} } + + if contractQuery.CwIca != nil { + res, err := cwica.HandleQuery(qp.cwicakeeper, ctx, contractQuery.CwIca) + if err != nil { + return nil, err + } + + bz, err := json.Marshal(res) + if err != nil { + return nil, errors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) + } + + return bz, nil + } + + if contractQuery.Ibc != nil { + err := bindings.HandleIBCQuery(ctx, qp.ibckeeper, qp.ibcstorekey, contractQuery.Ibc) + res, _ := json.Marshal(bindings.IbcVerifyResponse{}) + return res, err + } + + return nil, wasmvmtypes.UnsupportedRequest{Kind: "unknown Custom variant"} } } diff --git a/wasmbinding/test/helpers_test.go b/wasmbinding/test/helpers_test.go index c32fadc6..782f718a 100644 --- a/wasmbinding/test/helpers_test.go +++ b/wasmbinding/test/helpers_test.go @@ -1,6 +1,7 @@ package wasmbinding_test import ( + "os" "testing" "time" @@ -10,6 +11,8 @@ import ( "github.com/cometbft/cometbft/crypto/ed25519" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" @@ -29,6 +32,43 @@ func FundAccount(t *testing.T, ctx sdk.Context, app *app.App, acct sdk.AccAddres require.NoError(t, err) } +// SetupContract uploads the wasm code to the wasm storage and creates a contract instance +func SetupContract(t *testing.T, ctx sdk.Context, app *app.App) (sdk.AccAddress, sdk.AccAddress) { + // create an addr that perform contract transactions, upload the wasm code + actor := RandomAccountAddress() + storeWasmCode(t, ctx, app, actor) + + cInfo := app.WasmKeeper.GetCodeInfo(ctx, 1) + require.NotNil(t, cInfo) + + // create a contract instance + contractAddr := instantiateContract(t, ctx, app, actor) + require.NotEmpty(t, contractAddr) + + return contractAddr, actor +} + +func storeWasmCode(t *testing.T, ctx sdk.Context, app *app.App, addr sdk.AccAddress) { + wasmCode, err := os.ReadFile("../testdata/kujira_ibc.wasm") + require.NoError(t, err) + + contractKeeper := keeper.NewDefaultPermissionKeeper(app.WasmKeeper) + _, _, err = contractKeeper.Create(ctx, addr, wasmCode, &wasmtypes.AccessConfig{ + Permission: wasmtypes.AccessTypeEverybody, + }) + require.NoError(t, err) +} + +func instantiateContract(t *testing.T, ctx sdk.Context, app *app.App, funder sdk.AccAddress) sdk.AccAddress { + initMsgBz := []byte("{}") + contractKeeper := keeper.NewDefaultPermissionKeeper(app.WasmKeeper) + codeID := uint64(1) + addr, _, err := contractKeeper.Instantiate(ctx, codeID, funder, funder, initMsgBz, "demo contract", nil) + require.NoError(t, err) + + return addr +} + // we need to make this deterministic (same every test run), as content might affect gas costs func keyPubAddr() (crypto.PrivKey, crypto.PubKey, sdk.AccAddress) { key := ed25519.GenPrivKey() diff --git a/wasmbinding/test/wasm_test.go b/wasmbinding/test/wasm_test.go index 4e8e5327..e18808dd 100644 --- a/wasmbinding/test/wasm_test.go +++ b/wasmbinding/test/wasm_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" "github.com/Team-Kujira/core/x/oracle/types" "github.com/Team-Kujira/core/x/oracle/wasm" @@ -32,7 +33,7 @@ func TestQueryExchangeRates(t *testing.T) { app.OracleKeeper.SetExchangeRate(ctx, types.TestDenomB, ExchangeRateB) app.OracleKeeper.SetExchangeRate(ctx, types.TestDenomD, ExchangeRateD) - plugin := wasmbinding.NewQueryPlugin(app.BankKeeper, app.OracleKeeper, *app.DenomKeeper) + plugin := wasmbinding.NewQueryPlugin(app.BankKeeper, app.OracleKeeper, *app.DenomKeeper, *app.IBCKeeper, app.CwICAKeeper, app.GetKey(ibcexported.StoreKey)) querier := wasmbinding.CustomQuerier(plugin) var err error @@ -96,7 +97,7 @@ func TestSupply(t *testing.T) { app := app.Setup(t, false) ctx := app.BaseApp.NewContext(false, tmtypes.Header{Height: 1, ChainID: "kujira-1", Time: time.Now().UTC()}) - plugin := wasmbinding.NewQueryPlugin(app.BankKeeper, app.OracleKeeper, *app.DenomKeeper) + plugin := wasmbinding.NewQueryPlugin(app.BankKeeper, app.OracleKeeper, *app.DenomKeeper, *app.IBCKeeper, app.CwICAKeeper, app.GetKey(ibcexported.StoreKey)) querier := wasmbinding.CustomQuerier(plugin) var err error @@ -121,3 +122,52 @@ func TestSupply(t *testing.T) { err = json.Unmarshal(res, &x) require.NoError(t, err) } + +func TestVerifyMembership(t *testing.T) { + app := app.Setup(t, false) + ctx := app.BaseApp.NewContext(false, tmtypes.Header{Height: 1, ChainID: "kujira-1", Time: time.Now().UTC()}) + + var err error + contractAddr, _ := SetupContract(t, ctx, app) + queryMsg := bindings.IbcQuery{ + VerifyMembership: &bindings.VerifyMembershipQuery{ + Connection: "connection-0", + RevisionNumber: 0, + RevisionHeight: 0, + Proof: []byte{}, + Value: []byte{}, + PathPrefix: "ibc", + PathKey: "connections/connection-0", + }, + } + + bz, err := json.Marshal(queryMsg) + require.NoError(t, err) + + bz, err = app.WasmKeeper.QuerySmart(ctx, contractAddr, bz) + require.Error(t, err) +} + +func TestVerifyNonMembership(t *testing.T) { + app := app.Setup(t, false) + ctx := app.BaseApp.NewContext(false, tmtypes.Header{Height: 1, ChainID: "kujira-1", Time: time.Now().UTC()}) + + var err error + contractAddr, _ := SetupContract(t, ctx, app) + queryMsg := bindings.IbcQuery{ + VerifyNonMembership: &bindings.VerifyNonMembershipQuery{ + Connection: "connection-0", + RevisionNumber: 0, + RevisionHeight: 0, + Proof: []byte{}, + PathPrefix: "ibc", + PathKey: "connections/connection-0", + }, + } + + bz, err := json.Marshal(queryMsg) + require.NoError(t, err) + + bz, err = app.WasmKeeper.QuerySmart(ctx, contractAddr, bz) + require.Error(t, err) +} diff --git a/wasmbinding/testdata/kujira_ibc.wasm b/wasmbinding/testdata/kujira_ibc.wasm new file mode 100644 index 0000000000000000000000000000000000000000..f57a1124bcdaf346269d55e227467d66c8e0504f GIT binary patch literal 152399 zcmd?S51eJyRquKJ-9J^gs`_@*4F%nVbFUq#R{Et?(v1XTogSK|B@uLZ{u^h2gjT3R zpo>n6%Fq?lkk(*iJ`a67#fT9fXc9y6@QEWPl?0W%7nL}1LJTTN+DM)x@{~Av6EeK- zZ>@dKJ@?k1?grw_=QDIt=bp3wt-bd8x7S{K@93(Vek_inD1Ki&ePw$1@ZtFIl}Y(G zvM`W(efXjerrf4qZQ&AMOU^%7V=m#A=j<;s=v3Y#^hGj zKUL=SCtu12R2Tox4&Qp~tx@tz$+~p^^@kc)z2Sz1gHfj6t*hT~#lrrpu8x{|YxDNw z3)ddpA0>Jnv&0{};n4m;=9}Jl)%8(S7QKG|%?G{cP{$tFF8D>Z>Sk)vdR0 z6u9B~Yu`x9PwtOmmGr#Vyy?fTy1x3>y=ng&Z~WF*@0|aZD-P{nxb{bW!W)?$d|uf9 zMj%I_xgHA6{_tM|X*O+V_r=^S{| z{)L~o;*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!7e{2@g%@Qz5D@#@C!obqYN|VMBVz-auRVk}qVz<8=zoEXdv2o5{3Z9^Enh2dV zkqO}a8u-P38azR(C1|aUwA)aJjH`Vj>dw)u@8~&34k=-k0?r9_0EA=%mxcN@Fiw*Y zohHOV+5Rr)aBGy#0(~%Jw|Q(1<2=IHs}d5)pMFmUvjyjG7E%^cl06puaH1*J=<7ni zIY{)A)c@S}X*jj2`XIP0YG2aaJo$xT$MkCQtO5I<0F&;H^ZEXU-OZ1=yD=Bp+{pf5 zlrO{cjHL1?o-2_SYZgPC>0VVwcpl@=>srB0b>^v_%afR|2kUqfiPoDeFOWStfJE;D zZBqS0t96*}{K;QvDP7o-kp6|1&c%Qcd^4ePS(Q60ec|vn%@7jM__eORlRby|A!6m+ zn8)yK;^QKfw6s_`@LCYo8|Xta=jBMWR--&0ms>H)G@kBay4UEPCf{j6)Y08d?IEOI hq~tzCvweCUGSwcw2>Eiz98E|KNQ;pcAkD4L_&*Va9X$X5 literal 0 HcmV?d00001 diff --git a/wasmbinding/wasm.go b/wasmbinding/wasm.go index af8080eb..25df846d 100644 --- a/wasmbinding/wasm.go +++ b/wasmbinding/wasm.go @@ -2,26 +2,34 @@ package wasmbinding import ( denomkeeper "github.com/Team-Kujira/core/x/denom/keeper" - oraclekeeper "github.com/Team-Kujira/core/x/oracle/keeper" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + cwicakeeper "github.com/Team-Kujira/core/x/cw-ica/keeper" bankkeeper "github.com/terra-money/alliance/custom/bank/keeper" + + icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" ) func RegisterCustomPlugins( bank bankkeeper.Keeper, oracle oraclekeeper.Keeper, denom denomkeeper.Keeper, + ibc ibckeeper.Keeper, + cwica cwicakeeper.Keeper, + ica icacontrollerkeeper.Keeper, + ibcStoreKey *storetypes.KVStoreKey, ) []wasmkeeper.Option { - wasmQueryPlugin := NewQueryPlugin(bank, oracle, denom) + wasmQueryPlugin := NewQueryPlugin(bank, oracle, denom, ibc, cwica, ibcStoreKey) queryPluginOpt := wasmkeeper.WithQueryPlugins(&wasmkeeper.QueryPlugins{ Custom: CustomQuerier(wasmQueryPlugin), }) messengerDecoratorOpt := wasmkeeper.WithMessageHandlerDecorator( - CustomMessageDecorator(bank, denom), + CustomMessageDecorator(bank, denom, cwica, ica), ) return []wasmkeeper.Option{ diff --git a/x/batch/client/cli/tx.go b/x/batch/client/cli/tx.go new file mode 100644 index 00000000..d62ab007 --- /dev/null +++ b/x/batch/client/cli/tx.go @@ -0,0 +1,119 @@ +package cli + +import ( + "fmt" + "strings" + + "cosmossdk.io/math" + "github.com/Team-Kujira/core/x/batch/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/version" + "github.com/spf13/cobra" +) + +// GetTxCmd returns the transaction commands for this module +func GetTxCmd() *cobra.Command { + distTxCmd := &cobra.Command{ + Use: types.ModuleName, + Short: "Distribution extension commands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + distTxCmd.AddCommand( + NewWithdrawAllRewardsCmd(), + NewBatchResetDelegationCmd(), + ) + + return distTxCmd +} + +// NewWithdrawAllRewardsCmd returns a CLI command handler for creating a MsgWithdrawDelegatorReward transaction. +func NewWithdrawAllRewardsCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "withdraw-all-rewards", + Short: "withdraw all delegations rewards for a delegator", + Long: strings.TrimSpace( + fmt.Sprintf(`Withdraw all rewards for a single delegator. + +Example: +$ %[1]s tx distribution withdraw-all-rewards --from mykey +`, + version.AppName, flags.FlagBroadcastMode, flags.BroadcastSync, flags.BroadcastAsync, + ), + ), + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, _ []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + delAddr := clientCtx.GetFromAddress() + + // The transaction cannot be generated offline since it requires a query + // to get all the validators. + if clientCtx.Offline { + return fmt.Errorf("cannot generate tx in offline mode") + } + + msgs := []sdk.Msg{types.NewMsgWithdrawAllDelegatorRewards(delAddr)} + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msgs...) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +// NewBatchResetDelegationCmd returns a CLI command handler for creating a MsgBatchResetDelegation transaction. +func NewBatchResetDelegationCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "batch-reset-delegation", + Short: "Reset delegations in batch for a delegator", + Long: strings.TrimSpace( + fmt.Sprintf(`Reset delegations in batch for a single delegator. + +Example: +$ %[1]s tx batch batch-reset-delegation kujiravaloper1uf9knclap4a0vrqn8dj726anyhst7l0253g0da,kujiravaloper1ujhlm5qxyt2hn5fxq8wll805tsxcamqfhsty9a 100,200 --from mykey +`, + version.AppName, flags.FlagBroadcastMode, flags.BroadcastSync, flags.BroadcastAsync, + ), + ), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + delAddr := clientCtx.GetFromAddress() + + valAddrs := strings.Split(args[0], ",") + amountStrs := strings.Split(args[1], ",") + amounts := []math.Int{} + for _, amountStr := range amountStrs { + amount, ok := sdk.NewIntFromString(amountStr) + if !ok { + return types.ErrInvalidAmount + } + amounts = append(amounts, amount) + } + // The transaction cannot be generated offline since it requires a query + // to get all the validators. + if clientCtx.Offline { + return fmt.Errorf("cannot generate tx in offline mode") + } + + msgs := []sdk.Msg{types.NewMsgBatchResetDelegation(delAddr, valAddrs, amounts)} + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msgs...) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/batch/genesis.go b/x/batch/genesis.go new file mode 100644 index 00000000..a3d21f02 --- /dev/null +++ b/x/batch/genesis.go @@ -0,0 +1,16 @@ +package batch + +import ( + "github.com/Team-Kujira/core/x/batch/keeper" + "github.com/Team-Kujira/core/x/batch/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// InitGenesis initializes the capability module's state from a provided genesis +// state. +func InitGenesis(_ sdk.Context, _ keeper.Keeper, _ types.GenesisState) {} + +// ExportGenesis returns the capability module's exported genesis. +func ExportGenesis(_ sdk.Context, _ keeper.Keeper) *types.GenesisState { + return types.DefaultGenesis() +} diff --git a/x/batch/keeper/delegation.go b/x/batch/keeper/delegation.go new file mode 100644 index 00000000..af3c0593 --- /dev/null +++ b/x/batch/keeper/delegation.go @@ -0,0 +1,240 @@ +package keeper + +import ( + "time" + + "github.com/Team-Kujira/core/x/batch/types" + "github.com/armon/go-metrics" + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +// increment the reference count for a historical rewards value +// this func was copied from +// https://github.com/cosmos/cosmos-sdk/blob/main/x/distribution/keeper/validator.go +func (k Keeper) incrementReferenceCount(ctx sdk.Context, valAddr sdk.ValAddress, period uint64) { + historical := k.distrKeeper.GetValidatorHistoricalRewards(ctx, valAddr, period) + if historical.ReferenceCount > 2 { + panic("reference count should never exceed 2") + } + historical.ReferenceCount++ + k.distrKeeper.SetValidatorHistoricalRewards(ctx, valAddr, period, historical) +} + +// decrement the reference count for a historical rewards value, and delete if zero references remain +// this func was copied from +// https://github.com/cosmos/cosmos-sdk/blob/main/x/distribution/keeper/validator.go +func (k Keeper) decrementReferenceCount(ctx sdk.Context, valAddr sdk.ValAddress, period uint64) { + historical := k.distrKeeper.GetValidatorHistoricalRewards(ctx, valAddr, period) + if historical.ReferenceCount == 0 { + panic("cannot set negative reference count") + } + historical.ReferenceCount-- + if historical.ReferenceCount == 0 { + k.distrKeeper.DeleteValidatorHistoricalReward(ctx, valAddr, period) + } else { + k.distrKeeper.SetValidatorHistoricalRewards(ctx, valAddr, period, historical) + } +} + +// initialize starting info for a new delegation +// this func was copied from +// https://github.com/cosmos/cosmos-sdk/blob/main/x/distribution/keeper/delegation.go +func (k Keeper) initializeDelegation(ctx sdk.Context, val sdk.ValAddress, del sdk.AccAddress) { + // period has already been incremented - we want to store the period ended by this delegation action + previousPeriod := k.distrKeeper.GetValidatorCurrentRewards(ctx, val).Period - 1 + + // increment reference count for the period we're going to track + k.incrementReferenceCount(ctx, val, previousPeriod) + + validator := k.stakingKeeper.Validator(ctx, val) + delegation := k.stakingKeeper.Delegation(ctx, del, val) + + // calculate delegation stake in tokens + // we don't store directly, so multiply delegation shares * (tokens per share) + // note: necessary to truncate so we don't allow withdrawing more rewards than owed + stake := validator.TokensFromSharesTruncated(delegation.GetShares()) + k.distrKeeper.SetDelegatorStartingInfo(ctx, val, del, distrtypes.NewDelegatorStartingInfo(previousPeriod, stake, uint64(ctx.BlockHeight()))) +} + +func (k Keeper) withdrawAllDelegationRewards(ctx sdk.Context, delAddr sdk.AccAddress) (sdk.Coins, error) { + rewardsTotal := sdk.Coins{} + remainderTotal := sdk.DecCoins{} + // callback func was referenced from withdrawDelegationRewards func in + // https://github.com/cosmos/cosmos-sdk/blob/main/x/distribution/keeper/delegation.go + k.stakingKeeper.IterateDelegations(ctx, delAddr, func(_ int64, del stakingtypes.DelegationI) (stop bool) { + valAddr := del.GetValidatorAddr() + val := k.stakingKeeper.Validator(ctx, valAddr) + + // check existence of delegator starting info + if !k.distrKeeper.HasDelegatorStartingInfo(ctx, del.GetValidatorAddr(), del.GetDelegatorAddr()) { + return false + } + + // end current period and calculate rewards + endingPeriod := k.distrKeeper.IncrementValidatorPeriod(ctx, val) + rewardsRaw := k.distrKeeper.CalculateDelegationRewards(ctx, val, del, endingPeriod) + outstanding := k.distrKeeper.GetValidatorOutstandingRewardsCoins(ctx, del.GetValidatorAddr()) + + // defensive edge case may happen on the very final digits + // of the decCoins due to operation order of the distribution mechanism. + rewards := rewardsRaw.Intersect(outstanding) + if !rewards.IsEqual(rewardsRaw) { + logger := k.Logger(ctx) + logger.Info( + "rounding error withdrawing rewards from validator", + "delegator", del.GetDelegatorAddr().String(), + "validator", val.GetOperator().String(), + "got", rewards.String(), + "expected", rewardsRaw.String(), + ) + } + + // truncate reward dec coins, return remainder to community pool + finalRewards, remainder := rewards.TruncateDecimal() + remainderTotal = remainderTotal.Add(remainder...) + rewardsTotal = rewardsTotal.Add(finalRewards...) + + // update the outstanding rewards and the community pool only if the + // transaction was successful + k.distrKeeper.SetValidatorOutstandingRewards(ctx, del.GetValidatorAddr(), distrtypes.ValidatorOutstandingRewards{Rewards: outstanding.Sub(rewards)}) + + // decrement reference count of starting period + startingInfo := k.distrKeeper.GetDelegatorStartingInfo(ctx, del.GetValidatorAddr(), del.GetDelegatorAddr()) + startingPeriod := startingInfo.PreviousPeriod + k.decrementReferenceCount(ctx, del.GetValidatorAddr(), startingPeriod) + + // reinitialize the delegation + k.initializeDelegation(ctx, valAddr, delAddr) + + return false + }) + + // distribute total remainder to community pool + feePool := k.distrKeeper.GetFeePool(ctx) + feePool.CommunityPool = feePool.CommunityPool.Add(remainderTotal...) + k.distrKeeper.SetFeePool(ctx, feePool) + + // add total reward coins to user account + if !rewardsTotal.IsZero() { + withdrawAddr := k.distrKeeper.GetDelegatorWithdrawAddr(ctx, delAddr) + err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, distrtypes.ModuleName, withdrawAddr, rewardsTotal) + if err != nil { + return nil, err + } + } else { + rewardsTotal = sdk.Coins{} + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + distrtypes.EventTypeWithdrawRewards, + sdk.NewAttribute(sdk.AttributeKeyAmount, rewardsTotal.String()), + sdk.NewAttribute(distrtypes.AttributeKeyDelegator, delAddr.String()), + ), + ) + return rewardsTotal, nil +} + +func (k Keeper) batchResetDelegation(ctx sdk.Context, msg *types.MsgBatchResetDelegation) error { + delAddr, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return err + } + + if len(msg.Validators) != len(msg.Amounts) { + return types.ErrValidatorsAndAmountsMismatch + } + + bondDenom := k.stakingKeeper.BondDenom(ctx) + + for i, valStr := range msg.Validators { + valAddr, valErr := sdk.ValAddressFromBech32(valStr) + if valErr != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", valErr) + } + + validator, found := k.stakingKeeper.GetValidator(ctx, valAddr) + if !found { + return stakingtypes.ErrNoValidatorFound + } + + targetAmount := msg.Amounts[i] + currAmount := sdk.ZeroInt() + delegation, found := k.stakingKeeper.GetDelegation(ctx, delAddr, valAddr) + if found { + currAmount = validator.TokensFromShares(delegation.Shares).RoundInt() + } + + if currAmount.Equal(targetAmount) { + continue + } + + if currAmount.LT(targetAmount) { + amount := targetAmount.Sub(currAmount) + // NOTE: source funds are always unbonded + newShares, err := k.stakingKeeper.Delegate(ctx, delAddr, amount, stakingtypes.Unbonded, validator, true) + if err != nil { + return err + } + + if amount.IsInt64() { + defer func() { + telemetry.IncrCounter(1, types.ModuleName, "delegate") + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", sdk.MsgTypeURL(msg)}, + float32(amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", bondDenom)}, + ) + }() + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + stakingtypes.EventTypeDelegate, + sdk.NewAttribute(stakingtypes.AttributeKeyValidator, valStr), + sdk.NewAttribute(stakingtypes.AttributeKeyDelegator, msg.DelegatorAddress), + sdk.NewAttribute(sdk.AttributeKeyAmount, amount.String()), + sdk.NewAttribute(stakingtypes.AttributeKeyNewShares, newShares.String()), + ), + }) + } else { + amount := currAmount.Sub(targetAmount) + shares, err := k.stakingKeeper.ValidateUnbondAmount( + ctx, delAddr, valAddr, amount, + ) + if err != nil { + return err + } + + completionTime, err := k.stakingKeeper.Undelegate(ctx, delAddr, valAddr, shares) + if err != nil { + return err + } + + if amount.IsInt64() { + defer func() { + telemetry.IncrCounter(1, types.ModuleName, "undelegate") + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", msg.Type()}, + float32(amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", bondDenom)}, + ) + }() + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + stakingtypes.EventTypeUnbond, + sdk.NewAttribute(stakingtypes.AttributeKeyValidator, valStr), + sdk.NewAttribute(sdk.AttributeKeyAmount, amount.String()), + sdk.NewAttribute(stakingtypes.AttributeKeyCompletionTime, completionTime.Format(time.RFC3339)), + ), + }) + } + } + return nil +} diff --git a/x/batch/keeper/delegation_test.go b/x/batch/keeper/delegation_test.go new file mode 100644 index 00000000..b9e41982 --- /dev/null +++ b/x/batch/keeper/delegation_test.go @@ -0,0 +1,242 @@ +package keeper_test + +import ( + "fmt" + + "cosmossdk.io/math" + batchkeeper "github.com/Team-Kujira/core/x/batch/keeper" + batchtypes "github.com/Team-Kujira/core/x/batch/types" + "github.com/cometbft/cometbft/crypto/secp256k1" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + distrtestutil "github.com/cosmos/cosmos-sdk/x/distribution/testutil" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +func generateValidatorKeysAndAddresses(num int) (pubKeys []cryptotypes.PubKey, addrs []sdk.ConsAddress) { + pubKeys = simtestutil.CreateTestPubKeys(num) + for _, pubKey := range pubKeys { + addrs = append(addrs, sdk.ConsAddress(pubKey.Address())) + } + return +} + +func (suite *KeeperTestSuite) TestWithdrawAllDelegationRewards() { + // Generating validator key pubkey and addresses + totalVals := 75 + totalTokens := 100 + valConsPks, valConsAddrs := generateValidatorKeysAndAddresses(totalVals) + + // Setting up msg servers + distrMsgServer := distrkeeper.NewMsgServerImpl(suite.app.DistrKeeper) + batchMsgServer := batchkeeper.NewMsgServerImpl(suite.app.BatchKeeper) + + // Setting up validators and delegations + valTokens := sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction) + + delPub := secp256k1.GenPrivKey().PubKey() + delAddr := sdk.AccAddress(delPub.Address()) + suite.app.AccountKeeper.SetAccount(suite.ctx, authtypes.NewBaseAccount(delAddr, nil, 0, 0)) + + delTokens := sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction) + + for i := 0; i < totalVals; i++ { + // Setup the validator + validator, err := distrtestutil.CreateValidator(valConsPks[i], delTokens) + suite.Require().NoError(err) + + validator, _ = validator.SetInitialCommission(stakingtypes.NewCommission(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), math.LegacyNewDec(0))) + validator, _ = validator.AddTokensFromDel(valTokens) + suite.app.StakingKeeper.SetValidator(suite.ctx, validator) + suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator) + suite.app.StakingKeeper.SetValidatorByPowerIndex(suite.ctx, validator) + + // Call the after-creation hook + err = suite.app.StakingKeeper.Hooks().AfterValidatorCreated(suite.ctx, validator.GetOperator()) + suite.NoError(err) + + // Delegate to the validator + delAmount := sdk.NewCoin(sdk.DefaultBondDenom, delTokens) + err = suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, sdk.Coins{delAmount}) + suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, minttypes.ModuleName, delAddr, sdk.Coins{delAmount}) + suite.Require().NoError(err) + + _, err = suite.app.StakingKeeper.Delegate(suite.ctx, delAddr, delAmount.Amount, stakingtypes.Unbonded, validator, true) + suite.Require().NoError(err) + } + + // =====================Next block ===================== + suite.ctx = suite.ctx.WithBlockHeight(suite.ctx.BlockHeight() + 1) + + // Add tokens to distribution module for reward distribution + distrModuleTokens := sdk.Coins{} + for i := 0; i < totalTokens; i++ { + distrModuleTokens = append(distrModuleTokens, sdk.NewCoin(fmt.Sprintf("stake-%d", i), delTokens)) + } + distrModuleTokens = distrModuleTokens.Sort() + + err := suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, distrModuleTokens) + suite.app.BankKeeper.SendCoinsFromModuleToModule(suite.ctx, minttypes.ModuleName, distrtypes.ModuleName, distrModuleTokens) + suite.Require().NoError(err) + + // Allocate rewards to validators + valRewardTokens := sdk.DecCoins{} + expDelegatorRewards := sdk.Coins{} + for i := 0; i < totalTokens; i++ { + valRewardTokens = valRewardTokens.Add(sdk.NewInt64DecCoin(fmt.Sprintf("stake-%d", i), 10)) + expDelegatorRewards = expDelegatorRewards.Add(sdk.NewInt64Coin(fmt.Sprintf("stake-%d", i), 1)) + } + for i := 0; i < totalVals; i++ { + valAddr := sdk.ValAddress(valConsAddrs[i]) + suite.app.DistrKeeper.AllocateTokensToValidator(suite.ctx, suite.app.StakingKeeper.Validator(suite.ctx, valAddr), valRewardTokens) + } + + // Withdraw all rewards using a single batch transaction + gasForBatchWithdrawal := suite.ctx.GasMeter().GasConsumed() + res, err := batchMsgServer.WithdrawAllDelegatorRewards(sdk.WrapSDKContext(suite.ctx), batchtypes.NewMsgWithdrawAllDelegatorRewards(delAddr)) + gasForBatchWithdrawal = suite.ctx.GasMeter().GasConsumed() - gasForBatchWithdrawal + suite.Require().NoError(err) + suite.Require().False(res.Amount.IsZero()) + totalBatchRewards := res.Amount + + // check if there are no pending rewards for any validator + for i := 0; i < totalVals; i++ { + valAddr := sdk.ValAddress(valConsAddrs[i]) + val := suite.app.StakingKeeper.Validator(suite.ctx, valAddr) + delegation := suite.app.StakingKeeper.Delegation(suite.ctx, delAddr, valAddr) + endingPeriod := suite.app.DistrKeeper.IncrementValidatorPeriod(suite.ctx, val) + rewards := suite.app.DistrKeeper.CalculateDelegationRewards(suite.ctx, val, delegation, endingPeriod) + suite.Require().True(rewards.IsZero()) + } + + // ===================== Next block ===================== + suite.ctx = suite.ctx.WithBlockHeight(suite.ctx.BlockHeight() + 1) + + // Allocate rewards to validators + for i := 0; i < totalVals; i++ { + valAddr := sdk.ValAddress(valConsAddrs[i]) + suite.app.DistrKeeper.AllocateTokensToValidator(suite.ctx, suite.app.StakingKeeper.Validator(suite.ctx, valAddr), valRewardTokens) + } + + totalGasForIndividualWithdrawals := suite.ctx.GasMeter().GasConsumed() + totalIndividualRewards := sdk.Coins{} + // Withdraw all rewards using multiple individual transactions + for i := 0; i < totalVals; i++ { + valAddr := sdk.ValAddress(valConsAddrs[i]) + // Withdraw rewards + res, err := distrMsgServer.WithdrawDelegatorReward(sdk.WrapSDKContext(suite.ctx), distrtypes.NewMsgWithdrawDelegatorReward(delAddr, valAddr)) + suite.Require().NoError(err) + suite.Require().False(res.Amount.IsZero()) + // check individual rewards are accurate + suite.Require().Equal(res.Amount.String(), expDelegatorRewards.String()) + totalIndividualRewards = totalIndividualRewards.Add(res.Amount...) + } + // check if rewards are same for batch execution and individual executions + suite.Require().Equal(totalIndividualRewards.String(), totalBatchRewards.String()) + // check gas being reduced using batch operation + totalGasForIndividualWithdrawals = suite.ctx.GasMeter().GasConsumed() - totalGasForIndividualWithdrawals + suite.Require().True(gasForBatchWithdrawal < totalGasForIndividualWithdrawals) + suite.T().Log(">>>>>>> Gas usage for batch withdrawals is ", gasForBatchWithdrawal) + suite.T().Log(">>>>>>> Gas usage for individual withdrawals is ", totalGasForIndividualWithdrawals) +} + +func (suite *KeeperTestSuite) TestBatchResetDelegation() { + // Generating validator key pubkey and addresses + totalVals := 75 + valConsPks, valConsAddrs := generateValidatorKeysAndAddresses(totalVals) + + // Setting up msg servers + stakingMsgServer := stakingkeeper.NewMsgServerImpl(suite.app.StakingKeeper) + batchMsgServer := batchkeeper.NewMsgServerImpl(suite.app.BatchKeeper) + + // Setting up validators and delegations + valTokens := sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction) + + delPub := secp256k1.GenPrivKey().PubKey() + delAddr := sdk.AccAddress(delPub.Address()) + suite.app.AccountKeeper.SetAccount(suite.ctx, authtypes.NewBaseAccount(delAddr, nil, 0, 0)) + + delTokens := sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction) + + validators := []string{} + amounts := []sdk.Int{} + for i := 0; i < totalVals; i++ { + // Setup the validator + validator, err := distrtestutil.CreateValidator(valConsPks[i], delTokens) + suite.Require().NoError(err) + + validator, _ = validator.SetInitialCommission(stakingtypes.NewCommission(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), math.LegacyNewDec(0))) + validator, _ = validator.AddTokensFromDel(valTokens) + suite.app.StakingKeeper.SetValidator(suite.ctx, validator) + suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator) + suite.app.StakingKeeper.SetValidatorByPowerIndex(suite.ctx, validator) + + // Call the after-creation hook + err = suite.app.StakingKeeper.Hooks().AfterValidatorCreated(suite.ctx, validator.GetOperator()) + suite.Require().NoError(err) + + validators = append(validators, validator.GetOperator().String()) + amounts = append(amounts, sdk.NewInt(int64(500*(i%5)))) // 0, 500, 1000, 1500, 2000 + + // Mint coins for delegation + delAmount := sdk.NewCoin(sdk.DefaultBondDenom, delTokens) + err = suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, sdk.Coins{delAmount}) + suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, minttypes.ModuleName, delAddr, sdk.Coins{delAmount}) + suite.Require().NoError(err) + + // setup initial delegation + _, err = suite.app.StakingKeeper.Delegate(suite.ctx, delAddr, sdk.NewInt(1000), stakingtypes.Unbonded, validator, true) + suite.Require().NoError(err) + } + + // ===================== First cache context ===================== + cacheCtx1, _ := suite.ctx.CacheContext() + + // Set all delegations using a single batch transaction + gasForBatchDelegation := cacheCtx1.GasMeter().GasConsumed() + _, err := batchMsgServer.BatchResetDelegation(sdk.WrapSDKContext(cacheCtx1), batchtypes.NewMsgBatchResetDelegation(delAddr, validators, amounts)) + gasForBatchDelegation = cacheCtx1.GasMeter().GasConsumed() - gasForBatchDelegation + suite.Require().NoError(err) + + // ===================== Second cache context ===================== + cacheCtx2, _ := suite.ctx.CacheContext() + + totalGasForIndividualDelegations := cacheCtx2.GasMeter().GasConsumed() + // Delegate using multiple individual transactions + for i := 0; i < totalVals; i++ { + valAddr := sdk.ValAddress(valConsAddrs[i]) + existingDelegation := sdk.NewInt(1000) + if amounts[i].GT(existingDelegation) { + _, err := stakingMsgServer.Delegate( + sdk.WrapSDKContext(cacheCtx2), + stakingtypes.NewMsgDelegate( + delAddr, + valAddr, + sdk.NewCoin(sdk.DefaultBondDenom, amounts[i].Sub(existingDelegation)), + ), + ) + suite.Require().NoError(err) + } else if amounts[i].LT(existingDelegation) { + _, err := stakingMsgServer.Undelegate( + sdk.WrapSDKContext(cacheCtx2), + stakingtypes.NewMsgUndelegate( + delAddr, + valAddr, + sdk.NewCoin(sdk.DefaultBondDenom, existingDelegation.Sub(amounts[i])), + ), + ) + suite.Require().NoError(err) + } + } + totalGasForIndividualDelegations = cacheCtx2.GasMeter().GasConsumed() - totalGasForIndividualDelegations + + suite.T().Log(">>>>>>> Gas usage for batch delegation is ", gasForBatchDelegation) + suite.T().Log(">>>>>>> Gas usage for individual delegations is ", totalGasForIndividualDelegations) +} diff --git a/x/batch/keeper/keeper.go b/x/batch/keeper/keeper.go new file mode 100644 index 00000000..3c97b639 --- /dev/null +++ b/x/batch/keeper/keeper.go @@ -0,0 +1,52 @@ +package keeper + +import ( + "fmt" + + "github.com/cometbft/cometbft/libs/log" + + "github.com/Team-Kujira/core/x/batch/types" + + "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" +) + +type ( + Keeper struct { + cdc codec.BinaryCodec + storeKey storetypes.StoreKey + bankKeeper bankkeeper.Keeper + distrKeeper distrkeeper.Keeper + stakingKeeper *stakingkeeper.Keeper + } +) + +func NewKeeper( + cdc codec.BinaryCodec, + storeKey storetypes.StoreKey, + bankKeeper bankkeeper.Keeper, + distrKeeper distrkeeper.Keeper, + stakingKeeper *stakingkeeper.Keeper, +) Keeper { + return Keeper{ + cdc: cdc, + storeKey: storeKey, + bankKeeper: bankKeeper, + distrKeeper: distrKeeper, + stakingKeeper: stakingKeeper, + } +} + +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} + +// withdraw all delegation rewards for a delegator +func (k Keeper) WithdrawAllDelegationRewards(ctx sdk.Context, delAddr sdk.AccAddress) (sdk.Coins, error) { + return k.withdrawAllDelegationRewards(ctx, delAddr) +} diff --git a/x/batch/keeper/keeper_test.go b/x/batch/keeper/keeper_test.go new file mode 100644 index 00000000..5c2d77a4 --- /dev/null +++ b/x/batch/keeper/keeper_test.go @@ -0,0 +1,28 @@ +package keeper_test + +import ( + "testing" + "time" + + "github.com/Team-Kujira/core/app" + tmtypes "github.com/cometbft/cometbft/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/suite" +) + +type KeeperTestSuite struct { + suite.Suite + + ctx sdk.Context + + app *app.App +} + +func (suite *KeeperTestSuite) SetupTest() { + suite.app = app.Setup(suite.T(), false) + suite.ctx = suite.app.BaseApp.NewContext(false, tmtypes.Header{Height: 1, ChainID: "kujira-1", Time: time.Now().UTC()}) +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} diff --git a/x/batch/keeper/msg_server.go b/x/batch/keeper/msg_server.go new file mode 100644 index 00000000..6e689a17 --- /dev/null +++ b/x/batch/keeper/msg_server.go @@ -0,0 +1,58 @@ +package keeper + +import ( + "context" + + "github.com/armon/go-metrics" + + "github.com/Team-Kujira/core/x/batch/types" + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type msgServer struct { + Keeper +} + +var _ types.MsgServer = msgServer{} + +// NewMsgServerImpl returns an implementation of the batch MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +func (k msgServer) WithdrawAllDelegatorRewards(goCtx context.Context, msg *types.MsgWithdrawAllDelegatorRewards) (*types.MsgWithdrawAllDelegatorRewardsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + delAddr, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + amount, err := k.WithdrawAllDelegationRewards(ctx, delAddr) + if err != nil { + return nil, err + } + defer func() { + for _, a := range amount { + if a.Amount.IsInt64() { + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", "withdraw_reward"}, + float32(a.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, + ) + } + } + }() + return &types.MsgWithdrawAllDelegatorRewardsResponse{Amount: amount}, nil +} + +// BatchResetDelegation defines a method to delegate or undelegate in batches +// from existing delegation and target delegation amount +func (k msgServer) BatchResetDelegation(goCtx context.Context, msg *types.MsgBatchResetDelegation) (*types.MsgBatchResetDelegationResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + err := k.batchResetDelegation(ctx, msg) + if err != nil { + return nil, err + } + return &types.MsgBatchResetDelegationResponse{}, nil +} diff --git a/x/batch/module.go b/x/batch/module.go new file mode 100644 index 00000000..89be7a07 --- /dev/null +++ b/x/batch/module.go @@ -0,0 +1,160 @@ +package batch + +import ( + "encoding/json" + "fmt" + + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + abci "github.com/cometbft/cometbft/abci/types" + + "github.com/Team-Kujira/core/x/batch/client/cli" + "github.com/Team-Kujira/core/x/batch/keeper" + "github.com/Team-Kujira/core/x/batch/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface for the batch module. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the batch module's name. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterLegacyAminoCodec(cdc) +} + +// RegisterInterfaces registers the module's interface types +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns the batch module's default genesis state. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis performs genesis state validation for the batch module. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +// RegisterRESTRoutes registers the batch module's REST service handlers. +func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux) {} + +// GetTxCmd returns the batch module's root tx command. +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the batch module's root query command. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return &cobra.Command{} +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface for the batch module. +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper +} + +func NewAppModule( + cdc codec.Codec, + keeper keeper.Keeper, + accountKeeper authkeeper.AccountKeeper, + bankKeeper bankkeeper.Keeper, +) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + } +} + +// Name returns the batch module's name. +func (am AppModule) Name() string { + return am.AppModuleBasic.Name() +} + +// QuerierRoute returns the batch module's query routing key. +func (AppModule) QuerierRoute() string { return types.QuerierRoute } + +// RegisterInvariants registers the batch module's invariants. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// RegisterServices registers module services. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) +} + +// InitGenesis performs the batch module's genesis initialization It returns +// no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + + InitGenesis(ctx, am.keeper, genState) + + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the batch module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(genState) +} + +// ConsensusVersion implements ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return 1 } + +// BeginBlock executes all ABCI BeginBlock logic respective to the batch module. +func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} + +// EndBlock executes all ABCI EndBlock logic respective to the batch module. It +// returns no validator updates. +func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} diff --git a/x/batch/types/codec.go b/x/batch/types/codec.go new file mode 100644 index 00000000..70d67a15 --- /dev/null +++ b/x/batch/types/codec.go @@ -0,0 +1,42 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +// RegisterLegacyAminoCodec registers the necessary x/batch interfaces and concrete types +// on the provided LegacyAmino codec. These types are used for Amino JSON serialization. +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgWithdrawAllDelegatorRewards{}, "batch/MsgWithdrawAllDelegatorRewards", nil) +} + +// RegisterInterfaces registers the x/batch interfaces types with the interface registry +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgWithdrawAllDelegatorRewards{}, + ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + amino = codec.NewLegacyAmino() + + // ModuleCdc references the global x/batch module codec. Note, the codec should + // ONLY be used in certain instances of tests and for JSON encoding as Amino is + // still used for that purpose. + // + // The actual codec used for serialization should be provided to x/staking and + // defined at the application level. + ModuleCdc = codec.NewAminoCodec(amino) +) + +func init() { + RegisterLegacyAminoCodec(amino) + cryptocodec.RegisterCrypto(amino) + amino.Seal() +} diff --git a/x/batch/types/errors.go b/x/batch/types/errors.go new file mode 100644 index 00000000..42bc2077 --- /dev/null +++ b/x/batch/types/errors.go @@ -0,0 +1,14 @@ +package types + +// DONTCOVER + +import ( + errorsmod "cosmossdk.io/errors" +) + +// x/batch module sentinel errors +var ( + ErrValidatorsAndAmountsMismatch = errorsmod.Register(ModuleName, 1, "validators and amounts length mismatch") + ErrInvalidAmount = errorsmod.Register(ModuleName, 2, "invalid amount") + ErrNegativeDelegationAmount = errorsmod.Register(ModuleName, 3, "negative delegation amount") +) diff --git a/x/batch/types/expected_keeper.go b/x/batch/types/expected_keeper.go new file mode 100644 index 00000000..cec67a67 --- /dev/null +++ b/x/batch/types/expected_keeper.go @@ -0,0 +1,51 @@ +package types + +import ( + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +// StakingKeeper is expected keeper for staking module +type SlashingKeeper interface { + Slash(sdk.Context, sdk.ConsAddress, sdk.Dec, int64, int64) // slash the validator and delegators of the validator, specifying slash fraction, offence power and offence height + Jail(sdk.Context, sdk.ConsAddress) // jail a validator +} + +// StakingKeeper is expected keeper for staking module +type StakingKeeper interface { + Validator(ctx sdk.Context, address sdk.ValAddress) stakingtypes.ValidatorI // get validator by operator address; nil when validator not found + TotalBondedTokens(sdk.Context) math.Int // total bonded tokens within the validator set + ValidatorsPowerStoreIterator(ctx sdk.Context) sdk.Iterator // an iterator for the current validator power store + MaxValidators(sdk.Context) uint32 // MaxValidators returns the maximum amount of bonded validators + PowerReduction(ctx sdk.Context) (res math.Int) +} + +// DistributionKeeper is expected keeper for distribution module +type DistributionKeeper interface { + AllocateTokensToValidator(ctx sdk.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins) + + // only used for simulation + GetValidatorOutstandingRewardsCoins(ctx sdk.Context, val sdk.ValAddress) sdk.DecCoins +} + +// AccountKeeper is expected keeper for auth module +type AccountKeeper interface { + GetModuleAddress(name string) sdk.AccAddress + GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI + GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI // only used for simulation +} + +// BankKeeper defines the expected interface needed to retrieve account balances. +type BankKeeper interface { + GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error + GetDenomMetaData(ctx sdk.Context, denom string) (banktypes.Metadata, bool) + SetDenomMetaData(ctx sdk.Context, denomMetaData banktypes.Metadata) + + // only used for simulation + SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins +} diff --git a/x/batch/types/genesis.go b/x/batch/types/genesis.go new file mode 100644 index 00000000..b6362456 --- /dev/null +++ b/x/batch/types/genesis.go @@ -0,0 +1,21 @@ +package types + +// DefaultIndex is the default capability global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default Capability genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{ + Params: DefaultParams(), + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + err := gs.Params.Validate() + if err != nil { + return err + } + return nil +} diff --git a/x/batch/types/genesis.pb.go b/x/batch/types/genesis.pb.go new file mode 100644 index 00000000..5315242a --- /dev/null +++ b/x/batch/types/genesis.pb.go @@ -0,0 +1,321 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: batch/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the batch module's genesis state. +type GenesisState struct { + // params defines the paramaters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_60609f23019c0083, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "batch.GenesisState") +} + +func init() { proto.RegisterFile("batch/genesis.proto", fileDescriptor_60609f23019c0083) } + +var fileDescriptor_60609f23019c0083 = []byte{ + // 187 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4e, 0x4a, 0x2c, 0x49, + 0xce, 0xd0, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x62, 0x05, 0x0b, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x45, 0xf4, 0x41, 0x2c, 0x88, 0xa4, + 0x94, 0x10, 0x44, 0x47, 0x41, 0x62, 0x51, 0x62, 0x2e, 0x54, 0x83, 0x92, 0x35, 0x17, 0x8f, 0x3b, + 0xc4, 0x84, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x6d, 0x2e, 0x36, 0x88, 0xbc, 0x04, 0xa3, 0x02, + 0xa3, 0x06, 0xb7, 0x11, 0xaf, 0x1e, 0x58, 0x93, 0x5e, 0x00, 0x58, 0xd0, 0x89, 0xe5, 0xc4, 0x3d, + 0x79, 0x86, 0x20, 0xa8, 0x12, 0x27, 0xe7, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, + 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, + 0x88, 0xd2, 0x4c, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x0f, 0x49, 0x4d, + 0xcc, 0xd5, 0xf5, 0x2e, 0xcd, 0xca, 0x2c, 0x4a, 0xd4, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0xaf, 0xd0, + 0x87, 0x38, 0xa4, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x10, 0x63, 0x40, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x98, 0x3b, 0xfd, 0xb6, 0xd0, 0x00, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/batch/types/keys.go b/x/batch/types/keys.go new file mode 100644 index 00000000..958dbe9a --- /dev/null +++ b/x/batch/types/keys.go @@ -0,0 +1,22 @@ +package types + +const ( + // ModuleName defines the module name + ModuleName = "batch" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // RouterKey is the message route for slashing + RouterKey = ModuleName + + // QuerierRoute defines the module's query routing key + QuerierRoute = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_batch" +) + +func KeyPrefix(p string) []byte { + return []byte(p) +} diff --git a/x/batch/types/msgs.go b/x/batch/types/msgs.go new file mode 100644 index 00000000..7eebd883 --- /dev/null +++ b/x/batch/types/msgs.go @@ -0,0 +1,90 @@ +package types + +import ( + "cosmossdk.io/errors" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// constants +const ( + TypeMsgWithdrawAllDelegatorRewards = "withdraw_all_rewards" + TypeMsgBatchResetDelegation = "batch_reset_delegation" +) + +var _ sdk.Msg = &MsgWithdrawAllDelegatorRewards{} + +// NewMsgWithdrawAllDelegatorRewards creates a msg to create a new distrib +func NewMsgWithdrawAllDelegatorRewards(delegator sdk.AccAddress) *MsgWithdrawAllDelegatorRewards { + return &MsgWithdrawAllDelegatorRewards{ + DelegatorAddress: delegator.String(), + } +} + +func (m MsgWithdrawAllDelegatorRewards) Route() string { return RouterKey } +func (m MsgWithdrawAllDelegatorRewards) Type() string { return TypeMsgWithdrawAllDelegatorRewards } +func (m MsgWithdrawAllDelegatorRewards) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(m.DelegatorAddress) + if err != nil { + return errors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid delegator address (%s)", err) + } + return nil +} + +func (m MsgWithdrawAllDelegatorRewards) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +func (m MsgWithdrawAllDelegatorRewards) GetSigners() []sdk.AccAddress { + sender, _ := sdk.AccAddressFromBech32(m.DelegatorAddress) + return []sdk.AccAddress{sender} +} + +var _ sdk.Msg = &MsgBatchResetDelegation{} + +// NewMsgWithdrawAllDelegatorRewards creates a msg to create a new distrib +func NewMsgBatchResetDelegation(delegator sdk.AccAddress, validators []string, amounts []math.Int) *MsgBatchResetDelegation { + return &MsgBatchResetDelegation{ + DelegatorAddress: delegator.String(), + Validators: validators, + Amounts: amounts, + } +} + +func (m MsgBatchResetDelegation) Route() string { return RouterKey } +func (m MsgBatchResetDelegation) Type() string { return TypeMsgBatchResetDelegation } +func (m MsgBatchResetDelegation) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(m.DelegatorAddress) + if err != nil { + return errors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid delegator address (%s)", err) + } + + for _, valStr := range m.Validators { + _, err := sdk.ValAddressFromBech32(valStr) + if err != nil { + return err + } + } + + for _, amount := range m.Amounts { + if amount.IsNegative() { + return ErrNegativeDelegationAmount + } + } + + if len(m.Validators) != len(m.Amounts) { + return ErrValidatorsAndAmountsMismatch + } + + return nil +} + +func (m MsgBatchResetDelegation) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +func (m MsgBatchResetDelegation) GetSigners() []sdk.AccAddress { + sender, _ := sdk.AccAddressFromBech32(m.DelegatorAddress) + return []sdk.AccAddress{sender} +} diff --git a/x/batch/types/params.go b/x/batch/types/params.go new file mode 100644 index 00000000..f2aceb2f --- /dev/null +++ b/x/batch/types/params.go @@ -0,0 +1,34 @@ +package types + +import ( + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +// Parameter store keys. +var ( + KeyCreationFee = []byte("CreationFee") +) + +// ParamTable for gamm module. +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +func NewParams() Params { + return Params{} +} + +// default gamm module parameters. +func DefaultParams() Params { + return Params{} +} + +// validate params. +func (p Params) Validate() error { + return nil +} + +// Implements params.ParamSet. +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{} +} diff --git a/x/batch/types/params.pb.go b/x/batch/types/params.pb.go new file mode 100644 index 00000000..f8decffc --- /dev/null +++ b/x/batch/types/params.pb.go @@ -0,0 +1,262 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: batch/params.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params holds parameters for the batch module +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_ef6d3b35fcb21a26, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "batch.Params") +} + +func init() { proto.RegisterFile("batch/params.proto", fileDescriptor_ef6d3b35fcb21a26) } + +var fileDescriptor_ef6d3b35fcb21a26 = []byte{ + // 127 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4a, 0x4a, 0x2c, 0x49, + 0xce, 0xd0, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, + 0x05, 0x8b, 0x29, 0x71, 0x70, 0xb1, 0x05, 0x80, 0x85, 0x9d, 0x9c, 0x4f, 0x3c, 0x92, 0x63, 0xbc, + 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, + 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x33, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, + 0x57, 0x3f, 0x24, 0x35, 0x31, 0x57, 0xd7, 0xbb, 0x34, 0x2b, 0xb3, 0x28, 0x51, 0x3f, 0x39, 0xbf, + 0x28, 0x55, 0xbf, 0x42, 0x1f, 0x62, 0x78, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x70, + 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x48, 0x49, 0x7f, 0x47, 0x72, 0x00, 0x00, 0x00, +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/batch/types/tx.pb.go b/x/batch/types/tx.pb.go new file mode 100644 index 00000000..8dd6725c --- /dev/null +++ b/x/batch/types/tx.pb.go @@ -0,0 +1,1051 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: batch/tx.proto + +package types + +import ( + context "context" + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgWithdrawAllDelegatorRewards represents delegation withdrawal to a delegator +// from all staked validators. +type MsgWithdrawAllDelegatorRewards struct { + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` +} + +func (m *MsgWithdrawAllDelegatorRewards) Reset() { *m = MsgWithdrawAllDelegatorRewards{} } +func (m *MsgWithdrawAllDelegatorRewards) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawAllDelegatorRewards) ProtoMessage() {} +func (*MsgWithdrawAllDelegatorRewards) Descriptor() ([]byte, []int) { + return fileDescriptor_8d39f0ae6f1acfce, []int{0} +} +func (m *MsgWithdrawAllDelegatorRewards) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawAllDelegatorRewards) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawAllDelegatorRewards.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgWithdrawAllDelegatorRewards) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawAllDelegatorRewards.Merge(m, src) +} +func (m *MsgWithdrawAllDelegatorRewards) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawAllDelegatorRewards) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawAllDelegatorRewards.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawAllDelegatorRewards proto.InternalMessageInfo + +// MsgWithdrawAllDelegatorRewardsResponse defines the Msg/WithdrawAllDelegatorRewards response type. +type MsgWithdrawAllDelegatorRewardsResponse struct { + Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` +} + +func (m *MsgWithdrawAllDelegatorRewardsResponse) Reset() { + *m = MsgWithdrawAllDelegatorRewardsResponse{} +} +func (m *MsgWithdrawAllDelegatorRewardsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawAllDelegatorRewardsResponse) ProtoMessage() {} +func (*MsgWithdrawAllDelegatorRewardsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8d39f0ae6f1acfce, []int{1} +} +func (m *MsgWithdrawAllDelegatorRewardsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawAllDelegatorRewardsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawAllDelegatorRewardsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgWithdrawAllDelegatorRewardsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawAllDelegatorRewardsResponse.Merge(m, src) +} +func (m *MsgWithdrawAllDelegatorRewardsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawAllDelegatorRewardsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawAllDelegatorRewardsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawAllDelegatorRewardsResponse proto.InternalMessageInfo + +func (m *MsgWithdrawAllDelegatorRewardsResponse) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Amount + } + return nil +} + +type MsgBatchResetDelegation struct { + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + Validators []string `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators,omitempty"` + Amounts []cosmossdk_io_math.Int `protobuf:"bytes,3,rep,name=amounts,proto3,customtype=cosmossdk.io/math.Int" json:"amounts,omitempty"` +} + +func (m *MsgBatchResetDelegation) Reset() { *m = MsgBatchResetDelegation{} } +func (m *MsgBatchResetDelegation) String() string { return proto.CompactTextString(m) } +func (*MsgBatchResetDelegation) ProtoMessage() {} +func (*MsgBatchResetDelegation) Descriptor() ([]byte, []int) { + return fileDescriptor_8d39f0ae6f1acfce, []int{2} +} +func (m *MsgBatchResetDelegation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBatchResetDelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBatchResetDelegation.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgBatchResetDelegation) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBatchResetDelegation.Merge(m, src) +} +func (m *MsgBatchResetDelegation) XXX_Size() int { + return m.Size() +} +func (m *MsgBatchResetDelegation) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBatchResetDelegation.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBatchResetDelegation proto.InternalMessageInfo + +func (m *MsgBatchResetDelegation) GetDelegatorAddress() string { + if m != nil { + return m.DelegatorAddress + } + return "" +} + +func (m *MsgBatchResetDelegation) GetValidators() []string { + if m != nil { + return m.Validators + } + return nil +} + +type MsgBatchResetDelegationResponse struct { +} + +func (m *MsgBatchResetDelegationResponse) Reset() { *m = MsgBatchResetDelegationResponse{} } +func (m *MsgBatchResetDelegationResponse) String() string { return proto.CompactTextString(m) } +func (*MsgBatchResetDelegationResponse) ProtoMessage() {} +func (*MsgBatchResetDelegationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8d39f0ae6f1acfce, []int{3} +} +func (m *MsgBatchResetDelegationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBatchResetDelegationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBatchResetDelegationResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgBatchResetDelegationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBatchResetDelegationResponse.Merge(m, src) +} +func (m *MsgBatchResetDelegationResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgBatchResetDelegationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBatchResetDelegationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBatchResetDelegationResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgWithdrawAllDelegatorRewards)(nil), "batch.MsgWithdrawAllDelegatorRewards") + proto.RegisterType((*MsgWithdrawAllDelegatorRewardsResponse)(nil), "batch.MsgWithdrawAllDelegatorRewardsResponse") + proto.RegisterType((*MsgBatchResetDelegation)(nil), "batch.MsgBatchResetDelegation") + proto.RegisterType((*MsgBatchResetDelegationResponse)(nil), "batch.MsgBatchResetDelegationResponse") +} + +func init() { proto.RegisterFile("batch/tx.proto", fileDescriptor_8d39f0ae6f1acfce) } + +var fileDescriptor_8d39f0ae6f1acfce = []byte{ + // 500 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0x3f, 0x6f, 0xd3, 0x40, + 0x18, 0xc6, 0x7d, 0x44, 0x14, 0xf5, 0x90, 0x10, 0x58, 0x41, 0x75, 0x83, 0x38, 0xa7, 0x91, 0x28, + 0x01, 0xc9, 0x3e, 0x52, 0x36, 0xb6, 0xb8, 0x30, 0x54, 0x28, 0x8b, 0x41, 0x20, 0x31, 0x50, 0x9d, + 0xed, 0x93, 0x73, 0x34, 0xf6, 0x45, 0x7e, 0x2f, 0x69, 0x59, 0x59, 0x60, 0x41, 0xe2, 0x23, 0x74, + 0x66, 0x62, 0xc8, 0x87, 0xe8, 0x58, 0x65, 0x42, 0x1d, 0x0a, 0x4a, 0x24, 0xe0, 0x63, 0x20, 0xdb, + 0xe7, 0x52, 0x44, 0x88, 0x18, 0x98, 0xce, 0xf7, 0x3e, 0xfe, 0x3d, 0x7e, 0xfd, 0xfe, 0xc1, 0x57, + 0x02, 0xa6, 0xc2, 0x3e, 0x55, 0x07, 0xee, 0x30, 0x93, 0x4a, 0x9a, 0x17, 0x8b, 0x7b, 0xa3, 0x1e, + 0xcb, 0x58, 0x16, 0x11, 0x9a, 0x3f, 0x95, 0x62, 0x83, 0x84, 0x12, 0x12, 0x09, 0x34, 0x60, 0xc0, + 0xe9, 0xb8, 0x13, 0x70, 0xc5, 0x3a, 0x34, 0x94, 0x22, 0xd5, 0xfa, 0x7a, 0xa9, 0xef, 0x96, 0x60, + 0x79, 0xd1, 0xd2, 0x9a, 0x46, 0x13, 0x88, 0xe9, 0xb8, 0x93, 0x1f, 0xa5, 0xd0, 0x7a, 0x8b, 0x30, + 0xe9, 0x41, 0xfc, 0x5c, 0xa8, 0x7e, 0x94, 0xb1, 0xfd, 0xee, 0x60, 0xf0, 0x90, 0x0f, 0x78, 0xcc, + 0x94, 0xcc, 0x7c, 0xbe, 0xcf, 0xb2, 0x08, 0xcc, 0x47, 0xf8, 0x5a, 0x54, 0xc5, 0x76, 0x59, 0x14, + 0x65, 0x1c, 0xc0, 0x42, 0x4d, 0xd4, 0x5e, 0xf5, 0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x78, 0x27, 0x55, + 0x7e, 0xc5, 0xb5, 0x36, 0xb0, 0xfd, 0x97, 0xff, 0xac, 0x0a, 0xbe, 0x75, 0x82, 0x70, 0xad, 0x07, + 0xb1, 0x09, 0xf8, 0xc6, 0xb2, 0x49, 0xb9, 0xe5, 0x16, 0xe3, 0xeb, 0x2e, 0x6f, 0x63, 0xc3, 0xf9, + 0xa7, 0xd7, 0xce, 0xba, 0xfd, 0x12, 0xd7, 0x17, 0x36, 0x81, 0xfc, 0xb2, 0x59, 0xa4, 0x37, 0x36, + 0x97, 0xeb, 0x95, 0xbf, 0xb7, 0x7d, 0x34, 0x23, 0xe8, 0x78, 0x46, 0xd0, 0xd7, 0x19, 0x41, 0x1f, + 0xe6, 0xc4, 0x38, 0x9e, 0x13, 0xe3, 0xf3, 0x9c, 0x18, 0x2f, 0xee, 0x9c, 0x1b, 0x9a, 0xa7, 0x9c, + 0x25, 0xce, 0xe3, 0xd1, 0x2b, 0x91, 0x31, 0x1a, 0xca, 0x8c, 0xd3, 0x03, 0xaa, 0x77, 0x37, 0x9f, + 0x9d, 0x60, 0xa5, 0x58, 0xa7, 0xfb, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x0c, 0x45, 0xab, 0x52, + 0xd1, 0x03, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // WithdrawAllDelegatorRewards defines a method to withdraw rewards of delegator + // from all staked validators. + WithdrawAllDelegatorRewards(ctx context.Context, in *MsgWithdrawAllDelegatorRewards, opts ...grpc.CallOption) (*MsgWithdrawAllDelegatorRewardsResponse, error) + // BatchResetDelegation defines a method to delegate or undelegate in batches + // from existing delegation and target delegation amount + BatchResetDelegation(ctx context.Context, in *MsgBatchResetDelegation, opts ...grpc.CallOption) (*MsgBatchResetDelegationResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) WithdrawAllDelegatorRewards(ctx context.Context, in *MsgWithdrawAllDelegatorRewards, opts ...grpc.CallOption) (*MsgWithdrawAllDelegatorRewardsResponse, error) { + out := new(MsgWithdrawAllDelegatorRewardsResponse) + err := c.cc.Invoke(ctx, "/batch.Msg/WithdrawAllDelegatorRewards", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) BatchResetDelegation(ctx context.Context, in *MsgBatchResetDelegation, opts ...grpc.CallOption) (*MsgBatchResetDelegationResponse, error) { + out := new(MsgBatchResetDelegationResponse) + err := c.cc.Invoke(ctx, "/batch.Msg/BatchResetDelegation", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // WithdrawAllDelegatorRewards defines a method to withdraw rewards of delegator + // from all staked validators. + WithdrawAllDelegatorRewards(context.Context, *MsgWithdrawAllDelegatorRewards) (*MsgWithdrawAllDelegatorRewardsResponse, error) + // BatchResetDelegation defines a method to delegate or undelegate in batches + // from existing delegation and target delegation amount + BatchResetDelegation(context.Context, *MsgBatchResetDelegation) (*MsgBatchResetDelegationResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) WithdrawAllDelegatorRewards(ctx context.Context, req *MsgWithdrawAllDelegatorRewards) (*MsgWithdrawAllDelegatorRewardsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawAllDelegatorRewards not implemented") +} +func (*UnimplementedMsgServer) BatchResetDelegation(ctx context.Context, req *MsgBatchResetDelegation) (*MsgBatchResetDelegationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BatchResetDelegation not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_WithdrawAllDelegatorRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawAllDelegatorRewards) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).WithdrawAllDelegatorRewards(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/batch.Msg/WithdrawAllDelegatorRewards", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).WithdrawAllDelegatorRewards(ctx, req.(*MsgWithdrawAllDelegatorRewards)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_BatchResetDelegation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgBatchResetDelegation) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).BatchResetDelegation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/batch.Msg/BatchResetDelegation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).BatchResetDelegation(ctx, req.(*MsgBatchResetDelegation)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "batch.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "WithdrawAllDelegatorRewards", + Handler: _Msg_WithdrawAllDelegatorRewards_Handler, + }, + { + MethodName: "BatchResetDelegation", + Handler: _Msg_BatchResetDelegation_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "batch/tx.proto", +} + +func (m *MsgWithdrawAllDelegatorRewards) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgWithdrawAllDelegatorRewards) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawAllDelegatorRewards) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawAllDelegatorRewardsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgWithdrawAllDelegatorRewardsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawAllDelegatorRewardsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Amount) > 0 { + for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MsgBatchResetDelegation) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgBatchResetDelegation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBatchResetDelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Amounts) > 0 { + for iNdEx := len(m.Amounts) - 1; iNdEx >= 0; iNdEx-- { + { + size := m.Amounts[iNdEx].Size() + i -= size + if _, err := m.Amounts[iNdEx].MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Validators[iNdEx]) + copy(dAtA[i:], m.Validators[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Validators[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgBatchResetDelegationResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgBatchResetDelegationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBatchResetDelegationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgWithdrawAllDelegatorRewards) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgWithdrawAllDelegatorRewardsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgBatchResetDelegation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Validators) > 0 { + for _, s := range m.Validators { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if len(m.Amounts) > 0 { + for _, e := range m.Amounts { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgBatchResetDelegationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgWithdrawAllDelegatorRewards) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgWithdrawAllDelegatorRewards: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawAllDelegatorRewards: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgWithdrawAllDelegatorRewardsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgWithdrawAllDelegatorRewardsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawAllDelegatorRewardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = append(m.Amount, types.Coin{}) + if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgBatchResetDelegation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgBatchResetDelegation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBatchResetDelegation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validators = append(m.Validators, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amounts", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.Amounts = append(m.Amounts, v) + if err := m.Amounts[len(m.Amounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgBatchResetDelegationResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgBatchResetDelegationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBatchResetDelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/batch/types/types.go b/x/batch/types/types.go new file mode 100644 index 00000000..ab1254f4 --- /dev/null +++ b/x/batch/types/types.go @@ -0,0 +1 @@ +package types diff --git a/x/batch/wasm/interface_msg.go b/x/batch/wasm/interface_msg.go new file mode 100644 index 00000000..22cb8ca8 --- /dev/null +++ b/x/batch/wasm/interface_msg.go @@ -0,0 +1,53 @@ +package wasm + +import ( + "cosmossdk.io/errors" + wasmvmtypes "github.com/CosmWasm/wasmvm/types" + batchkeeper "github.com/Team-Kujira/core/x/batch/keeper" + batchtypes "github.com/Team-Kujira/core/x/batch/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type BatchMsg struct { + // Contracts can withdraw all rewards for the delegations from the contract. + WithdrawAllDelegatorRewards *WithdrawAllDelegatorRewards `json:"withdrawAllDelegatorRewards,omitempty"` +} + +type WithdrawAllDelegatorRewards struct{} + +// withdrawAllDelegatorRewards withdraw all delegation rewards for the delegations from the contract address +func withdrawAllDelegatorRewards(ctx sdk.Context, contractAddr sdk.AccAddress, withdrawAllDelegatorRewards *WithdrawAllDelegatorRewards, bk batchkeeper.Keeper) ([]sdk.Event, [][]byte, error) { + err := PerformWithdrawAllDelegatorRewards(bk, ctx, contractAddr, withdrawAllDelegatorRewards) + if err != nil { + return nil, nil, errors.Wrap(err, "perform withdrawAllDelegatorRewards") + } + return nil, nil, nil +} + +// PerformWithdrawAllDelegatorRewards is used to perform delegation rewards from the contract delegations +func PerformWithdrawAllDelegatorRewards(bk batchkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, _ *WithdrawAllDelegatorRewards) error { + msgServer := batchkeeper.NewMsgServerImpl(bk) + msgWithdrawAllDelegatorRewards := batchtypes.NewMsgWithdrawAllDelegatorRewards(contractAddr) + + if err := msgWithdrawAllDelegatorRewards.ValidateBasic(); err != nil { + return errors.Wrap(err, "failed validating MsgWithdrawAllDelegatorRewards") + } + + _, err := msgServer.WithdrawAllDelegatorRewards( + sdk.WrapSDKContext(ctx), + msgWithdrawAllDelegatorRewards, + ) + if err != nil { + return errors.Wrap(err, "batch claim") + } + return nil +} + +// QueryCustom implements custom msg interface +func HandleMsg(dk batchkeeper.Keeper, contractAddr sdk.AccAddress, ctx sdk.Context, q *BatchMsg) ([]sdk.Event, [][]byte, error) { + if q.WithdrawAllDelegatorRewards != nil { + return withdrawAllDelegatorRewards(ctx, contractAddr, q.WithdrawAllDelegatorRewards, dk) + } + + return nil, nil, wasmvmtypes.UnsupportedRequest{Kind: "unknown Custom variant"} +} diff --git a/x/cw-ica/client/cli/query.go b/x/cw-ica/client/cli/query.go new file mode 100644 index 00000000..bfb77701 --- /dev/null +++ b/x/cw-ica/client/cli/query.go @@ -0,0 +1,48 @@ +package cli + +import ( + "github.com/Team-Kujira/core/x/cw-ica/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" +) + +// GetQueryCmd creates and returns the cwica query command +func GetQueryCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: "Querying commands for the cw-ica module", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(getInterchainAccountCmd()) + + return cmd +} + +func getInterchainAccountCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "account [connection-id] [account-id] [owner-account]", + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.InterchainAccount(cmd.Context(), types.NewQueryInterchainAccountRequest(args[0], args[1], args[2])) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/cw-ica/client/cli/tx.go b/x/cw-ica/client/cli/tx.go new file mode 100644 index 00000000..ec0243e3 --- /dev/null +++ b/x/cw-ica/client/cli/tx.go @@ -0,0 +1,22 @@ +package cli + +import ( + "github.com/Team-Kujira/core/x/cw-ica/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" +) + +// GetTxCmd creates and returns the cwica tx command +func GetTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: "Transaction commands for the cw-ica module", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand() + + return cmd +} diff --git a/x/cw-ica/ibc_module.go b/x/cw-ica/ibc_module.go new file mode 100644 index 00000000..a7c112a8 --- /dev/null +++ b/x/cw-ica/ibc_module.go @@ -0,0 +1,125 @@ +package cwica + +import ( + "errors" + + "github.com/Team-Kujira/core/x/cw-ica/keeper" + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" +) + +var _ porttypes.IBCModule = IBCModule{} + +// IBCModule implements the ICS26 interface for interchain accounts controller chains +type IBCModule struct { + keeper keeper.Keeper +} + +// NewIBCModule creates a new IBCModule given the keeper +func NewIBCModule(k keeper.Keeper) IBCModule { + return IBCModule{ + keeper: k, + } +} + +// OnChanOpenInit implements the IBCModule interface. We don't need to implement this handler. +func (im IBCModule) OnChanOpenInit( + _ sdk.Context, + _ channeltypes.Order, + _ []string, + _ string, + _ string, + _ *capabilitytypes.Capability, + _ channeltypes.Counterparty, + version string, +) (string, error) { + return version, nil +} + +// OnChanOpenTry implements the IBCModule interface. We don't need to implement this handler. +func (im IBCModule) OnChanOpenTry( + _ sdk.Context, + _ channeltypes.Order, + _ []string, + _, + _ string, + _ *capabilitytypes.Capability, + _ channeltypes.Counterparty, + _ string, +) (string, error) { + return "", nil +} + +// OnChanOpenAck implements the IBCModule interface. This handler is called after we create an +// account on a remote zone (because icaControllerKeeper.RegisterInterchainAccount opens a channel). +func (im IBCModule) OnChanOpenAck( + ctx sdk.Context, + portID, + channelID string, + counterPartyChannelID string, + counterpartyVersion string, +) error { + return im.keeper.HandleChanOpenAck(ctx, portID, channelID, counterPartyChannelID, counterpartyVersion) +} + +// OnChanOpenConfirm implements the IBCModule interface. We don't need to implement this handler. +func (im IBCModule) OnChanOpenConfirm( + _ sdk.Context, + _, + _ string, +) error { + return nil +} + +// OnChanCloseInit implements the IBCModule interface. We don't need to implement this handler. +// Handler will be implemented in https://p2pvalidator.atlassian.net/browse/LSC-137 +func (im IBCModule) OnChanCloseInit( + _ sdk.Context, + _, + _ string, +) error { + return nil +} + +// OnChanCloseConfirm implements the IBCModule interface. We don't need to implement this handler. +func (im IBCModule) OnChanCloseConfirm( + _ sdk.Context, + _, + _ string, +) error { + return nil +} + +// OnRecvPacket implements the IBCModule interface. A successful acknowledgement +// is returned if the packet data is successfully decoded and the receiving application +// logic returns without error. +func (im IBCModule) OnRecvPacket( + _ sdk.Context, + _ channeltypes.Packet, + _ sdk.AccAddress, +) ibcexported.Acknowledgement { + return channeltypes.NewErrorAcknowledgement(errors.New("cannot receive packet via interchain accounts authentication module")) +} + +// OnAcknowledgementPacket implements the IBCModule interface. +func (im IBCModule) OnAcknowledgementPacket( + ctx sdk.Context, + packet channeltypes.Packet, + acknowledgement []byte, + relayer sdk.AccAddress, +) error { + return im.keeper.HandleAcknowledgement(ctx, packet, acknowledgement, relayer) +} + +// OnTimeoutPacket implements the IBCModule interface. +func (im IBCModule) OnTimeoutPacket( + ctx sdk.Context, + packet channeltypes.Packet, + relayer sdk.AccAddress, +) error { + return im.keeper.HandleTimeout(ctx, packet, relayer) +} diff --git a/x/cw-ica/keeper/callback.go b/x/cw-ica/keeper/callback.go new file mode 100644 index 00000000..6f4fc711 --- /dev/null +++ b/x/cw-ica/keeper/callback.go @@ -0,0 +1,56 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/Team-Kujira/core/x/cw-ica/types" +) + +// SetCallbackData set a specific callbackData in the store from its index +func (k Keeper) SetCallbackData(ctx sdk.Context, data types.CallbackData) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.CallbackDataKeyPrefix)) + b := k.Codec.MustMarshal(&data) + store.Set(types.CallbackDataKey(types.PacketID(data.PortId, data.ChannelId, data.Sequence)), b) +} + +// GetCallbackData returns a callbackData from its index +func (k Keeper) GetCallbackData( + ctx sdk.Context, + callbackKey string, +) (val types.CallbackData, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.CallbackDataKeyPrefix)) + + b := store.Get(types.CallbackDataKey(callbackKey)) + if b == nil { + return val, false + } + + k.Codec.MustUnmarshal(b, &val) + return val, true +} + +// RemoveCallbackData removes a callbackData from the store +func (k Keeper) RemoveCallbackData( + ctx sdk.Context, + callbackKey string, +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.CallbackDataKeyPrefix)) + store.Delete(types.CallbackDataKey(callbackKey)) +} + +// GetAllCallbackData returns all callbackData +func (k Keeper) GetAllCallbackData(ctx sdk.Context) (list []types.CallbackData) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.CallbackDataKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.CallbackData + k.Codec.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/cw-ica/keeper/grpc_query.go b/x/cw-ica/keeper/grpc_query.go new file mode 100644 index 00000000..0eb080b1 --- /dev/null +++ b/x/cw-ica/keeper/grpc_query.go @@ -0,0 +1,32 @@ +package keeper + +import ( + "context" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + sdk "github.com/cosmos/cosmos-sdk/types" + icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" + + "github.com/Team-Kujira/core/x/cw-ica/types" +) + +// InterchainAccount implements the Query/InterchainAccount gRPC method +func (k Keeper) InterchainAccount(goCtx context.Context, req *types.QueryInterchainAccountRequest) (*types.QueryInterchainAccountResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + owner := req.Owner + "-" + req.AccountId + + portID, err := icatypes.NewControllerPortID(owner) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "could not find account: %s", err) + } + + addr, found := k.icaControllerKeeper.GetInterchainAccountAddress(ctx, req.ConnectionId, portID) + if !found { + return nil, status.Errorf(codes.NotFound, "no account found for portID %s", portID) + } + + return types.NewQueryInterchainAccountResponse(addr), nil +} diff --git a/x/cw-ica/keeper/ibc_handlers.go b/x/cw-ica/keeper/ibc_handlers.go new file mode 100644 index 00000000..a4ad578d --- /dev/null +++ b/x/cw-ica/keeper/ibc_handlers.go @@ -0,0 +1,197 @@ +package keeper + +import ( + "fmt" + "strings" + + "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/Team-Kujira/core/x/cw-ica/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" +) + +const ( + // GasReserve is the amount of gas on the context gas meter we need to reserve in order to add contract failure to keeper + GasReserve = 15000 +) + +func (k *Keeper) outOfGasRecovery( + ctx sdk.Context, + gasMeter sdk.GasMeter, +) { + if r := recover(); r != nil { + _, ok := r.(sdk.ErrorOutOfGas) + if !ok || !gasMeter.IsOutOfGas() { + panic(r) + } + + k.Logger(ctx).Debug("Out of gas", "Gas meter", gasMeter.String()) + } +} + +// createCachedContext creates a cached context for handling Sudo calls to CosmWasm smart-contracts. +// If there is an error during Sudo call, we can safely revert changes made in cached context. +func (k *Keeper) createCachedContext(ctx sdk.Context) (sdk.Context, func(), sdk.GasMeter) { + gasMeter := ctx.GasMeter() + // determines type of gas meter by its prefix: + // * BasicGasMeter - basic gas meter which is used for processing tx directly in block; + // * InfiniteGasMeter - is used to process txs during simulation calls. We don't need to create a limit for such meter, + // since it's infinite. + gasMeterIsLimited := strings.HasPrefix(ctx.GasMeter().String(), "BasicGasMeter") + + cacheCtx, writeFn := ctx.CacheContext() + + // if gas meter is limited: + // 1. calculate how much free gas left we have for a Sudo call; + // 2. If gasLeft less than reserved gas (GasReserved), we set gas limit for cached context to zero, meaning we can't + // process Sudo call; + // 3. If we have more gas left than reserved gas (GasReserved) for Sudo call, we set gas limit for cached context to + // difference between gas left and reserved gas: (gasLeft - GasReserve); + // + // GasReserve is the amount of gas on the context gas meter we need to reserve in order to add contract failure to keeper + // and process failed Sudo call + if gasMeterIsLimited { + gasLeft := gasMeter.Limit() - gasMeter.GasConsumed() + + var newLimit uint64 + if gasLeft < GasReserve { + newLimit = 0 + } else { + newLimit = gasLeft - GasReserve + } + + gasMeter = sdk.NewGasMeter(newLimit) + } + + cacheCtx = cacheCtx.WithGasMeter(gasMeter) + + return cacheCtx, writeFn, gasMeter +} + +// HandleAcknowledgement passes the acknowledgement data to the appropriate contract via a Sudo call. +func (k *Keeper) HandleAcknowledgement(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, _ sdk.AccAddress) error { + k.Logger(ctx).Debug("Handling acknowledgement") + var ack channeltypes.Acknowledgement + if err := channeltypes.SubModuleCdc.UnmarshalJSON(acknowledgement, &ack); err != nil { + k.Logger(ctx).Error("HandleAcknowledgement: cannot unmarshal ICS-27 packet acknowledgement", "error", err) + return errors.Wrapf(sdkerrors.ErrUnknownRequest, "cannot unmarshal ICS-27 packet acknowledgement: %v", err) + } + + cacheCtx, writeFn, newGasMeter := k.createCachedContext(ctx) + defer k.outOfGasRecovery(ctx, newGasMeter) + + // Actually we have only one kind of error returned from acknowledgement + // maybe later we'll retrieve actual errors from events + errorText := ack.GetError() + var err error + if errorText != "" { + err = k.CallRegisteredICATxCallback(cacheCtx, packet, types.IcaCallbackResult{ + Error: &types.IcaCallbackError{ + Error: errorText, + }, + }) + } else { + err = k.CallRegisteredICATxCallback(cacheCtx, packet, types.IcaCallbackResult{ + Success: &types.IcaCallbackSuccess{ + Data: ack.GetResult(), + }, + }) + } + + if err != nil { + k.Logger(ctx).Debug("HandleAcknowledgement: failed to Sudo contract on packet acknowledgement", "error", err) + } else { + ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events()) + writeFn() + } + + ctx.GasMeter().ConsumeGas(newGasMeter.GasConsumed(), "consume from cached context") + return nil +} + +// HandleTimeout passes the timeout data to the appropriate contract via a Sudo call. +// Since all ICA channels are ORDERED, a single timeout shuts down a channel. +// The affected zone should be paused after a timeout. +func (k *Keeper) HandleTimeout(ctx sdk.Context, packet channeltypes.Packet, _ sdk.AccAddress) error { + k.Logger(ctx).Debug("HandleTimeout") + + cacheCtx, writeFn, newGasMeter := k.createCachedContext(ctx) + defer k.outOfGasRecovery(ctx, newGasMeter) + + err := k.CallRegisteredICATxCallback(ctx, packet, types.IcaCallbackResult{ + Timeout: &types.IcaCallbackTimeout{}, + }) + if err != nil { + k.Logger(ctx).Error("HandleTimeout: failed to Sudo contract on packet timeout", "port", packet.SourcePort, "error", err) + } else { + ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events()) + writeFn() + } + + ctx.GasMeter().ConsumeGas(newGasMeter.GasConsumed(), "consume from cached context") + return nil +} + +// HandleChanOpenAck passes the data about a successfully created channel to the appropriate contract +// (== the data about a successfully registered interchain account). +// Notice that in the case of an ICA channel - it is not yet in OPEN state here +// the last step of channel opening(confirm) happens on the host chain. +func (k *Keeper) HandleChanOpenAck( + ctx sdk.Context, + portID, + channelID, + counterpartyChannelID, + counterpartyVersion string, +) error { + k.Logger(ctx).Debug("HandleChanOpenAck", "port_id", portID, "channel_id", channelID, "counterparty_channel_id", counterpartyChannelID, "counterparty_version", counterpartyVersion) + + // Get the callback key and associated callback data from the packet + callbackDataKey := types.PacketID(portID, "", 0) + callbackData, found := k.GetCallbackData(ctx, callbackDataKey) + if !found { + k.Logger(ctx).Info(fmt.Sprintf("callback data not found for portID: %s, channelID: %s, sequence: %d", portID, "", 0)) + return nil + } + + cacheCtx, writeFn, newGasMeter := k.createCachedContext(ctx) + defer k.outOfGasRecovery(ctx, newGasMeter) + + // If there's an associated callback function, execute it + _, err := k.SudoIcaRegisterCallback(cacheCtx, callbackData, types.IcaCallbackResult{ + Success: &types.IcaCallbackSuccess{ + Data: []byte(counterpartyVersion), + }, + }) + if err != nil { + k.Logger(ctx).Error("SudoCallback failure", "error", err) + } else { + writeFn() + } + + // remove the callback data + k.RemoveCallbackData(ctx, callbackDataKey) + return nil +} + +func (k Keeper) CallRegisteredICATxCallback(ctx sdk.Context, packet channeltypes.Packet, result types.IcaCallbackResult) error { + // Get the callback key and associated callback data from the packet + callbackDataKey := types.PacketID(packet.GetSourcePort(), packet.GetSourceChannel(), packet.Sequence) + callbackData, found := k.GetCallbackData(ctx, callbackDataKey) + if !found { + k.Logger(ctx).Info(fmt.Sprintf("callback data not found for portID: %s, channelID: %s, sequence: %d", + packet.SourcePort, packet.SourceChannel, packet.Sequence)) + return nil + } + + // If there's an associated callback function, execute it + _, err := k.SudoIcaTxCallback(ctx, callbackData, result) + if err != nil { + return err + } + + // remove the callback data + k.RemoveCallbackData(ctx, callbackDataKey) + return nil +} diff --git a/x/cw-ica/keeper/keeper.go b/x/cw-ica/keeper/keeper.go new file mode 100644 index 00000000..4eae5702 --- /dev/null +++ b/x/cw-ica/keeper/keeper.go @@ -0,0 +1,51 @@ +package keeper + +import ( + "fmt" + + "github.com/cometbft/cometbft/libs/log" + "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + "github.com/Team-Kujira/core/x/cw-ica/types" + icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" +) + +type Keeper struct { + Codec codec.Codec + + storeKey storetypes.StoreKey + + scopedKeeper capabilitykeeper.ScopedKeeper + icaControllerKeeper icacontrollerkeeper.Keeper + wasmKeeper *wasmkeeper.Keeper +} + +func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey, iaKeeper icacontrollerkeeper.Keeper, scopedKeeper capabilitykeeper.ScopedKeeper, wasmKeeper *wasmkeeper.Keeper) Keeper { + return Keeper{ + Codec: cdc, + storeKey: storeKey, + + scopedKeeper: scopedKeeper, + icaControllerKeeper: iaKeeper, + wasmKeeper: wasmKeeper, + } +} + +// Logger returns the application logger, scoped to the associated module +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} + +// ClaimCapability claims the channel capability passed via the OnOpenChanInit callback +func (k *Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error { + return k.scopedKeeper.ClaimCapability(ctx, cap, name) +} + +func (k Keeper) IcaControllerKeeper() icacontrollerkeeper.Keeper { + return k.icaControllerKeeper +} diff --git a/x/cw-ica/keeper/keeper_test.go b/x/cw-ica/keeper/keeper_test.go new file mode 100644 index 00000000..489f55d0 --- /dev/null +++ b/x/cw-ica/keeper/keeper_test.go @@ -0,0 +1,136 @@ +package keeper_test + +import ( + "encoding/json" + "testing" + + dbm "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/libs/log" + "github.com/stretchr/testify/suite" + + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + "github.com/cosmos/cosmos-sdk/server" + icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + ibctesting "github.com/cosmos/ibc-go/v7/testing" + + icaapp "github.com/Team-Kujira/core/app" +) + +var ( + // TestOwnerAddress defines a reusable bech32 address for testing purposes + TestOwnerAddress = "cosmos17dtl0mjt3t77kpuhg2edqzjpszulwhgzuj9ljs" + + // TestAccountId defines a reusable interchainaccounts account id for testing purposes + TestAccountId = "1" + + // TestPortID defines a reusable port identifier for testing purposes + TestPortID, _ = icatypes.NewControllerPortID(TestOwnerAddress) + + // TestVersion defines a reusable interchainaccounts version string for testing purposes + TestVersion = string(icatypes.ModuleCdc.MustMarshalJSON(&icatypes.Metadata{ + Version: icatypes.Version, + ControllerConnectionId: ibctesting.FirstConnectionID, + HostConnectionId: ibctesting.FirstConnectionID, + Encoding: icatypes.EncodingProtobuf, + TxType: icatypes.TxTypeSDKMultiMsg, + })) +) + +func init() { + ibctesting.DefaultTestingAppInit = SetupICATestingApp +} + +func SetupICATestingApp() (ibctesting.TestingApp, map[string]json.RawMessage) { + db := dbm.NewMemDB() + encCdc := icaapp.MakeEncodingConfig() + + var wasmOpts []wasmkeeper.Option + baseappOptions := server.DefaultBaseappOptions(nil) + app := icaapp.New(log.NewNopLogger(), db, nil, true, encCdc, nil, wasmOpts, baseappOptions...) + return app, icaapp.NewDefaultGenesisState(encCdc.Codec) +} + +// KeeperTestSuite is a testing suite to test keeper functions +type KeeperTestSuite struct { + suite.Suite + + coordinator *ibctesting.Coordinator + + // testing chains used for convenience and readability + chainA *ibctesting.TestChain + chainB *ibctesting.TestChain +} + +// TestKeeperTestSuite runs all the tests within this package. +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} + +// SetupTest creates a coordinator with 2 test chains. +func (suite *KeeperTestSuite) SetupTest() { + suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) + suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(1)) + suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(2)) +} + +func NewICAPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { + path := ibctesting.NewPath(chainA, chainB) + 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 + + 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() +} + +func GetICAApp(chain *ibctesting.TestChain) *icaapp.App { + app, ok := chain.App.(*icaapp.App) + if !ok { + panic("not ica app") + } + + return app +} + +// RegisterInterchainAccount is a helper function for starting the channel handshake +func RegisterInterchainAccount(endpoint *ibctesting.Endpoint, owner string) error { + portID, err := icatypes.NewControllerPortID(owner) + if err != nil { + return err + } + + channelSequence := endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextChannelSequence(endpoint.Chain.GetContext()) + + if err := GetICAApp(endpoint.Chain).ICAControllerKeeper.RegisterInterchainAccount(endpoint.Chain.GetContext(), endpoint.ConnectionID, owner, TestVersion); 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 +} diff --git a/x/cw-ica/keeper/msg_server.go b/x/cw-ica/keeper/msg_server.go new file mode 100644 index 00000000..0f24c6ea --- /dev/null +++ b/x/cw-ica/keeper/msg_server.go @@ -0,0 +1,16 @@ +package keeper + +import ( + "github.com/Team-Kujira/core/x/cw-ica/types" +) + +var _ types.MsgServer = msgServer{} + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl creates and returns a new types.MsgServer, fulfilling the cwica Msg service interface +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} diff --git a/x/cw-ica/keeper/msg_server_test.go b/x/cw-ica/keeper/msg_server_test.go new file mode 100644 index 00000000..94292649 --- /dev/null +++ b/x/cw-ica/keeper/msg_server_test.go @@ -0,0 +1 @@ +package keeper_test diff --git a/x/cw-ica/keeper/sudo.go b/x/cw-ica/keeper/sudo.go new file mode 100644 index 00000000..65cd42d1 --- /dev/null +++ b/x/cw-ica/keeper/sudo.go @@ -0,0 +1,92 @@ +package keeper + +import ( + "encoding/json" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/Team-Kujira/core/x/cw-ica/types" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" +) + +func (k Keeper) HasContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress) bool { + return k.wasmKeeper.HasContractInfo(ctx, contractAddress) +} + +func (k Keeper) SudoIcaRegisterCallback( + ctx sdk.Context, + callbackData types.CallbackData, + result types.IcaCallbackResult, +) ([]byte, error) { + contractAddr := sdk.MustAccAddressFromBech32(callbackData.Contract) + + if !k.wasmKeeper.HasContractInfo(ctx, contractAddr) { + if callbackData.PortId == ibctransfertypes.PortID { + // we want to allow non contract account to send the assets via IBC Transfer module + // we can determine the originating module by the source port of the request packet + return nil, nil + } + k.Logger(ctx).Debug("SudoCallback: contract not found", "senderAddress", contractAddr) + return nil, fmt.Errorf("%s is not a contract address and not the Transfer module", contractAddr) + } + + x := types.MessageRegisterCallback{} + x.IcaRegisterCallback.ConnID = callbackData.ConnectionId + x.IcaRegisterCallback.AccID = callbackData.AccountId + x.IcaRegisterCallback.Callback = callbackData.Callback + x.IcaRegisterCallback.Result = result + + m, err := json.Marshal(x) + if err != nil { + k.Logger(ctx).Error("SudoCallback: failed to marshal MessageResponse message", "error", err, "contractAddress", contractAddr) + return nil, fmt.Errorf("failed to marshal MessageResponse: %v", err) + } + + resp, err := k.wasmKeeper.Sudo(ctx, contractAddr, m) + if err != nil { + k.Logger(ctx).Debug("SudoResponse: failed to Sudo", "error", err, "contractAddress", contractAddr) + return nil, fmt.Errorf("failed to Sudo: %v", err) + } + + return resp, nil +} + +func (k Keeper) SudoIcaTxCallback( + ctx sdk.Context, + callbackData types.CallbackData, + result types.IcaCallbackResult, +) ([]byte, error) { + contractAddr := sdk.MustAccAddressFromBech32(callbackData.Contract) + + if !k.wasmKeeper.HasContractInfo(ctx, contractAddr) { + if callbackData.PortId == ibctransfertypes.PortID { + // we want to allow non contract account to send the assets via IBC Transfer module + // we can determine the originating module by the source port of the request packet + return nil, nil + } + k.Logger(ctx).Debug("SudoCallback: contract not found", "senderAddress", contractAddr) + return nil, fmt.Errorf("%s is not a contract address and not the Transfer module", contractAddr) + } + + x := types.MessageTxCallback{} + x.IcaTxCallback.ConnID = callbackData.ConnectionId + x.IcaTxCallback.AccID = callbackData.AccountId + x.IcaTxCallback.Sequence = callbackData.Sequence + x.IcaTxCallback.Callback = callbackData.Callback + x.IcaTxCallback.Result = result + + m, err := json.Marshal(x) + if err != nil { + k.Logger(ctx).Error("SudoCallback: failed to marshal MessageResponse message", "error", err, "contractAddress", contractAddr) + return nil, fmt.Errorf("failed to marshal MessageResponse: %v", err) + } + + resp, err := k.wasmKeeper.Sudo(ctx, contractAddr, m) + if err != nil { + k.Logger(ctx).Debug("SudoResponse: failed to Sudo", "error", err, "contractAddress", contractAddr) + return nil, fmt.Errorf("failed to Sudo: %v", err) + } + + return resp, nil +} diff --git a/x/cw-ica/module.go b/x/cw-ica/module.go new file mode 100644 index 00000000..d7d88d72 --- /dev/null +++ b/x/cw-ica/module.go @@ -0,0 +1,143 @@ +package cwica + +import ( + "context" + "encoding/json" + + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + abci "github.com/cometbft/cometbft/abci/types" + + "github.com/Team-Kujira/core/x/cw-ica/client/cli" + "github.com/Team-Kujira/core/x/cw-ica/keeper" + "github.com/Team-Kujira/core/x/cw-ica/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} +) + +// AppModuleBasic implements the AppModuleBasic interface for the capability module. +type AppModuleBasic struct { + cdc codec.Codec +} + +func NewAppModuleBasic(cdc codec.Codec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the capability module's name. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +// RegisterInterfaces registers the module's interface types +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns the capability module's default genesis state. +func (AppModuleBasic) DefaultGenesis(_ codec.JSONCodec) json.RawMessage { + return nil +} + +// ValidateGenesis performs genesis state validation for the capability module. +func (AppModuleBasic) ValidateGenesis(_ codec.JSONCodec, _ client.TxEncodingConfig, _ json.RawMessage) error { + return nil +} + +// RegisterRESTRoutes registers the cw-ica module's REST service handlers. +func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) + if err != nil { + panic(err) + } +} + +// GetTxCmd returns the capability module's root tx command. +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the capability module's root query command. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd() +} + +// AppModule implements the AppModule interface for the capability module. +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper +} + +// NewAppModule creates and returns a new cwica AppModule +func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + } +} + +// Name returns the capability module's name. +func (am AppModule) Name() string { + return am.AppModuleBasic.Name() +} + +// QuerierRoute returns the capability module's query routing key. +func (AppModule) QuerierRoute() string { + return types.QuerierRoute +} + +// RegisterServices registers a GRPC query service to respond to the +// module-specific GRPC queries. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// RegisterInvariants registers the capability module's invariants. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the capability module's genesis initialization It returns +// no validator updates. +func (am AppModule) InitGenesis(_ sdk.Context, _ codec.JSONCodec, _ json.RawMessage) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the capability module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(_ sdk.Context, _ codec.JSONCodec) json.RawMessage { + return nil +} + +// ConsensusVersion implements AppModule/ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return 1 } + +// BeginBlock executes all ABCI BeginBlock logic respective to the capability module. +func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} + +// EndBlock executes all ABCI EndBlock logic respective to the capability module. It +// returns no validator updates. +func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} diff --git a/x/cw-ica/types/callback.pb.go b/x/cw-ica/types/callback.pb.go new file mode 100644 index 00000000..aaec9624 --- /dev/null +++ b/x/cw-ica/types/callback.pb.go @@ -0,0 +1,617 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kujira/cwica/callback.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type CallbackData struct { + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"` + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + Sequence uint64 `protobuf:"varint,3,opt,name=sequence,proto3" json:"sequence,omitempty"` + Contract string `protobuf:"bytes,4,opt,name=contract,proto3" json:"contract,omitempty"` + ConnectionId string `protobuf:"bytes,5,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"` + AccountId string `protobuf:"bytes,6,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + Callback []byte `protobuf:"bytes,7,opt,name=callback,proto3" json:"callback,omitempty"` +} + +func (m *CallbackData) Reset() { *m = CallbackData{} } +func (m *CallbackData) String() string { return proto.CompactTextString(m) } +func (*CallbackData) ProtoMessage() {} +func (*CallbackData) Descriptor() ([]byte, []int) { + return fileDescriptor_c1de6cedd893c366, []int{0} +} +func (m *CallbackData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CallbackData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CallbackData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CallbackData) XXX_Merge(src proto.Message) { + xxx_messageInfo_CallbackData.Merge(m, src) +} +func (m *CallbackData) XXX_Size() int { + return m.Size() +} +func (m *CallbackData) XXX_DiscardUnknown() { + xxx_messageInfo_CallbackData.DiscardUnknown(m) +} + +var xxx_messageInfo_CallbackData proto.InternalMessageInfo + +func (m *CallbackData) GetPortId() string { + if m != nil { + return m.PortId + } + return "" +} + +func (m *CallbackData) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *CallbackData) GetSequence() uint64 { + if m != nil { + return m.Sequence + } + return 0 +} + +func (m *CallbackData) GetContract() string { + if m != nil { + return m.Contract + } + return "" +} + +func (m *CallbackData) GetConnectionId() string { + if m != nil { + return m.ConnectionId + } + return "" +} + +func (m *CallbackData) GetAccountId() string { + if m != nil { + return m.AccountId + } + return "" +} + +func (m *CallbackData) GetCallback() []byte { + if m != nil { + return m.Callback + } + return nil +} + +func init() { + proto.RegisterType((*CallbackData)(nil), "kujira.cwica.CallbackData") +} + +func init() { proto.RegisterFile("kujira/cwica/callback.proto", fileDescriptor_c1de6cedd893c366) } + +var fileDescriptor_c1de6cedd893c366 = []byte{ + // 296 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x90, 0xc1, 0x4e, 0x02, 0x31, + 0x10, 0x86, 0xa9, 0x22, 0x48, 0xb3, 0x5e, 0x36, 0x26, 0x6e, 0x50, 0x1b, 0xa2, 0x17, 0x62, 0x02,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9, 0xb5, 0x13, 0xb2, 0xff, 0x8a, 0x49, 0xba, 0x03, + 0x36, 0x8c, 0x66, 0x8d, 0xbe, 0x9b, 0x7c, 0xee, 0x05, 0xdb, 0xed, 0x05, 0xfb, 0xd9, 0x0b, 0xf6, + 0x51, 0x89, 0xd6, 0xae, 0x12, 0xad, 0xaf, 0x4a, 0xb4, 0x9e, 0x6e, 0x52, 0x6d, 0x97, 0xe5, 0x7c, + 0x8c, 0xb4, 0x96, 0x8f, 0x0a, 0xd6, 0xa3, 0x87, 0xba, 0x69, 0x2a, 0x94, 0x7c, 0x93, 0xb8, 0x1d, + 0xb9, 0xc6, 0xed, 0x7b, 0xae, 0x36, 0xf3, 0x8e, 0x6f, 0xeb, 0xf6, 0x37, 0x00, 0x00, 0xff, 0xff, + 0x6f, 0x8a, 0xcf, 0xa4, 0x8e, 0x01, 0x00, 0x00, +} + +func (m *CallbackData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CallbackData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CallbackData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Callback) > 0 { + i -= len(m.Callback) + copy(dAtA[i:], m.Callback) + i = encodeVarintCallback(dAtA, i, uint64(len(m.Callback))) + i-- + dAtA[i] = 0x3a + } + if len(m.AccountId) > 0 { + i -= len(m.AccountId) + copy(dAtA[i:], m.AccountId) + i = encodeVarintCallback(dAtA, i, uint64(len(m.AccountId))) + i-- + dAtA[i] = 0x32 + } + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintCallback(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0x2a + } + if len(m.Contract) > 0 { + i -= len(m.Contract) + copy(dAtA[i:], m.Contract) + i = encodeVarintCallback(dAtA, i, uint64(len(m.Contract))) + i-- + dAtA[i] = 0x22 + } + if m.Sequence != 0 { + i = encodeVarintCallback(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x18 + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintCallback(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintCallback(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintCallback(dAtA []byte, offset int, v uint64) int { + offset -= sovCallback(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *CallbackData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovCallback(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovCallback(uint64(l)) + } + if m.Sequence != 0 { + n += 1 + sovCallback(uint64(m.Sequence)) + } + l = len(m.Contract) + if l > 0 { + n += 1 + l + sovCallback(uint64(l)) + } + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovCallback(uint64(l)) + } + l = len(m.AccountId) + if l > 0 { + n += 1 + l + sovCallback(uint64(l)) + } + l = len(m.Callback) + if l > 0 { + n += 1 + l + sovCallback(uint64(l)) + } + return n +} + +func sovCallback(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozCallback(x uint64) (n int) { + return sovCallback(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *CallbackData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallback + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CallbackData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CallbackData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallback + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCallback + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCallback + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallback + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCallback + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCallback + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallback + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallback + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCallback + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCallback + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Contract = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallback + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCallback + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCallback + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallback + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCallback + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCallback + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AccountId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Callback", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCallback + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCallback + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCallback + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Callback = append(m.Callback[:0], dAtA[iNdEx:postIndex]...) + if m.Callback == nil { + m.Callback = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCallback(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCallback + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCallback(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCallback + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCallback + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCallback + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthCallback + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCallback + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthCallback + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthCallback = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCallback = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCallback = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/cw-ica/types/codec.go b/x/cw-ica/types/codec.go new file mode 100644 index 00000000..e01098a1 --- /dev/null +++ b/x/cw-ica/types/codec.go @@ -0,0 +1,25 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + + // this line is used by starport scaffolding # 1 + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +var ( + amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewAminoCodec(amino) +) + +func RegisterCodec(_ *codec.LegacyAmino) { +} + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + registry.RegisterImplementations( + (*sdk.Msg)(nil), + ) +} diff --git a/x/cw-ica/types/errors.go b/x/cw-ica/types/errors.go new file mode 100644 index 00000000..890c9ea2 --- /dev/null +++ b/x/cw-ica/types/errors.go @@ -0,0 +1,10 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" +) + +var ( + ErrIBCAccountAlreadyExist = errorsmod.Register(ModuleName, 2, "interchain account already registered") + ErrIBCAccountNotExist = errorsmod.Register(ModuleName, 3, "interchain account does not exist") +) diff --git a/x/cw-ica/types/keys.go b/x/cw-ica/types/keys.go new file mode 100644 index 00000000..1eaa2306 --- /dev/null +++ b/x/cw-ica/types/keys.go @@ -0,0 +1,39 @@ +package types + +import ( + "fmt" +) + +const ( + ModuleName = "cwica" + + StoreKey = ModuleName + + RouterKey = ModuleName + + QuerierRoute = ModuleName +) + +const ( + // CallbackDataKeyPrefix is the prefix of CallbackData + CallbackDataKeyPrefix = "CallbackData/" +) + +func KeyPrefix(p string) []byte { + return []byte(p) +} + +func PacketID(portID string, channelID string, sequence uint64) string { + return fmt.Sprintf("%s.%s.%d", portID, channelID, sequence) +} + +// CallbackDataKey returns the store key to retrieve a CallbackData from the index fields +func CallbackDataKey(callbackKey string) []byte { + var key []byte + + callbackKeyBytes := []byte(callbackKey) + key = append(key, callbackKeyBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/cw-ica/types/query.go b/x/cw-ica/types/query.go new file mode 100644 index 00000000..aa25d191 --- /dev/null +++ b/x/cw-ica/types/query.go @@ -0,0 +1,17 @@ +package types + +// NewQueryInterchainAccountRequest creates and returns a new QueryInterchainAccountRequest +func NewQueryInterchainAccountRequest(connectionID, accountID, owner string) *QueryInterchainAccountRequest { + return &QueryInterchainAccountRequest{ + ConnectionId: connectionID, + AccountId: accountID, + Owner: owner, + } +} + +// NewQueryInterchainAccountResponse creates and returns a new QueryInterchainAccountResponse +func NewQueryInterchainAccountResponse(interchainAccAddr string) *QueryInterchainAccountResponse { + return &QueryInterchainAccountResponse{ + InterchainAccountAddress: interchainAccAddr, + } +} diff --git a/x/cw-ica/types/query.pb.go b/x/cw-ica/types/query.pb.go new file mode 100644 index 00000000..54fed4e8 --- /dev/null +++ b/x/cw-ica/types/query.pb.go @@ -0,0 +1,692 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kujira/cwica/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryInterchainAccountRequest is the request type for the Query/InterchainAccountAddress RPC +type QueryInterchainAccountRequest struct { + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + ConnectionId string `protobuf:"bytes,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` + AccountId string `protobuf:"bytes,3,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty" yaml:"account_id"` +} + +func (m *QueryInterchainAccountRequest) Reset() { *m = QueryInterchainAccountRequest{} } +func (m *QueryInterchainAccountRequest) String() string { return proto.CompactTextString(m) } +func (*QueryInterchainAccountRequest) ProtoMessage() {} +func (*QueryInterchainAccountRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2cbdca950ab79736, []int{0} +} +func (m *QueryInterchainAccountRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryInterchainAccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryInterchainAccountRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryInterchainAccountRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryInterchainAccountRequest.Merge(m, src) +} +func (m *QueryInterchainAccountRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryInterchainAccountRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryInterchainAccountRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryInterchainAccountRequest proto.InternalMessageInfo + +func (m *QueryInterchainAccountRequest) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *QueryInterchainAccountRequest) GetConnectionId() string { + if m != nil { + return m.ConnectionId + } + return "" +} + +func (m *QueryInterchainAccountRequest) GetAccountId() string { + if m != nil { + return m.AccountId + } + return "" +} + +// QueryInterchainAccountResponse the response type for the Query/InterchainAccountAddress RPC +type QueryInterchainAccountResponse struct { + InterchainAccountAddress string `protobuf:"bytes,1,opt,name=interchain_account_address,json=interchainAccountAddress,proto3" json:"interchain_account_address,omitempty" yaml:"interchain_account_address"` +} + +func (m *QueryInterchainAccountResponse) Reset() { *m = QueryInterchainAccountResponse{} } +func (m *QueryInterchainAccountResponse) String() string { return proto.CompactTextString(m) } +func (*QueryInterchainAccountResponse) ProtoMessage() {} +func (*QueryInterchainAccountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2cbdca950ab79736, []int{1} +} +func (m *QueryInterchainAccountResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryInterchainAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryInterchainAccountResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryInterchainAccountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryInterchainAccountResponse.Merge(m, src) +} +func (m *QueryInterchainAccountResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryInterchainAccountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryInterchainAccountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryInterchainAccountResponse proto.InternalMessageInfo + +func (m *QueryInterchainAccountResponse) GetInterchainAccountAddress() string { + if m != nil { + return m.InterchainAccountAddress + } + return "" +} + +func init() { + proto.RegisterType((*QueryInterchainAccountRequest)(nil), "kujira.cwica.QueryInterchainAccountRequest") + proto.RegisterType((*QueryInterchainAccountResponse)(nil), "kujira.cwica.QueryInterchainAccountResponse") +} + +func init() { proto.RegisterFile("kujira/cwica/query.proto", fileDescriptor_2cbdca950ab79736) } + +var fileDescriptor_2cbdca950ab79736 = []byte{ + // 399 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xc8, 0x2e, 0xcd, 0xca, + 0x2c, 0x4a, 0xd4, 0x4f, 0x2e, 0xcf, 0x4c, 0x4e, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x81, 0xc8, 0xe8, 0x81, 0x65, 0xa4, 0x44, 0xd2, 0xf3, 0xd3, + 0xf3, 0xc1, 0x12, 0xfa, 0x20, 0x16, 0x44, 0x8d, 0x94, 0x4c, 0x7a, 0x7e, 0x7e, 0x7a, 0x4e, 0xaa, + 0x7e, 0x62, 0x41, 0xa6, 0x7e, 0x62, 0x5e, 0x5e, 0x7e, 0x49, 0x62, 0x49, 0x66, 0x7e, 0x5e, 0x31, + 0x44, 0x56, 0x69, 0x15, 0x23, 0x97, 0x6c, 0x20, 0xc8, 0x44, 0xcf, 0xbc, 0x92, 0xd4, 0xa2, 0xe4, + 0x8c, 0xc4, 0xcc, 0x3c, 0xc7, 0xe4, 0xe4, 0xfc, 0xd2, 0xbc, 0x92, 0xa0, 0xd4, 0xc2, 0xd2, 0xd4, + 0xe2, 0x12, 0x21, 0x11, 0x2e, 0xd6, 0xfc, 0xf2, 0xbc, 0xd4, 0x22, 0x09, 0x46, 0x05, 0x46, 0x0d, + 0xce, 0x20, 0x08, 0x47, 0xc8, 0x96, 0x8b, 0x37, 0x39, 0x3f, 0x2f, 0x2f, 0x35, 0x19, 0x64, 0x58, + 0x7c, 0x66, 0x8a, 0x04, 0x13, 0x48, 0xd6, 0x49, 0xe2, 0xd3, 0x3d, 0x79, 0x91, 0xca, 0xc4, 0xdc, + 0x1c, 0x2b, 0x25, 0x14, 0x69, 0xa5, 0x20, 0x1e, 0x04, 0xdf, 0x33, 0x45, 0xc8, 0x84, 0x8b, 0x2b, + 0x11, 0x62, 0x0d, 0x48, 0x2f, 0x33, 0x58, 0xaf, 0xe8, 0xa7, 0x7b, 0xf2, 0x82, 0x10, 0xbd, 0x08, + 0x39, 0xa5, 0x20, 0x4e, 0x28, 0xc7, 0x33, 0x45, 0xa9, 0x95, 0x91, 0x4b, 0x0e, 0x97, 0x63, 0x8b, + 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0x92, 0xb9, 0xa4, 0x32, 0xe1, 0x92, 0xf1, 0x30, 0x73, 0x12, + 0x53, 0x52, 0x8a, 0x52, 0x8b, 0x8b, 0x21, 0x5e, 0x70, 0x52, 0xfd, 0x74, 0x4f, 0x5e, 0x11, 0x62, + 0x11, 0x6e, 0xb5, 0x4a, 0x41, 0x12, 0x99, 0xe8, 0xb6, 0x38, 0x42, 0xa4, 0x8c, 0x8e, 0x32, 0x72, + 0xb1, 0x82, 0xdd, 0x21, 0xb4, 0x9b, 0x91, 0x4b, 0x10, 0xc3, 0x31, 0x42, 0xda, 0x7a, 0xc8, 0xf1, + 0xa2, 0x87, 0x37, 0x7c, 0xa5, 0x74, 0x88, 0x53, 0x0c, 0xf1, 0x9f, 0x92, 0x77, 0xd3, 0xe5, 0x27, + 0x93, 0x99, 0x5c, 0x85, 0x9c, 0xf5, 0x93, 0xcb, 0x75, 0x41, 0xc9, 0x01, 0xd3, 0x07, 0xfa, 0xe0, + 0x18, 0xd2, 0xaf, 0x06, 0x53, 0xb5, 0xfa, 0x88, 0x70, 0xd7, 0xaf, 0x46, 0x89, 0x93, 0x5a, 0x27, + 0x97, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, + 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x4a, 0xcf, 0x2c, 0xc9, + 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x0f, 0x49, 0x4d, 0xcc, 0xd5, 0xf5, 0x86, 0x26, 0xc1, + 0xfc, 0xa2, 0x54, 0xfd, 0x0a, 0x98, 0xdd, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0x94, + 0x64, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xcc, 0xa4, 0x5c, 0xb2, 0xa7, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // QueryInterchainAccount returns the interchain account for given owner address on a given connection pair + InterchainAccount(ctx context.Context, in *QueryInterchainAccountRequest, opts ...grpc.CallOption) (*QueryInterchainAccountResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) InterchainAccount(ctx context.Context, in *QueryInterchainAccountRequest, opts ...grpc.CallOption) (*QueryInterchainAccountResponse, error) { + out := new(QueryInterchainAccountResponse) + err := c.cc.Invoke(ctx, "/kujira.cwica.Query/InterchainAccount", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // QueryInterchainAccount returns the interchain account for given owner address on a given connection pair + InterchainAccount(context.Context, *QueryInterchainAccountRequest) (*QueryInterchainAccountResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) InterchainAccount(ctx context.Context, req *QueryInterchainAccountRequest) (*QueryInterchainAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InterchainAccount not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_InterchainAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryInterchainAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).InterchainAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kujira.cwica.Query/InterchainAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).InterchainAccount(ctx, req.(*QueryInterchainAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "kujira.cwica.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "InterchainAccount", + Handler: _Query_InterchainAccount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "kujira/cwica/query.proto", +} + +func (m *QueryInterchainAccountRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryInterchainAccountRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryInterchainAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AccountId) > 0 { + i -= len(m.AccountId) + copy(dAtA[i:], m.AccountId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AccountId))) + i-- + dAtA[i] = 0x1a + } + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryInterchainAccountResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryInterchainAccountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryInterchainAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.InterchainAccountAddress) > 0 { + i -= len(m.InterchainAccountAddress) + copy(dAtA[i:], m.InterchainAccountAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.InterchainAccountAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryInterchainAccountRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AccountId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryInterchainAccountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.InterchainAccountAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryInterchainAccountRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryInterchainAccountRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryInterchainAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AccountId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryInterchainAccountResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryInterchainAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryInterchainAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InterchainAccountAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InterchainAccountAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/cw-ica/types/query.pb.gw.go b/x/cw-ica/types/query.pb.gw.go new file mode 100644 index 00000000..90d41b99 --- /dev/null +++ b/x/cw-ica/types/query.pb.gw.go @@ -0,0 +1,224 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: kujira/cwica/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage + +var ( + filter_Query_InterchainAccount_0 = &utilities.DoubleArray{Encoding: map[string]int{"owner": 0, "connection_id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +func request_Query_InterchainAccount_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryInterchainAccountRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["owner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner") + } + + protoReq.Owner, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner", err) + } + + val, ok = pathParams["connection_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "connection_id") + } + + protoReq.ConnectionId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "connection_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_InterchainAccount_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.InterchainAccount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_InterchainAccount_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryInterchainAccountRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["owner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner") + } + + protoReq.Owner, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner", err) + } + + val, ok = pathParams["connection_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "connection_id") + } + + protoReq.ConnectionId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "connection_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_InterchainAccount_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.InterchainAccount(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_InterchainAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_InterchainAccount_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_InterchainAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_InterchainAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_InterchainAccount_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_InterchainAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_InterchainAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cw-ica", "interchain_account", "owner", "connection", "connection_id"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_InterchainAccount_0 = runtime.ForwardResponseMessage +) diff --git a/x/cw-ica/types/sudo.go b/x/cw-ica/types/sudo.go new file mode 100644 index 00000000..f3b06bef --- /dev/null +++ b/x/cw-ica/types/sudo.go @@ -0,0 +1,40 @@ +package types + +type MessageTxCallback struct { + IcaTxCallback IcaTxCallbackData `json:"ica_tx_callback"` +} + +type MessageRegisterCallback struct { + IcaRegisterCallback IcaRegisterCallbackData `json:"ica_register_callback"` +} + +type IcaRegisterCallbackData struct { + ConnID string `json:"connection_id"` + AccID string `json:"account_id"` + Callback []byte `json:"callback"` + Result IcaCallbackResult `json:"result"` +} + +type IcaTxCallbackData struct { + ConnID string `json:"connection_id"` + AccID string `json:"account_id"` + Sequence uint64 `json:"sequence"` + Callback []byte `json:"callback"` + Result IcaCallbackResult `json:"result"` +} + +type IcaCallbackResult struct { + Success *IcaCallbackSuccess `json:"success,omitempty"` + Error *IcaCallbackError `json:"error,omitempty"` + Timeout *IcaCallbackTimeout `json:"timeout,omitempty"` +} + +type IcaCallbackSuccess struct { + Data []byte `json:"data"` +} + +type IcaCallbackError struct { + Error string `json:"error"` +} + +type IcaCallbackTimeout struct{} diff --git a/x/cw-ica/types/tx.pb.go b/x/cw-ica/types/tx.pb.go new file mode 100644 index 00000000..794de696 --- /dev/null +++ b/x/cw-ica/types/tx.pb.go @@ -0,0 +1,85 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kujira/cwica/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +func init() { proto.RegisterFile("kujira/cwica/tx.proto", fileDescriptor_c8324b32518dc323) } + +var fileDescriptor_c8324b32518dc323 = []byte{ + // 162 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcd, 0x2e, 0xcd, 0xca, + 0x2c, 0x4a, 0xd4, 0x4f, 0x2e, 0xcf, 0x4c, 0x4e, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, + 0xc9, 0x17, 0xe2, 0x81, 0x08, 0xeb, 0x81, 0x85, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x12, + 0xfa, 0x20, 0x16, 0x44, 0x8d, 0x94, 0x64, 0x7a, 0x7e, 0x7e, 0x7a, 0x4e, 0xaa, 0x3e, 0x98, 0x97, + 0x54, 0x9a, 0xa6, 0x9f, 0x98, 0x57, 0x09, 0x91, 0x32, 0x62, 0xe5, 0x62, 0xf6, 0x2d, 0x4e, 0x77, + 0x72, 0x39, 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, 0xad, 0xf4, 0xcc, 0x92, + 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0x90, 0xd4, 0xc4, 0x5c, 0x5d, 0x6f, 0xa8, 0x33, + 0xf2, 0x8b, 0x52, 0xf5, 0x2b, 0xf4, 0x93, 0xcb, 0x75, 0xc1, 0xce, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, + 0x62, 0x03, 0x9b, 0x69, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xfb, 0xb6, 0x12, 0x61, 0xab, 0x00, + 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "kujira.cwica.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{}, + Metadata: "kujira/cwica/tx.proto", +} diff --git a/x/cw-ica/types/tx_serialize.go b/x/cw-ica/types/tx_serialize.go new file mode 100644 index 00000000..2da853c8 --- /dev/null +++ b/x/cw-ica/types/tx_serialize.go @@ -0,0 +1,26 @@ +package types + +import ( + "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" + cosmostypes "github.com/cosmos/cosmos-sdk/codec/types" + icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" +) + +func SerializeCosmosTx(cdc codec.BinaryCodec, msgs []*cosmostypes.Any) (bz []byte, err error) { + // only ProtoCodec is supported + if _, ok := cdc.(*codec.ProtoCodec); !ok { + return nil, errors.Wrap(err, "only ProtoCodec is supported on host chain") + } + + cosmosTx := &icatypes.CosmosTx{ + Messages: msgs, + } + + bz, err = cdc.Marshal(cosmosTx) + if err != nil { + return nil, err + } + + return bz, nil +} diff --git a/x/cw-ica/wasm/interface_msg.go b/x/cw-ica/wasm/interface_msg.go new file mode 100644 index 00000000..d18012f5 --- /dev/null +++ b/x/cw-ica/wasm/interface_msg.go @@ -0,0 +1,180 @@ +package wasm + +import ( + "cosmossdk.io/errors" + wasmvmtypes "github.com/CosmWasm/wasmvm/types" + sdk "github.com/cosmos/cosmos-sdk/types" + icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" + icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" + icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" + + cwicakeeper "github.com/Team-Kujira/core/x/cw-ica/keeper" + "github.com/Team-Kujira/core/x/cw-ica/types" + cosmostypes "github.com/cosmos/cosmos-sdk/codec/types" +) + +// ProtobufAny is a hack-struct to serialize protobuf Any message into JSON object +// See https://github.com/neutron-org/neutron/blob/main/wasmbinding/bindings/msg.go +type ProtobufAny struct { + TypeURL string `json:"type_url"` + Value []byte `json:"value"` +} + +type CwIcaMsg struct { + /// Contracts can register a new interchain account. + Register *Register `json:"register,omitempty"` + /// Contracts can submit transactions to the ICA + /// associated with the given information. + Submit *Submit `json:"submit,omitempty"` +} + +// / Register creates a new interchain account. +// / If the account was created in the past, this will +// / re-establish a dropped connection, or do nothing if +// / the connection is still active. +// / The account is registered using (port, channel, sender, id) +// / as the unique identifier. +type Register struct { + ConnectionID string `json:"connection_id"` + AccountID string `json:"account_id"` + Version string `json:"version"` + Callback []byte `json:"callback"` +} + +// / Submit submits transactions to the ICA +// / associated with the given address. +type Submit struct { + ConnectionID string `json:"connection_id"` + AccountID string `json:"account_id"` + Msgs []ProtobufAny `json:"msgs"` + Memo string `json:"memo"` + Timeout uint64 `json:"timeout"` + Callback []byte `json:"callback"` +} + +func register(ctx sdk.Context, contractAddr sdk.AccAddress, register *Register, cwicak cwicakeeper.Keeper, ik icacontrollerkeeper.Keeper) ([]sdk.Event, [][]byte, error) { + _, err := PerformRegisterICA(cwicak, ik, ctx, contractAddr, register) + if err != nil { + return nil, nil, errors.Wrap(err, "perform register ICA") + } + return nil, nil, nil +} + +// PerformRegisterICA is used with register to validate the register message and register the ICA. +func PerformRegisterICA(cwicak cwicakeeper.Keeper, f icacontrollerkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, msg *Register) (*icacontrollertypes.MsgRegisterInterchainAccountResponse, error) { + if msg == nil { + return nil, wasmvmtypes.InvalidRequest{Err: "register ICA null message"} + } + + msgServer := icacontrollerkeeper.NewMsgServerImpl(&f) + + // format "{owner}-{id}" + owner := contractAddr.String() + "-" + msg.AccountID + msgRegister := icacontrollertypes.NewMsgRegisterInterchainAccount(msg.ConnectionID, owner, msg.Version) + + if err := msgRegister.ValidateBasic(); err != nil { + return nil, errors.Wrap(err, "failed validating MsgRegisterInterchainAccount") + } + + res, err := msgServer.RegisterInterchainAccount( + sdk.WrapSDKContext(ctx), + msgRegister, + ) + if err != nil { + return nil, err + } + + portID, err := icatypes.NewControllerPortID(owner) + if err != nil { + return nil, err + } + + if err != nil { + return nil, errors.Wrap(err, "registering ICA") + } + + f.SetMiddlewareEnabled(ctx, portID, msg.ConnectionID) + + cwicak.SetCallbackData(ctx, types.CallbackData{ + PortId: portID, + ChannelId: "", + Sequence: 0, + Contract: contractAddr.String(), + ConnectionId: msg.ConnectionID, + AccountId: msg.AccountID, + Callback: msg.Callback, + }) + + return res, nil +} + +func submit(ctx sdk.Context, contractAddr sdk.AccAddress, submitTx *Submit, cwicak cwicakeeper.Keeper, ik icacontrollerkeeper.Keeper) ([]sdk.Event, [][]byte, error) { + _, err := PerformSubmitTxs(ik, cwicak, ctx, contractAddr, submitTx) + if err != nil { + return nil, nil, errors.Wrap(err, "perform submit txs") + } + return nil, nil, nil +} + +// PerformSubmitTxs is used with submitTxs to validate the submitTxs message and submit the txs. +func PerformSubmitTxs(f icacontrollerkeeper.Keeper, cwicak cwicakeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, submitTx *Submit) (*icacontrollertypes.MsgSendTxResponse, error) { + if submitTx == nil { + return nil, wasmvmtypes.InvalidRequest{Err: "submit txs null message"} + } + msgs := []*cosmostypes.Any{} + for _, msg := range submitTx.Msgs { + msgs = append(msgs, &cosmostypes.Any{ + TypeUrl: msg.TypeURL, + Value: msg.Value, + }) + } + data, err := types.SerializeCosmosTx(cwicak.Codec, msgs) + if err != nil { + return nil, wasmvmtypes.InvalidRequest{Err: "failed to serialize txs"} + } + + packetData := icatypes.InterchainAccountPacketData{ + Type: icatypes.EXECUTE_TX, + Data: data, + Memo: submitTx.Memo, + } + + msgServer := icacontrollerkeeper.NewMsgServerImpl(&f) + + owner := contractAddr.String() + "-" + submitTx.AccountID + res, err := msgServer.SendTx(sdk.WrapSDKContext(ctx), icacontrollertypes.NewMsgSendTx(owner, submitTx.ConnectionID, submitTx.Timeout, packetData)) + if err != nil { + return nil, errors.Wrap(err, "submitting txs") + } + + portID, err := icatypes.NewControllerPortID(owner) + if err != nil { + return nil, err + } + + activeChannelID, found := f.GetOpenActiveChannel(ctx, submitTx.ConnectionID, portID) + if !found { + return nil, errors.Wrapf(icatypes.ErrActiveChannelNotFound, "failed to retrieve active channel on connection %s for port %s", submitTx.ConnectionID, portID) + } + + cwicak.SetCallbackData(ctx, types.CallbackData{ + PortId: portID, + ChannelId: activeChannelID, + Sequence: res.Sequence, + Contract: contractAddr.String(), + ConnectionId: submitTx.ConnectionID, + AccountId: submitTx.AccountID, + Callback: submitTx.Callback, + }) + return res, nil +} + +func HandleMsg(ctx sdk.Context, cwicak cwicakeeper.Keeper, icak icacontrollerkeeper.Keeper, contractAddr sdk.AccAddress, msg *CwIcaMsg) ([]sdk.Event, [][]byte, error) { + if msg.Register != nil { + return register(ctx, contractAddr, msg.Register, cwicak, icak) + } + if msg.Submit != nil { + return submit(ctx, contractAddr, msg.Submit, cwicak, icak) + } + return nil, nil, wasmvmtypes.InvalidRequest{Err: "unknown ICA Message variant"} +} diff --git a/x/cw-ica/wasm/interface_query.go b/x/cw-ica/wasm/interface_query.go new file mode 100644 index 00000000..6b9e2bbc --- /dev/null +++ b/x/cw-ica/wasm/interface_query.go @@ -0,0 +1,66 @@ +package wasm + +import ( + "cosmossdk.io/errors" + wasmvmtypes "github.com/CosmWasm/wasmvm/types" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/Team-Kujira/core/x/cw-ica/keeper" + icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" +) + +// Querier - staking query interface for wasm contract +type Querier struct { + keeper keeper.Keeper +} + +// NewWasmQuerier return bank wasm query interface +func NewWasmQuerier(keeper keeper.Keeper) Querier { + return Querier{keeper} +} + +// Query - implement query function +func (Querier) Query(_ sdk.Context, _ wasmvmtypes.QueryRequest) ([]byte, error) { + return nil, nil +} + +type CwIcaQuery struct { + /// Given the connection-id, owner, and account-id, returns the address + /// of the interchain account. + AccountAddress *AccountAddress `json:"account_address,omitempty"` +} + +type AccountAddress struct { + Owner string `json:"owner"` + ConnectionID string `json:"connection_id"` + AccountID string `json:"account_id"` +} + +type AccountAddressResponse struct { + Address string `json:"address"` +} + +// QueryCustom implements custom query interface +func HandleQuery(k keeper.Keeper, ctx sdk.Context, q *CwIcaQuery) (any, error) { + switch { + case q.AccountAddress != nil: + owner := q.AccountAddress.Owner + "-" + q.AccountAddress.AccountID + + portID, err := icatypes.NewControllerPortID(owner) + if err != nil { + return nil, errors.Wrap(err, "could not find account") + } + + addr, found := k.IcaControllerKeeper().GetInterchainAccountAddress(ctx, q.AccountAddress.ConnectionID, portID) + if !found { + return nil, errors.Wrap(err, "no account found for portID") + } + + return AccountAddressResponse{ + Address: addr, + }, nil + + default: + return nil, wasmvmtypes.UnsupportedRequest{Kind: "unknown CwIca Query variant"} + } +} diff --git a/x/denom/client/cli/query.go b/x/denom/client/cli/query.go index a424ac24..59f4b33e 100644 --- a/x/denom/client/cli/query.go +++ b/x/denom/client/cli/query.go @@ -42,7 +42,7 @@ func GetParams() *cobra.Command { Use: "params [flags]", Short: "Get the params for the x/denom module", Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err diff --git a/x/denom/types/denoms.go b/x/denom/types/denoms.go index 63bff597..e794f817 100644 --- a/x/denom/types/denoms.go +++ b/x/denom/types/denoms.go @@ -59,7 +59,7 @@ func DeconstructDenom(denom string) (creator string, nonce string, err error) { // NewdenomDenomMintCoinsRestriction creates and returns a BankMintingRestrictionFn that only allows minting of // valid denom denoms func NewdenomDenomMintCoinsRestriction() bankkeeper.MintingRestrictionFn { - return func(ctx sdk.Context, coinsToMint sdk.Coins) error { + return func(_ sdk.Context, coinsToMint sdk.Coins) error { for _, coin := range coinsToMint { _, _, err := DeconstructDenom(coin.Denom) if err != nil { diff --git a/x/oracle/client/cli/query.go b/x/oracle/client/cli/query.go index 71f31b8f..13dae645 100644 --- a/x/oracle/client/cli/query.go +++ b/x/oracle/client/cli/query.go @@ -96,7 +96,7 @@ Query the active list of assets recognized by the types. $ kujirad query oracle actives `), - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err @@ -122,7 +122,7 @@ func GetCmdQueryParams() *cobra.Command { Use: "params", Args: cobra.NoArgs, Short: "Query the current Oracle params", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err diff --git a/x/oracle/keeper/ballot.go b/x/oracle/keeper/ballot.go index 7c616af5..b13f99be 100644 --- a/x/oracle/keeper/ballot.go +++ b/x/oracle/keeper/ballot.go @@ -63,7 +63,7 @@ func (k Keeper) ClearBallots(ctx sdk.Context, votePeriod uint64) { }) // Clear all aggregate votes - k.IterateAggregateExchangeRateVotes(ctx, func(voterAddr sdk.ValAddress, aggregateVote types.AggregateExchangeRateVote) (stop bool) { + k.IterateAggregateExchangeRateVotes(ctx, func(voterAddr sdk.ValAddress, _ types.AggregateExchangeRateVote) (stop bool) { k.DeleteAggregateExchangeRateVote(ctx, voterAddr) return false }) diff --git a/x/oracle/keeper/querier.go b/x/oracle/keeper/querier.go index cb47e31b..2fd68bbb 100644 --- a/x/oracle/keeper/querier.go +++ b/x/oracle/keeper/querier.go @@ -70,7 +70,7 @@ func (q querier) Actives(c context.Context, _ *types.QueryActivesRequest) (*type ctx := sdk.UnwrapSDKContext(c) denoms := []string{} - q.IterateExchangeRates(ctx, func(denom string, rate sdk.Dec) (stop bool) { + q.IterateExchangeRates(ctx, func(denom string, _ sdk.Dec) (stop bool) { denoms = append(denoms, denom) return false }) diff --git a/x/oracle/types/ballot_test.go b/x/oracle/types/ballot_test.go index b9272a2b..9b18939b 100644 --- a/x/oracle/types/ballot_test.go +++ b/x/oracle/types/ballot_test.go @@ -199,7 +199,7 @@ func TestPBStandardDeviation(t *testing.T) { []float64{1.0, 2.0, 10.0, 100000.0}, []int64{1, 1, 100, 1}, []bool{true, true, true, true}, - sdk.MustNewDecFromStr("49995.000362536252310905"), + sdk.MustNewDecFromStr("49995.000362536252310906"), }, { // Adding fake validator doesn't change outcome diff --git a/x/scheduler/client/cli/query_hook.go b/x/scheduler/client/cli/query_hook.go index 1db34f3f..b71d1984 100644 --- a/x/scheduler/client/cli/query_hook.go +++ b/x/scheduler/client/cli/query_hook.go @@ -15,7 +15,7 @@ func CmdListHooks() *cobra.Command { cmd := &cobra.Command{ Use: "list-hooks", Short: "list all hooks", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) pageReq, err := client.ReadPageRequest(cmd.Flags()) diff --git a/x/scheduler/client/cli/query_params.go b/x/scheduler/client/cli/query_params.go index a630e535..8147ab2b 100644 --- a/x/scheduler/client/cli/query_params.go +++ b/x/scheduler/client/cli/query_params.go @@ -14,7 +14,7 @@ func CmdQueryParams() *cobra.Command { Use: "params", Short: "shows the parameters of the module", Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) diff --git a/x/scheduler/keeper/grpc_query_hook.go b/x/scheduler/keeper/grpc_query_hook.go index f1996bc4..4efe4e0a 100644 --- a/x/scheduler/keeper/grpc_query_hook.go +++ b/x/scheduler/keeper/grpc_query_hook.go @@ -23,7 +23,7 @@ func (k Keeper) HookAll(c context.Context, req *types.QueryAllHookRequest) (*typ store := ctx.KVStore(k.storeKey) hookStore := prefix.NewStore(store, types.KeyPrefix(types.HookKey)) - pageRes, err := query.Paginate(hookStore, req.Pagination, func(key []byte, value []byte) error { + pageRes, err := query.Paginate(hookStore, req.Pagination, func(_ []byte, value []byte) error { var hook types.Hook if err := k.cdc.Unmarshal(value, &hook); err != nil { return err From cbb82f03888df89aa414306917e4abc72f8985b7 Mon Sep 17 00:00:00 2001 From: codehans <94654388+codehans@users.noreply.github.com> Date: Wed, 13 Mar 2024 11:17:32 +0000 Subject: [PATCH 02/27] fix makefile error --- .tool-versions | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.tool-versions b/.tool-versions index 414a4609..698a7d2a 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -golang 1.20.2 \ No newline at end of file +golang 1.21.8 \ No newline at end of file diff --git a/Makefile b/Makefile index 06836306..5725af3f 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' check-go-version: @if ! go version | grep -Eq "go1.21.8"; then \ - echo "\033[0;31mERROR:\033[0m Go version 1.20.8 is required for compiling kujirad. Installed version:" "$(shell go version)"; \ + echo "\033[0;31mERROR:\033[0m Go version 1.21.8 is required for compiling kujirad. Installed version:" "$(shell go version)"; \ exit 1; \ fi From 3c27f6070d9a942dfe4d0959fdd330c0ab0c0259 Mon Sep 17 00:00:00 2001 From: antstalepresh <36045227+antstalepresh@users.noreply.github.com> Date: Sat, 23 Mar 2024 01:46:53 +0800 Subject: [PATCH 03/27] disable ibcfee on ICA (#59) * disable ibcfee on ica * revert unrelevant changes back --- app/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index 7c593dd4..ec432f08 100644 --- a/app/app.go +++ b/app/app.go @@ -767,7 +767,7 @@ func New( icaControllerStack = cwica.NewIBCModule(app.CwICAKeeper) icaControllerStack = icacontroller.NewIBCMiddleware(icaControllerStack, app.ICAControllerKeeper) - icaControllerStack = ibcfee.NewIBCMiddleware(icaControllerStack, app.IBCFeeKeeper) + // icaControllerStack = ibcfee.NewIBCMiddleware(icaControllerStack, app.IBCFeeKeeper) // RecvPacket, message that originates from core IBC and goes down to app, the flow is: // channel.RecvPacket -> fee.OnRecvPacket -> icaHost.OnRecvPacket From 2be72ee7b8a63c61270aa531d887a3689a9324f8 Mon Sep 17 00:00:00 2001 From: antstalepresh <36045227+antstalepresh@users.noreply.github.com> Date: Tue, 26 Mar 2024 21:20:36 +0800 Subject: [PATCH 04/27] cw-ica gas estimation & events logging (#61) --- x/cw-ica/keeper/ibc_handlers.go | 50 +++++++++++++++++++++++++++++---- x/cw-ica/types/events.go | 14 +++++++++ 2 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 x/cw-ica/types/events.go diff --git a/x/cw-ica/keeper/ibc_handlers.go b/x/cw-ica/keeper/ibc_handlers.go index a4ad578d..a4b48a04 100644 --- a/x/cw-ica/keeper/ibc_handlers.go +++ b/x/cw-ica/keeper/ibc_handlers.go @@ -5,10 +5,9 @@ import ( "strings" "cosmossdk.io/errors" + "github.com/Team-Kujira/core/x/cw-ica/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - "github.com/Team-Kujira/core/x/cw-ica/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" ) @@ -63,6 +62,8 @@ func (k *Keeper) createCachedContext(ctx sdk.Context) (sdk.Context, func(), sdk. } gasMeter = sdk.NewGasMeter(newLimit) + } else { + gasMeter = sdk.NewInfiniteGasMeter() } cacheCtx = cacheCtx.WithGasMeter(gasMeter) @@ -101,7 +102,20 @@ func (k *Keeper) HandleAcknowledgement(ctx sdk.Context, packet channeltypes.Pack } if err != nil { - k.Logger(ctx).Debug("HandleAcknowledgement: failed to Sudo contract on packet acknowledgement", "error", err) + k.Logger(ctx).Debug( + "HandleAcknowledgement: failed to Sudo contract on packet acknowledgement", + "source_port", packet.SourcePort, + "source_channel", packet.SourceChannel, + "sequence", packet.Sequence, + "error", err) + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeICATxCallbackFailure, + sdk.NewAttribute(types.AttributePacketSourcePort, packet.SourcePort), + sdk.NewAttribute(types.AttributePacketSourceChannel, packet.SourceChannel), + sdk.NewAttribute(types.AttributePacketSequence, fmt.Sprintf("%d", packet.Sequence)), + ), + }) } else { ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events()) writeFn() @@ -124,7 +138,20 @@ func (k *Keeper) HandleTimeout(ctx sdk.Context, packet channeltypes.Packet, _ sd Timeout: &types.IcaCallbackTimeout{}, }) if err != nil { - k.Logger(ctx).Error("HandleTimeout: failed to Sudo contract on packet timeout", "port", packet.SourcePort, "error", err) + k.Logger(ctx).Debug( + "HandleTimeout: failed to Sudo contract on packet timeout", + "source_port", packet.SourcePort, + "source_channel", packet.SourceChannel, + "sequence", packet.Sequence, + "error", err) + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeICATimeoutCallbackFailure, + sdk.NewAttribute(types.AttributePacketSourcePort, packet.SourcePort), + sdk.NewAttribute(types.AttributePacketSourceChannel, packet.SourceChannel), + sdk.NewAttribute(types.AttributePacketSequence, fmt.Sprintf("%d", packet.Sequence)), + ), + }) } else { ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events()) writeFn() @@ -165,10 +192,23 @@ func (k *Keeper) HandleChanOpenAck( }, }) if err != nil { - k.Logger(ctx).Error("SudoCallback failure", "error", err) + k.Logger(ctx).Error( + "HandleChanOpenAck: failed to Sudo contract on packet ChanOpenAck", + "port", portID, + "channel", channelID, + "error", err) + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeICARegisterCallbackFailure, + sdk.NewAttribute(types.AttributePacketSourcePort, portID), + sdk.NewAttribute(types.AttributePacketSourceChannel, channelID), + ), + }) } else { + ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events()) writeFn() } + ctx.GasMeter().ConsumeGas(newGasMeter.GasConsumed(), "consume from cached context") // remove the callback data k.RemoveCallbackData(ctx, callbackDataKey) diff --git a/x/cw-ica/types/events.go b/x/cw-ica/types/events.go new file mode 100644 index 00000000..246fb871 --- /dev/null +++ b/x/cw-ica/types/events.go @@ -0,0 +1,14 @@ +package types + +const ( + EventTypeICATxCallbackFailure = "ica_tx_callback_failure" + EventTypeICARegisterCallbackFailure = "ica_register_callback_failure" + EventTypeICATimeoutCallbackFailure = "ica_timeout_callback_failure" +) + +// event attributes returned +const ( + AttributePacketSourcePort = "source_port" + AttributePacketSourceChannel = "source_channel" + AttributePacketSequence = "sequence" +) From 9dcf692e809108c04bbef20919fa2f7dcb63828d Mon Sep 17 00:00:00 2001 From: codehans <94654388+codehans@users.noreply.github.com> Date: Tue, 26 Mar 2024 19:08:43 +0000 Subject: [PATCH 05/27] WithdrawAllDelegatorRewards serialize --- x/batch/wasm/interface_msg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/batch/wasm/interface_msg.go b/x/batch/wasm/interface_msg.go index 22cb8ca8..8966286d 100644 --- a/x/batch/wasm/interface_msg.go +++ b/x/batch/wasm/interface_msg.go @@ -10,7 +10,7 @@ import ( type BatchMsg struct { // Contracts can withdraw all rewards for the delegations from the contract. - WithdrawAllDelegatorRewards *WithdrawAllDelegatorRewards `json:"withdrawAllDelegatorRewards,omitempty"` + WithdrawAllDelegatorRewards *WithdrawAllDelegatorRewards `json:"withdraw_all_delegator_rewards,omitempty"` } type WithdrawAllDelegatorRewards struct{} From ae7461f0de5eaaa08cd334d0cae079c3bfb28913 Mon Sep 17 00:00:00 2001 From: codehans <94654388+codehans@users.noreply.github.com> Date: Tue, 26 Mar 2024 19:32:38 +0000 Subject: [PATCH 06/27] v1.0.2 upgrade --- app/upgrades.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/upgrades.go b/app/upgrades.go index ceb618b0..7baa142d 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -10,7 +10,7 @@ import ( ibcwasmtypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types" ) -const UpgradeName = "v1.0.0" +const UpgradeName = "v1.0.2" func (app App) RegisterUpgradeHandlers() { upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() From f767125d49ba1b85ab253ad565c16d1f7fbfe4ac Mon Sep 17 00:00:00 2001 From: codehans <94654388+codehans@users.noreply.github.com> Date: Wed, 27 Mar 2024 15:13:23 +0000 Subject: [PATCH 07/27] load batchkeeper in bindings --- app/app.go | 1 + wasmbinding/message_plugin.go | 2 ++ wasmbinding/wasm.go | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index ec432f08..565a6854 100644 --- a/app/app.go +++ b/app/app.go @@ -674,6 +674,7 @@ func New( app.BankKeeper, app.OracleKeeper, *app.DenomKeeper, + app.BatchKeeper, *app.IBCKeeper, app.CwICAKeeper, app.ICAControllerKeeper, diff --git a/wasmbinding/message_plugin.go b/wasmbinding/message_plugin.go index ce914f85..97cea300 100644 --- a/wasmbinding/message_plugin.go +++ b/wasmbinding/message_plugin.go @@ -24,6 +24,7 @@ import ( func CustomMessageDecorator( bank bankkeeper.Keeper, denom denomkeeper.Keeper, + batch batchkeeper.Keeper, cwica cwicakeeper.Keeper, ica icacontrollerkeeper.Keeper, ) func(wasmkeeper.Messenger) wasmkeeper.Messenger { @@ -34,6 +35,7 @@ func CustomMessageDecorator( denom: denom, cwica: cwica, ica: ica, + batch: batch, } } } diff --git a/wasmbinding/wasm.go b/wasmbinding/wasm.go index 25df846d..cd2c2871 100644 --- a/wasmbinding/wasm.go +++ b/wasmbinding/wasm.go @@ -1,6 +1,7 @@ package wasmbinding import ( + batchkeeper "github.com/Team-Kujira/core/x/batch/keeper" denomkeeper "github.com/Team-Kujira/core/x/denom/keeper" oraclekeeper "github.com/Team-Kujira/core/x/oracle/keeper" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -17,6 +18,7 @@ func RegisterCustomPlugins( bank bankkeeper.Keeper, oracle oraclekeeper.Keeper, denom denomkeeper.Keeper, + batch batchkeeper.Keeper, ibc ibckeeper.Keeper, cwica cwicakeeper.Keeper, ica icacontrollerkeeper.Keeper, @@ -29,7 +31,7 @@ func RegisterCustomPlugins( }) messengerDecoratorOpt := wasmkeeper.WithMessageHandlerDecorator( - CustomMessageDecorator(bank, denom, cwica, ica), + CustomMessageDecorator(bank, denom, batch, cwica, ica), ) return []wasmkeeper.Option{ From 21462c1fe170d19ff606ad8dd1ecf7d22009abd6 Mon Sep 17 00:00:00 2001 From: codehans <94654388+codehans@users.noreply.github.com> Date: Thu, 11 Apr 2024 10:12:44 +0100 Subject: [PATCH 08/27] skip-store-upgrades flag --- app/upgrades.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/upgrades.go b/app/upgrades.go index 7baa142d..0967990a 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -18,7 +18,7 @@ func (app App) RegisterUpgradeHandlers() { panic(err) } - if upgradeInfo.Name == UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + if upgradeInfo.Name == UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) && upgradeInfo.Info != "skip-store-upgrades" { storeUpgrades := storetypes.StoreUpgrades{ Added: []string{ ibcwasmtypes.ModuleName, From 6bf1aa3aa539dbcb0a1b3318e391de95add7fa40 Mon Sep 17 00:00:00 2001 From: codehans <94654388+codehans@users.noreply.github.com> Date: Thu, 11 Apr 2024 10:40:20 +0100 Subject: [PATCH 09/27] rosetta --- ROSETTA.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 ROSETTA.md diff --git a/ROSETTA.md b/ROSETTA.md new file mode 100644 index 00000000..096f1ce1 --- /dev/null +++ b/ROSETTA.md @@ -0,0 +1,39 @@ +Enable Rosetta support by modifying `.kujira/config/config.toml` as follows. + +``` +############################################################################### +### Rosetta Configuration ### +############################################################################### + +[rosetta] + +# Enable defines if the Rosetta API server should be enabled. +enable = true + +# Address defines the Rosetta API server to listen on. +address = ":8080" + +# Network defines the name of the blockchain that will be returned by Rosetta. +blockchain = "kujira" + +# Network defines the name of the network that will be returned by Rosetta. +network = "kaiyo-1" + +# Retries defines the number of retries when connecting to the node before failing. +retries = 3 + +# Offline defines if Rosetta server should run in offline mode. +offline = false + +# EnableDefaultSuggestedFee defines if the server should suggest fee by default. +# If 'construction/medata' is called without gas limit and gas price, +# suggested fee based on gas-to-suggest and denom-to-suggest will be given. +enable-fee-suggestion = false + +# GasToSuggest defines gas limit when calculating the fee +gas-to-suggest = 200000 + +# DenomToSuggest defines the defult denom for fee suggestion. +# Price must be in minimum-gas-prices. +denom-to-suggest = "ukuji" +``` From 06d04b243d5ff0b33c26d398a1d8c8fbc487c417 Mon Sep 17 00:00:00 2001 From: noah Date: Mon, 6 May 2024 08:40:20 -0700 Subject: [PATCH 10/27] remove extraneous semicolon (#63) --- proto/kujira/oracle/query.proto | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/proto/kujira/oracle/query.proto b/proto/kujira/oracle/query.proto index ad4cd39f..9066c6af 100644 --- a/proto/kujira/oracle/query.proto +++ b/proto/kujira/oracle/query.proto @@ -156,7 +156,6 @@ message QueryAggregatePrevoteRequest { message QueryAggregatePrevoteResponse { // aggregate_prevote defines oracle aggregate prevote submitted by a validator in the current vote period AggregateExchangeRatePrevote aggregate_prevote = 1 [(gogoproto.nullable) = false]; - ; } // QueryAggregatePrevotesRequest is the request type for the Query/AggregatePrevotes RPC method. @@ -202,4 +201,4 @@ message QueryParamsRequest {} message QueryParamsResponse { // params defines the parameters of the module. Params params = 1 [(gogoproto.nullable) = false]; -} \ No newline at end of file +} From 682a20dd428ee4b7ba38410145566b390ee600e0 Mon Sep 17 00:00:00 2001 From: antstalepresh <36045227+antstalepresh@users.noreply.github.com> Date: Mon, 6 May 2024 23:43:12 +0800 Subject: [PATCH 11/27] Authn pubkey (#65) * initial implementation of ecdsa256 pubkey * remove loggings * remove privkey section for ecdsa256 pubkey * remove privkey codec registration * update from ecdsa256 to authn * lint fixes * lint fixes --- app/ante.go | 2 +- app/app.go | 2 +- app/encoding.go | 3 + app/sigverify.go | 56 ++++ crypto/codec/amino.go | 14 + crypto/codec/proto.go | 13 + crypto/keys/authn/authn.go | 82 ++++++ crypto/keys/authn/keys.pb.go | 375 +++++++++++++++++++++++++++ crypto/keys/authn/signature.go | 87 +++++++ proto/kujira/crypto/authn/keys.proto | 18 ++ 10 files changed, 650 insertions(+), 2 deletions(-) create mode 100644 app/sigverify.go create mode 100644 crypto/codec/amino.go create mode 100644 crypto/codec/proto.go create mode 100644 crypto/keys/authn/authn.go create mode 100644 crypto/keys/authn/keys.pb.go create mode 100644 crypto/keys/authn/signature.go create mode 100644 proto/kujira/crypto/authn/keys.proto diff --git a/app/ante.go b/app/ante.go index d5071a35..9dcc1d18 100644 --- a/app/ante.go +++ b/app/ante.go @@ -42,7 +42,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { sigGasConsumer := options.SigGasConsumer if sigGasConsumer == nil { - sigGasConsumer = ante.DefaultSigVerificationGasConsumer + sigGasConsumer = SigVerificationGasConsumer } anteDecorators := []sdk.AnteDecorator{ diff --git a/app/app.go b/app/app.go index 565a6854..834d1c0f 100644 --- a/app/app.go +++ b/app/app.go @@ -1104,7 +1104,7 @@ func New( BankKeeper: app.BankKeeper, FeegrantKeeper: app.FeeGrantKeeper, SignModeHandler: txConfig.SignModeHandler(), - SigGasConsumer: ante.DefaultSigVerificationGasConsumer, + SigGasConsumer: SigVerificationGasConsumer, }, IBCKeeper: app.IBCKeeper, WasmConfig: &wasmConfig, diff --git a/app/encoding.go b/app/encoding.go index aca0d947..967a4658 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -2,6 +2,7 @@ package app import ( "github.com/Team-Kujira/core/app/params" + kujiracryptocodec "github.com/Team-Kujira/core/crypto/codec" "github.com/cosmos/cosmos-sdk/std" ) @@ -10,6 +11,8 @@ func MakeEncodingConfig() params.EncodingConfig { encodingConfig := params.MakeEncodingConfig() std.RegisterLegacyAminoCodec(encodingConfig.Amino) std.RegisterInterfaces(encodingConfig.InterfaceRegistry) + kujiracryptocodec.RegisterCrypto(encodingConfig.Amino) + kujiracryptocodec.RegisterInterfaces(encodingConfig.InterfaceRegistry) ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry) return encodingConfig diff --git a/app/sigverify.go b/app/sigverify.go new file mode 100644 index 00000000..7a1b4149 --- /dev/null +++ b/app/sigverify.go @@ -0,0 +1,56 @@ +package app + +import ( + "fmt" + + errorsmod "cosmossdk.io/errors" + authn "github.com/Team-Kujira/core/crypto/keys/authn" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1" + "github.com/cosmos/cosmos-sdk/crypto/types/multisig" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/cosmos/cosmos-sdk/x/auth/ante" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +// SigVerificationGasConsumer is the implementation of SignatureVerificationGasConsumer. It consumes gas +// for signature verification based upon the public key type. The cost is fetched from the given params and is matched +// by the concrete type. +func SigVerificationGasConsumer( + meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params, +) error { + pubkey := sig.PubKey + switch pubkey := pubkey.(type) { + case *ed25519.PubKey: + meter.ConsumeGas(params.SigVerifyCostED25519, "ante verify: ed25519") + return errorsmod.Wrap(sdkerrors.ErrInvalidPubKey, "ED25519 public keys are unsupported") + + case *secp256k1.PubKey: + meter.ConsumeGas(params.SigVerifyCostSecp256k1, "ante verify: secp256k1") + return nil + + case *secp256r1.PubKey: + meter.ConsumeGas(params.SigVerifyCostSecp256r1(), "ante verify: secp256r1") + return nil + + case *authn.PubKey: + meter.ConsumeGas(params.SigVerifyCostSecp256r1(), "ante verify: authn") + return nil + + case multisig.PubKey: + multisignature, ok := sig.Data.(*signing.MultiSignatureData) + if !ok { + return fmt.Errorf("expected %T, got, %T", &signing.MultiSignatureData{}, sig.Data) + } + err := ante.ConsumeMultisignatureVerificationGas(meter, multisignature, pubkey, params, sig.Sequence) + if err != nil { + return err + } + return nil + default: + return errorsmod.Wrapf(sdkerrors.ErrInvalidPubKey, "unrecognized public key type: %T", pubkey) + } +} diff --git a/crypto/codec/amino.go b/crypto/codec/amino.go new file mode 100644 index 00000000..59cd8bdc --- /dev/null +++ b/crypto/codec/amino.go @@ -0,0 +1,14 @@ +package codec + +import ( + authn "github.com/Team-Kujira/core/crypto/keys/authn" + + "github.com/cosmos/cosmos-sdk/codec" +) + +// RegisterCrypto registers all crypto dependency types with the provided Amino +// codec. +func RegisterCrypto(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(authn.PubKey{}, + authn.PubKeyName, nil) +} diff --git a/crypto/codec/proto.go b/crypto/codec/proto.go new file mode 100644 index 00000000..3606560b --- /dev/null +++ b/crypto/codec/proto.go @@ -0,0 +1,13 @@ +package codec + +import ( + authn "github.com/Team-Kujira/core/crypto/keys/authn" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" +) + +// RegisterInterfaces registers the sdk.Tx interface. +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + var pk *cryptotypes.PubKey + registry.RegisterImplementations(pk, &authn.PubKey{}) +} diff --git a/crypto/keys/authn/authn.go b/crypto/keys/authn/authn.go new file mode 100644 index 00000000..b7e5e61a --- /dev/null +++ b/crypto/keys/authn/authn.go @@ -0,0 +1,82 @@ +package authn + +import ( + "bytes" + "fmt" + + "github.com/cometbft/cometbft/crypto" + + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/types/address" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/gogoproto/proto" +) + +const ( + keyType = "authn" + PubKeyName = "tendermint/PubKeyAuthn" +) + +var ( + _ cryptotypes.PubKey = &PubKey{} + _ codec.AminoMarshaler = &PubKey{} +) + +// PubKeySize is comprised of 32 bytes for one field element +// (the x-coordinate), plus one byte for the parity of the y-coordinate. +const PubKeySize = 33 + +// Address returns a Bitcoin style addresses: RIPEMD160(SHA256(pubkey)) +func (pubKey *PubKey) Address() crypto.Address { + if len(pubKey.Key) != PubKeySize { + panic("length of pubkey is incorrect") + } + + return address.Hash(proto.MessageName(pubKey), pubKey.Key) +} + +// Bytes returns the pubkey byte format. +func (pubKey *PubKey) Bytes() []byte { + return pubKey.Key +} + +func (pubKey *PubKey) String() string { + return fmt.Sprintf("PubKeyAuthn{%X}", pubKey.Key) +} + +func (pubKey *PubKey) Type() string { + return keyType +} + +func (pubKey *PubKey) Equals(other cryptotypes.PubKey) bool { + return pubKey.Type() == other.Type() && bytes.Equal(pubKey.Bytes(), other.Bytes()) +} + +// MarshalAmino overrides Amino binary marshalling. +func (pubKey PubKey) MarshalAmino() ([]byte, error) { + return pubKey.Key, nil +} + +// UnmarshalAmino overrides Amino binary marshalling. +func (pubKey *PubKey) UnmarshalAmino(bz []byte) error { + if len(bz) != PubKeySize { + return errorsmod.Wrap(sdkerrors.ErrInvalidPubKey, "invalid pubkey size") + } + pubKey.Key = bz + + return nil +} + +// MarshalAminoJSON overrides Amino JSON marshalling. +func (pubKey PubKey) MarshalAminoJSON() ([]byte, error) { + // When we marshal to Amino JSON, we don't marshal the "key" field itself, + // just its contents (i.e. the key bytes). + return pubKey.MarshalAmino() +} + +// UnmarshalAminoJSON overrides Amino JSON marshalling. +func (pubKey *PubKey) UnmarshalAminoJSON(bz []byte) error { + return pubKey.UnmarshalAmino(bz) +} diff --git a/crypto/keys/authn/keys.pb.go b/crypto/keys/authn/keys.pb.go new file mode 100644 index 00000000..910cc2e5 --- /dev/null +++ b/crypto/keys/authn/keys.pb.go @@ -0,0 +1,375 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kujira/crypto/authn/keys.proto + +package authn + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// PubKey defines a authn public key +type PubKey struct { + KeyId string `protobuf:"bytes,1,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` + Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` +} + +func (m *PubKey) Reset() { *m = PubKey{} } +func (*PubKey) ProtoMessage() {} +func (*PubKey) Descriptor() ([]byte, []int) { + return fileDescriptor_83c6c671dbc05afe, []int{0} +} +func (m *PubKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PubKey.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PubKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_PubKey.Merge(m, src) +} +func (m *PubKey) XXX_Size() int { + return m.Size() +} +func (m *PubKey) XXX_DiscardUnknown() { + xxx_messageInfo_PubKey.DiscardUnknown(m) +} + +var xxx_messageInfo_PubKey proto.InternalMessageInfo + +func (m *PubKey) GetKeyId() string { + if m != nil { + return m.KeyId + } + return "" +} + +func (m *PubKey) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func init() { + proto.RegisterType((*PubKey)(nil), "kujira.crypto.authn.PubKey") +} + +func init() { proto.RegisterFile("kujira/crypto/authn/keys.proto", fileDescriptor_83c6c671dbc05afe) } + +var fileDescriptor_83c6c671dbc05afe = []byte{ + // 242 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcb, 0x2e, 0xcd, 0xca, + 0x2c, 0x4a, 0xd4, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0x4f, 0x2c, 0x2d, 0xc9, 0xc8, 0xd3, + 0xcf, 0x4e, 0xad, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17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c4, 0x06, 0x76, 0xb1, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xf3, 0x1b, 0x67, 0x98, 0x11, 0x01, + 0x00, 0x00, +} + +func (m *PubKey) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PubKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintKeys(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x12 + } + if len(m.KeyId) > 0 { + i -= len(m.KeyId) + copy(dAtA[i:], m.KeyId) + i = encodeVarintKeys(dAtA, i, uint64(len(m.KeyId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintKeys(dAtA []byte, offset int, v uint64) int { + offset -= sovKeys(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PubKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.KeyId) + if l > 0 { + n += 1 + l + sovKeys(uint64(l)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovKeys(uint64(l)) + } + return n +} + +func sovKeys(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozKeys(x uint64) (n int) { + return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PubKey) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeys + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PubKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KeyId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeys + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthKeys + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthKeys + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KeyId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeys + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKeys + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthKeys + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipKeys(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthKeys + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipKeys(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowKeys + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowKeys + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowKeys + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthKeys + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupKeys + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthKeys + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthKeys = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowKeys = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group") +) diff --git a/crypto/keys/authn/signature.go b/crypto/keys/authn/signature.go new file mode 100644 index 00000000..cd5f37bd --- /dev/null +++ b/crypto/keys/authn/signature.go @@ -0,0 +1,87 @@ +package authn + +import ( + // "bytes" + "bytes" + "crypto" + "crypto/elliptic" + "crypto/sha256" + "encoding/asn1" + "encoding/base64" + "encoding/hex" + "encoding/json" + "math/big" + + cecdsa "crypto/ecdsa" +) + +// VerifyBytes verifies a signature of the form R || S. +// It rejects signatures which are not in lower-S form. +func (pubKey *PubKey) VerifySignature(msg []byte, sigStr []byte) bool { + type CBORSignature struct { + AuthenticatorData string `json:"authenticatorData"` + ClientDataJSON string `json:"clientDataJSON"` + Signature string `json:"signature"` + } + + cborSig := CBORSignature{} + err := json.Unmarshal(sigStr, &cborSig) + if err != nil { + return false + } + + clientDataJSON, err := hex.DecodeString(cborSig.ClientDataJSON) + if err != nil { + return false + } + + clientData := make(map[string]interface{}) + err = json.Unmarshal(clientDataJSON, &clientData) + if err != nil { + return false + } + + challenge, err := base64.RawURLEncoding.DecodeString(clientData["challenge"].(string)) + if err != nil { + return false + } + + // Check challenge == msg + if !bytes.Equal(challenge, msg) { + return false + } + + publicKey := &cecdsa.PublicKey{Curve: elliptic.P256()} + publicKey.X, publicKey.Y = elliptic.UnmarshalCompressed(elliptic.P256(), pubKey.Key) + if publicKey.X == nil || publicKey.Y == nil { + return false + } + + type ECDSASignature struct { + R, S *big.Int + } + + signatureBytes, err := hex.DecodeString(cborSig.Signature) + if err != nil { + return false + } + + e := &ECDSASignature{} + _, err = asn1.Unmarshal(signatureBytes, e) + if err != nil { + return false + } + + authenticatorData, err := hex.DecodeString(cborSig.AuthenticatorData) + if err != nil { + return false + } + + clientDataHash := sha256.Sum256(clientDataJSON) + payload := append(authenticatorData, clientDataHash[:]...) + + h := crypto.SHA256.New() + h.Write(payload) + + return cecdsa.Verify(publicKey, h.Sum(nil), e.R, e.S) +} diff --git a/proto/kujira/crypto/authn/keys.proto b/proto/kujira/crypto/authn/keys.proto new file mode 100644 index 00000000..11fa9e8d --- /dev/null +++ b/proto/kujira/crypto/authn/keys.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package kujira.crypto.authn; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/Team-Kujira/core/crypto/keys/authn"; + +// PubKey defines a authn public key +message PubKey { + option (amino.name) = "tendermint/PubKeyAuthn"; + + option (amino.message_encoding) = "key_field"; + option (gogoproto.goproto_stringer) = false; + + string key_id = 1; + bytes key = 2; +} From 0f2f0af6b77d44631442de00e04bb83f9b8473cd Mon Sep 17 00:00:00 2001 From: codehans <94654388+codehans@users.noreply.github.com> Date: Mon, 6 May 2024 16:45:22 +0100 Subject: [PATCH 12/27] UpgradeHandler --- UPGRADES.md | 16 ++++++++++++++++ app/upgrades.go | 24 +----------------------- 2 files changed, 17 insertions(+), 23 deletions(-) create mode 100644 UPGRADES.md diff --git a/UPGRADES.md b/UPGRADES.md new file mode 100644 index 00000000..f02b7064 --- /dev/null +++ b/UPGRADES.md @@ -0,0 +1,16 @@ +# kujira + +**kujira** is a blockchain built using Cosmos SDK and Comet BFT + +Please refer to [docs.kujira.app](https://docs.kujira.app/) and join our [Discord](https://t.co/kur923FTZk) for guidance in getting set up. + +## Upgrades + +- 0 -> v0.4.0 +- 01764000 -> v0.5.0 +- 03495000 -> v0.6.0 +- 04553726 -> v0.6.4 **manual halt-height required** +- 05196234 -> v0.7.1 +- 09226200 -> v0.8.4 **tag `v0.8.4-mainnet`** +- 11478516 -> v0.8.7 **manual halt-height required** +- 16610000 -> v0.9.3-1 (note `-1` suffix) diff --git a/app/upgrades.go b/app/upgrades.go index 0967990a..98b6ae06 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -1,36 +1,14 @@ package app import ( - batchtypes "github.com/Team-Kujira/core/x/batch/types" - cwicatypes "github.com/Team-Kujira/core/x/cw-ica/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ibcwasmtypes "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types" ) -const UpgradeName = "v1.0.2" +const UpgradeName = "v1.1.0-beta" func (app App) RegisterUpgradeHandlers() { - upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() - if err != nil { - panic(err) - } - - if upgradeInfo.Name == UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) && upgradeInfo.Info != "skip-store-upgrades" { - storeUpgrades := storetypes.StoreUpgrades{ - Added: []string{ - ibcwasmtypes.ModuleName, - batchtypes.ModuleName, - cwicatypes.ModuleName, - }, - } - - // configure store loader that checks if version == upgradeHeight and applies store upgrades - app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) - } - app.UpgradeKeeper.SetUpgradeHandler( UpgradeName, func(ctx sdk.Context, From 2ba44dfdb0524bcc1183616366d6a0c2bbc1f2a2 Mon Sep 17 00:00:00 2001 From: antstalepresh <36045227+antstalepresh@users.noreply.github.com> Date: Tue, 14 May 2024 02:15:44 +0800 Subject: [PATCH 13/27] Authn test (#66) * unit test for authn pubkey signature * remove commented code * add more cases in authn test --- crypto/keys/authn/signature.go | 18 +- crypto/keys/authn/signature_test.go | 494 ++++++++++++++++++++++++++++ 2 files changed, 503 insertions(+), 9 deletions(-) create mode 100644 crypto/keys/authn/signature_test.go diff --git a/crypto/keys/authn/signature.go b/crypto/keys/authn/signature.go index cd5f37bd..ce4562f1 100644 --- a/crypto/keys/authn/signature.go +++ b/crypto/keys/authn/signature.go @@ -12,18 +12,18 @@ import ( "encoding/json" "math/big" - cecdsa "crypto/ecdsa" + ecdsa "crypto/ecdsa" ) +type CBORSignature struct { + AuthenticatorData string `json:"authenticatorData"` + ClientDataJSON string `json:"clientDataJSON"` + Signature string `json:"signature"` +} + // VerifyBytes verifies a signature of the form R || S. // It rejects signatures which are not in lower-S form. func (pubKey *PubKey) VerifySignature(msg []byte, sigStr []byte) bool { - type CBORSignature struct { - AuthenticatorData string `json:"authenticatorData"` - ClientDataJSON string `json:"clientDataJSON"` - Signature string `json:"signature"` - } - cborSig := CBORSignature{} err := json.Unmarshal(sigStr, &cborSig) if err != nil { @@ -51,7 +51,7 @@ func (pubKey *PubKey) VerifySignature(msg []byte, sigStr []byte) bool { return false } - publicKey := &cecdsa.PublicKey{Curve: elliptic.P256()} + publicKey := &ecdsa.PublicKey{Curve: elliptic.P256()} publicKey.X, publicKey.Y = elliptic.UnmarshalCompressed(elliptic.P256(), pubKey.Key) if publicKey.X == nil || publicKey.Y == nil { return false @@ -83,5 +83,5 @@ func (pubKey *PubKey) VerifySignature(msg []byte, sigStr []byte) bool { h := crypto.SHA256.New() h.Write(payload) - return cecdsa.Verify(publicKey, h.Sum(nil), e.R, e.S) + return ecdsa.Verify(publicKey, h.Sum(nil), e.R, e.S) } diff --git a/crypto/keys/authn/signature_test.go b/crypto/keys/authn/signature_test.go new file mode 100644 index 00000000..eef68d9a --- /dev/null +++ b/crypto/keys/authn/signature_test.go @@ -0,0 +1,494 @@ +package authn + +import ( + "crypto" + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "crypto/sha256" + "encoding/base64" + "encoding/hex" + "encoding/json" + "testing" + + cometcrypto "github.com/cometbft/cometbft/crypto" + "github.com/stretchr/testify/require" +) + +// CollectedClientData represents the contextual bindings of both the WebAuthn Relying Party +// and the client. It is a key-value mapping whose keys are strings. Values can be any type +// that has a valid encoding in JSON. Its structure is defined by the following Web IDL. +// https://www.w3.org/TR/webauthn/#sec-client-data +type CollectedClientData struct { + // Type the string "webauthn.create" when creating new credentials, + // and "webauthn.get" when getting an assertion from an existing credential. The + // purpose of this member is to prevent certain types of signature confusion attacks + //(where an attacker substitutes one legitimate signature for another). + Type CeremonyType `json:"type"` + Challenge string `json:"challenge"` + Origin string `json:"origin"` + TokenBinding *TokenBinding `json:"tokenBinding,omitempty"` + // Chromium (Chrome) returns a hint sometimes about how to handle clientDataJSON in a safe manner + Hint string `json:"new_keys_may_be_added_here,omitempty"` +} + +type TokenBinding struct { + Status TokenBindingStatus `json:"status"` + ID string `json:"id,omitempty"` +} + +type TokenBindingStatus string + +type CeremonyType string + +const ( + CreateCeremony CeremonyType = "webauthn.create" + AssertCeremony CeremonyType = "webauthn.get" +) + +func GenerateAuthnKey(t *testing.T) (*ecdsa.PrivateKey, PubKey) { + curve := elliptic.P256() + privateKey, err := ecdsa.GenerateKey(curve, rand.Reader) + require.NoError(t, err) + pkBytes := elliptic.MarshalCompressed(curve, privateKey.PublicKey.X, privateKey.PublicKey.Y) + pk := PubKey{ + KeyId: "a099eda0fb05e5783379f73a06acca726673b8e07e436edcd0d71645982af65c", + Key: pkBytes, + } + return privateKey, pk +} + +func GenerateClientData(t *testing.T, msg []byte) []byte { + clientData := CollectedClientData{ + // purpose of this member is to prevent certain types of signature confusion attacks + //(where an attacker substitutes one legitimate signature for another). + Type: "webauthn.create", + Challenge: base64.RawURLEncoding.EncodeToString(msg), + Origin: "https://blue.kujira.network", + TokenBinding: nil, + Hint: "", + } + clientDataJSON, err := json.Marshal(clientData) + require.NoError(t, err) + return clientDataJSON +} + +func TestVerifySignature(t *testing.T) { + privateKey, pk := GenerateAuthnKey(t) + authenticatorData := cometcrypto.CRandBytes(37) + msg := cometcrypto.CRandBytes(1000) + clientDataJSON := GenerateClientData(t, msg) + clientDataHash := sha256.Sum256(clientDataJSON) + payload := append(authenticatorData, clientDataHash[:]...) + + h := crypto.SHA256.New() + h.Write(payload) + digest := h.Sum(nil) + + sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) + require.NoError(t, err) + + cborSig := CBORSignature{ + AuthenticatorData: hex.EncodeToString(authenticatorData), + ClientDataJSON: hex.EncodeToString(clientDataJSON), + Signature: hex.EncodeToString(sig), + } + + sigBytes, err := json.Marshal(cborSig) + require.NoError(t, err) + require.True(t, pk.VerifySignature(msg, sigBytes)) + + // Mutate the signature + for i := range sigBytes { + sigCpy := make([]byte, len(sigBytes)) + copy(sigCpy, sigBytes) + sigCpy[i] ^= byte(0xFF) + require.False(t, pk.VerifySignature(msg, sigCpy)) + } + + // Mutate the message + msg[1] ^= byte(2) + require.False(t, pk.VerifySignature(msg, sig)) +} + +func TestVerifySignature_ChallengeStdEncoding(t *testing.T) { + privateKey, pk := GenerateAuthnKey(t) + authenticatorData := cometcrypto.CRandBytes(37) + msg := cometcrypto.CRandBytes(1000) + clientData := CollectedClientData{ + // purpose of this member is to prevent certain types of signature confusion attacks + //(where an attacker substitutes one legitimate signature for another). + Type: "webauthn.create", + Challenge: base64.StdEncoding.EncodeToString(msg), + Origin: "https://blue.kujira.network", + TokenBinding: nil, + Hint: "", + } + clientDataJSON, err := json.Marshal(clientData) + require.NoError(t, err) + clientDataHash := sha256.Sum256(clientDataJSON) + payload := append(authenticatorData, clientDataHash[:]...) + + h := crypto.SHA256.New() + h.Write(payload) + digest := h.Sum(nil) + + sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) + require.NoError(t, err) + + cborSig := CBORSignature{ + AuthenticatorData: hex.EncodeToString(authenticatorData), + ClientDataJSON: hex.EncodeToString(clientDataJSON), + Signature: hex.EncodeToString(sig), + } + + sigBytes, err := json.Marshal(cborSig) + require.NoError(t, err) + require.False(t, pk.VerifySignature(msg, sigBytes)) +} + +func VerifySignature_ChallengeHexEncoding(t *testing.T) { + privateKey, pk := GenerateAuthnKey(t) + authenticatorData := cometcrypto.CRandBytes(37) + msg := cometcrypto.CRandBytes(1000) + clientData := CollectedClientData{ + // purpose of this member is to prevent certain types of signature confusion attacks + //(where an attacker substitutes one legitimate signature for another). + Type: "webauthn.create", + Challenge: hex.EncodeToString(msg), + Origin: "https://blue.kujira.network", + TokenBinding: nil, + Hint: "", + } + clientDataJSON, err := json.Marshal(clientData) + require.NoError(t, err) + clientDataHash := sha256.Sum256(clientDataJSON) + payload := append(authenticatorData, clientDataHash[:]...) + + h := crypto.SHA256.New() + h.Write(payload) + digest := h.Sum(nil) + + sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) + require.NoError(t, err) + + cborSig := CBORSignature{ + AuthenticatorData: hex.EncodeToString(authenticatorData), + ClientDataJSON: hex.EncodeToString(clientDataJSON), + Signature: hex.EncodeToString(sig), + } + + sigBytes, err := json.Marshal(cborSig) + require.NoError(t, err) + require.False(t, pk.VerifySignature(msg, sigBytes)) +} + +func VerifySignature_ChallengeEmpty(t *testing.T) { + privateKey, pk := GenerateAuthnKey(t) + authenticatorData := cometcrypto.CRandBytes(37) + msg := cometcrypto.CRandBytes(1000) + clientData := CollectedClientData{ + // purpose of this member is to prevent certain types of signature confusion attacks + //(where an attacker substitutes one legitimate signature for another). + Type: "webauthn.create", + Challenge: "", + Origin: "https://blue.kujira.network", + TokenBinding: nil, + Hint: "", + } + clientDataJSON, err := json.Marshal(clientData) + require.NoError(t, err) + clientDataHash := sha256.Sum256(clientDataJSON) + payload := append(authenticatorData, clientDataHash[:]...) + + h := crypto.SHA256.New() + h.Write(payload) + digest := h.Sum(nil) + + sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) + require.NoError(t, err) + + cborSig := CBORSignature{ + AuthenticatorData: hex.EncodeToString(authenticatorData), + ClientDataJSON: hex.EncodeToString(clientDataJSON), + Signature: hex.EncodeToString(sig), + } + + sigBytes, err := json.Marshal(cborSig) + require.NoError(t, err) + require.False(t, pk.VerifySignature(msg, sigBytes)) +} + +func VerifySignature_ChallengeNil(t *testing.T) { + privateKey, pk := GenerateAuthnKey(t) + authenticatorData := cometcrypto.CRandBytes(37) + msg := cometcrypto.CRandBytes(1000) + clientData := map[string]interface{}{ + // purpose of this member is to prevent certain types of signature confusion attacks + //(where an attacker substitutes one legitimate signature for another). + "type": "webauthn.create", + "origin": "https://blue.kujira.network", + } + clientDataJSON, err := json.Marshal(clientData) + require.NoError(t, err) + clientDataHash := sha256.Sum256(clientDataJSON) + payload := append(authenticatorData, clientDataHash[:]...) + + h := crypto.SHA256.New() + h.Write(payload) + digest := h.Sum(nil) + + sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) + require.NoError(t, err) + + cborSig := CBORSignature{ + AuthenticatorData: hex.EncodeToString(authenticatorData), + ClientDataJSON: hex.EncodeToString(clientDataJSON), + Signature: hex.EncodeToString(sig), + } + + sigBytes, err := json.Marshal(cborSig) + require.NoError(t, err) + require.False(t, pk.VerifySignature(msg, sigBytes)) +} + +func VerifySignature_ChallengeInteger(t *testing.T) { + privateKey, pk := GenerateAuthnKey(t) + authenticatorData := cometcrypto.CRandBytes(37) + msg := cometcrypto.CRandBytes(1000) + clientData := map[string]interface{}{ + // purpose of this member is to prevent certain types of signature confusion attacks + //(where an attacker substitutes one legitimate signature for another). + "type": "webauthn.create", + "origin": "https://blue.kujira.network", + "challenge": 1, + } + clientDataJSON, err := json.Marshal(clientData) + require.NoError(t, err) + clientDataHash := sha256.Sum256(clientDataJSON) + payload := append(authenticatorData, clientDataHash[:]...) + + h := crypto.SHA256.New() + h.Write(payload) + digest := h.Sum(nil) + + sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) + require.NoError(t, err) + + cborSig := CBORSignature{ + AuthenticatorData: hex.EncodeToString(authenticatorData), + ClientDataJSON: hex.EncodeToString(clientDataJSON), + Signature: hex.EncodeToString(sig), + } + + sigBytes, err := json.Marshal(cborSig) + require.NoError(t, err) + require.False(t, pk.VerifySignature(msg, sigBytes)) +} + +func VerifySignature_ClientDataJSONEmpty(t *testing.T) { + privateKey, pk := GenerateAuthnKey(t) + authenticatorData := cometcrypto.CRandBytes(37) + msg := cometcrypto.CRandBytes(1000) + payload := authenticatorData + + h := crypto.SHA256.New() + h.Write(payload) + digest := h.Sum(nil) + + sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) + require.NoError(t, err) + + type CBORSignature struct { + AuthenticatorData string `json:"authenticatorData"` + Signature string `json:"signature"` + } + cborSig := CBORSignature{ + AuthenticatorData: hex.EncodeToString(authenticatorData), + Signature: hex.EncodeToString(sig), + } + + sigBytes, err := json.Marshal(cborSig) + require.NoError(t, err) + require.False(t, pk.VerifySignature(msg, sigBytes)) +} + +func TestVerifySignature_UncompressedPubKey(t *testing.T) { + curve := elliptic.P256() + privateKey, err := ecdsa.GenerateKey(curve, rand.Reader) + require.NoError(t, err) + pkBytes := elliptic.Marshal(curve, privateKey.PublicKey.X, privateKey.PublicKey.Y) + pk := PubKey{ + KeyId: "a099eda0fb05e5783379f73a06acca726673b8e07e436edcd0d71645982af65c", + Key: pkBytes, + } + + authenticatorData := cometcrypto.CRandBytes(37) + msg := cometcrypto.CRandBytes(1000) + + clientDataJSON := GenerateClientData(t, msg) + clientDataHash := sha256.Sum256(clientDataJSON) + payload := append(authenticatorData, clientDataHash[:]...) + + h := crypto.SHA256.New() + h.Write(payload) + digest := h.Sum(nil) + + sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) + require.NoError(t, err) + + cborSig := CBORSignature{ + AuthenticatorData: hex.EncodeToString(authenticatorData), + ClientDataJSON: hex.EncodeToString(clientDataJSON), + Signature: hex.EncodeToString(sig), + } + + sigBytes, err := json.Marshal(cborSig) + require.NoError(t, err) + require.False(t, pk.VerifySignature(msg, sigBytes)) +} + +func TestVerifySignature_AnotherPubKey(t *testing.T) { + privateKey, _ := GenerateAuthnKey(t) + _, pk := GenerateAuthnKey(t) + + authenticatorData := cometcrypto.CRandBytes(37) + msg := cometcrypto.CRandBytes(1000) + + clientDataJSON := GenerateClientData(t, msg) + clientDataHash := sha256.Sum256(clientDataJSON) + payload := append(authenticatorData, clientDataHash[:]...) + + h := crypto.SHA256.New() + h.Write(payload) + digest := h.Sum(nil) + + sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) + require.NoError(t, err) + + cborSig := CBORSignature{ + AuthenticatorData: hex.EncodeToString(authenticatorData), + ClientDataJSON: hex.EncodeToString(clientDataJSON), + Signature: hex.EncodeToString(sig), + } + + sigBytes, err := json.Marshal(cborSig) + require.NoError(t, err) + require.False(t, pk.VerifySignature(msg, sigBytes)) +} + +func TestVerifySignature_SignaureNotInASN1(t *testing.T) { + privateKey, pk := GenerateAuthnKey(t) + authenticatorData := cometcrypto.CRandBytes(37) + msg := cometcrypto.CRandBytes(1000) + + clientDataJSON := GenerateClientData(t, msg) + clientDataHash := sha256.Sum256(clientDataJSON) + payload := append(authenticatorData, clientDataHash[:]...) + + h := crypto.SHA256.New() + h.Write(payload) + digest := h.Sum(nil) + + sigR, sigS, err := ecdsa.Sign(rand.Reader, privateKey, digest) + require.NoError(t, err) + sig := append(sigR.Bytes(), sigS.Bytes()...) + + cborSig := CBORSignature{ + AuthenticatorData: hex.EncodeToString(authenticatorData), + ClientDataJSON: hex.EncodeToString(clientDataJSON), + Signature: hex.EncodeToString(sig), + } + + sigBytes, err := json.Marshal(cborSig) + require.NoError(t, err) + require.False(t, pk.VerifySignature(msg, sigBytes)) +} + +func TestVerifySignature_EmptyAuthenticatorData(t *testing.T) { + privateKey, pk := GenerateAuthnKey(t) + authenticatorData := cometcrypto.CRandBytes(37) + msg := cometcrypto.CRandBytes(1000) + + clientDataJSON := GenerateClientData(t, msg) + clientDataHash := sha256.Sum256(clientDataJSON) + payload := append(authenticatorData, clientDataHash[:]...) + + h := crypto.SHA256.New() + h.Write(payload) + digest := h.Sum(nil) + + sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) + require.NoError(t, err) + + cborSig := CBORSignature{ + AuthenticatorData: "", + ClientDataJSON: hex.EncodeToString(clientDataJSON), + Signature: hex.EncodeToString(sig), + } + + sigBytes, err := json.Marshal(cborSig) + require.NoError(t, err) + require.False(t, pk.VerifySignature(msg, sigBytes)) +} + +func TestVerifySignature_SignatureEncodingInBase64(t *testing.T) { + privateKey, pk := GenerateAuthnKey(t) + authenticatorData := cometcrypto.CRandBytes(37) + msg := cometcrypto.CRandBytes(1000) + + clientDataJSON := GenerateClientData(t, msg) + clientDataHash := sha256.Sum256(clientDataJSON) + payload := append(authenticatorData, clientDataHash[:]...) + + h := crypto.SHA256.New() + h.Write(payload) + digest := h.Sum(nil) + + sigR, sigS, err := ecdsa.Sign(rand.Reader, privateKey, digest) + require.NoError(t, err) + sig := append(sigR.Bytes(), sigS.Bytes()...) + + cborSig := CBORSignature{ + AuthenticatorData: hex.EncodeToString(authenticatorData), + ClientDataJSON: hex.EncodeToString(clientDataJSON), + Signature: base64.StdEncoding.EncodeToString(sig), + } + + sigBytes, err := json.Marshal(cborSig) + require.NoError(t, err) + require.False(t, pk.VerifySignature(msg, sigBytes)) +} + +func TestVerifySignature_ClientDataJSONEncodingInBase64(t *testing.T) { + privateKey, pk := GenerateAuthnKey(t) + authenticatorData := cometcrypto.CRandBytes(37) + msg := cometcrypto.CRandBytes(1000) + clientDataJSON := GenerateClientData(t, msg) + clientDataHash := sha256.Sum256(clientDataJSON) + payload := append(authenticatorData, clientDataHash[:]...) + + h := crypto.SHA256.New() + h.Write(payload) + digest := h.Sum(nil) + + sigR, sigS, err := ecdsa.Sign(rand.Reader, privateKey, digest) + require.NoError(t, err) + sig := append(sigR.Bytes(), sigS.Bytes()...) + + cborSig := CBORSignature{ + AuthenticatorData: hex.EncodeToString(authenticatorData), + ClientDataJSON: base64.StdEncoding.EncodeToString(clientDataJSON), + Signature: hex.EncodeToString(sig), + } + + sigBytes, err := json.Marshal(cborSig) + require.NoError(t, err) + require.False(t, pk.VerifySignature(msg, sigBytes)) +} + +func TestVerifySignature_EmptySignature(t *testing.T) { + _, pk := GenerateAuthnKey(t) + msg := cometcrypto.CRandBytes(1000) + require.False(t, pk.VerifySignature(msg, []byte{})) +} From 196a5c494491f900d8779da986d5efdfaaf1ae5c Mon Sep 17 00:00:00 2001 From: antstalepresh <36045227+antstalepresh@users.noreply.github.com> Date: Thu, 13 Jun 2024 15:08:18 +0800 Subject: [PATCH 14/27] add transfer callback in cw-ica (#67) * add transfer callback in cw-ica * add more data in transfer callback * add transfer receipt hook * custom wasmbinding for ibc transfer with callback * update execution order of timeout execution and callback * error check before callback execution --- app/app.go | 2 + wasmbinding/message_plugin.go | 30 ++--- wasmbinding/wasm.go | 4 +- x/cw-ica/keeper/sudo.go | 97 +++++++++++++++- x/cw-ica/keeper/transfer_handlers.go | 155 ++++++++++++++++++++++++++ x/cw-ica/transfer_middleware.go | 159 +++++++++++++++++++++++++++ x/cw-ica/types/sudo.go | 30 +++++ x/cw-ica/wasm/interface_msg.go | 71 +++++++++++- 8 files changed, 526 insertions(+), 22 deletions(-) create mode 100644 x/cw-ica/keeper/transfer_handlers.go create mode 100644 x/cw-ica/transfer_middleware.go diff --git a/app/app.go b/app/app.go index 834d1c0f..8d56ab46 100644 --- a/app/app.go +++ b/app/app.go @@ -678,6 +678,7 @@ func New( *app.IBCKeeper, app.CwICAKeeper, app.ICAControllerKeeper, + app.TransferKeeper, keys[ibcexported.StoreKey], ), wasmOpts...) @@ -758,6 +759,7 @@ func New( var transferStack ibcporttypes.IBCModule transferStack = transfer.NewIBCModule(app.TransferKeeper) transferStack = ibcfee.NewIBCMiddleware(transferStack, app.IBCFeeKeeper) + transferStack = cwica.NewIBCMiddleware(transferStack, app.CwICAKeeper, app.IBCKeeper.ChannelKeeper) // Create Interchain Accounts Stack // SendPacket, since it is originating from the application to core IBC: diff --git a/wasmbinding/message_plugin.go b/wasmbinding/message_plugin.go index 97cea300..8577a74c 100644 --- a/wasmbinding/message_plugin.go +++ b/wasmbinding/message_plugin.go @@ -10,6 +10,7 @@ import ( bankkeeper "github.com/terra-money/alliance/custom/bank/keeper" "github.com/Team-Kujira/core/wasmbinding/bindings" + ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" batchkeeper "github.com/Team-Kujira/core/x/batch/keeper" batch "github.com/Team-Kujira/core/x/batch/wasm" @@ -27,26 +28,29 @@ func CustomMessageDecorator( batch batchkeeper.Keeper, cwica cwicakeeper.Keeper, ica icacontrollerkeeper.Keeper, + transfer ibctransferkeeper.Keeper, ) func(wasmkeeper.Messenger) wasmkeeper.Messenger { return func(old wasmkeeper.Messenger) wasmkeeper.Messenger { return &CustomMessenger{ - wrapped: old, - bank: bank, - denom: denom, - cwica: cwica, - ica: ica, - batch: batch, + wrapped: old, + bank: bank, + denom: denom, + cwica: cwica, + ica: ica, + batch: batch, + transfer: transfer, } } } type CustomMessenger struct { - wrapped wasmkeeper.Messenger - bank bankkeeper.Keeper - denom denomkeeper.Keeper - cwica cwicakeeper.Keeper - ica icacontrollerkeeper.Keeper - batch batchkeeper.Keeper + wrapped wasmkeeper.Messenger + bank bankkeeper.Keeper + denom denomkeeper.Keeper + cwica cwicakeeper.Keeper + ica icacontrollerkeeper.Keeper + batch batchkeeper.Keeper + transfer ibctransferkeeper.Keeper } var _ wasmkeeper.Messenger = (*CustomMessenger)(nil) @@ -75,7 +79,7 @@ func (m *CustomMessenger) DispatchMsg( } if contractMsg.CwIca != nil { - return cwica.HandleMsg(ctx, m.cwica, m.ica, contractAddr, contractMsg.CwIca) + return cwica.HandleMsg(ctx, m.cwica, m.ica, m.transfer, contractAddr, contractMsg.CwIca) } return nil, nil, wasmvmtypes.UnsupportedRequest{Kind: "unknown Custom variant"} diff --git a/wasmbinding/wasm.go b/wasmbinding/wasm.go index cd2c2871..72135136 100644 --- a/wasmbinding/wasm.go +++ b/wasmbinding/wasm.go @@ -12,6 +12,7 @@ import ( bankkeeper "github.com/terra-money/alliance/custom/bank/keeper" icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" + ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" ) func RegisterCustomPlugins( @@ -22,6 +23,7 @@ func RegisterCustomPlugins( ibc ibckeeper.Keeper, cwica cwicakeeper.Keeper, ica icacontrollerkeeper.Keeper, + transfer ibctransferkeeper.Keeper, ibcStoreKey *storetypes.KVStoreKey, ) []wasmkeeper.Option { wasmQueryPlugin := NewQueryPlugin(bank, oracle, denom, ibc, cwica, ibcStoreKey) @@ -31,7 +33,7 @@ func RegisterCustomPlugins( }) messengerDecoratorOpt := wasmkeeper.WithMessageHandlerDecorator( - CustomMessageDecorator(bank, denom, batch, cwica, ica), + CustomMessageDecorator(bank, denom, batch, cwica, ica, transfer), ) return []wasmkeeper.Option{ diff --git a/x/cw-ica/keeper/sudo.go b/x/cw-ica/keeper/sudo.go index 65cd42d1..c4cd5e67 100644 --- a/x/cw-ica/keeper/sudo.go +++ b/x/cw-ica/keeper/sudo.go @@ -7,7 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/Team-Kujira/core/x/cw-ica/types" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" ) func (k Keeper) HasContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress) bool { @@ -22,7 +23,7 @@ func (k Keeper) SudoIcaRegisterCallback( contractAddr := sdk.MustAccAddressFromBech32(callbackData.Contract) if !k.wasmKeeper.HasContractInfo(ctx, contractAddr) { - if callbackData.PortId == ibctransfertypes.PortID { + if callbackData.PortId == transfertypes.PortID { // we want to allow non contract account to send the assets via IBC Transfer module // we can determine the originating module by the source port of the request packet return nil, nil @@ -60,7 +61,7 @@ func (k Keeper) SudoIcaTxCallback( contractAddr := sdk.MustAccAddressFromBech32(callbackData.Contract) if !k.wasmKeeper.HasContractInfo(ctx, contractAddr) { - if callbackData.PortId == ibctransfertypes.PortID { + if callbackData.PortId == transfertypes.PortID { // we want to allow non contract account to send the assets via IBC Transfer module // we can determine the originating module by the source port of the request packet return nil, nil @@ -90,3 +91,93 @@ func (k Keeper) SudoIcaTxCallback( return resp, nil } + +func (k Keeper) SudoIbcTransferCallback( + ctx sdk.Context, + packet channeltypes.Packet, + data transfertypes.FungibleTokenPacketData, + callbackData types.CallbackData, + result types.IcaCallbackResult, +) error { + contractAddr, err := sdk.AccAddressFromBech32(data.Sender) + if err != nil { + return err + } + + if !k.wasmKeeper.HasContractInfo(ctx, contractAddr) { + return nil + } + + if callbackData.Callback == nil { + callbackData.Callback = []byte{} + } + + x := types.MessageTransferCallback{} + x.TransferCallback.Port = packet.SourcePort + x.TransferCallback.Channel = packet.SourceChannel + x.TransferCallback.Sequence = packet.Sequence + x.TransferCallback.Receiver = data.Receiver + x.TransferCallback.Denom = data.Denom + x.TransferCallback.Amount = data.Amount + x.TransferCallback.Memo = data.Memo + x.TransferCallback.Result = result + x.TransferCallback.Callback = callbackData.Callback + + m, err := json.Marshal(x) + if err != nil { + k.Logger(ctx).Error("SudoCallback: failed to marshal MessageResponse message", "error", err, "contractAddress", contractAddr) + return err + } + + _, err = k.wasmKeeper.Sudo(ctx, contractAddr, m) + if err != nil { + k.Logger(ctx).Debug("SudoResponse: failed to Sudo", "error", err, "contractAddress", contractAddr) + } + return err +} + +func (k Keeper) SudoIbcTransferReceipt( + ctx sdk.Context, + packet channeltypes.Packet, + data transfertypes.FungibleTokenPacketData, +) error { + contractAddr, err := sdk.AccAddressFromBech32(data.Receiver) + if err != nil { + return err + } + + if !k.wasmKeeper.HasContractInfo(ctx, contractAddr) { + return nil + } + + denom := "" + if transfertypes.ReceiverChainIsSource(packet.GetSourcePort(), packet.GetSourceChannel(), data.Denom) { + voucherPrefix := transfertypes.GetDenomPrefix(packet.GetSourcePort(), packet.GetSourceChannel()) + denom = data.Denom[len(voucherPrefix):] + } else { + sourcePrefix := transfertypes.GetDenomPrefix(packet.GetDestPort(), packet.GetDestChannel()) + prefixedDenom := sourcePrefix + data.Denom + denom = transfertypes.ParseDenomTrace(prefixedDenom).IBCDenom() + } + + x := types.MessageTransferReceipt{} + x.TransferReceipt.Port = packet.DestinationPort + x.TransferReceipt.Channel = packet.DestinationChannel + x.TransferReceipt.Sequence = packet.Sequence + x.TransferReceipt.Sender = data.Sender + x.TransferReceipt.Denom = denom + x.TransferReceipt.Amount = data.Amount + x.TransferReceipt.Memo = data.Memo + + m, err := json.Marshal(x) + if err != nil { + k.Logger(ctx).Error("SudoCallback: failed to marshal MessageResponse message", "error", err, "contractAddress", contractAddr) + return err + } + + _, err = k.wasmKeeper.Sudo(ctx, contractAddr, m) + if err != nil { + k.Logger(ctx).Debug("SudoResponse: failed to Sudo", "error", err, "contractAddress", contractAddr) + } + return err +} diff --git a/x/cw-ica/keeper/transfer_handlers.go b/x/cw-ica/keeper/transfer_handlers.go new file mode 100644 index 00000000..b72c1b10 --- /dev/null +++ b/x/cw-ica/keeper/transfer_handlers.go @@ -0,0 +1,155 @@ +package keeper + +import ( + "fmt" + + "github.com/Team-Kujira/core/x/cw-ica/types" + sdk "github.com/cosmos/cosmos-sdk/types" + transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" +) + +// HandleAcknowledgement passes the acknowledgement data to the appropriate contract via a Sudo call. +func (k *Keeper) HandleTransferAcknowledgement(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, _ sdk.AccAddress) { + k.Logger(ctx).Debug("Handling transfer acknowledgement") + var data transfertypes.FungibleTokenPacketData + if err := transfertypes.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil { + return + } + + var ack channeltypes.Acknowledgement + if err := channeltypes.SubModuleCdc.UnmarshalJSON(acknowledgement, &ack); err != nil { + k.Logger(ctx).Error("HandleTransferAcknowledgement: cannot unmarshal IBC transfer packet acknowledgement", "error", err) + return + } + + cacheCtx, writeFn, newGasMeter := k.createCachedContext(ctx) + defer k.outOfGasRecovery(ctx, newGasMeter) + + callbackDataKey := types.PacketID(packet.GetSourcePort(), packet.GetSourceChannel(), packet.Sequence) + callbackData, found := k.GetCallbackData(ctx, callbackDataKey) + + // Actually we have only one kind of error returned from acknowledgement + // maybe later we'll retrieve actual errors from events + errorText := ack.GetError() + var err error + if errorText != "" { + err = k.SudoIbcTransferCallback(cacheCtx, packet, data, callbackData, types.IcaCallbackResult{ + Error: &types.IcaCallbackError{ + Error: errorText, + }, + }) + } else { + err = k.SudoIbcTransferCallback(cacheCtx, packet, data, callbackData, types.IcaCallbackResult{ + Success: &types.IcaCallbackSuccess{ + Data: ack.GetResult(), + }, + }) + } + + if err != nil { + k.Logger(ctx).Debug( + "HandleTransferAcknowledgement: failed to Sudo contract on transfer packet acknowledgement", + "source_port", packet.SourcePort, + "source_channel", packet.SourceChannel, + "sequence", packet.Sequence, + "error", err) + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeICATxCallbackFailure, + sdk.NewAttribute(types.AttributePacketSourcePort, packet.SourcePort), + sdk.NewAttribute(types.AttributePacketSourceChannel, packet.SourceChannel), + sdk.NewAttribute(types.AttributePacketSequence, fmt.Sprintf("%d", packet.Sequence)), + ), + }) + } else { + ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events()) + writeFn() + } + + ctx.GasMeter().ConsumeGas(newGasMeter.GasConsumed(), "consume from cached context") + + // remove the callback data + if found { + k.RemoveCallbackData(ctx, callbackDataKey) + } +} + +func (k *Keeper) HandleTransferTimeout(ctx sdk.Context, packet channeltypes.Packet, _ sdk.AccAddress) { + k.Logger(ctx).Debug("Transfer HandleTimeout") + + var data transfertypes.FungibleTokenPacketData + if err := transfertypes.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil { + return + } + + cacheCtx, writeFn, newGasMeter := k.createCachedContext(ctx) + defer k.outOfGasRecovery(ctx, newGasMeter) + + callbackDataKey := types.PacketID(packet.GetSourcePort(), packet.GetSourceChannel(), packet.Sequence) + callbackData, found := k.GetCallbackData(ctx, callbackDataKey) + err := k.SudoIbcTransferCallback(ctx, packet, data, callbackData, types.IcaCallbackResult{ + Timeout: &types.IcaCallbackTimeout{}, + }) + if err != nil { + k.Logger(ctx).Debug( + "HandleTransferTimeout: failed to Sudo contract on transfer packet timeout", + "source_port", packet.SourcePort, + "source_channel", packet.SourceChannel, + "sequence", packet.Sequence, + "error", err) + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeICATimeoutCallbackFailure, + sdk.NewAttribute(types.AttributePacketSourcePort, packet.SourcePort), + sdk.NewAttribute(types.AttributePacketSourceChannel, packet.SourceChannel), + sdk.NewAttribute(types.AttributePacketSequence, fmt.Sprintf("%d", packet.Sequence)), + ), + }) + } else { + ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events()) + writeFn() + } + + ctx.GasMeter().ConsumeGas(newGasMeter.GasConsumed(), "consume from cached context") + + // remove the callback data + if found { + k.RemoveCallbackData(ctx, callbackDataKey) + } +} + +func (k *Keeper) HandleTransferReceipt(ctx sdk.Context, packet channeltypes.Packet, _ sdk.AccAddress) { + k.Logger(ctx).Debug("Transfer Receipt") + + var data transfertypes.FungibleTokenPacketData + if err := transfertypes.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil { + return + } + + cacheCtx, writeFn, newGasMeter := k.createCachedContext(ctx) + defer k.outOfGasRecovery(ctx, newGasMeter) + + err := k.SudoIbcTransferReceipt(ctx, packet, data) + if err != nil { + k.Logger(ctx).Debug( + "HandleTransferReceipt: failed to Sudo contract on transfer receipt", + "destination_port", packet.DestinationPort, + "destination_channel", packet.DestinationChannel, + "sequence", packet.Sequence, + "error", err) + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeICATimeoutCallbackFailure, + sdk.NewAttribute(types.AttributePacketSourcePort, packet.SourcePort), + sdk.NewAttribute(types.AttributePacketSourceChannel, packet.SourceChannel), + sdk.NewAttribute(types.AttributePacketSequence, fmt.Sprintf("%d", packet.Sequence)), + ), + }) + } else { + ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events()) + writeFn() + } + + ctx.GasMeter().ConsumeGas(newGasMeter.GasConsumed(), "consume from cached context") +} diff --git a/x/cw-ica/transfer_middleware.go b/x/cw-ica/transfer_middleware.go new file mode 100644 index 00000000..0f834f1f --- /dev/null +++ b/x/cw-ica/transfer_middleware.go @@ -0,0 +1,159 @@ +package cwica + +import ( + "github.com/Team-Kujira/core/x/cw-ica/keeper" + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" +) + +var _ porttypes.Middleware = &IBCMiddleware{} + +type IBCMiddleware struct { + App porttypes.IBCModule + keeper keeper.Keeper + ICS4Middleware porttypes.ICS4Wrapper +} + +func NewIBCMiddleware(app porttypes.IBCModule, keeper keeper.Keeper, ics4 porttypes.ICS4Wrapper) IBCMiddleware { + return IBCMiddleware{ + App: app, + keeper: keeper, + ICS4Middleware: ics4, + } +} + +// OnChanOpenInit implements the IBCMiddleware interface +func (im IBCMiddleware) OnChanOpenInit( + ctx sdk.Context, + order channeltypes.Order, + connectionHops []string, + portID string, + channelID string, + channelCap *capabilitytypes.Capability, + counterparty channeltypes.Counterparty, + version string, +) (string, error) { + return im.App.OnChanOpenInit(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version) +} + +// OnChanOpenTry implements the IBCMiddleware interface +func (im IBCMiddleware) OnChanOpenTry( + ctx sdk.Context, + order channeltypes.Order, + connectionHops []string, + portID, + channelID string, + channelCap *capabilitytypes.Capability, + counterparty channeltypes.Counterparty, + counterpartyVersion string, +) (string, error) { + return im.App.OnChanOpenTry(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion) +} + +// OnChanOpenAck implements the IBCMiddleware interface +func (im IBCMiddleware) OnChanOpenAck( + ctx sdk.Context, + portID, + channelID string, + counterpartyChannelID string, + counterpartyVersion string, +) error { + return im.App.OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) +} + +// OnChanOpenConfirm implements the IBCMiddleware interface +func (im IBCMiddleware) OnChanOpenConfirm( + ctx sdk.Context, + portID, + channelID string, +) error { + return im.App.OnChanOpenConfirm(ctx, portID, channelID) +} + +// OnChanCloseInit implements the IBCMiddleware interface +func (im IBCMiddleware) OnChanCloseInit( + ctx sdk.Context, + portID, + channelID string, +) error { + return im.App.OnChanCloseInit(ctx, portID, channelID) +} + +// OnChanCloseConfirm implements the IBCMiddleware interface +func (im IBCMiddleware) OnChanCloseConfirm( + ctx sdk.Context, + portID, + channelID string, +) error { + return im.App.OnChanCloseConfirm(ctx, portID, channelID) +} + +// OnRecvPacket implements the IBCMiddleware interface +func (im IBCMiddleware) OnRecvPacket( + ctx sdk.Context, + packet channeltypes.Packet, + relayer sdk.AccAddress, +) ibcexported.Acknowledgement { + ack := im.App.OnRecvPacket(ctx, packet, relayer) + im.keeper.HandleTransferReceipt(ctx, packet, relayer) + return ack +} + +// OnAcknowledgementPacket implements the IBCMiddleware interface +func (im IBCMiddleware) OnAcknowledgementPacket( + ctx sdk.Context, + packet channeltypes.Packet, + acknowledgement []byte, + relayer sdk.AccAddress, +) error { + err := im.App.OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer) + if err != nil { + return err + } + im.keeper.HandleTransferAcknowledgement(ctx, packet, acknowledgement, relayer) + return nil +} + +// OnTimeoutPacket implements the IBCMiddleware interface +func (im IBCMiddleware) OnTimeoutPacket( + ctx sdk.Context, + packet channeltypes.Packet, + relayer sdk.AccAddress, +) error { + err := im.App.OnTimeoutPacket(ctx, packet, relayer) + if err != nil { + return err + } + im.keeper.HandleTransferTimeout(ctx, packet, relayer) + return nil +} + +// SendPacket implements the ICS4 Wrapper interface +func (im IBCMiddleware) SendPacket( + ctx sdk.Context, + chanCap *capabilitytypes.Capability, + sourcePort string, sourceChannel string, + timeoutHeight clienttypes.Height, + timeoutTimestamp uint64, + data []byte, +) (sequence uint64, err error) { + return im.ICS4Middleware.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) +} + +// WriteAcknowledgement implements the ICS4 Wrapper interface +func (im IBCMiddleware) WriteAcknowledgement( + ctx sdk.Context, + chanCap *capabilitytypes.Capability, + packet ibcexported.PacketI, + ack ibcexported.Acknowledgement, +) error { + return im.ICS4Middleware.WriteAcknowledgement(ctx, chanCap, packet, ack) +} + +func (im IBCMiddleware) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) { + return im.ICS4Middleware.GetAppVersion(ctx, portID, channelID) +} diff --git a/x/cw-ica/types/sudo.go b/x/cw-ica/types/sudo.go index f3b06bef..41bf158d 100644 --- a/x/cw-ica/types/sudo.go +++ b/x/cw-ica/types/sudo.go @@ -38,3 +38,33 @@ type IcaCallbackError struct { } type IcaCallbackTimeout struct{} + +type MessageTransferCallback struct { + TransferCallback TransferCallbackData `json:"transfer_callback"` +} + +type TransferCallbackData struct { + Port string `json:"port"` + Channel string `json:"channel"` + Sequence uint64 `json:"sequence"` + Receiver string `json:"receiver"` + Denom string `json:"denom"` + Amount string `json:"amount"` + Memo string `json:"memo"` + Result IcaCallbackResult `json:"result"` + Callback []byte `json:"callback"` +} + +type MessageTransferReceipt struct { + TransferReceipt TransferReceiptData `json:"transfer_receipt"` +} + +type TransferReceiptData struct { + Port string `json:"port"` + Channel string `json:"channel"` + Sequence uint64 `json:"sequence"` + Sender string `json:"sender"` + Denom string `json:"denom"` + Amount string `json:"amount"` + Memo string `json:"memo"` +} diff --git a/x/cw-ica/wasm/interface_msg.go b/x/cw-ica/wasm/interface_msg.go index d18012f5..64c3122c 100644 --- a/x/cw-ica/wasm/interface_msg.go +++ b/x/cw-ica/wasm/interface_msg.go @@ -2,15 +2,17 @@ package wasm import ( "cosmossdk.io/errors" + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmvmtypes "github.com/CosmWasm/wasmvm/types" + cwicakeeper "github.com/Team-Kujira/core/x/cw-ica/keeper" + "github.com/Team-Kujira/core/x/cw-ica/types" + cosmostypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - - cwicakeeper "github.com/Team-Kujira/core/x/cw-ica/keeper" - "github.com/Team-Kujira/core/x/cw-ica/types" - cosmostypes "github.com/cosmos/cosmos-sdk/codec/types" + ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" ) // ProtobufAny is a hack-struct to serialize protobuf Any message into JSON object @@ -26,6 +28,9 @@ type CwIcaMsg struct { /// Contracts can submit transactions to the ICA /// associated with the given information. Submit *Submit `json:"submit,omitempty"` + /// Transfer submits ibc-transfer msg with + /// optional callback field + Transfer *Transfer `json:"transfer,omitempty"` } // / Register creates a new interchain account. @@ -52,6 +57,14 @@ type Submit struct { Callback []byte `json:"callback"` } +type Transfer struct { + ChannelID string `json:"channel_id"` + ToAddress string `json:"to_address"` + Amount wasmvmtypes.Coin `json:"amount"` + Timeout wasmvmtypes.IBCTimeout `json:"timeout"` + Callback []byte `json:"callback"` +} + func register(ctx sdk.Context, contractAddr sdk.AccAddress, register *Register, cwicak cwicakeeper.Keeper, ik icacontrollerkeeper.Keeper) ([]sdk.Event, [][]byte, error) { _, err := PerformRegisterICA(cwicak, ik, ctx, contractAddr, register) if err != nil { @@ -169,12 +182,60 @@ func PerformSubmitTxs(f icacontrollerkeeper.Keeper, cwicak cwicakeeper.Keeper, c return res, nil } -func HandleMsg(ctx sdk.Context, cwicak cwicakeeper.Keeper, icak icacontrollerkeeper.Keeper, contractAddr sdk.AccAddress, msg *CwIcaMsg) ([]sdk.Event, [][]byte, error) { +func transfer(ctx sdk.Context, contractAddr sdk.AccAddress, transferTx *Transfer, cwicak cwicakeeper.Keeper, tk ibctransferkeeper.Keeper) ([]sdk.Event, [][]byte, error) { + _, err := PerformTransfer(tk, cwicak, ctx, contractAddr, transferTx) + if err != nil { + return nil, nil, errors.Wrap(err, "perform submit txs") + } + return nil, nil, nil +} + +// PerformTransfer is used to perform ibc transfer through wasmbinding. +func PerformTransfer(f ibctransferkeeper.Keeper, cwicak cwicakeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, transferTx *Transfer) (*ibctransfertypes.MsgTransferResponse, error) { + if transferTx == nil { + return nil, wasmvmtypes.InvalidRequest{Err: "transfer txs null message"} + } + + amount, err := wasmkeeper.ConvertWasmCoinToSdkCoin(transferTx.Amount) + if err != nil { + return nil, errors.Wrap(err, "amount") + } + msg := &ibctransfertypes.MsgTransfer{ + SourcePort: ibctransfertypes.PortID, + SourceChannel: transferTx.ChannelID, + Token: amount, + Sender: contractAddr.String(), + Receiver: transferTx.ToAddress, + TimeoutHeight: wasmkeeper.ConvertWasmIBCTimeoutHeightToCosmosHeight(transferTx.Timeout.Block), + TimeoutTimestamp: transferTx.Timeout.Timestamp, + } + + res, err := f.Transfer(sdk.WrapSDKContext(ctx), msg) + if err != nil { + return nil, errors.Wrap(err, "submitting transfer tx") + } + + cwicak.SetCallbackData(ctx, types.CallbackData{ + PortId: msg.SourcePort, + ChannelId: msg.SourceChannel, + Sequence: res.Sequence, + Contract: contractAddr.String(), + ConnectionId: "", + AccountId: "", + Callback: transferTx.Callback, + }) + return res, nil +} + +func HandleMsg(ctx sdk.Context, cwicak cwicakeeper.Keeper, icak icacontrollerkeeper.Keeper, transferk ibctransferkeeper.Keeper, contractAddr sdk.AccAddress, msg *CwIcaMsg) ([]sdk.Event, [][]byte, error) { if msg.Register != nil { return register(ctx, contractAddr, msg.Register, cwicak, icak) } if msg.Submit != nil { return submit(ctx, contractAddr, msg.Submit, cwicak, icak) } + if msg.Transfer != nil { + return transfer(ctx, contractAddr, msg.Transfer, cwicak, transferk) + } return nil, nil, wasmvmtypes.InvalidRequest{Err: "unknown ICA Message variant"} } From 50f3a0e377bc21d5177b8d4c52b3acddce85034e Mon Sep 17 00:00:00 2001 From: antstalepresh <36045227+antstalepresh@users.noreply.github.com> Date: Thu, 13 Jun 2024 20:34:08 +0800 Subject: [PATCH 15/27] Add no creation fee accounts on denom module (#46) * add no fee accounts on denom module * add migration script for denom module * add unit test for create denom * add separate storage for no fee accounts * lint and param validation fix --- app/app.go | 1 + proto/kujira/denom/genesis.proto | 3 + proto/kujira/denom/query.proto | 14 + proto/kujira/denom/tx.proto | 14 + x/denom/client/cli/query.go | 28 + x/denom/genesis.go | 5 + x/denom/keeper/createdenom.go | 10 +- x/denom/keeper/grpc_query.go | 7 + x/denom/keeper/keeper.go | 10 +- x/denom/keeper/keeper_test.go | 46 +- x/denom/keeper/migrations.go | 24 + x/denom/keeper/msg_server.go | 46 ++ x/denom/keeper/msg_server_test.go | 84 +++ x/denom/keeper/no_fee_accounts.go | 43 ++ x/denom/keeper/no_fee_accounts_test.go | 33 + x/denom/module.go | 7 +- x/denom/types/codec.go | 4 + x/denom/types/errors.go | 1 + x/denom/types/events.go | 1 + x/denom/types/genesis.pb.go | 104 ++- x/denom/types/keys.go | 6 + x/denom/types/msgs.go | 72 ++- x/denom/types/params.go | 3 +- x/denom/types/query.pb.go | 422 ++++++++++-- x/denom/types/query.pb.gw.go | 75 ++- x/denom/types/tx.pb.go | 854 +++++++++++++++++++++++-- 26 files changed, 1759 insertions(+), 158 deletions(-) create mode 100644 x/denom/keeper/migrations.go create mode 100644 x/denom/keeper/msg_server_test.go create mode 100644 x/denom/keeper/no_fee_accounts.go create mode 100644 x/denom/keeper/no_fee_accounts_test.go diff --git a/app/app.go b/app/app.go index 8d56ab46..90357772 100644 --- a/app/app.go +++ b/app/app.go @@ -636,6 +636,7 @@ func New( app.AccountKeeper, app.BankKeeper.WithMintCoinsRestriction(denomtypes.NewdenomDenomMintCoinsRestriction()), app.DistrKeeper, + authority, ) app.DenomKeeper = &denomKeeper diff --git a/proto/kujira/denom/genesis.proto b/proto/kujira/denom/genesis.proto index 1bd46fd6..bd9b1bb8 100644 --- a/proto/kujira/denom/genesis.proto +++ b/proto/kujira/denom/genesis.proto @@ -16,6 +16,9 @@ message GenesisState { (gogoproto.moretags) = "yaml:\"factory_denoms\"", (gogoproto.nullable) = false ]; + + // whitelisted accounts that do not require paying creation fees + repeated string no_fee_accounts = 3; } message GenesisDenom { diff --git a/proto/kujira/denom/query.proto b/proto/kujira/denom/query.proto index bf233df3..d4deaa87 100644 --- a/proto/kujira/denom/query.proto +++ b/proto/kujira/denom/query.proto @@ -27,6 +27,20 @@ service Query { option (google.api.http).get = "/kujira/denoms/by_creator/{creator}"; } + + // NoFeeAccounts returns accounts whitelisted to create denom without fee + rpc NoFeeAccounts(QueryNoFeeAccountsRequest) returns (QueryNoFeeAccountsResponse) { + option (google.api.http).get = "/kujira/denoms/no_fee_accounts"; + } +} + +// QueryNoFeeAccountsRequest is the request type for the Query/NoFeeAccounts RPC method. +message QueryNoFeeAccountsRequest {} + +// QueryNoFeeAccountsResponse is the response type for the Query/NoFeeAccounts RPC method. +message QueryNoFeeAccountsResponse { + // params defines the parameters of the module. + repeated string accounts = 1; } // QueryParamsRequest is the request type for the Query/Params RPC method. diff --git a/proto/kujira/denom/tx.proto b/proto/kujira/denom/tx.proto index 9378cb5a..a8d55c81 100644 --- a/proto/kujira/denom/tx.proto +++ b/proto/kujira/denom/tx.proto @@ -8,6 +8,8 @@ option go_package = "github.com/Team-Kujira/core/x/denom/types"; // Msg defines the Msg service. service Msg { + rpc AddNoFeeAccounts(MsgAddNoFeeAccounts) returns (MsgAddNoFeeAccountsResponse); + rpc RemoveNoFeeAccounts(MsgRemoveNoFeeAccounts) returns (MsgRemoveNoFeeAccountsResponse); rpc CreateDenom(MsgCreateDenom) returns (MsgCreateDenomResponse); rpc Mint(MsgMint) returns (MsgMintResponse); rpc Burn(MsgBurn) returns (MsgBurnResponse); @@ -17,6 +19,18 @@ service Msg { rpc ChangeAdmin(MsgChangeAdmin) returns (MsgChangeAdminResponse); } +message MsgAddNoFeeAccounts { + string authority = 1; + repeated string accounts = 2; +} +message MsgAddNoFeeAccountsResponse {} + +message MsgRemoveNoFeeAccounts { + string authority = 1; + repeated string accounts = 2; +} +message MsgRemoveNoFeeAccountsResponse {} + // MsgCreateDenom is the sdk.Msg type for allowing an account to create // a new denom. It requires a sender address and a unique nonce // (to allow accounts to create multiple denoms) diff --git a/x/denom/client/cli/query.go b/x/denom/client/cli/query.go index 59f4b33e..cbf9c233 100644 --- a/x/denom/client/cli/query.go +++ b/x/denom/client/cli/query.go @@ -31,6 +31,7 @@ func GetQueryCmd() *cobra.Command { GetParams(), GetCmdDenomAuthorityMetadata(), GetCmdDenomsFromCreator(), + GetCmdNoFeeAccounts(), ) return cmd @@ -120,3 +121,30 @@ func GetCmdDenomsFromCreator() *cobra.Command { return cmd } + +// GetCmdNoFeeAccounts a command to get a list of no fee accounts +func GetCmdNoFeeAccounts() *cobra.Command { + cmd := &cobra.Command{ + Use: "no-fee-accounts [flags]", + Short: "Returns a list of no fee accounts", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, _ []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.NoFeeAccounts(cmd.Context(), &types.QueryNoFeeAccountsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/denom/genesis.go b/x/denom/genesis.go index e57d816f..3d02b0d4 100644 --- a/x/denom/genesis.go +++ b/x/denom/genesis.go @@ -31,6 +31,10 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) panic(err) } } + + for _, addr := range genState.NoFeeAccounts { + k.SetNoFeeAccount(ctx, addr) + } } // ExportGenesis returns the denom module's exported genesis. @@ -55,5 +59,6 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { return &types.GenesisState{ FactoryDenoms: genDenoms, Params: k.GetParams(ctx), + NoFeeAccounts: k.GetNoFeeAccounts(ctx), } } diff --git a/x/denom/keeper/createdenom.go b/x/denom/keeper/createdenom.go index 1404dc79..705d56b1 100644 --- a/x/denom/keeper/createdenom.go +++ b/x/denom/keeper/createdenom.go @@ -7,10 +7,18 @@ import ( "github.com/Team-Kujira/core/x/denom/types" ) +func (k Keeper) GetCreationFee(ctx sdk.Context, creatorAddr string) sdk.Coins { + if k.IsNoFeeAccount(ctx, creatorAddr) { + return sdk.Coins{} + } + params := k.GetParams(ctx) + return params.CreationFee +} + // ConvertToBaseToken converts a fee amount in a whitelisted fee token to the base fee token amount func (k Keeper) CreateDenom(ctx sdk.Context, creatorAddr string, denomNonce string) (newTokenDenom string, err error) { // Send creation fee to community pool - creationFee := k.GetParams(ctx).CreationFee + creationFee := k.GetCreationFee(ctx, creatorAddr) accAddr, err := sdk.AccAddressFromBech32(creatorAddr) if err != nil { return "", err diff --git a/x/denom/keeper/grpc_query.go b/x/denom/keeper/grpc_query.go index 419ef75f..c227d7e3 100644 --- a/x/denom/keeper/grpc_query.go +++ b/x/denom/keeper/grpc_query.go @@ -33,3 +33,10 @@ func (k Keeper) DenomsFromCreator(ctx context.Context, req *types.QueryDenomsFro denoms := k.getDenomsFromCreator(sdkCtx, req.GetCreator()) return &types.QueryDenomsFromCreatorResponse{Denoms: denoms}, nil } + +func (k Keeper) NoFeeAccounts(ctx context.Context, _ *types.QueryNoFeeAccountsRequest) (*types.QueryNoFeeAccountsResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + return &types.QueryNoFeeAccountsResponse{ + Accounts: k.GetNoFeeAccounts(sdkCtx), + }, nil +} diff --git a/x/denom/keeper/keeper.go b/x/denom/keeper/keeper.go index b1890673..a15683f6 100644 --- a/x/denom/keeper/keeper.go +++ b/x/denom/keeper/keeper.go @@ -18,14 +18,15 @@ import ( type ( Keeper struct { - cdc codec.Codec - storeKey storetypes.StoreKey - + cdc codec.Codec + storeKey storetypes.StoreKey paramSpace paramtypes.Subspace accountKeeper types.AccountKeeper bankKeeper types.BankKeeper distrKeeper types.DistrKeeper + + authority string } ) @@ -37,6 +38,7 @@ func NewKeeper( accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, distrKeeper types.DistrKeeper, + authority string, ) Keeper { if !paramSpace.HasKeyTable() { paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) @@ -50,6 +52,8 @@ func NewKeeper( accountKeeper: accountKeeper, bankKeeper: bankKeeper, distrKeeper: distrKeeper, + + authority: authority, } } diff --git a/x/denom/keeper/keeper_test.go b/x/denom/keeper/keeper_test.go index d12af92d..6825d4d2 100644 --- a/x/denom/keeper/keeper_test.go +++ b/x/denom/keeper/keeper_test.go @@ -1,34 +1,28 @@ package keeper_test -// import ( -// "testing" +import ( + "testing" -// "github.com/Team-Kujira/core/x/denom/types" + app "github.com/Team-Kujira/core/app" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/suite" +) -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/stretchr/testify/suite" -// ) +type KeeperTestSuite struct { + suite.Suite -// type KeeperTestSuite struct { -// apptesting.KeeperTestHelper + App *app.App + Ctx sdk.Context +} -// queryClient types.QueryClient -// } +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} -// func TestKeeperTestSuite(t *testing.T) { -// suite.Run(t, new(KeeperTestSuite)) -// } +func (suite *KeeperTestSuite) SetupTest() { + app := app.Setup(suite.T(), false) -// func (suite *KeeperTestSuite) SetupTest() { -// suite.Setup() - -// // Fund every TestAcc with 100 denom creation fees. -// fundAccsAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().CreationFee[0].Denom, types.DefaultParams().CreationFee[0].Amount.MulRaw(100))) -// for _, acc := range suite.TestAccs { -// suite.FundAcc(acc, fundAccsAmount) -// } - -// suite.Setupdenom() - -// suite.queryClient = types.NewQueryClient(suite.QueryHelper) -// } + suite.Ctx = app.BaseApp.NewContext(false, tmproto.Header{}) + suite.App = app +} diff --git a/x/denom/keeper/migrations.go b/x/denom/keeper/migrations.go new file mode 100644 index 00000000..e595aa64 --- /dev/null +++ b/x/denom/keeper/migrations.go @@ -0,0 +1,24 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/Team-Kujira/core/x/denom/types" +) + +// Migrator is a struct for handling in-place store migrations. +type Migrator struct { + keeper Keeper +} + +// NewMigrator returns a new Migrator. +func NewMigrator(keeper Keeper) Migrator { + return Migrator{keeper: keeper} +} + +// Migrate1to2 migrates from version 1 to 2. +func (m Migrator) Migrate1to2(ctx sdk.Context) error { + params := types.DefaultParams() + m.keeper.SetParams(ctx, params) + return nil +} diff --git a/x/denom/keeper/msg_server.go b/x/denom/keeper/msg_server.go index 57535e93..41bbfe56 100644 --- a/x/denom/keeper/msg_server.go +++ b/x/denom/keeper/msg_server.go @@ -20,6 +20,52 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { var _ types.MsgServer = msgServer{} +func (server msgServer) AddNoFeeAccounts(goCtx context.Context, msg *types.MsgAddNoFeeAccounts) (*types.MsgAddNoFeeAccountsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if msg.Authority != server.authority { + return nil, types.ErrInvalidAuthority + } + + for _, address := range msg.Accounts { + if server.IsNoFeeAccount(ctx, address) { + continue + } + server.SetNoFeeAccount(ctx, address) + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.TypeMsgAddNoFeeAccounts, + sdk.NewAttribute(types.AttributeAddress, address), + ), + }) + } + + return &types.MsgAddNoFeeAccountsResponse{}, nil +} + +func (server msgServer) RemoveNoFeeAccounts(goCtx context.Context, msg *types.MsgRemoveNoFeeAccounts) (*types.MsgRemoveNoFeeAccountsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if msg.Authority != server.authority { + return nil, types.ErrInvalidAuthority + } + + for _, address := range msg.Accounts { + if !server.IsNoFeeAccount(ctx, address) { + continue + } + server.RemoveNoFeeAccount(ctx, address) + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.TypeMsgRemoveNoFeeAccounts, + sdk.NewAttribute(types.AttributeAddress, address), + ), + }) + } + + return &types.MsgRemoveNoFeeAccountsResponse{}, nil +} + func (server msgServer) CreateDenom(goCtx context.Context, msg *types.MsgCreateDenom) (*types.MsgCreateDenomResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) diff --git a/x/denom/keeper/msg_server_test.go b/x/denom/keeper/msg_server_test.go new file mode 100644 index 00000000..fb1c599f --- /dev/null +++ b/x/denom/keeper/msg_server_test.go @@ -0,0 +1,84 @@ +package keeper_test + +import ( + "github.com/Team-Kujira/core/x/denom/keeper" + "github.com/Team-Kujira/core/x/denom/types" + "github.com/cometbft/cometbft/crypto/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" +) + +func (suite *KeeperTestSuite) TestMsgServerCreateDenom() { + for _, tc := range []struct { + desc string + balance sdk.Coins + whitelisted bool + balanceAfter sdk.Coins + expPass bool + }{ + { + desc: "successful denom creation: positive fee payment", + balance: sdk.Coins{sdk.NewInt64Coin("ukuji", 10_000_000)}, + whitelisted: false, + balanceAfter: sdk.Coins{}, + expPass: true, + }, + { + desc: "insufficient balance for fee payment", + balance: sdk.Coins{}, + whitelisted: false, + balanceAfter: sdk.Coins{}, + expPass: false, + }, + { + desc: "successful denom creation: whitelisted address", + balance: sdk.Coins{}, + whitelisted: true, + balanceAfter: sdk.Coins{}, + expPass: true, + }, + } { + suite.Run(tc.desc, func() { + suite.SetupTest() + + // bootstrap accounts + sender := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + + if tc.whitelisted { + suite.App.DenomKeeper.SetNoFeeAccount(suite.Ctx, sender.String()) + } + + if tc.balance.IsAllPositive() { + err := suite.App.BankKeeper.MintCoins(suite.Ctx, minttypes.ModuleName, tc.balance) + suite.Require().NoError(err) + err = suite.App.BankKeeper.SendCoinsFromModuleToAccount(suite.Ctx, minttypes.ModuleName, sender, tc.balance) + suite.Require().NoError(err) + } + + msgServer := keeper.NewMsgServerImpl(*suite.App.DenomKeeper) + resp, err := msgServer.CreateDenom( + sdk.WrapSDKContext(suite.Ctx), + &types.MsgCreateDenom{ + Sender: sender.String(), + Nonce: "1", + }, + ) + if !tc.expPass { + suite.Require().Error(err) + } else { + suite.Require().NoError(err) + denom, err := types.GetTokenDenom(sender.String(), "1") + suite.Require().NoError(err) + suite.Require().Equal(resp.NewTokenDenom, denom) + + // check balance after + balances := suite.App.BankKeeper.GetAllBalances(suite.Ctx, sender) + suite.Require().Equal(balances.String(), tc.balanceAfter.String()) + + metadata, err := suite.App.DenomKeeper.GetAuthorityMetadata(suite.Ctx, denom) + suite.Require().NoError(err) + suite.Require().Equal(metadata.Admin, sender.String()) + } + }) + } +} diff --git a/x/denom/keeper/no_fee_accounts.go b/x/denom/keeper/no_fee_accounts.go new file mode 100644 index 00000000..50386f9a --- /dev/null +++ b/x/denom/keeper/no_fee_accounts.go @@ -0,0 +1,43 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/Team-Kujira/core/x/denom/types" +) + +// IsNoFeeAccount returns if an address is no fee account +func (k Keeper) IsNoFeeAccount(ctx sdk.Context, address string) bool { + store := ctx.KVStore(k.storeKey) + prefixStore := prefix.NewStore(store, types.GetNoFeeAccountPrefix()) + bz := prefixStore.Get([]byte(address)) + return bz != nil +} + +// SetNoFeeAccount sets an address as no fee account +func (k Keeper) SetNoFeeAccount(ctx sdk.Context, address string) { + store := ctx.KVStore(k.storeKey) + prefixStore := prefix.NewStore(store, types.GetNoFeeAccountPrefix()) + prefixStore.Set([]byte(address), []byte(address)) +} + +// RemoveNoFeeAccount removes an address from no fee account list +func (k Keeper) RemoveNoFeeAccount(ctx sdk.Context, address string) { + store := ctx.KVStore(k.storeKey) + prefixStore := prefix.NewStore(store, types.GetNoFeeAccountPrefix()) + prefixStore.Delete([]byte(address)) +} + +// GetNoFeeAccounts returns all no fee accounts +func (k Keeper) GetNoFeeAccounts(ctx sdk.Context) []string { + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, types.GetNoFeeAccountPrefix()) + defer iterator.Close() + + accounts := []string{} + for ; iterator.Valid(); iterator.Next() { + accounts = append(accounts, string(iterator.Value())) + } + return accounts +} diff --git a/x/denom/keeper/no_fee_accounts_test.go b/x/denom/keeper/no_fee_accounts_test.go new file mode 100644 index 00000000..7cfb13b2 --- /dev/null +++ b/x/denom/keeper/no_fee_accounts_test.go @@ -0,0 +1,33 @@ +package keeper_test + +import ( + "github.com/cometbft/cometbft/crypto/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (suite *KeeperTestSuite) TestNoFeeAccounts() { + suite.SetupTest() + + // Set accounts + addr1 := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + addr2 := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + addr3 := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + suite.App.DenomKeeper.SetNoFeeAccount(suite.Ctx, addr1.String()) + suite.App.DenomKeeper.SetNoFeeAccount(suite.Ctx, addr2.String()) + + // Check queries + suite.Require().True(suite.App.DenomKeeper.IsNoFeeAccount(suite.Ctx, addr1.String())) + suite.Require().True(suite.App.DenomKeeper.IsNoFeeAccount(suite.Ctx, addr2.String())) + suite.Require().False(suite.App.DenomKeeper.IsNoFeeAccount(suite.Ctx, addr3.String())) + suite.Require().Len(suite.App.DenomKeeper.GetNoFeeAccounts(suite.Ctx), 2) + + // Remove accounts + suite.App.DenomKeeper.RemoveNoFeeAccount(suite.Ctx, addr2.String()) + suite.App.DenomKeeper.RemoveNoFeeAccount(suite.Ctx, addr3.String()) + + // Check queries + suite.Require().True(suite.App.DenomKeeper.IsNoFeeAccount(suite.Ctx, addr1.String())) + suite.Require().False(suite.App.DenomKeeper.IsNoFeeAccount(suite.Ctx, addr2.String())) + suite.Require().False(suite.App.DenomKeeper.IsNoFeeAccount(suite.Ctx, addr3.String())) + suite.Require().Len(suite.App.DenomKeeper.GetNoFeeAccounts(suite.Ctx), 1) +} diff --git a/x/denom/module.go b/x/denom/module.go index a91c5b16..64f2a59f 100644 --- a/x/denom/module.go +++ b/x/denom/module.go @@ -124,6 +124,11 @@ func (AppModule) QuerierRoute() string { return types.QuerierRoute } func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + m := keeper.NewMigrator(am.keeper) + err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2) + if err != nil { + panic(err) + } } // RegisterInvariants registers the denom module's invariants. @@ -147,7 +152,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 1 } +func (AppModule) ConsensusVersion() uint64 { return 2 } // BeginBlock executes all ABCI BeginBlock logic respective to the denom module. func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} diff --git a/x/denom/types/codec.go b/x/denom/types/codec.go index afcdb528..0495d951 100644 --- a/x/denom/types/codec.go +++ b/x/denom/types/codec.go @@ -13,6 +13,8 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgBurn{}, "github.com/Team-Kujira/core/denom/burn", nil) // cdc.RegisterConcrete(&MsgForceTransfer{}, "github.com/Team-Kujira/core/denom/force-transfer", nil) cdc.RegisterConcrete(&MsgChangeAdmin{}, "github.com/Team-Kujira/core/denom/change-admin", nil) + cdc.RegisterConcrete(&MsgAddNoFeeAccounts{}, "github.com/Team-Kujira/core/denom/add-no-fee-accounts", nil) + cdc.RegisterConcrete(&MsgRemoveNoFeeAccounts{}, "github.com/Team-Kujira/core/denom/remove-no-fee-accounts", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -23,6 +25,8 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgBurn{}, // &MsgForceTransfer{}, &MsgChangeAdmin{}, + &MsgAddNoFeeAccounts{}, + &MsgRemoveNoFeeAccounts{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/denom/types/errors.go b/x/denom/types/errors.go index 18976926..d09c390c 100644 --- a/x/denom/types/errors.go +++ b/x/denom/types/errors.go @@ -14,4 +14,5 @@ var ( ErrInvalidCreator = errors.Register(ModuleName, 5, "invalid creator") ErrInvalidAuthorityMetadata = errors.Register(ModuleName, 6, "invalid authority metadata") ErrInvalidGenesis = errors.Register(ModuleName, 7, "invalid genesis") + ErrInvalidAuthority = errors.Register(ModuleName, 8, "not a governance address") ) diff --git a/x/denom/types/events.go b/x/denom/types/events.go index 9ccd13da..9d3d4d37 100644 --- a/x/denom/types/events.go +++ b/x/denom/types/events.go @@ -14,4 +14,5 @@ const ( AttributeTransferToAddress = "transfer_to_address" AttributeDenom = "denom" AttributeNewAdmin = "new_admin" + AttributeAddress = "address" ) diff --git a/x/denom/types/genesis.pb.go b/x/denom/types/genesis.pb.go index c6719f18..a0b767b0 100644 --- a/x/denom/types/genesis.pb.go +++ b/x/denom/types/genesis.pb.go @@ -28,6 +28,8 @@ type GenesisState struct { // params defines the paramaters of the module. Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` FactoryDenoms []GenesisDenom `protobuf:"bytes,2,rep,name=factory_denoms,json=factoryDenoms,proto3" json:"factory_denoms" yaml:"factory_denoms"` + // whitelisted accounts that do not require paying creation fees + NoFeeAccounts []string `protobuf:"bytes,3,rep,name=no_fee_accounts,json=noFeeAccounts,proto3" json:"no_fee_accounts,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -77,6 +79,13 @@ func (m *GenesisState) GetFactoryDenoms() []GenesisDenom { return nil } +func (m *GenesisState) GetNoFeeAccounts() []string { + if m != nil { + return m.NoFeeAccounts + } + return nil +} + type GenesisDenom struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` AuthorityMetadata DenomAuthorityMetadata `protobuf:"bytes,2,opt,name=authority_metadata,json=authorityMetadata,proto3" json:"authority_metadata" yaml:"authority_metadata"` @@ -137,29 +146,31 @@ func init() { func init() { proto.RegisterFile("kujira/denom/genesis.proto", fileDescriptor_a1b1d94429cdf595) } var fileDescriptor_a1b1d94429cdf595 = []byte{ - // 344 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xca, 0x2e, 0xcd, 0xca, - 0x2c, 0x4a, 0xd4, 0x4f, 0x49, 0xcd, 0xcb, 0xcf, 0xd5, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, - 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x81, 0xc8, 0xe9, 0x81, 0xe5, 0xa4, 0x44, 0xd2, - 0xf3, 0xd3, 0xf3, 0xc1, 0x12, 0xfa, 0x20, 0x16, 0x44, 0x8d, 0x94, 0x0a, 0x8a, 0xfe, 0xc4, 0xd2, - 0x92, 0x8c, 0xfc, 0xa2, 0xcc, 0x92, 0x4a, 0xdf, 0xd4, 0x92, 0xc4, 0x94, 0xc4, 0x92, 0x44, 0xa8, - 0x2a, 0x49, 0x14, 0x55, 0x05, 0x89, 0x45, 0x89, 0xb9, 0x50, 0x4b, 0x94, 0x96, 0x30, 0x72, 0xf1, - 0xb8, 0x43, 0xac, 0x0d, 0x2e, 0x49, 0x2c, 0x49, 0x15, 0x32, 0xe2, 0x62, 0x83, 0x28, 0x90, 0x60, - 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x12, 0xd1, 0x43, 0x76, 0x86, 0x5e, 0x00, 0x58, 0xce, 0x89, 0xe5, - 0xc4, 0x3d, 0x79, 0x86, 0x20, 0xa8, 0x4a, 0xa1, 0x04, 0x2e, 0xbe, 0xb4, 0xc4, 0xe4, 0x92, 0xfc, - 0xa2, 0xca, 0x78, 0xb0, 0xaa, 0x62, 0x09, 0x26, 0x05, 0x66, 0x0d, 0x6e, 0x23, 0x29, 0x54, 0xbd, - 0x50, 0x7b, 0x5c, 0x40, 0x1c, 0x27, 0x59, 0x90, 0x09, 0x9f, 0xee, 0xc9, 0x8b, 0x56, 0x26, 0xe6, - 0xe6, 0x58, 0x29, 0xa1, 0xea, 0x57, 0x0a, 0xe2, 0x85, 0x0a, 0xb8, 0x40, 0xf8, 0x5b, 0x10, 0xce, - 0x04, 0x8b, 0x08, 0xa9, 0x71, 0xb1, 0x82, 0x95, 0x82, 0x5d, 0xc9, 0xe9, 0x24, 0xf0, 0xe9, 0x9e, - 0x3c, 0x0f, 0xc4, 0x24, 0xb0, 0xb0, 0x52, 0x10, 0x44, 0x5a, 0xa8, 0x8c, 0x4b, 0x08, 0x1e, 0x2a, - 0xf1, 0xb9, 0xd0, 0x60, 0x91, 0x60, 0x02, 0x7b, 0x4d, 0x05, 0xd5, 0x79, 0x60, 0x83, 0x1d, 0xd1, - 0x83, 0xd0, 0x49, 0x11, 0xea, 0x50, 0x49, 0x88, 0xf1, 0x98, 0xa6, 0x29, 0x05, 0x09, 0x62, 0x04, - 0xbc, 0x15, 0xcb, 0x8b, 0x05, 0xf2, 0x8c, 0x4e, 0xce, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, - 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, - 0x2c, 0xc7, 0x10, 0xa5, 0x99, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x1f, - 0x92, 0x9a, 0x98, 0xab, 0xeb, 0x0d, 0x89, 0xa2, 0xe4, 0xfc, 0xa2, 0x54, 0xfd, 0x0a, 0x68, 0x4c, - 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x63, 0xca, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, - 0x52, 0x75, 0xe4, 0xb7, 0x2c, 0x02, 0x00, 0x00, + // 380 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x51, 0xcd, 0x4e, 0xea, 0x40, + 0x18, 0x6d, 0x81, 0x4b, 0xc2, 0x00, 0xf7, 0x67, 0xc2, 0x4d, 0x4a, 0x13, 0x5b, 0x6c, 0x08, 0xc1, + 0x85, 0x6d, 0x82, 0x3b, 0x76, 0x54, 0xa3, 0x0b, 0x63, 0x62, 0xaa, 0x2b, 0x37, 0x75, 0x28, 0x43, + 0xa9, 0xda, 0x0e, 0x69, 0xa7, 0xc6, 0xbe, 0x85, 0x8f, 0xe0, 0x43, 0xf8, 0x10, 0x2c, 0x5c, 0xb0, + 0x74, 0x45, 0x0c, 0x6c, 0x5c, 0xf3, 0x04, 0x86, 0x99, 0x89, 0x5a, 0xd9, 0xb5, 0xdf, 0x39, 0xdf, + 0xf9, 0xe6, 0x9c, 0x03, 0xd4, 0xdb, 0xf4, 0x26, 0x88, 0x91, 0x35, 0xc2, 0x11, 0x09, 0x2d, 0x1f, + 0x47, 0x38, 0x09, 0x12, 0x73, 0x1a, 0x13, 0x4a, 0x60, 0x8d, 0x63, 0x26, 0xc3, 0xd4, 0x86, 0x4f, + 0x7c, 0xc2, 0x00, 0x6b, 0xf3, 0xc5, 0x39, 0x6a, 0x3b, 0xb7, 0x8f, 0x52, 0x3a, 0x21, 0x71, 0x40, + 0xb3, 0x33, 0x4c, 0xd1, 0x08, 0x51, 0x24, 0x58, 0xcd, 0x1c, 0x6b, 0x8a, 0x62, 0x14, 0x8a, 0x23, + 0xc6, 0x8b, 0x0c, 0x6a, 0x27, 0xfc, 0xec, 0x05, 0x45, 0x14, 0xc3, 0x1e, 0x28, 0x73, 0x82, 0x22, + 0xb7, 0xe4, 0x6e, 0xb5, 0xd7, 0x30, 0xbf, 0x3f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xf2, 0x2a, 0x3d, + 0x12, 0x63, 0xeb, 0x41, 0x34, 0x4a, 0xb3, 0x29, 0x4e, 0x86, 0x65, 0xd6, 0xe8, 0xc1, 0x47, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xc3, 0x49, 0xbb, 0x00, 0x54, 0x02, 0x00, 0x00, } func (this *GenesisDenom) Equal(that interface{}) bool { @@ -209,6 +220,15 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.NoFeeAccounts) > 0 { + for iNdEx := len(m.NoFeeAccounts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NoFeeAccounts[iNdEx]) + copy(dAtA[i:], m.NoFeeAccounts[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.NoFeeAccounts[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } if len(m.FactoryDenoms) > 0 { for iNdEx := len(m.FactoryDenoms) - 1; iNdEx >= 0; iNdEx-- { { @@ -301,6 +321,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.NoFeeAccounts) > 0 { + for _, s := range m.NoFeeAccounts { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -421,6 +447,38 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoFeeAccounts", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NoFeeAccounts = append(m.NoFeeAccounts, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/denom/types/keys.go b/x/denom/types/keys.go index ec4e7428..5adfa0eb 100644 --- a/x/denom/types/keys.go +++ b/x/denom/types/keys.go @@ -29,6 +29,7 @@ var ( DenomsPrefixKey = "denoms" CreatorPrefixKey = "creator" AdminPrefixKey = "admin" + NoFeeAccountPrefixKey = "nofeeaccount" ) // GetDenomPrefixStore returns the store prefix where all the data associated with a specific denom @@ -47,3 +48,8 @@ func GetCreatorPrefix(creator string) []byte { func GetCreatorsPrefix() []byte { return []byte(strings.Join([]string{CreatorPrefixKey, ""}, KeySeparator)) } + +// GetNoFeeAccountPrefix returns the store prefix where a list of all no fee spending accounts in denom creation +func GetNoFeeAccountPrefix() []byte { + return []byte(strings.Join([]string{NoFeeAccountPrefixKey, ""}, KeySeparator)) +} diff --git a/x/denom/types/msgs.go b/x/denom/types/msgs.go index 76df3f0c..829411bf 100644 --- a/x/denom/types/msgs.go +++ b/x/denom/types/msgs.go @@ -8,11 +8,13 @@ import ( // constants const ( - TypeMsgCreateDenom = "create_denom" - TypeMsgMint = "mint" - TypeMsgBurn = "burn" - TypeMsgForceTransfer = "force_transfer" - TypeMsgChangeAdmin = "change_admin" + TypeMsgCreateDenom = "create_denom" + TypeMsgMint = "mint" + TypeMsgBurn = "burn" + TypeMsgForceTransfer = "force_transfer" + TypeMsgChangeAdmin = "change_admin" + TypeMsgAddNoFeeAccounts = "add_no_fee_accounts" + TypeMsgRemoveNoFeeAccounts = "remove_no_fee_accounts" ) var _ sdk.Msg = &MsgCreateDenom{} @@ -204,3 +206,63 @@ func (m MsgChangeAdmin) GetSigners() []sdk.AccAddress { sender, _ := sdk.AccAddressFromBech32(m.Sender) return []sdk.AccAddress{sender} } + +var _ sdk.Msg = &MsgAddNoFeeAccounts{} + +// NewMsgAddNoFeeAccounts creates a message to add no fee accounts +func NewMsgAddNoFeeAccounts(authority string, accounts []string) *MsgAddNoFeeAccounts { + return &MsgAddNoFeeAccounts{ + Authority: authority, + Accounts: accounts, + } +} + +func (m MsgAddNoFeeAccounts) Route() string { return RouterKey } +func (m MsgAddNoFeeAccounts) Type() string { return TypeMsgAddNoFeeAccounts } +func (m MsgAddNoFeeAccounts) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(m.Authority) + if err != nil { + return errors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + } + + return nil +} + +func (m MsgAddNoFeeAccounts) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +func (m MsgAddNoFeeAccounts) GetSigners() []sdk.AccAddress { + sender, _ := sdk.AccAddressFromBech32(m.Authority) + return []sdk.AccAddress{sender} +} + +var _ sdk.Msg = &MsgRemoveNoFeeAccounts{} + +// NewMsgRemoveNoFeeAccounts creates a message to add no fee accounts +func NewMsgRemoveNoFeeAccounts(authority string, accounts []string) *MsgRemoveNoFeeAccounts { + return &MsgRemoveNoFeeAccounts{ + Authority: authority, + Accounts: accounts, + } +} + +func (m MsgRemoveNoFeeAccounts) Route() string { return RouterKey } +func (m MsgRemoveNoFeeAccounts) Type() string { return TypeMsgRemoveNoFeeAccounts } +func (m MsgRemoveNoFeeAccounts) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(m.Authority) + if err != nil { + return errors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err) + } + + return nil +} + +func (m MsgRemoveNoFeeAccounts) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +func (m MsgRemoveNoFeeAccounts) GetSigners() []sdk.AccAddress { + sender, _ := sdk.AccAddressFromBech32(m.Authority) + return []sdk.AccAddress{sender} +} diff --git a/x/denom/types/params.go b/x/denom/types/params.go index f4021749..5e7bd00f 100644 --- a/x/denom/types/params.go +++ b/x/denom/types/params.go @@ -9,7 +9,8 @@ import ( // Parameter store keys. var ( - KeyCreationFee = []byte("CreationFee") + KeyCreationFee = []byte("CreationFee") + KeyNoFeeAccounts = []byte("NoFeeAccounts") ) // ParamTable for gamm module. diff --git a/x/denom/types/query.pb.go b/x/denom/types/query.pb.go index 25b49e45..96f3f14a 100644 --- a/x/denom/types/query.pb.go +++ b/x/denom/types/query.pb.go @@ -30,6 +30,89 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// QueryNoFeeAccountsRequest is the request type for the Query/NoFeeAccounts RPC method. +type QueryNoFeeAccountsRequest struct { +} + +func (m *QueryNoFeeAccountsRequest) Reset() { *m = QueryNoFeeAccountsRequest{} } +func (m *QueryNoFeeAccountsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryNoFeeAccountsRequest) ProtoMessage() {} +func (*QueryNoFeeAccountsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b3d0e02d4d7e16e6, []int{0} +} +func (m *QueryNoFeeAccountsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNoFeeAccountsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNoFeeAccountsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryNoFeeAccountsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNoFeeAccountsRequest.Merge(m, src) +} +func (m *QueryNoFeeAccountsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryNoFeeAccountsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNoFeeAccountsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNoFeeAccountsRequest proto.InternalMessageInfo + +// QueryNoFeeAccountsResponse is the response type for the Query/NoFeeAccounts RPC method. +type QueryNoFeeAccountsResponse struct { + // params defines the parameters of the module. + Accounts []string `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` +} + +func (m *QueryNoFeeAccountsResponse) Reset() { *m = QueryNoFeeAccountsResponse{} } +func (m *QueryNoFeeAccountsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryNoFeeAccountsResponse) ProtoMessage() {} +func (*QueryNoFeeAccountsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b3d0e02d4d7e16e6, []int{1} +} +func (m *QueryNoFeeAccountsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNoFeeAccountsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNoFeeAccountsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryNoFeeAccountsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNoFeeAccountsResponse.Merge(m, src) +} +func (m *QueryNoFeeAccountsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryNoFeeAccountsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNoFeeAccountsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNoFeeAccountsResponse proto.InternalMessageInfo + +func (m *QueryNoFeeAccountsResponse) GetAccounts() []string { + if m != nil { + return m.Accounts + } + return nil +} + // QueryParamsRequest is the request type for the Query/Params RPC method. type QueryParamsRequest struct { } @@ -38,7 +121,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b3d0e02d4d7e16e6, []int{0} + return fileDescriptor_b3d0e02d4d7e16e6, []int{2} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -77,7 +160,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b3d0e02d4d7e16e6, []int{1} + return fileDescriptor_b3d0e02d4d7e16e6, []int{3} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -121,7 +204,7 @@ func (m *QueryDenomAuthorityMetadataRequest) Reset() { *m = QueryDenomAu func (m *QueryDenomAuthorityMetadataRequest) String() string { return proto.CompactTextString(m) } func (*QueryDenomAuthorityMetadataRequest) ProtoMessage() {} func (*QueryDenomAuthorityMetadataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b3d0e02d4d7e16e6, []int{2} + return fileDescriptor_b3d0e02d4d7e16e6, []int{4} } func (m *QueryDenomAuthorityMetadataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -165,7 +248,7 @@ func (m *QueryDenomAuthorityMetadataResponse) Reset() { *m = QueryDenomA func (m *QueryDenomAuthorityMetadataResponse) String() string { return proto.CompactTextString(m) } func (*QueryDenomAuthorityMetadataResponse) ProtoMessage() {} func (*QueryDenomAuthorityMetadataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b3d0e02d4d7e16e6, []int{3} + return fileDescriptor_b3d0e02d4d7e16e6, []int{5} } func (m *QueryDenomAuthorityMetadataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -209,7 +292,7 @@ func (m *QueryDenomsFromCreatorRequest) Reset() { *m = QueryDenomsFromCr func (m *QueryDenomsFromCreatorRequest) String() string { return proto.CompactTextString(m) } func (*QueryDenomsFromCreatorRequest) ProtoMessage() {} func (*QueryDenomsFromCreatorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b3d0e02d4d7e16e6, []int{4} + return fileDescriptor_b3d0e02d4d7e16e6, []int{6} } func (m *QueryDenomsFromCreatorRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -253,7 +336,7 @@ func (m *QueryDenomsFromCreatorResponse) Reset() { *m = QueryDenomsFromC func (m *QueryDenomsFromCreatorResponse) String() string { return proto.CompactTextString(m) } func (*QueryDenomsFromCreatorResponse) ProtoMessage() {} func (*QueryDenomsFromCreatorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b3d0e02d4d7e16e6, []int{5} + return fileDescriptor_b3d0e02d4d7e16e6, []int{7} } func (m *QueryDenomsFromCreatorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -290,6 +373,8 @@ func (m *QueryDenomsFromCreatorResponse) GetDenoms() []string { } func init() { + proto.RegisterType((*QueryNoFeeAccountsRequest)(nil), "kujira.denom.QueryNoFeeAccountsRequest") + proto.RegisterType((*QueryNoFeeAccountsResponse)(nil), "kujira.denom.QueryNoFeeAccountsResponse") proto.RegisterType((*QueryParamsRequest)(nil), "kujira.denom.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "kujira.denom.QueryParamsResponse") proto.RegisterType((*QueryDenomAuthorityMetadataRequest)(nil), "kujira.denom.QueryDenomAuthorityMetadataRequest") @@ -301,42 +386,46 @@ func init() { func init() { proto.RegisterFile("kujira/denom/query.proto", fileDescriptor_b3d0e02d4d7e16e6) } var fileDescriptor_b3d0e02d4d7e16e6 = []byte{ - // 554 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0xcf, 0x6e, 0xd3, 0x4a, - 0x14, 0xc6, 0xe3, 0xdb, 0xdb, 0xa0, 0x0e, 0x05, 0x91, 0x21, 0x40, 0x1b, 0x51, 0xa7, 0x9d, 0x16, - 0xd4, 0x90, 0xe2, 0x21, 0x61, 0xc7, 0x0e, 0x17, 0x21, 0xa1, 0x52, 0x09, 0x2c, 0x56, 0x6c, 0xaa, - 0x71, 0x3a, 0x72, 0x0d, 0xb1, 0xc7, 0xf5, 0x8c, 0x2b, 0xac, 0xaa, 0x1b, 0x9e, 0x00, 0x89, 0x25, - 0xe2, 0x1d, 0x78, 0x0a, 0xd4, 0x65, 0x25, 0x36, 0xac, 0x2c, 0x94, 0xf0, 0x04, 0x79, 0x02, 0xe4, - 0x99, 0x29, 0xc4, 0x71, 0x1a, 0xc1, 0xca, 0xd6, 0x39, 0x9f, 0xbf, 0xf3, 0x3b, 0x7f, 0x0c, 0x96, - 0xde, 0x26, 0x6f, 0xfc, 0x98, 0xe0, 0x7d, 0x1a, 0xb2, 0x00, 0x1f, 0x26, 0x34, 0x4e, 0xad, 0x28, - 0x66, 0x82, 0xc1, 0x45, 0x95, 0xb1, 0x64, 0xa6, 0x51, 0xf7, 0x98, 0xc7, 0x64, 0x02, 0xe7, 0x6f, - 0x4a, 0xd3, 0xb8, 0xed, 0x31, 0xe6, 0xf5, 0x29, 0x26, 0x91, 0x8f, 0x49, 0x18, 0x32, 0x41, 0x84, - 0xcf, 0x42, 0xae, 0xb3, 0xf7, 0x7a, 0x8c, 0x07, 0x8c, 0x63, 0x97, 0x70, 0xaa, 0xac, 0xf1, 0x51, - 0xc7, 0xa5, 0x82, 0x74, 0x70, 0x44, 0x3c, 0x3f, 0x94, 0x62, 0xad, 0xdd, 0x28, 0x70, 0x90, 0x44, - 0x1c, 0xb0, 0xd8, 0x17, 0xe9, 0x2e, 0x15, 0x64, 0x9f, 0x08, 0xa2, 0x55, 0xcb, 0x05, 0x55, 0x44, - 0x62, 0x12, 0xe8, 0x62, 0xa8, 0x0e, 0xe0, 0xcb, 0xbc, 0xc4, 0x0b, 0x19, 0x74, 0xe8, 0x61, 0x42, - 0xb9, 0x40, 0xcf, 0xc0, 0xf5, 0x42, 0x94, 0x47, 0x2c, 0xe4, 0x14, 0x76, 0x41, 0x55, 0x7d, 0xbc, - 0x64, 0xac, 0x1a, 0x9b, 0x97, 0xbb, 0x75, 0x6b, 0xbc, 0x59, 0x4b, 0x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x8b, 0x01, 0x6e, 0x4e, 0x1f, 0x32, 0x7c, 0x30, 0xc5, 0x7c, 0xe6, 0xa1, 0x34, 0x3a, - 0xff, 0xf0, 0x85, 0xc6, 0xeb, 0x48, 0xbc, 0x36, 0x6c, 0x4d, 0xe0, 0x1d, 0xcb, 0xe7, 0x09, 0x2e, - 0xaf, 0x16, 0x7e, 0x32, 0x40, 0xad, 0x34, 0x73, 0xd8, 0xbe, 0xa8, 0xf6, 0x94, 0x45, 0x37, 0xb6, - 0xfe, 0x4e, 0xac, 0x19, 0xdb, 0x92, 0xf1, 0x0e, 0x5c, 0x9f, 0x60, 0x74, 0xd3, 0x3d, 0x7d, 0x0b, - 0xf8, 0x58, 0xbf, 0x9c, 0xd8, 0xdb, 0xa7, 0x03, 0xd3, 0x38, 0x1b, 0x98, 0xc6, 0x8f, 0x81, 0x69, - 0x7c, 0x18, 0x9a, 0x95, 0xb3, 0xa1, 0x59, 0xf9, 0x3e, 0x34, 0x2b, 0xaf, 0x5b, 0x9e, 0x2f, 0x0e, - 0x12, 0xd7, 0xea, 0xb1, 0x00, 0xbf, 0xa2, 0x24, 0xb8, 0xbf, 0xa3, 0xdc, 0x7a, 0x2c, 0xa6, 0xf8, - 0x9d, 0xfe, 0xff, 0x45, 0x1a, 0x51, 0xee, 0x56, 0xe5, 0xff, 0xff, 0xf0, 0x57, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xb3, 0x61, 0x5b, 0x53, 0xca, 0x04, 0x00, 0x00, + // 622 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x4f, 0x4f, 0x13, 0x41, + 0x18, 0xc6, 0xbb, 0x0a, 0x55, 0x46, 0x30, 0x32, 0xa2, 0xc2, 0x2a, 0xdb, 0x32, 0x20, 0x52, 0x8b, + 0x1d, 0x5b, 0x2f, 0xc6, 0x1b, 0xc5, 0x90, 0x18, 0xc4, 0xe8, 0xc6, 0x93, 0x97, 0x66, 0xba, 0x8c, + 0xcb, 0x6a, 0x77, 0x67, 0xd9, 0x99, 0x25, 0x36, 0x84, 0x8b, 0x47, 0x4f, 0x26, 0x1e, 0x8d, 0xdf, + 0xc1, 0x8f, 0xc1, 0x91, 0x84, 0x8b, 0xa7, 0xc6, 0xb4, 0x7e, 0x82, 0x7e, 0x02, 0xd3, 0x99, 0x29, + 0x76, 0xdb, 0xa5, 0xea, 0xa9, 0xdb, 0x79, 0x9f, 0x7d, 0xde, 0xdf, 0xfb, 0x67, 0x07, 0xcc, 0xbf, + 0x8f, 0xdf, 0x79, 0x11, 0xc1, 0xbb, 0x34, 0x60, 0x3e, 0xde, 0x8f, 0x69, 0xd4, 0x2c, 0x85, 0x11, + 0x13, 0x0c, 0x4e, 0xab, 0x48, 0x49, 0x46, 0xcc, 0x39, 0x97, 0xb9, 0x4c, 0x06, 0x70, 0xef, 0x49, + 0x69, 0xcc, 0x3b, 0x2e, 0x63, 0x6e, 0x83, 0x62, 0x12, 0x7a, 0x98, 0x04, 0x01, 0x13, 0x44, 0x78, + 0x2c, 0xe0, 0x3a, 0x7a, 0xdf, 0x61, 0xdc, 0x67, 0x1c, 0xd7, 0x09, 0xa7, 0xca, 0x1a, 0x1f, 0x94, + 0xeb, 0x54, 0x90, 0x32, 0x0e, 0x89, 0xeb, 0x05, 0x52, 0xac, 0xb5, 0x2b, 0x09, 0x0e, 0x12, 0x8b, + 0x3d, 0x16, 0x79, 0xa2, 0xb9, 0x43, 0x05, 0xd9, 0x25, 0x82, 0x68, 0xd5, 0x42, 0x42, 0x15, 0x92, + 0x88, 0xf8, 0x3a, 0x19, 0xba, 0x0d, 0x16, 0x5e, 0xf5, 0x52, 0xbc, 0x60, 0x5b, 0x94, 0x6e, 0x38, + 0x0e, 0x8b, 0x03, 0xc1, 0x6d, 0xba, 0x1f, 0x53, 0x2e, 0xd0, 0x63, 0x60, 0xa6, 0x05, 0x79, 0xc8, + 0x02, 0x4e, 0xa1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xca, + 0xc8, 0x61, 0x11, 0xc5, 0x1f, 0xf4, 0x1d, 0x27, 0x9a, 0x21, 0xe5, 0xf5, 0xac, 0xbc, 0xe3, 0x1e, + 0xfd, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x68, 0xd3, 0x32, 0xf7, 0xae, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -355,6 +444,8 @@ type QueryClient interface { Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) DenomAuthorityMetadata(ctx context.Context, in *QueryDenomAuthorityMetadataRequest, opts ...grpc.CallOption) (*QueryDenomAuthorityMetadataResponse, error) DenomsFromCreator(ctx context.Context, in *QueryDenomsFromCreatorRequest, opts ...grpc.CallOption) (*QueryDenomsFromCreatorResponse, error) + // NoFeeAccounts returns accounts whitelisted to create denom without fee + NoFeeAccounts(ctx context.Context, in *QueryNoFeeAccountsRequest, opts ...grpc.CallOption) (*QueryNoFeeAccountsResponse, error) } type queryClient struct { @@ -392,12 +483,23 @@ func (c *queryClient) DenomsFromCreator(ctx context.Context, in *QueryDenomsFrom return out, nil } +func (c *queryClient) NoFeeAccounts(ctx context.Context, in *QueryNoFeeAccountsRequest, opts ...grpc.CallOption) (*QueryNoFeeAccountsResponse, error) { + out := new(QueryNoFeeAccountsResponse) + err := c.cc.Invoke(ctx, "/kujira.denom.Query/NoFeeAccounts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Params returns the total set of minting parameters. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) DenomAuthorityMetadata(context.Context, *QueryDenomAuthorityMetadataRequest) (*QueryDenomAuthorityMetadataResponse, error) DenomsFromCreator(context.Context, *QueryDenomsFromCreatorRequest) (*QueryDenomsFromCreatorResponse, error) + // NoFeeAccounts returns accounts whitelisted to create denom without fee + NoFeeAccounts(context.Context, *QueryNoFeeAccountsRequest) (*QueryNoFeeAccountsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -413,6 +515,9 @@ func (*UnimplementedQueryServer) DenomAuthorityMetadata(ctx context.Context, req func (*UnimplementedQueryServer) DenomsFromCreator(ctx context.Context, req *QueryDenomsFromCreatorRequest) (*QueryDenomsFromCreatorResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DenomsFromCreator not implemented") } +func (*UnimplementedQueryServer) NoFeeAccounts(ctx context.Context, req *QueryNoFeeAccountsRequest) (*QueryNoFeeAccountsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NoFeeAccounts not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -472,6 +577,24 @@ func _Query_DenomsFromCreator_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Query_NoFeeAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryNoFeeAccountsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).NoFeeAccounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kujira.denom.Query/NoFeeAccounts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).NoFeeAccounts(ctx, req.(*QueryNoFeeAccountsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "kujira.denom.Query", HandlerType: (*QueryServer)(nil), @@ -488,11 +611,70 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "DenomsFromCreator", Handler: _Query_DenomsFromCreator_Handler, }, + { + MethodName: "NoFeeAccounts", + Handler: _Query_NoFeeAccounts_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "kujira/denom/query.proto", } +func (m *QueryNoFeeAccountsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryNoFeeAccountsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNoFeeAccountsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryNoFeeAccountsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryNoFeeAccountsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNoFeeAccountsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Accounts) > 0 { + for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Accounts[iNdEx]) + copy(dAtA[i:], m.Accounts[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Accounts[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -685,6 +867,30 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *QueryNoFeeAccountsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryNoFeeAccountsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Accounts) > 0 { + for _, s := range m.Accounts { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func (m *QueryParamsRequest) Size() (n int) { if m == nil { return 0 @@ -763,6 +969,138 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *QueryNoFeeAccountsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNoFeeAccountsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNoFeeAccountsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryNoFeeAccountsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNoFeeAccountsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNoFeeAccountsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Accounts = append(m.Accounts, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/denom/types/query.pb.gw.go b/x/denom/types/query.pb.gw.go index f93044eb..5045cc92 100644 --- a/x/denom/types/query.pb.gw.go +++ b/x/denom/types/query.pb.gw.go @@ -20,7 +20,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,7 +30,6 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage -var _ = metadata.Join func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryParamsRequest @@ -159,17 +157,33 @@ func local_request_Query_DenomsFromCreator_0(ctx context.Context, marshaler runt } +func request_Query_NoFeeAccounts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNoFeeAccountsRequest + var metadata runtime.ServerMetadata + + msg, err := client.NoFeeAccounts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_NoFeeAccounts_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNoFeeAccountsRequest + var metadata runtime.ServerMetadata + + msg, err := server.NoFeeAccounts(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -177,7 +191,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -191,8 +204,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_DenomAuthorityMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -200,7 +211,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_DenomAuthorityMetadata_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -214,8 +224,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_DenomsFromCreator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -223,7 +231,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_DenomsFromCreator_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -234,6 +241,26 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_NoFeeAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_NoFeeAccounts_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NoFeeAccounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -335,6 +362,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_NoFeeAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_NoFeeAccounts_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NoFeeAccounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -344,6 +391,8 @@ var ( pattern_Query_DenomAuthorityMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"kujira", "denoms", "denom", "authority_metadata"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_DenomsFromCreator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"kujira", "denoms", "by_creator", "creator"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_NoFeeAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"kujira", "denoms", "no_fee_accounts"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -352,4 +401,6 @@ var ( forward_Query_DenomAuthorityMetadata_0 = runtime.ForwardResponseMessage forward_Query_DenomsFromCreator_0 = runtime.ForwardResponseMessage + + forward_Query_NoFeeAccounts_0 = runtime.ForwardResponseMessage ) diff --git a/x/denom/types/tx.pb.go b/x/denom/types/tx.pb.go index 55bdbfd5..80fcf5cd 100644 --- a/x/denom/types/tx.pb.go +++ b/x/denom/types/tx.pb.go @@ -29,6 +29,182 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type MsgAddNoFeeAccounts struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Accounts []string `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts,omitempty"` +} + +func (m *MsgAddNoFeeAccounts) Reset() { *m = MsgAddNoFeeAccounts{} } +func (m *MsgAddNoFeeAccounts) String() string { return proto.CompactTextString(m) } +func (*MsgAddNoFeeAccounts) ProtoMessage() {} +func (*MsgAddNoFeeAccounts) Descriptor() ([]byte, []int) { + return fileDescriptor_4060456503c2ab45, []int{0} +} +func (m *MsgAddNoFeeAccounts) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddNoFeeAccounts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddNoFeeAccounts.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAddNoFeeAccounts) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddNoFeeAccounts.Merge(m, src) +} +func (m *MsgAddNoFeeAccounts) XXX_Size() int { + return m.Size() +} +func (m *MsgAddNoFeeAccounts) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddNoFeeAccounts.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddNoFeeAccounts proto.InternalMessageInfo + +func (m *MsgAddNoFeeAccounts) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgAddNoFeeAccounts) GetAccounts() []string { + if m != nil { + return m.Accounts + } + return nil +} + +type MsgAddNoFeeAccountsResponse struct { +} + +func (m *MsgAddNoFeeAccountsResponse) Reset() { *m = MsgAddNoFeeAccountsResponse{} } +func (m *MsgAddNoFeeAccountsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAddNoFeeAccountsResponse) ProtoMessage() {} +func (*MsgAddNoFeeAccountsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4060456503c2ab45, []int{1} +} +func (m *MsgAddNoFeeAccountsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddNoFeeAccountsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddNoFeeAccountsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAddNoFeeAccountsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddNoFeeAccountsResponse.Merge(m, src) +} +func (m *MsgAddNoFeeAccountsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAddNoFeeAccountsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddNoFeeAccountsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddNoFeeAccountsResponse proto.InternalMessageInfo + +type MsgRemoveNoFeeAccounts struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Accounts []string `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts,omitempty"` +} + +func (m *MsgRemoveNoFeeAccounts) Reset() { *m = MsgRemoveNoFeeAccounts{} } +func (m *MsgRemoveNoFeeAccounts) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveNoFeeAccounts) ProtoMessage() {} +func (*MsgRemoveNoFeeAccounts) Descriptor() ([]byte, []int) { + return fileDescriptor_4060456503c2ab45, []int{2} +} +func (m *MsgRemoveNoFeeAccounts) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRemoveNoFeeAccounts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRemoveNoFeeAccounts.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRemoveNoFeeAccounts) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveNoFeeAccounts.Merge(m, src) +} +func (m *MsgRemoveNoFeeAccounts) XXX_Size() int { + return m.Size() +} +func (m *MsgRemoveNoFeeAccounts) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveNoFeeAccounts.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRemoveNoFeeAccounts proto.InternalMessageInfo + +func (m *MsgRemoveNoFeeAccounts) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgRemoveNoFeeAccounts) GetAccounts() []string { + if m != nil { + return m.Accounts + } + return nil +} + +type MsgRemoveNoFeeAccountsResponse struct { +} + +func (m *MsgRemoveNoFeeAccountsResponse) Reset() { *m = MsgRemoveNoFeeAccountsResponse{} } +func (m *MsgRemoveNoFeeAccountsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveNoFeeAccountsResponse) ProtoMessage() {} +func (*MsgRemoveNoFeeAccountsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4060456503c2ab45, []int{3} +} +func (m *MsgRemoveNoFeeAccountsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRemoveNoFeeAccountsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRemoveNoFeeAccountsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRemoveNoFeeAccountsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveNoFeeAccountsResponse.Merge(m, src) +} +func (m *MsgRemoveNoFeeAccountsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRemoveNoFeeAccountsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveNoFeeAccountsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRemoveNoFeeAccountsResponse proto.InternalMessageInfo + // MsgCreateDenom is the sdk.Msg type for allowing an account to create // a new denom. It requires a sender address and a unique nonce // (to allow accounts to create multiple denoms) @@ -41,7 +217,7 @@ func (m *MsgCreateDenom) Reset() { *m = MsgCreateDenom{} } func (m *MsgCreateDenom) String() string { return proto.CompactTextString(m) } func (*MsgCreateDenom) ProtoMessage() {} func (*MsgCreateDenom) Descriptor() ([]byte, []int) { - return fileDescriptor_4060456503c2ab45, []int{0} + return fileDescriptor_4060456503c2ab45, []int{4} } func (m *MsgCreateDenom) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -94,7 +270,7 @@ func (m *MsgCreateDenomResponse) Reset() { *m = MsgCreateDenomResponse{} func (m *MsgCreateDenomResponse) String() string { return proto.CompactTextString(m) } func (*MsgCreateDenomResponse) ProtoMessage() {} func (*MsgCreateDenomResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4060456503c2ab45, []int{1} + return fileDescriptor_4060456503c2ab45, []int{5} } func (m *MsgCreateDenomResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -142,7 +318,7 @@ func (m *MsgMint) Reset() { *m = MsgMint{} } func (m *MsgMint) String() string { return proto.CompactTextString(m) } func (*MsgMint) ProtoMessage() {} func (*MsgMint) Descriptor() ([]byte, []int) { - return fileDescriptor_4060456503c2ab45, []int{2} + return fileDescriptor_4060456503c2ab45, []int{6} } func (m *MsgMint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -199,7 +375,7 @@ func (m *MsgMintResponse) Reset() { *m = MsgMintResponse{} } func (m *MsgMintResponse) String() string { return proto.CompactTextString(m) } func (*MsgMintResponse) ProtoMessage() {} func (*MsgMintResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4060456503c2ab45, []int{3} + return fileDescriptor_4060456503c2ab45, []int{7} } func (m *MsgMintResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -239,7 +415,7 @@ func (m *MsgBurn) Reset() { *m = MsgBurn{} } func (m *MsgBurn) String() string { return proto.CompactTextString(m) } func (*MsgBurn) ProtoMessage() {} func (*MsgBurn) Descriptor() ([]byte, []int) { - return fileDescriptor_4060456503c2ab45, []int{4} + return fileDescriptor_4060456503c2ab45, []int{8} } func (m *MsgBurn) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -289,7 +465,7 @@ func (m *MsgBurnResponse) Reset() { *m = MsgBurnResponse{} } func (m *MsgBurnResponse) String() string { return proto.CompactTextString(m) } func (*MsgBurnResponse) ProtoMessage() {} func (*MsgBurnResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4060456503c2ab45, []int{5} + return fileDescriptor_4060456503c2ab45, []int{9} } func (m *MsgBurnResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -330,7 +506,7 @@ func (m *MsgChangeAdmin) Reset() { *m = MsgChangeAdmin{} } func (m *MsgChangeAdmin) String() string { return proto.CompactTextString(m) } func (*MsgChangeAdmin) ProtoMessage() {} func (*MsgChangeAdmin) Descriptor() ([]byte, []int) { - return fileDescriptor_4060456503c2ab45, []int{6} + return fileDescriptor_4060456503c2ab45, []int{10} } func (m *MsgChangeAdmin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -387,7 +563,7 @@ func (m *MsgChangeAdminResponse) Reset() { *m = MsgChangeAdminResponse{} func (m *MsgChangeAdminResponse) String() string { return proto.CompactTextString(m) } func (*MsgChangeAdminResponse) ProtoMessage() {} func (*MsgChangeAdminResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4060456503c2ab45, []int{7} + return fileDescriptor_4060456503c2ab45, []int{11} } func (m *MsgChangeAdminResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -417,6 +593,10 @@ func (m *MsgChangeAdminResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChangeAdminResponse proto.InternalMessageInfo func init() { + proto.RegisterType((*MsgAddNoFeeAccounts)(nil), "kujira.denom.MsgAddNoFeeAccounts") + proto.RegisterType((*MsgAddNoFeeAccountsResponse)(nil), "kujira.denom.MsgAddNoFeeAccountsResponse") + proto.RegisterType((*MsgRemoveNoFeeAccounts)(nil), "kujira.denom.MsgRemoveNoFeeAccounts") + proto.RegisterType((*MsgRemoveNoFeeAccountsResponse)(nil), "kujira.denom.MsgRemoveNoFeeAccountsResponse") proto.RegisterType((*MsgCreateDenom)(nil), "kujira.denom.MsgCreateDenom") proto.RegisterType((*MsgCreateDenomResponse)(nil), "kujira.denom.MsgCreateDenomResponse") proto.RegisterType((*MsgMint)(nil), "kujira.denom.MsgMint") @@ -430,40 +610,46 @@ func init() { func init() { proto.RegisterFile("kujira/denom/tx.proto", fileDescriptor_4060456503c2ab45) } var fileDescriptor_4060456503c2ab45 = []byte{ - // 515 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x54, 0xbf, 0x6e, 0xd3, 0x40, - 0x1c,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0xf3, 0x8e, 0x3b, 0xbf, - 0x36, 0xd0, 0x66, 0x4f, 0xc4, 0xf6, 0x47, 0xb4, 0x5d, 0x36, 0xf5, 0x23, 0x52, 0xfe, 0x57, 0xc8, - 0xaa, 0x1b, 0x9d, 0xa7, 0xff, 0x63, 0x17, 0x5e, 0x7d, 0x83, 0xee, 0x68, 0x8f, 0xb5, 0x2a, 0x6a, - 0x05, 0x3b, 0x8f, 0x6b, 0xe1, 0x72, 0xb4, 0x3e, 0x6d, 0x35, 0x5a, 0xc1, 0x35, 0xd1, 0xe5, 0x43, - 0xe8, 0x71, 0x4a, 0x47, 0xa8, 0x19, 0x67, 0xc9, 0xd6, 0x8d, 0x53, 0xdd, 0x54, 0xd0, 0xbd, 0x9e, - 0xb8, 0xd6, 0xcd, 0xc4, 0xb5, 0xfe, 0x4e, 0x5c, 0xeb, 0xc7, 0xd4, 0x6d, 0xdc, 0x4c, 0xdd, 0xc6, - 0x9f, 0xa9, 0xdb, 0xf8, 0x74, 0x1c, 0x27, 0xf2, 0x7c, 0xd4, 0x27, 0x11, 0x4f, 0xfd, 0x53, 0xa0, - 0xe9, 0x8b, 0x0f, 0xe6, 0xf9, 0x89, 0x78, 0x06, 0xfe, 0xe5, 0xfc, 0x15, 0xba, 0x1a, 0x82, 0xe8, - 0x37, 0xf5, 0x2b, 0xf2, 0xea, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x20, 0x2b, 0x84, 0xc3, 0xa2, - 0x04, 0x00, 0x00, + // 623 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x8d, 0x1b, 0x28, 0xcd, 0xb6, 0xa5, 0xa9, 0xdb, 0x54, 0xc1, 0xb4, 0x4e, 0x58, 0x55, 0xa8, + 0x91, 0xc0, 0xa6, 0xe1, 0x86, 0xb8, 0x24, 0x41, 0x08, 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 0xba, + 0xe8, 0xb6, 0xc5, 0xbc, 0x4e, 0x08, 0x0e, 0x87, 0x67, 0xd1, 0xd3, 0x52, 0x1b, 0x68, 0x95, 0x01, + 0xe9, 0x41, 0x28, 0xa5, 0xda, 0xdb, 0xf3, 0x49, 0x6d, 0x73, 0xec, 0x04, 0x1f, 0x9f, 0x60, 0x19, + 0xc7, 0x76, 0x4c, 0x50, 0xef, 0xa3, 0x9b, 0x84, 0x12, 0x17, 0xaa, 0x2b, 0x82, 0x59, 0x9e, 0x4f, + 0x6a, 0x1b, 0x92, 0x29, 0xc2, 0xd8, 0x96, 0x30, 0x7e, 0x27, 0x46, 0x4b, 0x89, 0x2c, 0xe4, 0xd5, + 0x36, 0xda, 0x22, 0x30, 0x3a, 0xe5, 0xf4, 0x0c, 0xc8, 0xa9, 0xd8, 0x56, 0xac, 0xaa, 0xcd, 0x27, + 0xb5, 0xbd, 0xb8, 0xd6, 0xaf, 0x04, 0x6c, 0x6f, 0x12, 0x18, 0x9d, 0x44, 0x01, 0x51, 0x0b, 0x7f, + 0x55, 0xd0, 0x2d, 0x8b, 0x79, 0x96, 0x4f, 0xf8, 0x75, 0x9a, 0x7f, 0x81, 0x56, 0x9d, 0x20, 0x7a, + 0x18, 0xa2, 0xfb, 0xf5, 0xe6, 0x1d, 0x43, 0x1a, 0xc2, 0x88, 0x0c, 0x61, 0xc4, 0x86, 0x30, 0x3a, + 0xd4, 0x27, 0xed, 0xca, 0xe5, 0xa4, 0x56, 0x58, 0x56, 0x92, 0x69, 0xd8, 0x8e, 0xf3, 0xd5, 0x26, + 0x2a, 0x85, 0xe0, 0xfa, 0x03, 0x1f, 0x08, 0xaf, 0x16, 0x85, 0xee, 0xee, 0x7c, 0x52, 0x2b, 0x4b, + 0x76, 0x02, 0x61, 0x7b, 0x49, 0xc3, 0xdb, 0x68, 0x2b, 0xee, 0x39, 0x59, 0xc5, 0x27, 0x31, 0x46, + 0x7b, 0x18, 0x92, 0xff, 0x32, 0x46, 0xdc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 0xf0, 0xa5, 0xfc, + 0x62, 0xb8, 0x34, 0x04, 0xf3, 0x62, 0xf1, 0xe1, 0x18, 0x0f, 0x80, 0x75, 0x57, 0xc5, 0x8b, 0xff, + 0xf1, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x80, 0x22, 0x26, 0x15, 0x55, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -478,6 +664,8 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { + AddNoFeeAccounts(ctx context.Context, in *MsgAddNoFeeAccounts, opts ...grpc.CallOption) (*MsgAddNoFeeAccountsResponse, error) + RemoveNoFeeAccounts(ctx context.Context, in *MsgRemoveNoFeeAccounts, opts ...grpc.CallOption) (*MsgRemoveNoFeeAccountsResponse, error) CreateDenom(ctx context.Context, in *MsgCreateDenom, opts ...grpc.CallOption) (*MsgCreateDenomResponse, error) Mint(ctx context.Context, in *MsgMint, opts ...grpc.CallOption) (*MsgMintResponse, error) Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOption) (*MsgBurnResponse, error) @@ -495,6 +683,24 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } +func (c *msgClient) AddNoFeeAccounts(ctx context.Context, in *MsgAddNoFeeAccounts, opts ...grpc.CallOption) (*MsgAddNoFeeAccountsResponse, error) { + out := new(MsgAddNoFeeAccountsResponse) + err := c.cc.Invoke(ctx, "/kujira.denom.Msg/AddNoFeeAccounts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RemoveNoFeeAccounts(ctx context.Context, in *MsgRemoveNoFeeAccounts, opts ...grpc.CallOption) (*MsgRemoveNoFeeAccountsResponse, error) { + out := new(MsgRemoveNoFeeAccountsResponse) + err := c.cc.Invoke(ctx, "/kujira.denom.Msg/RemoveNoFeeAccounts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) CreateDenom(ctx context.Context, in *MsgCreateDenom, opts ...grpc.CallOption) (*MsgCreateDenomResponse, error) { out := new(MsgCreateDenomResponse) err := c.cc.Invoke(ctx, "/kujira.denom.Msg/CreateDenom", in, out, opts...) @@ -533,6 +739,8 @@ func (c *msgClient) ChangeAdmin(ctx context.Context, in *MsgChangeAdmin, opts .. // MsgServer is the server API for Msg service. type MsgServer interface { + AddNoFeeAccounts(context.Context, *MsgAddNoFeeAccounts) (*MsgAddNoFeeAccountsResponse, error) + RemoveNoFeeAccounts(context.Context, *MsgRemoveNoFeeAccounts) (*MsgRemoveNoFeeAccountsResponse, error) CreateDenom(context.Context, *MsgCreateDenom) (*MsgCreateDenomResponse, error) Mint(context.Context, *MsgMint) (*MsgMintResponse, error) Burn(context.Context, *MsgBurn) (*MsgBurnResponse, error) @@ -546,6 +754,12 @@ type MsgServer interface { type UnimplementedMsgServer struct { } +func (*UnimplementedMsgServer) AddNoFeeAccounts(ctx context.Context, req *MsgAddNoFeeAccounts) (*MsgAddNoFeeAccountsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddNoFeeAccounts not implemented") +} +func (*UnimplementedMsgServer) RemoveNoFeeAccounts(ctx context.Context, req *MsgRemoveNoFeeAccounts) (*MsgRemoveNoFeeAccountsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveNoFeeAccounts not implemented") +} func (*UnimplementedMsgServer) CreateDenom(ctx context.Context, req *MsgCreateDenom) (*MsgCreateDenomResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateDenom not implemented") } @@ -563,6 +777,42 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } +func _Msg_AddNoFeeAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAddNoFeeAccounts) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AddNoFeeAccounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kujira.denom.Msg/AddNoFeeAccounts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AddNoFeeAccounts(ctx, req.(*MsgAddNoFeeAccounts)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RemoveNoFeeAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRemoveNoFeeAccounts) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RemoveNoFeeAccounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kujira.denom.Msg/RemoveNoFeeAccounts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RemoveNoFeeAccounts(ctx, req.(*MsgRemoveNoFeeAccounts)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_CreateDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgCreateDenom) if err := dec(in); err != nil { @@ -639,6 +889,14 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "kujira.denom.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "AddNoFeeAccounts", + Handler: _Msg_AddNoFeeAccounts_Handler, + }, + { + MethodName: "RemoveNoFeeAccounts", + Handler: _Msg_RemoveNoFeeAccounts_Handler, + }, { MethodName: "CreateDenom", Handler: _Msg_CreateDenom_Handler, @@ -660,6 +918,130 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "kujira/denom/tx.proto", } +func (m *MsgAddNoFeeAccounts) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAddNoFeeAccounts) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddNoFeeAccounts) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Accounts) > 0 { + for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Accounts[iNdEx]) + copy(dAtA[i:], m.Accounts[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Accounts[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAddNoFeeAccountsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAddNoFeeAccountsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddNoFeeAccountsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRemoveNoFeeAccounts) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRemoveNoFeeAccounts) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRemoveNoFeeAccounts) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Accounts) > 0 { + for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Accounts[iNdEx]) + copy(dAtA[i:], m.Accounts[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Accounts[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRemoveNoFeeAccountsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRemoveNoFeeAccountsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRemoveNoFeeAccountsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgCreateDenom) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -938,13 +1320,69 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgCreateDenom) Size() (n int) { +func (m *MsgAddNoFeeAccounts) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Sender) + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Accounts) > 0 { + for _, s := range m.Accounts { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgAddNoFeeAccountsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRemoveNoFeeAccounts) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Accounts) > 0 { + for _, s := range m.Accounts { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgRemoveNoFeeAccountsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCreateDenom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -1056,6 +1494,334 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *MsgAddNoFeeAccounts) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAddNoFeeAccounts: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddNoFeeAccounts: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Accounts = append(m.Accounts, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAddNoFeeAccountsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAddNoFeeAccountsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddNoFeeAccountsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRemoveNoFeeAccounts) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRemoveNoFeeAccounts: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveNoFeeAccounts: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Accounts = append(m.Accounts, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRemoveNoFeeAccountsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRemoveNoFeeAccountsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveNoFeeAccountsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgCreateDenom) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 From 378b0443e94022c9f2bb0c927045474a9627b716 Mon Sep 17 00:00:00 2001 From: codehans <94654388+codehans@users.noreply.github.com> Date: Fri, 14 Jun 2024 16:14:10 +0100 Subject: [PATCH 16/27] docs --- crypto/keys/authn/signature.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto/keys/authn/signature.go b/crypto/keys/authn/signature.go index ce4562f1..c05bf8ca 100644 --- a/crypto/keys/authn/signature.go +++ b/crypto/keys/authn/signature.go @@ -23,6 +23,8 @@ type CBORSignature struct { // VerifyBytes verifies a signature of the form R || S. // It rejects signatures which are not in lower-S form. +// See https://github.com/Team-Kujira/kujira.js/blob/master/src/authn/AuthnWebSigner.ts for a reference implementation +// signing a transaction with the webauthn API func (pubKey *PubKey) VerifySignature(msg []byte, sigStr []byte) bool { cborSig := CBORSignature{} err := json.Unmarshal(sigStr, &cborSig) From b78fcdf585d65d860d7be762290ecdee8e5eff4c Mon Sep 17 00:00:00 2001 From: antstalepresh Date: Tue, 18 Jun 2024 22:59:41 +0800 Subject: [PATCH 17/27] fix verifySignature Z1 --- crypto/keys/authn/signature_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/keys/authn/signature_test.go b/crypto/keys/authn/signature_test.go index eef68d9a..aa97bb11 100644 --- a/crypto/keys/authn/signature_test.go +++ b/crypto/keys/authn/signature_test.go @@ -108,7 +108,7 @@ func TestVerifySignature(t *testing.T) { // Mutate the message msg[1] ^= byte(2) - require.False(t, pk.VerifySignature(msg, sig)) + require.False(t, pk.VerifySignature(msg, sigBytes)) } func TestVerifySignature_ChallengeStdEncoding(t *testing.T) { From da75633b749087345e152943982f3480727344ea Mon Sep 17 00:00:00 2001 From: antstalepresh Date: Tue, 18 Jun 2024 23:01:05 +0800 Subject: [PATCH 18/27] Z2: fix challenge not available panic case --- crypto/keys/authn/signature.go | 6 +++++- crypto/keys/authn/signature_test.go | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/crypto/keys/authn/signature.go b/crypto/keys/authn/signature.go index c05bf8ca..daaef7c6 100644 --- a/crypto/keys/authn/signature.go +++ b/crypto/keys/authn/signature.go @@ -43,7 +43,11 @@ func (pubKey *PubKey) VerifySignature(msg []byte, sigStr []byte) bool { return false } - challenge, err := base64.RawURLEncoding.DecodeString(clientData["challenge"].(string)) + challengeBase64, ok := clientData["challenge"].(string) + if !ok { + return false + } + challenge, err := base64.RawURLEncoding.DecodeString(challengeBase64) if err != nil { return false } diff --git a/crypto/keys/authn/signature_test.go b/crypto/keys/authn/signature_test.go index aa97bb11..d825ca8e 100644 --- a/crypto/keys/authn/signature_test.go +++ b/crypto/keys/authn/signature_test.go @@ -147,7 +147,7 @@ func TestVerifySignature_ChallengeStdEncoding(t *testing.T) { require.False(t, pk.VerifySignature(msg, sigBytes)) } -func VerifySignature_ChallengeHexEncoding(t *testing.T) { +func TestVerifySignature_ChallengeHexEncoding(t *testing.T) { privateKey, pk := GenerateAuthnKey(t) authenticatorData := cometcrypto.CRandBytes(37) msg := cometcrypto.CRandBytes(1000) @@ -183,7 +183,7 @@ func VerifySignature_ChallengeHexEncoding(t *testing.T) { require.False(t, pk.VerifySignature(msg, sigBytes)) } -func VerifySignature_ChallengeEmpty(t *testing.T) { +func TestVerifySignature_ChallengeEmpty(t *testing.T) { privateKey, pk := GenerateAuthnKey(t) authenticatorData := cometcrypto.CRandBytes(37) msg := cometcrypto.CRandBytes(1000) @@ -219,7 +219,7 @@ func VerifySignature_ChallengeEmpty(t *testing.T) { require.False(t, pk.VerifySignature(msg, sigBytes)) } -func VerifySignature_ChallengeNil(t *testing.T) { +func TestVerifySignature_ChallengeNil(t *testing.T) { privateKey, pk := GenerateAuthnKey(t) authenticatorData := cometcrypto.CRandBytes(37) msg := cometcrypto.CRandBytes(1000) @@ -252,7 +252,7 @@ func VerifySignature_ChallengeNil(t *testing.T) { require.False(t, pk.VerifySignature(msg, sigBytes)) } -func VerifySignature_ChallengeInteger(t *testing.T) { +func TestVerifySignature_ChallengeInteger(t *testing.T) { privateKey, pk := GenerateAuthnKey(t) authenticatorData := cometcrypto.CRandBytes(37) msg := cometcrypto.CRandBytes(1000) @@ -286,7 +286,7 @@ func VerifySignature_ChallengeInteger(t *testing.T) { require.False(t, pk.VerifySignature(msg, sigBytes)) } -func VerifySignature_ClientDataJSONEmpty(t *testing.T) { +func TestVerifySignature_ClientDataJSONEmpty(t *testing.T) { privateKey, pk := GenerateAuthnKey(t) authenticatorData := cometcrypto.CRandBytes(37) msg := cometcrypto.CRandBytes(1000) From 16fffa03fb88c9f158480c588e1790b8c4f4ae90 Mon Sep 17 00:00:00 2001 From: antstalepresh <36045227+antstalepresh@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:44:48 +0800 Subject: [PATCH 19/27] update key path from string to bytes for wasmbinding (#69) --- wasmbinding/bindings/ibc.go | 8 ++++---- wasmbinding/test/wasm_test.go | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/wasmbinding/bindings/ibc.go b/wasmbinding/bindings/ibc.go index 3d9454c1..5d13f6a4 100644 --- a/wasmbinding/bindings/ibc.go +++ b/wasmbinding/bindings/ibc.go @@ -20,7 +20,7 @@ type VerifyMembershipQuery struct { Proof []byte `json:"proof"` Value []byte `json:"value"` PathPrefix string `json:"path_prefix"` - PathKey string `json:"path_key"` + PathKey []byte `json:"path_key"` } type VerifyNonMembershipQuery struct { @@ -29,7 +29,7 @@ type VerifyNonMembershipQuery struct { RevisionHeight uint64 `json:"revision_height"` Proof []byte `json:"proof"` PathPrefix string `json:"path_prefix"` - PathKey string `json:"path_key"` + PathKey []byte `json:"path_key"` } type IbcVerifyResponse struct{} @@ -119,7 +119,7 @@ func HandleIBCQuery(ctx sdk.Context, keeper ibckeeper.Keeper, ibcStoreKey *store } height := clienttypes.NewHeight(q.VerifyMembership.RevisionNumber, q.VerifyMembership.RevisionHeight) - consState, merklePath, err := getConsStateAndMerklePath(keeper, clientState, clientStore, height, q.VerifyMembership.PathPrefix, q.VerifyMembership.PathKey) + consState, merklePath, err := getConsStateAndMerklePath(keeper, clientState, clientStore, height, q.VerifyMembership.PathPrefix, string(q.VerifyMembership.PathKey)) if err != nil { return err } @@ -148,7 +148,7 @@ func HandleIBCQuery(ctx sdk.Context, keeper ibckeeper.Keeper, ibcStoreKey *store } height := clienttypes.NewHeight(q.VerifyNonMembership.RevisionNumber, q.VerifyNonMembership.RevisionHeight) - consState, merklePath, err := getConsStateAndMerklePath(keeper, clientState, clientStore, height, q.VerifyMembership.PathPrefix, q.VerifyMembership.PathKey) + consState, merklePath, err := getConsStateAndMerklePath(keeper, clientState, clientStore, height, q.VerifyMembership.PathPrefix, string(q.VerifyMembership.PathKey)) if err != nil { return err } diff --git a/wasmbinding/test/wasm_test.go b/wasmbinding/test/wasm_test.go index e18808dd..ec04f8fb 100644 --- a/wasmbinding/test/wasm_test.go +++ b/wasmbinding/test/wasm_test.go @@ -70,7 +70,7 @@ func TestQueryExchangeRates(t *testing.T) { }) require.NoError(t, err) - res, err = querier(ctx, bz) + _, err = querier(ctx, bz) require.NoError(t, err) queryParams = wasm.ExchangeRateQueryParams{ @@ -118,6 +118,7 @@ func TestSupply(t *testing.T) { var x banktypes.QuerySupplyOfResponse res, err := querier(ctx, bz) + require.NoError(t, err) err = json.Unmarshal(res, &x) require.NoError(t, err) @@ -137,14 +138,14 @@ func TestVerifyMembership(t *testing.T) { Proof: []byte{}, Value: []byte{}, PathPrefix: "ibc", - PathKey: "connections/connection-0", + PathKey: []byte("connections/connection-0"), }, } bz, err := json.Marshal(queryMsg) require.NoError(t, err) - bz, err = app.WasmKeeper.QuerySmart(ctx, contractAddr, bz) + _, err = app.WasmKeeper.QuerySmart(ctx, contractAddr, bz) require.Error(t, err) } @@ -161,13 +162,13 @@ func TestVerifyNonMembership(t *testing.T) { RevisionHeight: 0, Proof: []byte{}, PathPrefix: "ibc", - PathKey: "connections/connection-0", + PathKey: []byte("connections/connection-0"), }, } bz, err := json.Marshal(queryMsg) require.NoError(t, err) - bz, err = app.WasmKeeper.QuerySmart(ctx, contractAddr, bz) + _, err = app.WasmKeeper.QuerySmart(ctx, contractAddr, bz) require.Error(t, err) } From 25fd172acc8a32bd717935f61f28edcbe01f14f3 Mon Sep 17 00:00:00 2001 From: antstalepresh Date: Wed, 19 Jun 2024 21:34:30 +0800 Subject: [PATCH 20/27] Z1: authenticatorData length checker --- crypto/keys/authn/signature.go | 5 +++++ crypto/keys/authn/signature_test.go | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/crypto/keys/authn/signature.go b/crypto/keys/authn/signature.go index daaef7c6..9910766e 100644 --- a/crypto/keys/authn/signature.go +++ b/crypto/keys/authn/signature.go @@ -83,6 +83,11 @@ func (pubKey *PubKey) VerifySignature(msg []byte, sigStr []byte) bool { return false } + // check authenticatorData length + if len(authenticatorData) < 37 { + return false + } + clientDataHash := sha256.Sum256(clientDataJSON) payload := append(authenticatorData, clientDataHash[:]...) diff --git a/crypto/keys/authn/signature_test.go b/crypto/keys/authn/signature_test.go index d825ca8e..3fbc986a 100644 --- a/crypto/keys/authn/signature_test.go +++ b/crypto/keys/authn/signature_test.go @@ -492,3 +492,29 @@ func TestVerifySignature_EmptySignature(t *testing.T) { msg := cometcrypto.CRandBytes(1000) require.False(t, pk.VerifySignature(msg, []byte{})) } + +func TestVerifySignature_AuthenticatorDataLength(t *testing.T) { + privateKey, pk := GenerateAuthnKey(t) + authenticatorData := cometcrypto.CRandBytes(10) + msg := cometcrypto.CRandBytes(1000) + clientDataJSON := GenerateClientData(t, msg) + clientDataHash := sha256.Sum256(clientDataJSON) + payload := append(authenticatorData, clientDataHash[:]...) + + h := crypto.SHA256.New() + h.Write(payload) + digest := h.Sum(nil) + + sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) + require.NoError(t, err) + + cborSig := CBORSignature{ + AuthenticatorData: hex.EncodeToString(authenticatorData), + ClientDataJSON: hex.EncodeToString(clientDataJSON), + Signature: hex.EncodeToString(sig), + } + + sigBytes, err := json.Marshal(cborSig) + require.NoError(t, err) + require.False(t, pk.VerifySignature(msg, sigBytes)) +} From 998d4d69c79eacc6ec66afdd1c0d863a4317413f Mon Sep 17 00:00:00 2001 From: antstalepresh Date: Wed, 19 Jun 2024 21:42:37 +0800 Subject: [PATCH 21/27] Z4: use ecdsa.VerifyASN1 instead of ecdsa.Verify --- crypto/keys/authn/signature.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/crypto/keys/authn/signature.go b/crypto/keys/authn/signature.go index 9910766e..18338357 100644 --- a/crypto/keys/authn/signature.go +++ b/crypto/keys/authn/signature.go @@ -6,11 +6,9 @@ import ( "crypto" "crypto/elliptic" "crypto/sha256" - "encoding/asn1" "encoding/base64" "encoding/hex" "encoding/json" - "math/big" ecdsa "crypto/ecdsa" ) @@ -63,21 +61,11 @@ func (pubKey *PubKey) VerifySignature(msg []byte, sigStr []byte) bool { return false } - type ECDSASignature struct { - R, S *big.Int - } - signatureBytes, err := hex.DecodeString(cborSig.Signature) if err != nil { return false } - e := &ECDSASignature{} - _, err = asn1.Unmarshal(signatureBytes, e) - if err != nil { - return false - } - authenticatorData, err := hex.DecodeString(cborSig.AuthenticatorData) if err != nil { return false @@ -94,5 +82,5 @@ func (pubKey *PubKey) VerifySignature(msg []byte, sigStr []byte) bool { h := crypto.SHA256.New() h.Write(payload) - return ecdsa.Verify(publicKey, h.Sum(nil), e.R, e.S) + return ecdsa.VerifyASN1(publicKey, h.Sum(nil), signatureBytes) } From b708904e4557d59c80f753f573588b71208de5ee Mon Sep 17 00:00:00 2001 From: codehans <94654388+codehans@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:35:24 +0100 Subject: [PATCH 22/27] rename signature --- crypto/keys/authn/signature.go | 12 ++++++------ crypto/keys/authn/signature_test.go | 26 +++++++++++++------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/crypto/keys/authn/signature.go b/crypto/keys/authn/signature.go index 18338357..a3767378 100644 --- a/crypto/keys/authn/signature.go +++ b/crypto/keys/authn/signature.go @@ -13,7 +13,7 @@ import ( ecdsa "crypto/ecdsa" ) -type CBORSignature struct { +type Signature struct { AuthenticatorData string `json:"authenticatorData"` ClientDataJSON string `json:"clientDataJSON"` Signature string `json:"signature"` @@ -24,13 +24,13 @@ type CBORSignature struct { // See https://github.com/Team-Kujira/kujira.js/blob/master/src/authn/AuthnWebSigner.ts for a reference implementation // signing a transaction with the webauthn API func (pubKey *PubKey) VerifySignature(msg []byte, sigStr []byte) bool { - cborSig := CBORSignature{} - err := json.Unmarshal(sigStr, &cborSig) + sig := Signature{} + err := json.Unmarshal(sigStr, &sig) if err != nil { return false } - clientDataJSON, err := hex.DecodeString(cborSig.ClientDataJSON) + clientDataJSON, err := hex.DecodeString(sig.ClientDataJSON) if err != nil { return false } @@ -61,12 +61,12 @@ func (pubKey *PubKey) VerifySignature(msg []byte, sigStr []byte) bool { return false } - signatureBytes, err := hex.DecodeString(cborSig.Signature) + signatureBytes, err := hex.DecodeString(sig.Signature) if err != nil { return false } - authenticatorData, err := hex.DecodeString(cborSig.AuthenticatorData) + authenticatorData, err := hex.DecodeString(sig.AuthenticatorData) if err != nil { return false } diff --git a/crypto/keys/authn/signature_test.go b/crypto/keys/authn/signature_test.go index 3fbc986a..264590d8 100644 --- a/crypto/keys/authn/signature_test.go +++ b/crypto/keys/authn/signature_test.go @@ -88,7 +88,7 @@ func TestVerifySignature(t *testing.T) { sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) require.NoError(t, err) - cborSig := CBORSignature{ + cborSig := Signature{ AuthenticatorData: hex.EncodeToString(authenticatorData), ClientDataJSON: hex.EncodeToString(clientDataJSON), Signature: hex.EncodeToString(sig), @@ -136,7 +136,7 @@ func TestVerifySignature_ChallengeStdEncoding(t *testing.T) { sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) require.NoError(t, err) - cborSig := CBORSignature{ + cborSig := Signature{ AuthenticatorData: hex.EncodeToString(authenticatorData), ClientDataJSON: hex.EncodeToString(clientDataJSON), Signature: hex.EncodeToString(sig), @@ -172,7 +172,7 @@ func TestVerifySignature_ChallengeHexEncoding(t *testing.T) { sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) require.NoError(t, err) - cborSig := CBORSignature{ + cborSig := Signature{ AuthenticatorData: hex.EncodeToString(authenticatorData), ClientDataJSON: hex.EncodeToString(clientDataJSON), Signature: hex.EncodeToString(sig), @@ -208,7 +208,7 @@ func TestVerifySignature_ChallengeEmpty(t *testing.T) { sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) require.NoError(t, err) - cborSig := CBORSignature{ + cborSig := Signature{ AuthenticatorData: hex.EncodeToString(authenticatorData), ClientDataJSON: hex.EncodeToString(clientDataJSON), Signature: hex.EncodeToString(sig), @@ -241,7 +241,7 @@ func TestVerifySignature_ChallengeNil(t *testing.T) { sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) require.NoError(t, err) - cborSig := CBORSignature{ + cborSig := Signature{ AuthenticatorData: hex.EncodeToString(authenticatorData), ClientDataJSON: hex.EncodeToString(clientDataJSON), Signature: hex.EncodeToString(sig), @@ -275,7 +275,7 @@ func TestVerifySignature_ChallengeInteger(t *testing.T) { sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) require.NoError(t, err) - cborSig := CBORSignature{ + cborSig := Signature{ AuthenticatorData: hex.EncodeToString(authenticatorData), ClientDataJSON: hex.EncodeToString(clientDataJSON), Signature: hex.EncodeToString(sig), @@ -337,7 +337,7 @@ func TestVerifySignature_UncompressedPubKey(t *testing.T) { sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) require.NoError(t, err) - cborSig := CBORSignature{ + cborSig := Signature{ AuthenticatorData: hex.EncodeToString(authenticatorData), ClientDataJSON: hex.EncodeToString(clientDataJSON), Signature: hex.EncodeToString(sig), @@ -366,7 +366,7 @@ func TestVerifySignature_AnotherPubKey(t *testing.T) { sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) require.NoError(t, err) - cborSig := CBORSignature{ + cborSig := Signature{ AuthenticatorData: hex.EncodeToString(authenticatorData), ClientDataJSON: hex.EncodeToString(clientDataJSON), Signature: hex.EncodeToString(sig), @@ -394,7 +394,7 @@ func TestVerifySignature_SignaureNotInASN1(t *testing.T) { require.NoError(t, err) sig := append(sigR.Bytes(), sigS.Bytes()...) - cborSig := CBORSignature{ + cborSig := Signature{ AuthenticatorData: hex.EncodeToString(authenticatorData), ClientDataJSON: hex.EncodeToString(clientDataJSON), Signature: hex.EncodeToString(sig), @@ -421,7 +421,7 @@ func TestVerifySignature_EmptyAuthenticatorData(t *testing.T) { sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) require.NoError(t, err) - cborSig := CBORSignature{ + cborSig := Signature{ AuthenticatorData: "", ClientDataJSON: hex.EncodeToString(clientDataJSON), Signature: hex.EncodeToString(sig), @@ -449,7 +449,7 @@ func TestVerifySignature_SignatureEncodingInBase64(t *testing.T) { require.NoError(t, err) sig := append(sigR.Bytes(), sigS.Bytes()...) - cborSig := CBORSignature{ + cborSig := Signature{ AuthenticatorData: hex.EncodeToString(authenticatorData), ClientDataJSON: hex.EncodeToString(clientDataJSON), Signature: base64.StdEncoding.EncodeToString(sig), @@ -476,7 +476,7 @@ func TestVerifySignature_ClientDataJSONEncodingInBase64(t *testing.T) { require.NoError(t, err) sig := append(sigR.Bytes(), sigS.Bytes()...) - cborSig := CBORSignature{ + cborSig := Signature{ AuthenticatorData: hex.EncodeToString(authenticatorData), ClientDataJSON: base64.StdEncoding.EncodeToString(clientDataJSON), Signature: hex.EncodeToString(sig), @@ -508,7 +508,7 @@ func TestVerifySignature_AuthenticatorDataLength(t *testing.T) { sig, err := ecdsa.SignASN1(rand.Reader, privateKey, digest) require.NoError(t, err) - cborSig := CBORSignature{ + cborSig := Signature{ AuthenticatorData: hex.EncodeToString(authenticatorData), ClientDataJSON: hex.EncodeToString(clientDataJSON), Signature: hex.EncodeToString(sig), From 12b9dc15e1579740eabfde68822d22729f74f895 Mon Sep 17 00:00:00 2001 From: Starsquid <108214377+starsquidnodes@users.noreply.github.com> Date: Thu, 20 Jun 2024 12:23:15 +0200 Subject: [PATCH 23/27] Set default timeout_commit to 1.5s --- cmd/kujirad/cmd/root.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/kujirad/cmd/root.go b/cmd/kujirad/cmd/root.go index 067e12e0..f4b7c990 100644 --- a/cmd/kujirad/cmd/root.go +++ b/cmd/kujirad/cmd/root.go @@ -4,6 +4,7 @@ import ( "errors" "io" "os" + "time" "github.com/prometheus/client_golang/prometheus" "github.com/spf13/cast" @@ -88,6 +89,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { // return tmcfg.DefaultConfig if no custom configuration is required for the application. func initTendermintConfig() *tmcfg.Config { cfg := tmcfg.DefaultConfig() + cfg.Consensus.TimeoutCommit = time.Millisecond * 1500 cfg.P2P.Seeds = "" From 406cc776c3ab3531dfd457fc7bea984a992aa2ee Mon Sep 17 00:00:00 2001 From: codehans <94654388+codehans@users.noreply.github.com> Date: Fri, 21 Jun 2024 08:42:18 +0100 Subject: [PATCH 24/27] upgrade ibc-go --- go.mod | 99 +++++++++++++----------- go.sum | 238 +++++++++++++++++++++++++++++---------------------------- 2 files changed, 174 insertions(+), 163 deletions(-) diff --git a/go.mod b/go.mod index 39a9c8f9..92ff2125 100644 --- a/go.mod +++ b/go.mod @@ -6,45 +6,45 @@ toolchain go1.21.8 require ( cosmossdk.io/errors v1.0.1 - cosmossdk.io/math v1.2.0 + cosmossdk.io/math v1.3.0 cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462 cosmossdk.io/tools/rosetta v0.2.1 github.com/CosmWasm/wasmd v0.45.0 github.com/CosmWasm/wasmvm v1.5.2 github.com/armon/go-metrics v0.4.1 - github.com/cometbft/cometbft v0.37.4 + github.com/cometbft/cometbft v0.37.5 github.com/cometbft/cometbft-db v0.8.0 - github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.47.8 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/cosmos-sdk v0.47.12 github.com/cosmos/gogoproto v1.4.10 github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.1.1-0.20231213092633-b306e7a706e1 - github.com/cosmos/ibc-go/v7 v7.3.2 - github.com/golang/protobuf v1.5.3 + github.com/cosmos/ibc-go/v7 v7.6.0 + github.com/golang/protobuf v1.5.4 github.com/google/gofuzz v1.2.0 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.16.0 - github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.7.0 - github.com/stretchr/testify v1.8.4 + github.com/spf13/cast v1.6.0 + github.com/spf13/cobra v1.8.0 + github.com/stretchr/testify v1.9.0 github.com/terra-money/alliance v0.3.5 - google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 - google.golang.org/grpc v1.60.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 + google.golang.org/grpc v1.62.1 gopkg.in/yaml.v2 v2.4.0 ) require ( - cloud.google.com/go v0.111.0 // indirect + cloud.google.com/go v0.112.0 // indirect cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v1.1.5 // indirect - cloud.google.com/go/storage v1.30.1 // indirect + cloud.google.com/go/storage v1.36.0 // indirect cosmossdk.io/api v0.3.1 // indirect cosmossdk.io/core v0.6.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect - cosmossdk.io/log v1.3.0 // indirect + cosmossdk.io/log v1.3.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -73,7 +73,7 @@ require ( github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect github.com/creachadair/taskgroup v0.4.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect @@ -81,19 +81,19 @@ require ( github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/docker/distribution v2.8.2+incompatible // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/getsentry/sentry-go v0.23.0 // indirect github.com/go-kit/kit v0.12.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.2.4 // indirect + github.com/go-logr/logr v1.3.0 // indirect github.com/go-logr/stdr v1.2.2 // 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 - github.com/golang/glog v1.1.2 // indirect + github.com/golang/glog v1.2.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect @@ -101,7 +101,7 @@ require ( github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/google/s2a-go v0.1.7 // indirect - github.com/google/uuid v1.4.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/gorilla/handlers v1.5.1 // indirect @@ -123,7 +123,7 @@ require ( 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/klauspost/compress v1.16.7 // indirect + github.com/klauspost/compress v1.17.0 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -141,9 +141,9 @@ require ( github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.10.1 // indirect @@ -151,13 +151,15 @@ require ( github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.31.0 // indirect + github.com/rs/zerolog v1.32.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/spf13/afero v1.9.5 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.16.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/spf13/viper v1.18.2 // indirect + github.com/subosito/gotenv v1.6.0 // 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.6.0 // indirect @@ -166,34 +168,39 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/otel v1.19.0 // indirect - go.opentelemetry.io/otel/metric v1.19.0 // indirect - go.opentelemetry.io/otel/trace v1.19.0 // indirect - golang.org/x/crypto v0.16.0 // indirect - golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // indirect - golang.org/x/net v0.19.0 // indirect - golang.org/x/oauth2 v0.13.0 // indirect - golang.org/x/sync v0.4.0 // indirect - golang.org/x/sys v0.16.0 // indirect - golang.org/x/term v0.15.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect + go.opentelemetry.io/otel v1.21.0 // indirect + go.opentelemetry.io/otel/metric v1.21.0 // indirect + go.opentelemetry.io/otel/trace v1.21.0 // indirect + go.uber.org/atomic v1.10.0 // indirect + go.uber.org/multierr v1.9.0 // indirect + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/oauth2 v0.16.0 // indirect + golang.org/x/sync v0.6.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/api v0.149.0 // indirect + golang.org/x/time v0.5.0 // indirect + google.golang.org/api v0.155.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect - google.golang.org/protobuf v1.32.0 // indirect + google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.5.5 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) replace ( // Use the cosmos-flavored keyring library github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - github.com/cosmos/ibc-go/v7 => github.com/Team-Kujira/ibc-go/v7 v7.3.0-factory + github.com/cosmos/ibc-go/v7 => github.com/Team-Kujira/ibc-go/v7 v7.6.0-factory // dgrijalva/jwt-go is deprecated and doesn't receive security updates. // See: https://github.com/cosmos/cosmos-sdk/issues/13134 diff --git a/go.sum b/go.sum index 19d41073..ea3deadc 100644 --- a/go.sum +++ b/go.sum @@ -4,7 +4,6 @@ cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSR cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -18,7 +17,6 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= @@ -34,8 +32,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.111.0 h1:YHLKNupSD1KqjDbQ3+LVdQ81h/UJbJyZG203cEfnQgM= -cloud.google.com/go v0.111.0/go.mod h1:0mibmpKP1TyOOFYQY5izo0LnT+ecvOQ0Sg3OdmMiNRU= +cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= +cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -173,12 +171,11 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM= -cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= +cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8= +cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -199,10 +196,10 @@ cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98ok cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= 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.0 h1:L0Z0XstClo2kOU4h3V1iDoE5Ji64sg5HLOogzGg67Oo= -cosmossdk.io/log v1.3.0/go.mod h1:HIDyvWLqZe2ovlWabsDN4aPMpY/nUEquAhgfTf2ZzB8= -cosmossdk.io/math v1.2.0 h1:8gudhTkkD3NxOP2YyyJIYYmt6dQ55ZfJkDOaxXpy7Ig= -cosmossdk.io/math v1.2.0/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= +cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= +cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= +cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462 h1:g8muUHnXL8vhld2Sjilyhb1UQObc+x9GVuDK43TYZns= cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462/go.mod h1:4Dd3NLoLYoN90kZ0uyHoTHzVVk9+J0v4HhZRBNTAq2c= cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= @@ -232,8 +229,8 @@ github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= -github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= @@ -241,8 +238,8 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/Team-Kujira/ibc-go/v7 v7.3.0-factory h1:NaUaCur93Nx0rCz1JI4pYygy0OZv8jJhBMMrkqsqs1o= -github.com/Team-Kujira/ibc-go/v7 v7.3.0-factory/go.mod h1:mUmaHFXpXrEdcxfdXyau+utZf14pGKVUiXwYftRZZfQ= +github.com/Team-Kujira/ibc-go/v7 v7.6.0-factory h1:4Edl+r31RnJZef3YPXnslz2Anh82khVUGCh931RIcBU= +github.com/Team-Kujira/ibc-go/v7 v7.6.0-factory/go.mod h1:LifBA7JHRHl95ujjHIaBEHmUqy2qCGyqDCXB7qmAsZk= github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= 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= @@ -368,6 +365,8 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= +github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= @@ -381,8 +380,8 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= -github.com/cometbft/cometbft v0.37.4 h1:xyvvEqlyfK8MgNIIKVJaMsuIp03wxOcFmVkT26+Ikpg= -github.com/cometbft/cometbft v0.37.4/go.mod h1:Cmg5Hp4sNpapm7j+x0xRyt2g0juQfmB752ous+pA0G8= +github.com/cometbft/cometbft v0.37.5 h1:/U/TlgMh4NdnXNo+YU9T2NMCWyhXNDF34Mx582jlvq0= +github.com/cometbft/cometbft v0.37.5/go.mod h1:QC+mU0lBhKn8r9qvmnq53Dmf3DWBt4VtkcKw2C81wxY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= @@ -401,10 +400,10 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= -github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.47.8 h1:kzYF2xhnfi8dy15t2VVS24tc2KcuU4JBgjh9yCFx4y4= -github.com/cosmos/cosmos-sdk v0.47.8/go.mod h1:VTAtthIsmfplanhFfUTfT6ED4F+kkJxT7nmvmKXRthI= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.47.12 h1:KOZHAVWrcilHywBN/FabBaXbDFMzoFmtdX0hqy5Ory8= +github.com/cosmos/cosmos-sdk v0.47.12/go.mod h1:ADjORYzUQqQv/FxDi0H0K5gW/rAk1CiDR3ZKsExfJV0= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -427,7 +426,7 @@ github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzU github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= 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.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= @@ -438,8 +437,9 @@ github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnG github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= @@ -478,8 +478,8 @@ github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:Htrtb github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= +github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= @@ -496,24 +496,26 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= +github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +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.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= 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= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= -github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= @@ -545,8 +547,8 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/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.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= @@ -586,8 +588,8 @@ github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= -github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= +github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= +github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -622,8 +624,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +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.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -674,7 +676,6 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -688,8 +689,8 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= @@ -707,7 +708,6 @@ github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMd github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= @@ -846,8 +846,8 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs 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.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= +github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5 h1:2U0HzY8BJ8hVwDKIzp7y4voR9CX/nvcfymLmg2UiOio= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= @@ -856,7 +856,6 @@ github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPR github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= 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= @@ -1013,8 +1012,8 @@ github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChl github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= @@ -1032,10 +1031,10 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -1091,12 +1090,16 @@ 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.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= -github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +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/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/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= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= 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= @@ -1117,29 +1120,29 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1 github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +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.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +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/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.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= 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= @@ -1147,8 +1150,9 @@ github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5J github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -1159,11 +1163,11 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= 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= @@ -1230,20 +1234,28 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= -go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= -go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= -go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= -go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= -go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= -go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= -go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= +go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= +go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= +go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= +go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= +go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= +go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= 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.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= 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.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= @@ -1269,13 +1281,11 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1290,8 +1300,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1319,8 +1329,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1364,7 +1374,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -1374,7 +1383,6 @@ golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/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= @@ -1389,8 +1397,8 @@ golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfS golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= 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= @@ -1416,8 +1424,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.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= -golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= +golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= 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= @@ -1432,8 +1440,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.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -1495,7 +1503,6 @@ golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1504,7 +1511,6 @@ golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1537,23 +1543,22 @@ golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBc 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-20220908164124-27713097b956/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.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.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.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= 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.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= 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= @@ -1575,6 +1580,8 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1630,7 +1637,6 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= @@ -1638,8 +1644,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1704,8 +1710,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.149.0 h1:b2CqT6kG+zqJIVKRQ3ELJVLN1PwHZ6DJ3dW8yl82rgY= -google.golang.org/api v0.149.0/go.mod h1:Mwn1B7JTXrzXtnvmzQE2BD6bYZQ8DShKZDZbeN9I7qI= +google.golang.org/api v0.155.0 h1:vBmGhCYs0djJttDNynWo44zosHlPvHmA0XiN2zP2DtA= +google.golang.org/api v0.155.0/go.mod h1:GI5qK5f40kCpHfPn6+YzGAByIKWv8ujFnmoWm7Igduk= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1756,10 +1762,8 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1826,12 +1830,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg= -google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917/go.mod h1:pZqR+glSb11aJ+JQcczCvgf47+duRuzNSKqE8YAQnV0= -google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 h1:s1w3X6gQxwrLEpxnLd/qXTVLgQE2yXwaOaoa6IlY/+o= -google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0/go.mod h1:CAny0tYF+0/9rmDB9fahA9YLzX3+AEVl1qXbv5hhj6c= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 h1:gphdwh0npgs8elJ4T6J+DQJHPVF7RsuJHCfwztUb4J4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= +google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= +google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= +google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU= +google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= 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= @@ -1873,8 +1877,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.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= -google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= 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= @@ -1891,8 +1895,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1943,14 +1947,14 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= -pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= From 9f1706519d4b72e55b22d2a613edd38c3f484a13 Mon Sep 17 00:00:00 2001 From: codehans <94654388+codehans@users.noreply.github.com> Date: Fri, 21 Jun 2024 13:22:34 +0100 Subject: [PATCH 25/27] 1.1.0 --- app/upgrades.go | 2 +- go.mod | 4 +++- go.sum | 39 ++++++--------------------------------- 3 files changed, 10 insertions(+), 35 deletions(-) diff --git a/app/upgrades.go b/app/upgrades.go index 98b6ae06..57497ba5 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -6,7 +6,7 @@ import ( upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) -const UpgradeName = "v1.1.0-beta" +const UpgradeName = "v1.1.0" func (app App) RegisterUpgradeHandlers() { app.UpgradeKeeper.SetUpgradeHandler( diff --git a/go.mod b/go.mod index 92ff2125..48cea682 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,6 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 google.golang.org/grpc v1.62.1 gopkg.in/yaml.v2 v2.4.0 - ) require ( @@ -214,4 +213,7 @@ replace ( // Downgraded to avoid bugs in following commits which caused simulations to fail. // https://github.com/cosmos/cosmos-sdk/issues/14949 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 + + // https://github.com/cosmos/cosmos-sdk/issues/20159 + golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb ) diff --git a/go.sum b/go.sum index ea3deadc..10d08ee0 100644 --- a/go.sum +++ b/go.sum @@ -204,7 +204,6 @@ cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462 h1:g8muUHnXL8vhld2Sjilyhb cosmossdk.io/simapp v0.0.0-20230224204036-a6adb0821462/go.mod h1:4Dd3NLoLYoN90kZ0uyHoTHzVVk9+J0v4HhZRBNTAq2c= cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -218,7 +217,6 @@ github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/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/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= github.com/CosmWasm/wasmd v0.45.0 h1:9zBqrturKJwC2kVsfHvbrA++EN0PS7UTXCffCGbg6JI= @@ -531,9 +529,6 @@ github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1T github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= @@ -1283,28 +1278,13 @@ golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/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= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= +golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= +golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1317,18 +1297,16 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1454,7 +1432,6 @@ golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1466,7 +1443,6 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/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-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= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1589,7 +1565,6 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1598,9 +1573,7 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1616,7 +1589,6 @@ golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1644,6 +1616,7 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 690a0dece9372993178deb467e2f0ae49d0733ce Mon Sep 17 00:00:00 2001 From: codehans <94654388+codehans@users.noreply.github.com> Date: Fri, 21 Jun 2024 13:52:38 +0100 Subject: [PATCH 26/27] ica query router --- app/app.go | 1 + 1 file changed, 1 insertion(+) diff --git a/app/app.go b/app/app.go index 90357772..c824bb31 100644 --- a/app/app.go +++ b/app/app.go @@ -572,6 +572,7 @@ func New( scopedICAHostKeeper, app.MsgServiceRouter(), ) + app.ICAHostKeeper.WithQueryRouter(app.GRPCQueryRouter()) scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName) app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( From b2ae775919f43a98151fca9fb79920765ad6d5bd Mon Sep 17 00:00:00 2001 From: antstalepresh Date: Sat, 13 Jul 2024 01:26:27 +0800 Subject: [PATCH 27/27] attach memo in transfer-tx --- x/cw-ica/wasm/interface_msg.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x/cw-ica/wasm/interface_msg.go b/x/cw-ica/wasm/interface_msg.go index 64c3122c..4c1d4413 100644 --- a/x/cw-ica/wasm/interface_msg.go +++ b/x/cw-ica/wasm/interface_msg.go @@ -63,6 +63,7 @@ type Transfer struct { Amount wasmvmtypes.Coin `json:"amount"` Timeout wasmvmtypes.IBCTimeout `json:"timeout"` Callback []byte `json:"callback"` + Memo string `json:"memo"` } func register(ctx sdk.Context, contractAddr sdk.AccAddress, register *Register, cwicak cwicakeeper.Keeper, ik icacontrollerkeeper.Keeper) ([]sdk.Event, [][]byte, error) { @@ -208,6 +209,7 @@ func PerformTransfer(f ibctransferkeeper.Keeper, cwicak cwicakeeper.Keeper, ctx Receiver: transferTx.ToAddress, TimeoutHeight: wasmkeeper.ConvertWasmIBCTimeoutHeightToCosmosHeight(transferTx.Timeout.Block), TimeoutTimestamp: transferTx.Timeout.Timestamp, + Memo: transferTx.Memo, } res, err := f.Transfer(sdk.WrapSDKContext(ctx), msg)