From 8a60bd6a35254cd2b9626bb0d59e3048bc51aef2 Mon Sep 17 00:00:00 2001 From: Vishal Potpelliwar <71565171+vishal-kanna@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:39:03 +0530 Subject: [PATCH] feat : upgraded the app with evm module to SDK v0.50 (#1036) * made changes in the app folder * go mod changes * cmd folder commits * util folder commits * testutil changess * made changes to the evm module proto and solved the errors in evm module * evm module changes * deleted the commented files * resolved the conflicts * made chagnes as per review * added the cmproto header to test file * added the blockheight in genesis_test * move params to module state * Removed params realted code because evm module doesn't contain any params * Changes made as per review comments * removed the sdk params types * used Witherror * made changes as per review * Changed sdk.ctx to context. ctx in all keeper mthd * Mades changes in app.go and keeper.go * Made changes as per the review commets * changes as per review comments * reverted the params.go file --------- Co-authored-by: deepan95dev Co-authored-by: ruthishvitwit --- app/app.go | 156 +- app/app_setup.go | 2 +- app/encoding.go | 4 +- app/export.go | 2 +- app/genesis.go | 7 - cmd/palomad/commands.go | 180 ++ cmd/palomad/config.go | 13 + cmd/palomad/root.go | 183 +- go.mod | 61 +- go.sum | 63 + proto/palomachain/paloma/evm/params.proto | 1 - proto/palomachain/paloma/evm/tx.proto | 4 +- .../palomachain/paloma/treasury/params.proto | 3 +- .../palomachain/paloma/valset/snapshot.proto | 4 +- util/keeper/ifaces.go | 8 +- util/keeper/iter.go | 8 +- util/keeper/iter_test.go | 6 +- util/keeper/store_getter.go | 11 +- util/liblog/liblog.go | 7 +- x/consensus/types/tx.pb.go | 112 +- x/evm/genesis.go | 6 +- x/evm/genesis_test.go | 5 +- x/evm/keeper/attest.go | 58 +- x/evm/keeper/attest_test.go | 6 +- x/evm/keeper/attest_validator_balances.go | 14 +- x/evm/keeper/keeper.go | 175 +- x/evm/keeper/keeper_integration_test.go | 2416 ++++++++--------- x/evm/keeper/keeper_test.go | 35 +- x/evm/keeper/msg_assigner.go | 10 +- x/evm/keeper/msg_assigner_test.go | 9 +- ...r_remove_smart_contract_deployment_test.go | 3 +- x/evm/keeper/params.go | 9 +- x/evm/keeper/scheduler_job.go | 1 + x/evm/keeper/setup_test.go | 29 +- x/evm/keeper/smart_contract_deployment.go | 107 +- x/evm/keeper/treasury.go | 7 +- x/evm/module.go | 41 +- x/evm/types/chain_info.pb.go | 32 +- x/evm/types/errors.go | 2 +- x/evm/types/expected_keepers.go | 41 +- x/evm/types/mocks/ConsensusKeeper.go | 49 +- x/evm/types/mocks/MsgSender.go | 25 +- x/evm/types/mocks/ValsetKeeper.go | 132 +- x/evm/types/msg_assigner.go | 5 +- x/evm/types/msg_sender.go | 6 +- x/evm/types/params.go | 7 - x/evm/types/params.pb.go | 18 +- x/evm/types/turnstone.pb.go | 78 +- x/evm/types/tx.pb.go | 124 +- x/gravity/types/msgs.pb.go | 176 +- x/gravity/types/query.pb.go | 213 +- x/paloma/types/tx.pb.go | 42 +- x/scheduler/types/tx.pb.go | 55 +- x/valset/types/common.pb.go | 22 +- x/valset/types/snapshot.pb.go | 97 +- x/valset/types/tx.pb.go | 59 +- 56 files changed, 2265 insertions(+), 2684 deletions(-) create mode 100644 cmd/palomad/commands.go create mode 100644 cmd/palomad/config.go diff --git a/app/app.go b/app/app.go index 36da5277..f179ebb3 100644 --- a/app/app.go +++ b/app/app.go @@ -13,13 +13,9 @@ import ( wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" dbm "github.com/cosmos/cosmos-db" - "github.com/cosmos/gogoproto/proto" - - // xchain "github.com/palomachain/paloma/internal/x-chain" - // "github.com/palomachain/paloma/x/evm" - "github.com/cosmos/cosmos-sdk/std" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/gogoproto/proto" abci "github.com/cometbft/cometbft/abci/types" tmjson "github.com/cometbft/cometbft/libs/json" @@ -124,7 +120,6 @@ import ( porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" - ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" palomamempool "github.com/palomachain/paloma/app/mempool" appparams "github.com/palomachain/paloma/app/params" @@ -133,10 +128,11 @@ import ( // consensusmodule "github.com/palomachain/paloma/x/consensus" // consensusmodulekeeper "github.com/palomachain/paloma/x/consensus/keeper" // consensusmoduletypes "github.com/palomachain/paloma/x/consensus/types" - // "github.com/palomachain/paloma/x/evm" - // evmclient "github.com/palomachain/paloma/x/evm/client" - // evmmodulekeeper "github.com/palomachain/paloma/x/evm/keeper" - // evmmoduletypes "github.com/palomachain/paloma/x/evm/types" + "github.com/palomachain/paloma/x/evm" + evmclient "github.com/palomachain/paloma/x/evm/client" + evmmodulekeeper "github.com/palomachain/paloma/x/evm/keeper" + evmmoduletypes "github.com/palomachain/paloma/x/evm/types" + // gravitymodule "github.com/palomachain/paloma/x/gravity" // gravityclient "github.com/palomachain/paloma/x/gravity/client" // gravitymodulekeeper "github.com/palomachain/paloma/x/gravity/keeper" @@ -151,6 +147,7 @@ import ( // treasuryclient "github.com/palomachain/paloma/x/treasury/client" // treasurymodulekeeper "github.com/palomachain/paloma/x/treasury/keeper" // treasurymoduletypes "github.com/palomachain/paloma/x/treasury/types" + // valsetmodule "github.com/palomachain/paloma/x/valset" // valsetmodulekeeper "github.com/palomachain/paloma/x/valset/keeper" // valsetmoduletypes "github.com/palomachain/paloma/x/valset/types" @@ -168,9 +165,7 @@ const ( func getGovProposalHandlers() []govclient.ProposalHandler { return []govclient.ProposalHandler{ paramsclient.ProposalHandler, - // evmclient.ProposalHandler, - // gravityclient.ProposalHandler, - // treasuryclient.ProposalHandler, + evmclient.ProposalHandler, } } @@ -178,41 +173,6 @@ var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string - // ModuleBasics defines the module BasicManager is in charge of setting up basic, - // non-dependant module elements, such as codec registration - // and genesis verification. - ModuleBasics = module.NewBasicManager( - auth.AppModuleBasic{}, - genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), - BankModule{}, - capability.AppModuleBasic{}, - StakingModule{}, - MintModule{}, - distr.AppModuleBasic{}, - GovModule{gov.NewAppModuleBasic(getGovProposalHandlers())}, - params.AppModuleBasic{}, - CrisisModule{}, - slashing.AppModule{}, - feegrantmodule.AppModuleBasic{}, - upgrade.AppModuleBasic{}, - evidence.AppModuleBasic{}, - vesting.AppModuleBasic{}, - // schedulermodule.AppModuleBasic{}, - // consensusmodule.AppModuleBasic{}, - // valsetmodule.AppModuleBasic{}, - // wasm.AppModuleBasic{}, - // evm.AppModuleBasic{}, - // gravitymodule.AppModuleBasic{}, - // palomamodule.AppModuleBasic{}, - // treasurymodule.AppModuleBasic{}, - // consensus.AppModuleBasic{}, - transfer.AppModuleBasic{}, - ibc.AppModuleBasic{}, - ibctm.AppModuleBasic{}, - ica.AppModuleBasic{}, - ibcfee.AppModuleBasic{}, - ) - // module account permissions maccPerms = map[string][]string{ authtypes.FeeCollectorName: nil, @@ -221,12 +181,10 @@ var ( stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, govtypes.ModuleName: {authtypes.Burner}, - // gravitymoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - ibcfeetypes.ModuleName: nil, - icatypes.ModuleName: nil, - // wasm.ModuleName: {authtypes.Burner}, - // treasurymoduletypes.ModuleName: {authtypes.Burner, authtypes.Minter}, + ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + ibcfeetypes.ModuleName: nil, + icatypes.ModuleName: nil, + evmmoduletypes.ModuleName: {authtypes.Burner, authtypes.Minter}, } ) @@ -289,14 +247,14 @@ type App struct { // ConsensusKeeper consensusmodulekeeper.Keeper // ValsetKeeper valsetmodulekeeper.Keeper // PalomaKeeper palomamodulekeeper.Keeper - // TreasuryKeeper treasurymodulekeeper.Keeper - // EvmKeeper evmmodulekeeper.Keeper + // TreasuryKeeper treasurymodulekeeper.Keeper + EvmKeeper evmmodulekeeper.Keeper // GravityKeeper gravitymodulekeeper.Keeper wasmKeeper wasmkeeper.Keeper // mm is the module manager - mm *module.Manager - bm module.BasicManager + ModuleManager *module.Manager + BasicModuleManager module.BasicManager // sm is the simulation manager sm *module.SimulationManager @@ -367,6 +325,8 @@ func New( // consensusmoduletypes.StoreKey, // valsetmoduletypes.StoreKey, // treasurymoduletypes.StoreKey, + // // wasm.StoreKey, + evmmoduletypes.StoreKey, wasmtypes.StoreKey, // evmmoduletypes.StoreKey, // gravitymoduletypes.StoreKey, @@ -378,7 +338,7 @@ func New( capabilitytypes.MemStoreKey, // valsetmoduletypes.MemStoreKey, // consensusmoduletypes.MemStoreKey, - // evmmoduletypes.MemStoreKey, + evmmoduletypes.MemStoreKey, // schedulermoduletypes.MemStoreKey, // treasurymoduletypes.MemStoreKey, // palomamoduletypes.MemStoreKey, @@ -587,14 +547,13 @@ func New( // consensusRegistry, // ) - // app.EvmKeeper = *evmmodulekeeper.NewKeeper( - // appCodec, - // keys[evmmoduletypes.StoreKey], - // memKeys[evmmoduletypes.MemStoreKey], - // app.GetSubspace(evmmoduletypes.ModuleName), - // app.ConsensusKeeper, - // app.ValsetKeeper, - // ) + app.EvmKeeper = *evmmodulekeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[evmmoduletypes.StoreKey]), + nil, //TODO + nil, //TODO + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) // app.ValsetKeeper.SnapshotListeners = []valsetmoduletypes.OnSnapshotBuiltListener{ // app.EvmKeeper, // } @@ -655,10 +614,10 @@ func New( // appCodec, // keys[treasurymoduletypes.StoreKey], // memKeys[treasurymoduletypes.MemStoreKey], - // app.GetSubspace(schedulermoduletypes.ModuleName), + // app.GetSubspace("" /*schedulermoduletypes.ModuleName*/), // app.BankKeeper, // app.AccountKeeper, - // app.SchedulerKeeper, + // nil, // app.SchedulerKeeper, // ) // app.ScopedConsensusKeeper = scopedConsensusKeeper @@ -666,11 +625,8 @@ func New( govRouter := govv1beta1.NewRouter() govRouter. AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)) - // AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) - // AddRoute(evmmoduletypes.RouterKey, evm.NewReferenceChainReferenceIDProposalHandler(app.EvmKeeper)). - // AddRoute(gravitymoduletypes.RouterKey, gravitymodulekeeper.NewGravityProposalHandler(app.GravityKeeper)). - // AddRoute(treasurymoduletypes.RouterKey, treasurymodule.NewFeeProposalHandler(app.TreasuryKeeper)) + AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). + AddRoute(evmmoduletypes.RouterKey, evm.NewReferenceChainReferenceIDProposalHandler(app.EvmKeeper)) // Example of setting gov params: govKeeper := govkeeper.NewKeeper( @@ -778,14 +734,14 @@ func New( // NOTE: Any module instantiated in the module manager that is later modified // must be passed by reference here. - // evmModule := evm.NewAppModule(appCodec, app.EvmKeeper, app.AccountKeeper, app.BankKeeper) + evmModule := evm.NewAppModule(appCodec, app.EvmKeeper, app.AccountKeeper, app.BankKeeper) // consensusModule := consensusmodule.NewAppModule(appCodec, app.ConsensusKeeper, app.AccountKeeper, app.BankKeeper) // valsetModule := valsetmodule.NewAppModule(appCodec, app.ValsetKeeper, app.AccountKeeper, app.BankKeeper) // schedulerModule := schedulermodule.NewAppModule(appCodec, app.SchedulerKeeper, app.AccountKeeper, app.BankKeeper) // palomaModule := palomamodule.NewAppModule(appCodec, app.PalomaKeeper, app.AccountKeeper, app.BankKeeper) // gravityModule := gravitymodule.NewAppModule(appCodec, app.GravityKeeper, app.BankKeeper) // treasuryModule := treasurymodule.NewAppModule(appCodec, app.TreasuryKeeper, app.AccountKeeper, app.BankKeeper) - app.mm = module.NewManager( + app.ModuleManager = module.NewManager( genutil.NewAppModule( app.AccountKeeper, app.StakingKeeper, @@ -809,7 +765,7 @@ func New( // schedulerModule, // consensusModule, // valsetModule, - // evmModule, + evmModule, // gravityModule, // palomaModule, // treasuryModule, @@ -821,11 +777,23 @@ func New( consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper), ) + app.BasicModuleManager = module.NewBasicManagerFromManager( + app.ModuleManager, + map[string]module.AppModuleBasic{ + genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), + govtypes.ModuleName: gov.NewAppModuleBasic( + []govclient.ProposalHandler{ + paramsclient.ProposalHandler, + }, + ), + }) + app.BasicModuleManager.RegisterLegacyAminoCodec(legacyAmino) + app.BasicModuleManager.RegisterInterfaces(interfaceRegistry) // During begin block slashing happens after distr.BeginBlocker so that // there is nothing left over in the validator fee pool, so as to keep the // CanWithdrawInvariant invariant. // NOTE: staking module is required if HistoricalEntries param > 0 - app.mm.SetOrderBeginBlockers( + app.ModuleManager.SetOrderBeginBlockers( upgradetypes.ModuleName, capabilitytypes.ModuleName, minttypes.ModuleName, @@ -845,6 +813,8 @@ func New( genutiltypes.ModuleName, // valsetmoduletypes.ModuleName, // palomamoduletypes.ModuleName, + // wasm.ModuleName, + evmmoduletypes.ModuleName, wasmtypes.ModuleName, // evmmoduletypes.ModuleName, // gravitymoduletypes.ModuleName, @@ -856,7 +826,7 @@ func New( consensusparamtypes.ModuleName, ) - app.mm.SetOrderEndBlockers( + app.ModuleManager.SetOrderEndBlockers( crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, @@ -877,6 +847,8 @@ func New( genutiltypes.ModuleName, // valsetmoduletypes.ModuleName, // palomamoduletypes.ModuleName, + // wasm.ModuleName, + evmmoduletypes.ModuleName, wasmtypes.ModuleName, // evmmoduletypes.ModuleName, // gravitymoduletypes.ModuleName, @@ -893,7 +865,7 @@ func New( // NOTE: Capability module must occur first so that it can initialize any capabilities // so that other modules that want to create or claim capabilities afterwards in InitChain // can do so safely. - app.mm.SetOrderInitGenesis( + app.ModuleManager.SetOrderInitGenesis( capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, @@ -918,6 +890,8 @@ func New( ibcexported.ModuleName, icatypes.ModuleName, ibcfeetypes.ModuleName, + // wasm.ModuleName, + evmmoduletypes.ModuleName, wasmtypes.ModuleName, // evmmoduletypes.ModuleName, // gravitymoduletypes.ModuleName, @@ -925,9 +899,9 @@ func New( consensusparamtypes.ModuleName, ) - app.mm.RegisterInvariants(app.CrisisKeeper) + app.ModuleManager.RegisterInvariants(app.CrisisKeeper) app.configurator = module.NewConfigurator(appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) - app.mm.RegisterServices(app.configurator) + app.ModuleManager.RegisterServices(app.configurator) // RegisterUpgradeHandlers is used for registering any on-chain upgrades. // Make sure it's called after `app.ModuleManager` and `app.configurator` are @@ -944,7 +918,7 @@ func New( app.GetSubspace(authtypes.ModuleName), ), } - app.sm = module.NewSimulationManagerFromAppModules(app.mm.Modules, overrideModules) + app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules) app.sm.RegisterStoreDecoders() // initialize stores @@ -955,6 +929,8 @@ func New( // initialize BaseApp app.SetInitChainer(app.InitChainer) app.SetBeginBlocker(app.BeginBlocker) + app.SetPreBlocker(app.PreBlocker) + app.SetEndBlocker(app.EndBlocker) /*baseAnteHandler*/ _, err = ante.NewAnteHandler( @@ -1016,17 +992,17 @@ func (app *App) Name() string { return app.BaseApp.Name() } func (app App) GetBaseApp() *baseapp.BaseApp { return app.BaseApp } func (app *App) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { - return app.mm.PreBlock(ctx) + return app.ModuleManager.PreBlock(ctx) } // BeginBlocker application updates every begin block func (app *App) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) { - return app.mm.BeginBlock(ctx) + return app.ModuleManager.BeginBlock(ctx) } // EndBlocker application updates every end block func (app *App) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) { - return app.mm.EndBlock(ctx) + return app.ModuleManager.EndBlock(ctx) } // InitChainer application update at chain initialization @@ -1036,8 +1012,8 @@ func (app *App) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci. panic(err) } - app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) - return app.mm.InitGenesis(ctx, app.appCodec, genesisState) + app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap()) + return app.ModuleManager.InitGenesis(ctx, app.appCodec, genesisState) } // LoadHeight loads a particular height @@ -1119,7 +1095,7 @@ func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register grpc-gateway routes for all modules. - ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + app.BasicModuleManager.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) } // RegisterTxService implements the Application.RegisterTxService method. @@ -1179,7 +1155,7 @@ func (app *App) SimulationManager() *module.SimulationManager { // DefaultGenesis returns a default genesis from the registered AppModuleBasic's. func (app *App) DefaultGenesis() map[string]json.RawMessage { - return ModuleBasics.DefaultGenesis(app.appCodec) + return app.BasicModuleManager.DefaultGenesis(app.appCodec) } func (app *App) RegisterNodeService(clientCtx client.Context, cfg config.Config) { diff --git a/app/app_setup.go b/app/app_setup.go index 1b11f199..5c7f9982 100644 --- a/app/app_setup.go +++ b/app/app_setup.go @@ -97,7 +97,7 @@ func NewTestApp(t testing, isCheckTx bool) TestApp { ) if !isCheckTx { - genesisState := NewDefaultGenesisState(encCfg.Codec) + genesisState := app.DefaultGenesis() genesisState = genesisStateWithValSet(t, app, genesisState, valSet, []authtypes.GenesisAccount{acc}, balance) stateBytes, err := json.MarshalIndent(genesisState, "", " ") if err != nil { diff --git a/app/encoding.go b/app/encoding.go index 404584fe..bc5724fe 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -13,8 +13,8 @@ func MakeEncodingConfig() params.EncodingConfig { std.RegisterLegacyAminoCodec(encodingConfig.Amino) std.RegisterInterfaces(encodingConfig.InterfaceRegistry) - ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) - ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry) + // a.RegisterLegacyAminoCodec(encodingConfig.Amino) + // ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry) return encodingConfig } diff --git a/app/export.go b/app/export.go index a5277e39..15859751 100644 --- a/app/export.go +++ b/app/export.go @@ -26,7 +26,7 @@ func (app *App) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) } - genState, err := app.mm.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) + genState, err := app.ModuleManager.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) if err != nil { panic(err) } diff --git a/app/genesis.go b/app/genesis.go index 5bf0c1da..69e3fb36 100644 --- a/app/genesis.go +++ b/app/genesis.go @@ -2,8 +2,6 @@ package app import ( "encoding/json" - - "github.com/cosmos/cosmos-sdk/codec" ) // The genesis state of the blockchain is represented here as a map of raw json @@ -14,8 +12,3 @@ import ( // the ModuleBasicManager which populates json from each BasicModule // object provided to it during init. type GenesisState map[string]json.RawMessage - -// NewDefaultGenesisState generates the default state for the application. -func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState { - return ModuleBasics.DefaultGenesis(cdc) -} diff --git a/cmd/palomad/commands.go b/cmd/palomad/commands.go new file mode 100644 index 00000000..4eca01ee --- /dev/null +++ b/cmd/palomad/commands.go @@ -0,0 +1,180 @@ +package main + +import ( + "errors" + "io" + + tmcli "github.com/cometbft/cometbft/libs/cli" + "github.com/cosmos/cosmos-sdk/client/debug" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" + palomaapp "github.com/palomachain/paloma/app" + + cosmoslog "cosmossdk.io/log" + "cosmossdk.io/tools/confix/cmd" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/keys" + "github.com/cosmos/cosmos-sdk/client/rpc" + "github.com/cosmos/cosmos-sdk/client/snapshot" + "github.com/cosmos/cosmos-sdk/server" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + "github.com/cosmos/cosmos-sdk/types/module" + authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" + "github.com/cosmos/cosmos-sdk/x/crisis" + "github.com/palomachain/paloma/app" + "github.com/palomachain/paloma/app/params" + "github.com/spf13/cobra" + "github.com/spf13/viper" +) + +// appExport creates a new simapp (optionally at a given height) and exports state. +func appExport( + logger cosmoslog.Logger, + db dbm.DB, + traceStore io.Writer, + height int64, + forZeroHeight bool, + jailAllowedAddrs []string, + appOpts servertypes.AppOptions, + modulesToExport []string, +) (servertypes.ExportedApp, error) { + // this check is necessary as we use the flag in x/upgrade. + // we can exit more gracefully by checking the flag here. + homePath, ok := appOpts.Get(flags.FlagHome).(string) + if !ok || homePath == "" { + return servertypes.ExportedApp{}, errors.New("application home not set") + } + + viperAppOpts, ok := appOpts.(*viper.Viper) + if !ok { + return servertypes.ExportedApp{}, errors.New("appOpts is not viper.Viper") + } + + // overwrite the FlagInvCheckPeriod + viperAppOpts.Set(server.FlagInvCheckPeriod, 1) + appOpts = viperAppOpts + + var App *app.App + if height != -1 { + App = app.New(logger, db, traceStore, false, params.EncodingConfig{}, nil) + + if err := App.LoadHeight(height); err != nil { + return servertypes.ExportedApp{}, err + } + } else { + App = app.New(logger, db, traceStore, true, params.EncodingConfig{}, nil) + } + + return App.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) +} + +// newApp creates the application +func newApp( + logger cosmoslog.Logger, + db dbm.DB, + traceStore io.Writer, + appOpts servertypes.AppOptions, +) servertypes.Application { + //baseappOptions := server.DefaultBaseappOptions(appOpts) + + return app.New( + logger, db, traceStore, true, + params.EncodingConfig{}, nil, + ) +} + +func initRootCmd( + rootCmd *cobra.Command, + txConfig params.EncodingConfig, + interfaceRegistry codectypes.InterfaceRegistry, + appCodec params.EncodingConfig, + basicManager module.BasicManager, +) { + + rootCmd.AddCommand( + genutilcli.InitCmd(basicManager, palomaapp.DefaultNodeHome), + genesisCommand(txConfig, basicManager, appExport), + tmcli.NewCompletionCmd(rootCmd, true), + debug.Cmd(), + cmd.ConfigCommand(), + ) + + server.AddCommands(rootCmd, palomaapp.DefaultNodeHome, newApp, appExport, addModuleInitFlags) + + // add keybase, auxiliary RPC, query, genesis, and tx child commands + rootCmd.AddCommand( + server.StatusCommand(), + queryCommand(basicManager), + txCommand(basicManager), + keys.Commands(), + ) + rootCmd.AddCommand( + snapshot.Cmd(newApp), + ) +} + +// genesisCommand builds genesis-related `palomad genesis` command. Users may provide application specific commands as a parameter +func genesisCommand(encodingConfig params.EncodingConfig, basicManager module.BasicManager, appExport servertypes.AppExporter, cmds ...*cobra.Command) *cobra.Command { + cmd := genutilcli.GenesisCoreCommand(encodingConfig.TxConfig, basicManager, palomaapp.DefaultNodeHome) + + for _, sub_cmd := range cmds { + cmd.AddCommand(sub_cmd) + } + return cmd +} + +func addModuleInitFlags(startCmd *cobra.Command) { + crisis.AddModuleInitFlags(startCmd) +} + +func queryCommand(mm module.BasicManager) *cobra.Command { + cmd := &cobra.Command{ + Use: "query", + Aliases: []string{"q"}, + Short: "Querying subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + rpc.QueryEventForTxCmd(), + rpc.ValidatorCommand(), + server.QueryBlocksCmd(), + authcmd.QueryTxsByEventsCmd(), + authcmd.QueryTxCmd(), + ) + + mm.AddQueryCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + return cmd +} + +func txCommand(mm module.BasicManager) *cobra.Command { + cmd := &cobra.Command{ + Use: "tx", + Short: "Transactions sub-commands", + DisableFlagParsing: false, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + authcmd.GetSignCommand(), + authcmd.GetSignBatchCommand(), + authcmd.GetMultiSignCommand(), + authcmd.GetMultiSignBatchCmd(), + authcmd.GetValidateSignaturesCommand(), + authcmd.GetBroadcastCommand(), + authcmd.GetEncodeCommand(), + authcmd.GetDecodeCommand(), + ) + + mm.AddTxCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + return cmd +} diff --git a/cmd/palomad/config.go b/cmd/palomad/config.go new file mode 100644 index 00000000..24cdab31 --- /dev/null +++ b/cmd/palomad/config.go @@ -0,0 +1,13 @@ +package main + +import tmcfg "github.com/cometbft/cometbft/config" + +func initCometBFTConfig() *tmcfg.Config { + cfg := tmcfg.DefaultConfig() + + // these values put a higher strain on node memory + // cfg.P2P.MaxNumInboundPeers = 100 + // cfg.P2P.MaxNumOutboundPeers = 40 + + return cfg +} diff --git a/cmd/palomad/root.go b/cmd/palomad/root.go index 112c9f3b..78adc857 100644 --- a/cmd/palomad/root.go +++ b/cmd/palomad/root.go @@ -1,7 +1,6 @@ package main import ( - "errors" "fmt" "io" "log" @@ -12,27 +11,13 @@ import ( "time" cosmoslog "cosmossdk.io/log" - "cosmossdk.io/tools/confix/cmd" - dbm "github.com/cosmos/cosmos-db" - servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/spf13/viper" - - tmcfg "github.com/cometbft/cometbft/config" - tmcli "github.com/cometbft/cometbft/libs/cli" + db "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" - "github.com/cosmos/cosmos-sdk/client/debug" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/keys" - "github.com/cosmos/cosmos-sdk/client/rpc" - "github.com/cosmos/cosmos-sdk/client/snapshot" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/server" - "github.com/cosmos/cosmos-sdk/types/module" - authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" "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" "github.com/palomachain/paloma/app" palomaapp "github.com/palomachain/paloma/app" "github.com/palomachain/paloma/app/params" @@ -43,8 +28,9 @@ import ( func NewRootCmd() *cobra.Command { // set Bech32 address configuration params.SetAddressConfig() - encCfg := palomaapp.MakeEncodingConfig() + + tempApp := palomaapp.New(cosmoslog.NewNopLogger(), db.NewMemDB(), io.MultiWriter(), true, encCfg, db.OptionsMap{}) initClientCtx := client.Context{}. WithCodec(encCfg.Codec). WithInterfaceRegistry(encCfg.InterfaceRegistry). @@ -80,7 +66,7 @@ func NewRootCmd() *cobra.Command { } customAppTemplate, customAppConfig := initAppConfig() - customTMConfig := initTendermintConfig() + customTMConfig := initCometBFTConfig() if err := server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customTMConfig); err != nil { return err @@ -89,12 +75,7 @@ func NewRootCmd() *cobra.Command { return applyForcedConfigOptions(cmd) }, } - - ac := appCreator{ - encCfg: encCfg, - moduleManager: palomaapp.ModuleBasics, - } - initRootCmd(rootCmd, ac) + initRootCmd(rootCmd, encCfg, encCfg.InterfaceRegistry, encCfg, tempApp.BasicModuleManager) if err := overwriteFlagDefaults(rootCmd, map[string]string{ flags.FlagChainID: palomaapp.Name, @@ -156,16 +137,6 @@ func applyForcedConfigOptions(cmd *cobra.Command) error { return server.SetCmdServerContext(cmd, serverCtx) } -func initTendermintConfig() *tmcfg.Config { - cfg := tmcfg.DefaultConfig() - - // these values put a higher strain on node memory - // cfg.P2P.MaxNumInboundPeers = 100 - // cfg.P2P.MaxNumOutboundPeers = 40 - - return cfg -} - func rootPreRunE(cmd *cobra.Command, args []string) error { go func() { pprofListen := os.Getenv("PPROF_LISTEN") @@ -192,147 +163,3 @@ func rootPreRunE(cmd *cobra.Command, args []string) error { return nil } - -// appExport creates a new simapp (optionally at a given height) and exports state. -func appExport( - logger cosmoslog.Logger, - db dbm.DB, - traceStore io.Writer, - height int64, - forZeroHeight bool, - jailAllowedAddrs []string, - appOpts servertypes.AppOptions, - modulesToExport []string, -) (servertypes.ExportedApp, error) { - // this check is necessary as we use the flag in x/upgrade. - // we can exit more gracefully by checking the flag here. - homePath, ok := appOpts.Get(flags.FlagHome).(string) - if !ok || homePath == "" { - return servertypes.ExportedApp{}, errors.New("application home not set") - } - - viperAppOpts, ok := appOpts.(*viper.Viper) - if !ok { - return servertypes.ExportedApp{}, errors.New("appOpts is not viper.Viper") - } - - // overwrite the FlagInvCheckPeriod - viperAppOpts.Set(server.FlagInvCheckPeriod, 1) - appOpts = viperAppOpts - - var App *app.App - if height != -1 { - App = app.New(logger, db, traceStore, false, params.EncodingConfig{}, nil) - - if err := App.LoadHeight(height); err != nil { - return servertypes.ExportedApp{}, err - } - } else { - App = app.New(logger, db, traceStore, true, params.EncodingConfig{}, nil) - } - - return App.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) -} - -// newApp creates the application -func newApp( - logger cosmoslog.Logger, - db dbm.DB, - traceStore io.Writer, - appOpts servertypes.AppOptions, -) servertypes.Application { - //baseappOptions := server.DefaultBaseappOptions(appOpts) - - return app.New( - logger, db, traceStore, true, - params.EncodingConfig{}, nil, - ) -} - -func initRootCmd(rootCmd *cobra.Command, ac appCreator) { - rootCmd.AddCommand( - genutilcli.InitCmd(ac.moduleManager, palomaapp.DefaultNodeHome), - genesisCommand(ac.encCfg), - tmcli.NewCompletionCmd(rootCmd, true), - debug.Cmd(), - cmd.ConfigCommand(), - ) - - server.AddCommands(rootCmd, palomaapp.DefaultNodeHome, newApp, appExport, addModuleInitFlags) - - // add keybase, auxiliary RPC, query, and tx child commands - rootCmd.AddCommand( - server.StatusCommand(), - queryCommand(ac.moduleManager), - txCommand(ac.moduleManager), - keys.Commands(), - ) - - rootCmd.AddCommand( - snapshot.Cmd(newApp), - ) -} - -// genesisCommand builds genesis-related `palomad genesis` command. Users may provide application specific commands as a parameter -func genesisCommand(encodingConfig params.EncodingConfig, cmds ...*cobra.Command) *cobra.Command { - cmd := genutilcli.GenesisCoreCommand(encodingConfig.TxConfig, palomaapp.ModuleBasics, palomaapp.DefaultNodeHome) - - for _, sub_cmd := range cmds { - cmd.AddCommand(sub_cmd) - } - return cmd -} - -func addModuleInitFlags(startCmd *cobra.Command) { - crisis.AddModuleInitFlags(startCmd) -} - -func queryCommand(mm module.BasicManager) *cobra.Command { - cmd := &cobra.Command{ - Use: "query", - Aliases: []string{"q"}, - Short: "Querying subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - rpc.QueryEventForTxCmd(), - rpc.ValidatorCommand(), - server.QueryBlocksCmd(), - authcmd.QueryTxsByEventsCmd(), - authcmd.QueryTxCmd(), - ) - - mm.AddQueryCommands(cmd) - cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") - - return cmd -} - -func txCommand(mm module.BasicManager) *cobra.Command { - cmd := &cobra.Command{ - Use: "tx", - Short: "Transactions sub-commands", - DisableFlagParsing: false, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - authcmd.GetSignCommand(), - authcmd.GetSignBatchCommand(), - authcmd.GetMultiSignCommand(), - authcmd.GetMultiSignBatchCmd(), - authcmd.GetValidateSignaturesCommand(), - authcmd.GetBroadcastCommand(), - authcmd.GetEncodeCommand(), - authcmd.GetDecodeCommand(), - ) - - mm.AddTxCommands(cmd) - cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") - - return cmd -} diff --git a/go.mod b/go.mod index f625d881..cf284dd5 100644 --- a/go.mod +++ b/go.mod @@ -3,33 +3,34 @@ module github.com/palomachain/paloma go 1.21 require ( - cosmossdk.io/errors v1.0.0 // indirect + cosmossdk.io/errors v1.0.0 cosmossdk.io/math v1.2.0 github.com/CosmWasm/wasmd v0.50.0-rc.0 github.com/CosmWasm/wasmvm v1.5.0 // indirect github.com/VolumeFi/whoops v0.7.2 github.com/cometbft/cometbft v0.38.1 - github.com/cometbft/cometbft-db v0.8.0 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect + github.com/cometbft/cometbft-db v0.8.0 + github.com/cosmos/cosmos-proto v1.0.0-beta.3 github.com/cosmos/cosmos-sdk v0.50.1 github.com/cosmos/gogoproto v1.4.11 - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/gorilla/mux v1.8.1 // indirect - github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect + github.com/gogo/protobuf v1.3.2 + github.com/golang/protobuf v1.5.3 + github.com/gorilla/mux v1.8.1 + github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/huandu/skiplist v1.2.0 - github.com/onsi/gomega v1.28.0 // indirect + github.com/onsi/gomega v1.29.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/cast v1.5.1 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.17.0 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a // indirect - google.golang.org/grpc v1.59.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + golang.org/x/exp v0.0.0-20231006140011-7918f672742d + golang.org/x/mod v0.13.0 + google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a + google.golang.org/grpc v1.59.0 + google.golang.org/protobuf v1.31.0 + gopkg.in/yaml.v2 v2.4.0 ) require ( @@ -39,6 +40,7 @@ require ( cosmossdk.io/x/upgrade v0.1.0 github.com/cosmos/cosmos-db v1.0.0 github.com/cosmos/ibc-go/v8 v8.0.0 + github.com/ethereum/go-ethereum v1.13.5 ) require ( @@ -46,26 +48,32 @@ require ( github.com/Microsoft/go-winio v0.6.1 // indirect github.com/bits-and-blooms/bitset v1.8.0 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/consensys/bavard v0.1.13 // indirect + github.com/consensys/gnark-crypto v0.12.1 // indirect + github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect github.com/creachadair/atomicfile v0.3.1 // indirect github.com/creachadair/tomledit v0.0.24 // indirect - github.com/distribution/reference v0.5.0 // indirect github.com/emicklei/dot v1.6.0 // indirect + github.com/ethereum/c-kzg-4844 v0.4.0 // indirect github.com/fatih/color v1.15.0 // indirect - github.com/google/gofuzz v1.2.0 // indirect + github.com/gofrs/flock v0.8.1 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-metrics v0.5.1 // indirect github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect + github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/rivo/uniseg v0.2.0 // indirect github.com/sagikazarmark/locafero v0.3.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect + github.com/supranational/blst v0.3.11 // indirect go.uber.org/multierr v1.11.0 // indirect gotest.tools/v3 v3.5.1 // indirect + rsc.io/tmplfunc v0.0.3 // indirect ) require ( @@ -84,6 +92,8 @@ require ( github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect github.com/DataDog/zstd v1.5.5 // indirect + github.com/StackExchange/wmi v1.2.1 // indirect + github.com/VictoriaMetrics/fastcache v1.12.1 // indirect github.com/aws/aws-sdk-go v1.44.224 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect @@ -107,6 +117,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/deckarep/golang-set/v2 v2.1.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect @@ -120,6 +131,10 @@ 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.3.0 // indirect + github.com/go-ole/go-ole v1.2.5 // indirect + github.com/go-stack/stack v1.8.1 // indirect + github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/golang/glog v1.1.2 // indirect @@ -129,6 +144,7 @@ require ( github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect + github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.3.1 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect @@ -145,6 +161,8 @@ require ( github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect + github.com/holiman/bloomfilter/v2 v2.0.3 // indirect + github.com/holiman/uint256 v1.2.3 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect @@ -159,11 +177,14 @@ require ( github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.13 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/onsi/ginkgo/v2 v2.13.1 github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect github.com/pkg/errors v0.9.1 // indirect @@ -177,12 +198,15 @@ require ( github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/spf13/afero v1.10.0 // indirect github.com/stretchr/objx v0.5.0 // 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.7.0 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect @@ -192,9 +216,10 @@ require ( golang.org/x/net v0.17.0 // indirect golang.org/x/oauth2 v0.12.0 // indirect golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.13.0 // indirect + golang.org/x/sys v0.14.0 // indirect golang.org/x/term v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect + golang.org/x/tools v0.14.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.143.0 // indirect google.golang.org/appengine v1.6.7 // indirect @@ -213,8 +238,6 @@ replace ( // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 // Link to op-geth, which is built on top of go-ethereum github.com/ethereum/go-ethereum v1.11.6 => github.com/ethereum-optimism/op-geth v1.101106.0-rc.2 - // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. - // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.1 // Downgraded to avoid bugs in following commits which caused simulations to fail. github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 diff --git a/go.sum b/go.sum index df3347e8..ee04293c 100644 --- a/go.sum +++ b/go.sum @@ -244,6 +244,10 @@ 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= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= +github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= +github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= +github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/VolumeFi/whoops v0.7.2 h1:BMxDRo1N14QPPkruA9tsqivpWFXlujvFR+CtWGeQ0cc= @@ -256,6 +260,7 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -351,6 +356,10 @@ github.com/cometbft/cometbft v0.38.1 h1:hflfGk/VrPapfHco3rgCqn2YpOglAqJshSdyrM2z github.com/cometbft/cometbft v0.38.1/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= 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/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= +github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= +github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= +github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= 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= @@ -389,6 +398,8 @@ github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5X 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.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA= +github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q= github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU= github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ= @@ -401,6 +412,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs 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/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= +github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= @@ -445,6 +458,10 @@ 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/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= +github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= +github.com/ethereum/go-ethereum v1.13.5 h1:U6TCRciCqZRe4FPXmy1sMGxTfuk8P7u2UoinF3VbaFk= +github.com/ethereum/go-ethereum v1.13.5/go.mod h1:yMTu38GSuyxaYzQMViqNmQ1s3cE84abZexQmTgenWk0= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= @@ -488,6 +505,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.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-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY= +github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= @@ -497,6 +519,10 @@ github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= +github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= @@ -510,6 +536,8 @@ github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MG github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= +github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= @@ -613,9 +641,12 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= 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/pprof v0.0.0-20230228050547-1710fef4ab10 h1:CqYfpuYIjnlNxM3msdyPRKabhXZWbKjf3Q8BWROFBso= +github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= +github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -709,6 +740,10 @@ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= +github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= +github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= +github.com/holiman/uint256 v1.2.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o= +github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= @@ -803,6 +838,9 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= +github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= @@ -822,6 +860,9 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= +github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= +github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -853,17 +894,23 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= 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/ginkgo/v2 v2.13.1 h1:LNGfMbR2OVGBfXjvRZIZ2YCTQdGKtPLvuI1rMCCj3OU= +github.com/onsi/ginkgo/v2 v2.13.1/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM= 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.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c= github.com/onsi/gomega v1.28.0/go.mod h1:A1H2JE76sI14WIP57LMKj7FVfCHx3g3BcZVjJG8bjX8= +github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= +github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= 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= @@ -944,6 +991,8 @@ github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3c github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -968,6 +1017,8 @@ github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0 github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= +github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -1026,12 +1077,18 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= +github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= 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= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= @@ -1280,6 +1337,7 @@ golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1361,9 +1419,12 @@ golang.org/x/sys v0.1.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.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1753,6 +1814,8 @@ 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 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= +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.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/proto/palomachain/paloma/evm/params.proto b/proto/palomachain/paloma/evm/params.proto index 43373e8f..3ede5c7f 100644 --- a/proto/palomachain/paloma/evm/params.proto +++ b/proto/palomachain/paloma/evm/params.proto @@ -7,6 +7,5 @@ option go_package = "github.com/palomachain/paloma/x/evm/types"; // Params defines the parameters for the module. message Params { - option (gogoproto.goproto_stringer) = false; } diff --git a/proto/palomachain/paloma/evm/tx.proto b/proto/palomachain/paloma/evm/tx.proto index 384decf1..6add11c4 100644 --- a/proto/palomachain/paloma/evm/tx.proto +++ b/proto/palomachain/paloma/evm/tx.proto @@ -2,8 +2,9 @@ syntax = "proto3"; package palomachain.paloma.evm; import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; import "palomachain/paloma/valset/common.proto"; - option go_package = "github.com/palomachain/paloma/x/evm/types"; service Msg { @@ -31,3 +32,4 @@ message MsgRemoveSmartContractDeploymentRequest { palomachain.paloma.valset.MsgMetadata metadata = 4 [(gogoproto.nullable) = false]; } message RemoveSmartContractDeploymentResponse {} + diff --git a/proto/palomachain/paloma/treasury/params.proto b/proto/palomachain/paloma/treasury/params.proto index bb58d5b0..4c8473ad 100644 --- a/proto/palomachain/paloma/treasury/params.proto +++ b/proto/palomachain/paloma/treasury/params.proto @@ -7,6 +7,5 @@ option go_package = "github.com/palomachain/paloma/x/treasury/types"; // Params defines the parameters for the module. message Params { - option (gogoproto.goproto_stringer) = false; - + option (gogoproto.goproto_stringer) = false; } \ No newline at end of file diff --git a/proto/palomachain/paloma/valset/snapshot.proto b/proto/palomachain/paloma/valset/snapshot.proto index 5326def8..b807057a 100644 --- a/proto/palomachain/paloma/valset/snapshot.proto +++ b/proto/palomachain/paloma/valset/snapshot.proto @@ -11,7 +11,7 @@ option go_package = "github.com/palomachain/paloma/x/valset/types"; message Validator { bytes shareCount = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; @@ -41,7 +41,7 @@ message Snapshot { bytes totalShares = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; diff --git a/util/keeper/ifaces.go b/util/keeper/ifaces.go index 6010e137..81b5f824 100644 --- a/util/keeper/ifaces.go +++ b/util/keeper/ifaces.go @@ -1,11 +1,13 @@ package keeper -import "github.com/cosmos/cosmos-sdk/codec" +import ( + "github.com/cosmos/gogoproto/proto" +) type ProtoUnmarshaler interface { - Unmarshal(bz []byte, ptr codec.ProtoMarshaler) error + Unmarshal(bz []byte, ptr proto.Message) error } type ProtoMarshaler interface { - Marshal(ptr codec.ProtoMarshaler) ([]byte, error) + Marshal(ptr proto.Message) ([]byte, error) } diff --git a/util/keeper/iter.go b/util/keeper/iter.go index a2c5e2ac..68dbbc24 100644 --- a/util/keeper/iter.go +++ b/util/keeper/iter.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/gogoproto/proto" ) -func IterAll[T proto.Message](store storetypes.KVStore, pu proto.Unmarshaler) ([][]byte, []T, error) { +func IterAll[T proto.Message](store storetypes.KVStore, pu ProtoUnmarshaler) ([][]byte, []T, error) { res := []T{} keys := [][]byte{} err := IterAllFnc(store, pu, func(key []byte, val T) bool { @@ -21,7 +21,7 @@ func IterAll[T proto.Message](store storetypes.KVStore, pu proto.Unmarshaler) ([ return keys, res, nil } -func IterAllRaw(store storetypes.KVStore, pu proto.Unmarshaler) (keys [][]byte, values [][]byte, _err error) { +func IterAllRaw(store storetypes.KVStore, pu ProtoUnmarshaler) (keys [][]byte, values [][]byte, _err error) { iterator := store.Iterator(nil, nil) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -31,7 +31,7 @@ func IterAllRaw(store storetypes.KVStore, pu proto.Unmarshaler) (keys [][]byte, return } -func IterAllFnc[T proto.Message](store storetypes.KVStore, pu proto.Unmarshaler, fnc func([]byte, T) bool) error { +func IterAllFnc[T proto.Message](store storetypes.KVStore, pu ProtoUnmarshaler, fnc func([]byte, T) bool) error { res := []T{} iterator := store.Iterator(nil, nil) defer iterator.Close() @@ -45,7 +45,7 @@ func IterAllFnc[T proto.Message](store storetypes.KVStore, pu proto.Unmarshaler, v := reflect.New(va.Type().Elem()) va.Set(v) - if err := pu.Unmarshal(iterData); err != nil { + if err := pu.Unmarshal(iterData, val); err != nil { return err } if !fnc(iterator.Key(), val) { diff --git a/util/keeper/iter_test.go b/util/keeper/iter_test.go index ca75a16e..7b93acf1 100644 --- a/util/keeper/iter_test.go +++ b/util/keeper/iter_test.go @@ -4,7 +4,7 @@ import ( "testing" // using any test that that extends protobuf - "github.com/cosmos/gogoproto/proto" + "github.com/palomachain/paloma/util/keeper" "github.com/palomachain/paloma/x/consensus/types" "github.com/stretchr/testify/assert" @@ -31,7 +31,7 @@ func TestIteration(t *testing.T) { store.Set([]byte{byte(i)}, bz) } - _, all, err := keeper.IterAll[*types.SimpleMessage](store, proto.Unmarshaler(nil)) + _, all, err := keeper.IterAll[*types.SimpleMessage](store, types.ModuleCdc) assert.NoError(t, err) assert.Len(t, all, 3) assert.Equal(t, inData, all) @@ -42,6 +42,6 @@ func TestIterationWithError(t *testing.T) { store := ms.GetKVStore(kv) store.Set([]byte("1"), []byte("something that's can't be unmarshalled")) - _, _, err := keeper.IterAll[*types.SimpleMessage](store, proto.Unmarshaler(nil)) + _, _, err := keeper.IterAll[*types.SimpleMessage](store, types.ModuleCdc) assert.Error(t, err) } diff --git a/util/keeper/store_getter.go b/util/keeper/store_getter.go index 6b610a41..6a2ec963 100644 --- a/util/keeper/store_getter.go +++ b/util/keeper/store_getter.go @@ -1,22 +1,23 @@ package keeper import ( + "context" + storetypes "cosmossdk.io/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" ) type StoreGetter interface { - Store(ctx sdk.Context) storetypes.KVStore + Store(ctx context.Context) storetypes.KVStore } -type StoreGetterFn func(ctx sdk.Context) storetypes.KVStore +type StoreGetterFn func(ctx context.Context) storetypes.KVStore -func (s StoreGetterFn) Store(ctx sdk.Context) storetypes.KVStore { +func (s StoreGetterFn) Store(ctx context.Context) storetypes.KVStore { return s(ctx) } func SimpleStoreGetter(s storetypes.KVStore) StoreGetter { - return StoreGetterFn(func(sdk.Context) storetypes.KVStore { + return StoreGetterFn(func(context.Context) storetypes.KVStore { return s }) } diff --git a/util/liblog/liblog.go b/util/liblog/liblog.go index 379f4fbd..d0024506 100644 --- a/util/liblog/liblog.go +++ b/util/liblog/liblog.go @@ -11,7 +11,7 @@ type Logr interface { } func FromSDKLogger(l log.Logger) Logr { - return &lgwr{l: l} + return &lgwr{l} } func (l *lgwr) Impl() interface{} { return l @@ -21,6 +21,11 @@ type lgwr struct { l log.Logger } +// Impl implements Logr. +func (*lgwr) Impl() any { + return log.NewNopLogger() +} + func (l *lgwr) Debug(msg string, keyvals ...interface{}) { l.l.Debug(msg, keyvals...) } diff --git a/x/consensus/types/tx.pb.go b/x/consensus/types/tx.pb.go index 10831ef2..b743d925 100644 --- a/x/consensus/types/tx.pb.go +++ b/x/consensus/types/tx.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - types1 "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -18,14 +14,15 @@ import ( 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 - _ = fmt.Errorf - _ = math.Inf -) +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. @@ -45,11 +42,9 @@ func (*MsgAddMessagesSignatures) ProtoMessage() {} func (*MsgAddMessagesSignatures) Descriptor() ([]byte, []int) { return fileDescriptor_9a053a9b8cda05fe, []int{0} } - func (m *MsgAddMessagesSignatures) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgAddMessagesSignatures) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgAddMessagesSignatures.Marshal(b, m, deterministic) @@ -62,15 +57,12 @@ func (m *MsgAddMessagesSignatures) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } - func (m *MsgAddMessagesSignatures) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgAddMessagesSignatures.Merge(m, src) } - func (m *MsgAddMessagesSignatures) XXX_Size() int { return m.Size() } - func (m *MsgAddMessagesSignatures) XXX_DiscardUnknown() { xxx_messageInfo_MsgAddMessagesSignatures.DiscardUnknown(m) } @@ -112,11 +104,9 @@ func (*ConsensusMessageSignature) ProtoMessage() {} func (*ConsensusMessageSignature) Descriptor() ([]byte, []int) { return fileDescriptor_9a053a9b8cda05fe, []int{1} } - func (m *ConsensusMessageSignature) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *ConsensusMessageSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ConsensusMessageSignature.Marshal(b, m, deterministic) @@ -129,15 +119,12 @@ func (m *ConsensusMessageSignature) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } - func (m *ConsensusMessageSignature) XXX_Merge(src proto.Message) { xxx_messageInfo_ConsensusMessageSignature.Merge(m, src) } - func (m *ConsensusMessageSignature) XXX_Size() int { return m.Size() } - func (m *ConsensusMessageSignature) XXX_DiscardUnknown() { xxx_messageInfo_ConsensusMessageSignature.DiscardUnknown(m) } @@ -172,7 +159,8 @@ func (m *ConsensusMessageSignature) GetSignedByAddress() string { return "" } -type MsgAddMessagesSignaturesResponse struct{} +type MsgAddMessagesSignaturesResponse struct { +} func (m *MsgAddMessagesSignaturesResponse) Reset() { *m = MsgAddMessagesSignaturesResponse{} } func (m *MsgAddMessagesSignaturesResponse) String() string { return proto.CompactTextString(m) } @@ -180,11 +168,9 @@ func (*MsgAddMessagesSignaturesResponse) ProtoMessage() {} func (*MsgAddMessagesSignaturesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_9a053a9b8cda05fe, []int{2} } - func (m *MsgAddMessagesSignaturesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgAddMessagesSignaturesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgAddMessagesSignaturesResponse.Marshal(b, m, deterministic) @@ -197,15 +183,12 @@ func (m *MsgAddMessagesSignaturesResponse) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } - func (m *MsgAddMessagesSignaturesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgAddMessagesSignaturesResponse.Merge(m, src) } - func (m *MsgAddMessagesSignaturesResponse) XXX_Size() int { return m.Size() } - func (m *MsgAddMessagesSignaturesResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgAddMessagesSignaturesResponse.DiscardUnknown(m) } @@ -225,11 +208,9 @@ func (*MsgDeleteJob) ProtoMessage() {} func (*MsgDeleteJob) Descriptor() ([]byte, []int) { return fileDescriptor_9a053a9b8cda05fe, []int{3} } - func (m *MsgDeleteJob) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgDeleteJob) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgDeleteJob.Marshal(b, m, deterministic) @@ -242,15 +223,12 @@ func (m *MsgDeleteJob) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } - func (m *MsgDeleteJob) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgDeleteJob.Merge(m, src) } - func (m *MsgDeleteJob) XXX_Size() int { return m.Size() } - func (m *MsgDeleteJob) XXX_DiscardUnknown() { xxx_messageInfo_MsgDeleteJob.DiscardUnknown(m) } @@ -286,7 +264,8 @@ func (m *MsgDeleteJob) GetMetadata() types.MsgMetadata { return types.MsgMetadata{} } -type MsgDeleteJobResponse struct{} +type MsgDeleteJobResponse struct { +} func (m *MsgDeleteJobResponse) Reset() { *m = MsgDeleteJobResponse{} } func (m *MsgDeleteJobResponse) String() string { return proto.CompactTextString(m) } @@ -294,11 +273,9 @@ func (*MsgDeleteJobResponse) ProtoMessage() {} func (*MsgDeleteJobResponse) Descriptor() ([]byte, []int) { return fileDescriptor_9a053a9b8cda05fe, []int{4} } - func (m *MsgDeleteJobResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgDeleteJobResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgDeleteJobResponse.Marshal(b, m, deterministic) @@ -311,15 +288,12 @@ func (m *MsgDeleteJobResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } - func (m *MsgDeleteJobResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgDeleteJobResponse.Merge(m, src) } - func (m *MsgDeleteJobResponse) XXX_Size() int { return m.Size() } - func (m *MsgDeleteJobResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgDeleteJobResponse.DiscardUnknown(m) } @@ -340,11 +314,9 @@ func (*MsgAddEvidence) ProtoMessage() {} func (*MsgAddEvidence) Descriptor() ([]byte, []int) { return fileDescriptor_9a053a9b8cda05fe, []int{5} } - func (m *MsgAddEvidence) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgAddEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgAddEvidence.Marshal(b, m, deterministic) @@ -357,15 +329,12 @@ func (m *MsgAddEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } - func (m *MsgAddEvidence) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgAddEvidence.Merge(m, src) } - func (m *MsgAddEvidence) XXX_Size() int { return m.Size() } - func (m *MsgAddEvidence) XXX_DiscardUnknown() { xxx_messageInfo_MsgAddEvidence.DiscardUnknown(m) } @@ -408,7 +377,8 @@ func (m *MsgAddEvidence) GetMetadata() types.MsgMetadata { return types.MsgMetadata{} } -type MsgAddEvidenceResponse struct{} +type MsgAddEvidenceResponse struct { +} func (m *MsgAddEvidenceResponse) Reset() { *m = MsgAddEvidenceResponse{} } func (m *MsgAddEvidenceResponse) String() string { return proto.CompactTextString(m) } @@ -416,11 +386,9 @@ func (*MsgAddEvidenceResponse) ProtoMessage() {} func (*MsgAddEvidenceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_9a053a9b8cda05fe, []int{6} } - func (m *MsgAddEvidenceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgAddEvidenceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgAddEvidenceResponse.Marshal(b, m, deterministic) @@ -433,15 +401,12 @@ func (m *MsgAddEvidenceResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } - func (m *MsgAddEvidenceResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgAddEvidenceResponse.Merge(m, src) } - func (m *MsgAddEvidenceResponse) XXX_Size() int { return m.Size() } - func (m *MsgAddEvidenceResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgAddEvidenceResponse.DiscardUnknown(m) } @@ -462,11 +427,9 @@ func (*MsgSetPublicAccessData) ProtoMessage() {} func (*MsgSetPublicAccessData) Descriptor() ([]byte, []int) { return fileDescriptor_9a053a9b8cda05fe, []int{7} } - func (m *MsgSetPublicAccessData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgSetPublicAccessData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgSetPublicAccessData.Marshal(b, m, deterministic) @@ -479,15 +442,12 @@ func (m *MsgSetPublicAccessData) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } - func (m *MsgSetPublicAccessData) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgSetPublicAccessData.Merge(m, src) } - func (m *MsgSetPublicAccessData) XXX_Size() int { return m.Size() } - func (m *MsgSetPublicAccessData) XXX_DiscardUnknown() { xxx_messageInfo_MsgSetPublicAccessData.DiscardUnknown(m) } @@ -530,7 +490,8 @@ func (m *MsgSetPublicAccessData) GetMetadata() types.MsgMetadata { return types.MsgMetadata{} } -type MsgSetPublicAccessDataResponse struct{} +type MsgSetPublicAccessDataResponse struct { +} func (m *MsgSetPublicAccessDataResponse) Reset() { *m = MsgSetPublicAccessDataResponse{} } func (m *MsgSetPublicAccessDataResponse) String() string { return proto.CompactTextString(m) } @@ -538,11 +499,9 @@ func (*MsgSetPublicAccessDataResponse) ProtoMessage() {} func (*MsgSetPublicAccessDataResponse) Descriptor() ([]byte, []int) { return fileDescriptor_9a053a9b8cda05fe, []int{8} } - func (m *MsgSetPublicAccessDataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgSetPublicAccessDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgSetPublicAccessDataResponse.Marshal(b, m, deterministic) @@ -555,15 +514,12 @@ func (m *MsgSetPublicAccessDataResponse) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } - func (m *MsgSetPublicAccessDataResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgSetPublicAccessDataResponse.Merge(m, src) } - func (m *MsgSetPublicAccessDataResponse) XXX_Size() int { return m.Size() } - func (m *MsgSetPublicAccessDataResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgSetPublicAccessDataResponse.DiscardUnknown(m) } @@ -584,11 +540,9 @@ func (*MsgSetErrorData) ProtoMessage() {} func (*MsgSetErrorData) Descriptor() ([]byte, []int) { return fileDescriptor_9a053a9b8cda05fe, []int{9} } - func (m *MsgSetErrorData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgSetErrorData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgSetErrorData.Marshal(b, m, deterministic) @@ -601,15 +555,12 @@ func (m *MsgSetErrorData) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } - func (m *MsgSetErrorData) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgSetErrorData.Merge(m, src) } - func (m *MsgSetErrorData) XXX_Size() int { return m.Size() } - func (m *MsgSetErrorData) XXX_DiscardUnknown() { xxx_messageInfo_MsgSetErrorData.DiscardUnknown(m) } @@ -652,7 +603,8 @@ func (m *MsgSetErrorData) GetMetadata() types.MsgMetadata { return types.MsgMetadata{} } -type MsgSetErrorDataResponse struct{} +type MsgSetErrorDataResponse struct { +} func (m *MsgSetErrorDataResponse) Reset() { *m = MsgSetErrorDataResponse{} } func (m *MsgSetErrorDataResponse) String() string { return proto.CompactTextString(m) } @@ -660,11 +612,9 @@ func (*MsgSetErrorDataResponse) ProtoMessage() {} func (*MsgSetErrorDataResponse) Descriptor() ([]byte, []int) { return fileDescriptor_9a053a9b8cda05fe, []int{10} } - func (m *MsgSetErrorDataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgSetErrorDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgSetErrorDataResponse.Marshal(b, m, deterministic) @@ -677,15 +627,12 @@ func (m *MsgSetErrorDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } - func (m *MsgSetErrorDataResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgSetErrorDataResponse.Merge(m, src) } - func (m *MsgSetErrorDataResponse) XXX_Size() int { return m.Size() } - func (m *MsgSetErrorDataResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgSetErrorDataResponse.DiscardUnknown(m) } @@ -756,10 +703,8 @@ var fileDescriptor_9a053a9b8cda05fe = []byte{ } // Reference imports to suppress errors if they are not otherwise used. -var ( - _ context.Context - _ grpc.ClientConn -) +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. @@ -839,24 +784,21 @@ type MsgServer interface { } // UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct{} +type UnimplementedMsgServer struct { +} func (*UnimplementedMsgServer) AddMessagesSignatures(ctx context.Context, req *MsgAddMessagesSignatures) (*MsgAddMessagesSignaturesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddMessagesSignatures not implemented") } - func (*UnimplementedMsgServer) DeleteJob(ctx context.Context, req *MsgDeleteJob) (*MsgDeleteJobResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteJob not implemented") } - func (*UnimplementedMsgServer) AddEvidence(ctx context.Context, req *MsgAddEvidence) (*MsgAddEvidenceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddEvidence not implemented") } - func (*UnimplementedMsgServer) SetPublicAccessData(ctx context.Context, req *MsgSetPublicAccessData) (*MsgSetPublicAccessDataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetPublicAccessData not implemented") } - func (*UnimplementedMsgServer) SetErrorData(ctx context.Context, req *MsgSetErrorData) (*MsgSetErrorDataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetErrorData not implemented") } @@ -1447,7 +1389,6 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *MsgAddMessagesSignatures) Size() (n int) { if m == nil { return 0 @@ -1641,11 +1582,9 @@ func (m *MsgSetErrorDataResponse) Size() (n int) { 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 *MsgAddMessagesSignatures) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1795,7 +1734,6 @@ func (m *MsgAddMessagesSignatures) Unmarshal(dAtA []byte) error { } return nil } - func (m *ConsensusMessageSignature) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1963,7 +1901,6 @@ func (m *ConsensusMessageSignature) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgAddMessagesSignaturesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2014,7 +1951,6 @@ func (m *MsgAddMessagesSignaturesResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgDeleteJob) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2181,7 +2117,6 @@ func (m *MsgDeleteJob) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgDeleteJobResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2232,7 +2167,6 @@ func (m *MsgDeleteJobResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgAddEvidence) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2435,7 +2369,6 @@ func (m *MsgAddEvidence) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgAddEvidenceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2486,7 +2419,6 @@ func (m *MsgAddEvidenceResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgSetPublicAccessData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2687,7 +2619,6 @@ func (m *MsgSetPublicAccessData) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgSetPublicAccessDataResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2738,7 +2669,6 @@ func (m *MsgSetPublicAccessDataResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgSetErrorData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2939,7 +2869,6 @@ func (m *MsgSetErrorData) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgSetErrorDataResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2990,7 +2919,6 @@ func (m *MsgSetErrorDataResponse) Unmarshal(dAtA []byte) error { } return nil } - func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/evm/genesis.go b/x/evm/genesis.go index f70e8787..4e079c72 100644 --- a/x/evm/genesis.go +++ b/x/evm/genesis.go @@ -1,12 +1,12 @@ package evm import ( + "context" "errors" "fmt" "math/big" "github.com/VolumeFi/whoops" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" keeperutil "github.com/palomachain/paloma/util/keeper" "github.com/palomachain/paloma/x/evm/keeper" @@ -15,7 +15,7 @@ import ( // InitGenesis initializes the capability module's state from a provided genesis // state. -func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { +func InitGenesis(ctx context.Context, k keeper.Keeper, genState types.GenesisState) { k.SetParams(ctx, genState.Params) for _, chainInfo := range genState.GetChains() { @@ -67,7 +67,7 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) } // ExportGenesis returns the capability module's exported genesis. -func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { +func ExportGenesis(ctx context.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) diff --git a/x/evm/genesis_test.go b/x/evm/genesis_test.go index 29167118..e7c955f0 100644 --- a/x/evm/genesis_test.go +++ b/x/evm/genesis_test.go @@ -3,7 +3,6 @@ package evm_test import ( "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" g "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -45,9 +44,7 @@ var _ = g.Describe("genesis", func() { g.BeforeEach(func() { t := g.GinkgoT() a = app.NewTestApp(t, false) - ctx = a.NewContext(false, tmproto.Header{ - Height: 5, - }) + ctx = a.NewContext(false).WithBlockHeight(5) k = &a.EvmKeeper }) diff --git a/x/evm/keeper/attest.go b/x/evm/keeper/attest.go index 641fec8d..f83172da 100644 --- a/x/evm/keeper/attest.go +++ b/x/evm/keeper/attest.go @@ -1,6 +1,7 @@ package keeper import ( + "context" "crypto/sha256" "encoding/hex" "errors" @@ -8,8 +9,10 @@ import ( "math/big" sdkmath "cosmossdk.io/math" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" "github.com/VolumeFi/whoops" - "github.com/cosmos/cosmos-sdk/store/prefix" + "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" @@ -43,7 +46,7 @@ func (c *consensusPower) setTotal(total sdkmath.Int) { func (c *consensusPower) add(power sdkmath.Int) { var zero sdkmath.Int if c.runningSum == zero { - c.runningSum = sdk.NewInt(0) + c.runningSum = sdkmath.NewInt(0) } c.runningSum = c.runningSum.Add(power) } @@ -58,13 +61,14 @@ func (c *consensusPower) consensus() bool { === 3 * sum >= totalPower * 2 */ - return c.runningSum.Mul(sdk.NewInt(3)).GTE( - c.totalPower.Mul(sdk.NewInt(2)), + return c.runningSum.Mul(sdkmath.NewInt(3)).GTE( + c.totalPower.Mul(sdkmath.NewInt(2)), ) } -func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensustypes.QueuedSignedMessageI) (err error) { - logger := k.Logger(ctx).WithFields( +func (k Keeper) attestRouter(ctx context.Context, q consensus.Queuer, msg consensustypes.QueuedSignedMessageI) (err error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + logger := k.Logger(sdkCtx).WithFields( "component", "attest-router", "msg-id", msg.GetId(), "msg-nonce", msg.Nonce()) @@ -74,7 +78,7 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust return nil } - ctx, writeCache := ctx.CacheContext() + ctx, writeCache := sdkCtx.CacheContext() defer func() { if err != nil { logger.WithError(err).Error("failed to attest. Skipping writeback.") @@ -89,7 +93,7 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust return err } - evidence, err := k.findEvidenceThatWon(ctx, msg.GetEvidence()) + evidence, err := k.findEvidenceThatWon(sdkCtx, msg.GetEvidence()) if err != nil { if errors.Is(err, ErrConsensusNotAchieved) { logger.WithError(err).Error("consensus not achieved") @@ -102,7 +106,7 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust defer func() { // given that there was enough evidence for a proof, regardless of the outcome, // we should remove this from the queue as there isn't much that we can do about it. - if err := q.Remove(ctx, msg.GetId()); err != nil { + if err := q.Remove(sdkCtx, msg.GetId()); err != nil { logger.WithError(err).Error("error removing message, attestRouter") } }() @@ -113,7 +117,7 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust case *types.TxExecutedProof: tx, err := winner.GetTX() if err == nil { - k.setTxAsAlreadyProcessed(ctx, tx) + k.setTxAsAlreadyProcessed(sdkCtx, tx) } } }() @@ -130,7 +134,7 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust // regardless of the outcome, this upload/deployment should be removed id := origMsg.TransferERC20Ownership.GetSmartContractID() logger.With("smart-contract-id", id).Debug("removing deployment.") - k.DeleteSmartContractDeploymentByContractID(ctx, id, chainReferenceID) + k.DeleteSmartContractDeploymentByContractID(sdkCtx, id, chainReferenceID) }() switch winner := evidence.(type) { case *types.TxExecutedProof: @@ -140,7 +144,7 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust logger.WithError(err).Error("Failed to get TX") return err } - if k.isTxProcessed(ctx, tx) { + if k.isTxProcessed(sdkCtx, tx) { // somebody submitted the old transaction that was already processed? // punish those validators!! logger.WithError(err).Error("TX already processed") @@ -154,7 +158,7 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust return err } - deployment, _ := k.getSmartContractDeploymentByContractID(ctx, origMsg.TransferERC20Ownership.SmartContractID, chainReferenceID) + deployment, _ := k.getSmartContractDeploymentByContractID(sdkCtx, origMsg.TransferERC20Ownership.SmartContractID, chainReferenceID) if deployment == nil { logger.WithError(err).Error("Deployment not found") return ErrCannotActiveSmartContractThatIsNotDeploying @@ -164,7 +168,7 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust return ErrCannotActiveSmartContractThatIsNotDeploying } - smartContract, err := k.getSmartContract(ctx, deployment.GetSmartContractID()) + smartContract, err := k.getSmartContract(sdkCtx, deployment.GetSmartContractID()) if err != nil { logger.WithError(err).Error("Failed to get contract") return err @@ -186,7 +190,7 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust case *types.SmartContractExecutionErrorProof: logger.Debug("Error Proof") - keeperutil.EmitEvent(k, ctx, types.SmartContractExecutionFailedKey, + keeperutil.EmitEvent(k, sdkCtx, types.SmartContractExecutionFailedKey, types.SmartContractExecutionFailedMessageID.With(fmt.Sprintf("%d", msg.GetId())), types.SmartContractExecutionFailedChainReferenceID.With(chainReferenceID), types.SmartContractExecutionFailedError.With(winner.GetErrorMessage()), @@ -206,7 +210,7 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust logger.WithError(err).Error("Failed to get TX") return err } - if k.isTxProcessed(ctx, tx) { + if k.isTxProcessed(sdkCtx, tx) { // somebody submitted the old transaction that was already processed? // punish those validators!! logger.WithError(err).Error("TX already processed") @@ -240,7 +244,7 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust turnstoneID := consensusMsg.(*types.Message).GetTurnstoneID() newCompassAddr := crypto.CreateAddress(ethMsg.From, tx.Nonce()) err = k.initiateERC20TokenOwnershipTransfer( - ctx, + sdkCtx, chainReferenceID, turnstoneID, &types.TransferERC20Ownership{ @@ -261,7 +265,7 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust case *types.SmartContractExecutionErrorProof: logger.Debug("smart contract execution error proof", "smart-contract-error", winner.GetErrorMessage()) - keeperutil.EmitEvent(k, ctx, types.SmartContractExecutionFailedKey, + keeperutil.EmitEvent(k, sdkCtx, types.SmartContractExecutionFailedKey, types.SmartContractExecutionFailedMessageID.With(fmt.Sprintf("%d", msg.GetId())), types.SmartContractExecutionFailedChainReferenceID.With(chainReferenceID), types.SmartContractExecutionFailedError.With(winner.GetErrorMessage()), @@ -277,7 +281,7 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust case *types.TxExecutedProof: // check if the correct valset was updated case *types.SmartContractExecutionErrorProof: - keeperutil.EmitEvent(k, ctx, types.SmartContractExecutionFailedKey, + keeperutil.EmitEvent(k, sdkCtx, types.SmartContractExecutionFailedKey, types.SmartContractExecutionFailedMessageID.With(fmt.Sprintf("%d", msg.GetId())), types.SmartContractExecutionFailedChainReferenceID.With(chainReferenceID), types.SmartContractExecutionFailedError.With(winner.GetErrorMessage()), @@ -296,8 +300,8 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust // now remove all older update valsets given that new one was uploaded. // if there are any, that is. - keeperutil.EmitEvent(k, ctx, types.AttestingUpdateValsetRemoveOldMessagesKey) - msgs, err := q.GetAll(ctx) + keeperutil.EmitEvent(k, sdkCtx, types.AttestingUpdateValsetRemoveOldMessagesKey) + msgs, err := q.GetAll(sdkCtx) if err != nil { return err } @@ -309,7 +313,7 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust } if _, ok := (actionMsg.(*types.Message).GetAction()).(*types.Message_UpdateValset); ok { if oldMessage.GetId() < msg.GetId() { - if err := q.Remove(ctx, oldMessage.GetId()); err != nil { + if err := q.Remove(sdkCtx, oldMessage.GetId()); err != nil { logger.WithError(err).Error("error removing old message, attestRouter", "msg-id", oldMessage.GetId(), "msg-nonce", oldMessage.Nonce()) } } @@ -320,7 +324,7 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust case *types.TxExecutedProof: // check if correct thing was called case *types.SmartContractExecutionErrorProof: - keeperutil.EmitEvent(k, ctx, types.SmartContractExecutionFailedKey, + keeperutil.EmitEvent(k, sdkCtx, types.SmartContractExecutionFailedKey, types.SmartContractExecutionFailedMessageID.With(fmt.Sprintf("%d", msg.GetId())), types.SmartContractExecutionFailedChainReferenceID.With(chainReferenceID), types.SmartContractExecutionFailedError.With(winner.GetErrorMessage()), @@ -364,7 +368,7 @@ func (k Keeper) attestRouter(ctx sdk.Context, q consensus.Queuer, msg consensust } func (k Keeper) findEvidenceThatWon( - ctx sdk.Context, + ctx context.Context, evidences []*consensustypes.Evidence, ) (any, error) { snapshot, err := k.Valset.GetCurrentSnapshot(ctx) @@ -482,9 +486,9 @@ func (k Keeper) initiateERC20TokenOwnershipTransfer( return nil } -func (k Keeper) txAlreadyProcessedStore(ctx sdk.Context) sdk.KVStore { - kv := ctx.KVStore(k.storeKey) - return prefix.NewStore(kv, []byte("tx-processed")) +func (k Keeper) txAlreadyProcessedStore(ctx sdk.Context) storetypes.KVStore { + s := runtime.KVStoreAdapter(k.storeKey.OpenKVStore(ctx)) + return prefix.NewStore(s, []byte("tx-processed")) } func (k Keeper) setTxAsAlreadyProcessed(ctx sdk.Context, tx *ethtypes.Transaction) { diff --git a/x/evm/keeper/attest_test.go b/x/evm/keeper/attest_test.go index f1db2169..944de66a 100644 --- a/x/evm/keeper/attest_test.go +++ b/x/evm/keeper/attest_test.go @@ -6,11 +6,13 @@ import ( "os" "sync" + sdkmath "cosmossdk.io/math" "github.com/VolumeFi/whoops" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" ethcoretypes "github.com/ethereum/go-ethereum/core/types" + g "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/palomachain/paloma/util/slice" @@ -128,12 +130,12 @@ var _ = g.Describe("attest router", func() { &valsettypes.Snapshot{ Validators: slice.Map(valpowers, func(p valpower) valsettypes.Validator { return valsettypes.Validator{ - ShareCount: sdk.NewInt(p.power), + ShareCount: sdkmath.NewInt(p.power), Address: p.valAddr, ExternalChainInfos: p.externalChain, } }), - TotalShares: sdk.NewInt(totalPower), + TotalShares: sdkmath.NewInt(totalPower), }, nil, ) diff --git a/x/evm/keeper/attest_validator_balances.go b/x/evm/keeper/attest_validator_balances.go index 1ef48704..20c6b75b 100644 --- a/x/evm/keeper/attest_validator_balances.go +++ b/x/evm/keeper/attest_validator_balances.go @@ -1,6 +1,7 @@ package keeper import ( + "context" "errors" "fmt" "math/big" @@ -12,13 +13,14 @@ import ( "github.com/palomachain/paloma/x/evm/types" ) -func (k Keeper) attestValidatorBalances(ctx sdk.Context, q consensus.Queuer, msg consensustypes.QueuedSignedMessageI) (retErr error) { - k.Logger(ctx).Debug("attest-validator-balances", "msg-id", msg.GetId(), "msg-nonce", msg.Nonce()) +func (k Keeper) attestValidatorBalances(ctx context.Context, q consensus.Queuer, msg consensustypes.QueuedSignedMessageI) (retErr error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + k.Logger(sdkCtx).Debug("attest-validator-balances", "msg-id", msg.GetId(), "msg-nonce", msg.Nonce()) if len(msg.GetEvidence()) == 0 { return nil } - ctx, writeCache := ctx.CacheContext() + ctx, writeCache := sdkCtx.CacheContext() defer func() { if retErr == nil { writeCache() @@ -43,8 +45,8 @@ func (k Keeper) attestValidatorBalances(ctx sdk.Context, q consensus.Queuer, msg defer func() { // given that there was enough evidence for a proof, regardless of the outcome, // we should remove this from the queue as there isn't much that we can do about it. - if err := q.Remove(ctx, msg.GetId()); err != nil { - k.Logger(ctx).Error("error removing message, attestValidatorBalances", "msg-id", msg.GetId(), "msg-nonce", msg.Nonce()) + if err := q.Remove(sdkCtx, msg.GetId()); err != nil { + k.Logger(sdkCtx).Error("error removing message, attestValidatorBalances", "msg-id", msg.GetId(), "msg-nonce", msg.Nonce()) } }() @@ -59,7 +61,7 @@ func (k Keeper) attestValidatorBalances(ctx sdk.Context, q consensus.Queuer, msg return err } - return k.processValidatorBalanceProof(ctx, request, evidence, chainReferenceID, minBalance) + return k.processValidatorBalanceProof(sdkCtx, request, evidence, chainReferenceID, minBalance) } func (k Keeper) processValidatorBalanceProof( diff --git a/x/evm/keeper/keeper.go b/x/evm/keeper/keeper.go index d58267b7..62c55672 100644 --- a/x/evm/keeper/keeper.go +++ b/x/evm/keeper/keeper.go @@ -1,6 +1,7 @@ package keeper import ( + "context" "errors" "fmt" "math/big" @@ -8,13 +9,16 @@ import ( "strings" "time" + corestore "cosmossdk.io/core/store" + sdkmath "cosmossdk.io/math" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" "github.com/VolumeFi/whoops" - "github.com/cometbft/cometbft/libs/log" + "github.com/cosmos/cosmos-sdk/runtime" + + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" xchain "github.com/palomachain/paloma/internal/x-chain" @@ -47,7 +51,7 @@ type supportedChainInfo struct { subqueue string batch bool msgType any - processAttesationFunc func(Keeper) func(ctx sdk.Context, q consensus.Queuer, msg consensustypes.QueuedSignedMessageI) error + processAttesationFunc func(Keeper) func(ctx context.Context, q consensus.Queuer, msg consensustypes.QueuedSignedMessageI) error } var SupportedConsensusQueues = []supportedChainInfo{ @@ -55,7 +59,7 @@ var SupportedConsensusQueues = []supportedChainInfo{ subqueue: ConsensusTurnstoneMessage, batch: false, msgType: &types.Message{}, - processAttesationFunc: func(k Keeper) func(ctx sdk.Context, q consensus.Queuer, msg consensustypes.QueuedSignedMessageI) error { + processAttesationFunc: func(k Keeper) func(ctx context.Context, q consensus.Queuer, msg consensustypes.QueuedSignedMessageI) error { return k.attestRouter }, }, @@ -63,7 +67,7 @@ var SupportedConsensusQueues = []supportedChainInfo{ subqueue: ConsensusGetValidatorBalances, batch: false, msgType: &types.ValidatorBalancesAttestation{}, - processAttesationFunc: func(k Keeper) func(ctx sdk.Context, q consensus.Queuer, msg consensustypes.QueuedSignedMessageI) error { + processAttesationFunc: func(k Keeper) func(ctx context.Context, q consensus.Queuer, msg consensustypes.QueuedSignedMessageI) error { return k.attestValidatorBalances }, }, @@ -71,7 +75,7 @@ var SupportedConsensusQueues = []supportedChainInfo{ batch: false, subqueue: ConsensusCollectFundEvents, msgType: &types.CollectFunds{}, - processAttesationFunc: func(k Keeper) func(ctx sdk.Context, q consensus.Queuer, msg consensustypes.QueuedSignedMessageI) error { + processAttesationFunc: func(k Keeper) func(ctx context.Context, q consensus.Queuer, msg consensustypes.QueuedSignedMessageI) error { return k.attestCollectedFunds }, }, @@ -91,37 +95,27 @@ func init() { var _ valsettypes.OnSnapshotBuiltListener = Keeper{} type Keeper struct { - cdc codec.BinaryCodec - storeKey storetypes.StoreKey - memKey storetypes.StoreKey - paramstore paramtypes.Subspace - + cdc codec.BinaryCodec + storeKey corestore.KVStoreService ConsensusKeeper types.ConsensusKeeper SchedulerKeeper types.SchedulerKeeper Valset types.ValsetKeeper ider keeperutil.IDGenerator msgSender types.MsgSender msgAssigner types.MsgAssigner + authority string } func NewKeeper( cdc codec.BinaryCodec, - storeKey, - memKey storetypes.StoreKey, - ps paramtypes.Subspace, + storeService corestore.KVStoreService, consensusKeeper types.ConsensusKeeper, valsetKeeper types.ValsetKeeper, + authority string, ) *Keeper { - // set KeyTable if it has not already been set - if !ps.HasKeyTable() { - ps = ps.WithKeyTable(types.ParamKeyTable()) - } - k := &Keeper{ cdc: cdc, - storeKey: storeKey, - memKey: memKey, - paramstore: ps, + storeKey: storeService, ConsensusKeeper: consensusKeeper, Valset: valsetKeeper, msgSender: msgSender{ @@ -129,16 +123,16 @@ func NewKeeper( cdc: cdc, }, msgAssigner: MsgAssigner{ - valsetKeeper, + nil, }, + authority: authority, } - k.ider = keeperutil.NewIDGenerator(keeperutil.StoreGetterFn(k.provideSmartContractStore), []byte("id-key")) return k } -func (k Keeper) PickValidatorForMessage(ctx sdk.Context, chainReferenceID string, requirements *xchain.JobRequirements) (string, error) { +func (k Keeper) PickValidatorForMessage(ctx context.Context, chainReferenceID string, requirements *xchain.JobRequirements) (string, error) { weights, err := k.GetRelayWeights(ctx, chainReferenceID) if err != nil { return "", err @@ -148,6 +142,7 @@ func (k Keeper) PickValidatorForMessage(ctx sdk.Context, chainReferenceID string func (k Keeper) Logger(ctx sdk.Context) liblog.Logr { return liblog.FromSDKLogger(ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName))) + } func (k Keeper) ChangeMinOnChainBalance(ctx sdk.Context, chainReferenceID string, balance *big.Int) error { @@ -216,12 +211,12 @@ func (k Keeper) SupportedQueues(ctx sdk.Context) ([]consensus.SupportsConsensusQ return res, nil } -func (k Keeper) GetAllChainInfos(ctx sdk.Context) ([]*types.ChainInfo, error) { +func (k Keeper) GetAllChainInfos(ctx context.Context) ([]*types.ChainInfo, error) { _, all, err := keeperutil.IterAll[*types.ChainInfo](k.chainInfoStore(ctx), k.cdc) return all, err } -func (k Keeper) GetChainInfo(ctx sdk.Context, targetChainReferenceID string) (*types.ChainInfo, error) { +func (k Keeper) GetChainInfo(ctx context.Context, targetChainReferenceID string) (*types.ChainInfo, error) { res, err := keeperutil.Load[*types.ChainInfo](k.chainInfoStore(ctx), k.cdc, []byte(targetChainReferenceID)) if errors.Is(err, keeperutil.ErrNotFound) { return nil, ErrChainNotFound.Format(targetChainReferenceID) @@ -230,10 +225,12 @@ func (k Keeper) GetChainInfo(ctx sdk.Context, targetChainReferenceID string) (*t } // MissingChains returns the chains in this keeper that aren't in the input slice -func (k Keeper) MissingChains(ctx sdk.Context, inputChainReferenceIDs []string) ([]string, error) { +func (k Keeper) MissingChains(ctx context.Context, inputChainReferenceIDs []string) ([]string, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + allChains, err := k.GetAllChainInfos(ctx) if err != nil { - k.Logger(ctx).Error("Unable to get chains infos from keeper") + k.Logger(sdkCtx).Error("Unable to get chains infos from keeper") return nil, err } @@ -257,12 +254,12 @@ func (k Keeper) MissingChains(ctx sdk.Context, inputChainReferenceIDs []string) return unsuportedChainReferenceIDs, nil } -func (k Keeper) updateChainInfo(ctx sdk.Context, chainInfo *types.ChainInfo) error { +func (k Keeper) updateChainInfo(ctx context.Context, chainInfo *types.ChainInfo) error { return keeperutil.Save(k.chainInfoStore(ctx), k.cdc, []byte(chainInfo.GetChainReferenceID()), chainInfo) } func (k Keeper) AddSupportForNewChain( - ctx sdk.Context, + ctx context.Context, chainReferenceID string, chainID uint64, blockHeight uint64, @@ -313,12 +310,14 @@ func (k Keeper) AddSupportForNewChain( } func (k Keeper) ActivateChainReferenceID( - ctx sdk.Context, + ctx context.Context, chainReferenceID string, smartContract *types.SmartContract, smartContractAddr string, smartContractUniqueID []byte, ) (retErr error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + defer func() { args := []any{ "chain-reference-id", chainReferenceID, @@ -331,9 +330,9 @@ func (k Keeper) ActivateChainReferenceID( } if retErr != nil { - k.Logger(ctx).Error("error while activating chain with a new smart contract", args...) + k.Logger(sdkCtx).Error("error while activating chain with a new smart contract", args...) } else { - k.Logger(ctx).Info("activated chain with a new smart contract", args...) + k.Logger(sdkCtx).Info("activated chain with a new smart contract", args...) } }() chainInfo, err := k.GetChainInfo(ctx, chainReferenceID) @@ -357,7 +356,9 @@ func (k Keeper) ActivateChainReferenceID( return k.updateChainInfo(ctx, chainInfo) } -func (k Keeper) RemoveSupportForChain(ctx sdk.Context, proposal *types.RemoveChainProposal) error { +func (k Keeper) RemoveSupportForChain(ctx context.Context, proposal *types.RemoveChainProposal) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + _, err := k.GetChainInfo(ctx, proposal.GetChainReferenceID()) if err != nil { return err @@ -368,15 +369,16 @@ func (k Keeper) RemoveSupportForChain(ctx sdk.Context, proposal *types.RemoveCha for _, q := range SupportedConsensusQueues { queue := consensustypes.Queue(q.subqueue, xchainType, xchain.ReferenceID(proposal.GetChainReferenceID())) if e := k.ConsensusKeeper.RemoveConsensusQueue(ctx, queue); e != nil { - k.Logger(ctx).Error("error removing consensus queue", "err", err, "referenceID", proposal.GetChainReferenceID()) + k.Logger(sdkCtx).Error("error removing consensus queue", "err", err, "referenceID", proposal.GetChainReferenceID()) } } return nil } -func (k Keeper) chainInfoStore(ctx sdk.Context) sdk.KVStore { - return prefix.NewStore(ctx.KVStore(k.storeKey), []byte("chain-info")) +func (k Keeper) chainInfoStore(ctx context.Context) storetypes.KVStore { + kvstore := runtime.KVStoreAdapter(k.storeKey.OpenKVStore(ctx)) + return prefix.NewStore(kvstore, []byte("chain-info")) } func (k Keeper) PreJobExecution(ctx sdk.Context, job *schedulertypes.Job) error { @@ -394,16 +396,19 @@ func (k Keeper) PreJobExecution(ctx sdk.Context, job *schedulertypes.Job) error return k.justInTimeValsetUpdate(ctx, chain) } -func (k Keeper) justInTimeValsetUpdate(ctx sdk.Context, chain *types.ChainInfo) error { +func (k Keeper) justInTimeValsetUpdate(ctx context.Context, chain *types.ChainInfo) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + latestSnapshot, err := k.Valset.GetCurrentSnapshot(ctx) + if err != nil { - k.Logger(ctx).Error("couldn't get latest snapshot", "err", err) + k.Logger(sdkCtx).Error("couldn't get latest snapshot", "err", err) return err } if latestSnapshot == nil { // For some reason, GetCurrentShapshot is hiding the notFound errors and just returning nil, nil, so we need this err := errors.New("nil, nil returned from Valset.GetCurrentSnapshot") - k.Logger(ctx).Error("unable to find current snapshot", "err", err) + k.Logger(sdkCtx).Error("unable to find current snapshot", "err", err) return err } @@ -411,17 +416,17 @@ func (k Keeper) justInTimeValsetUpdate(ctx sdk.Context, chain *types.ChainInfo) latestPublishedSnapshot, err := k.Valset.GetLatestSnapshotOnChain(ctx, chainReferenceID) if err != nil { - k.Logger(ctx).Info("couldn't get latest published snapshot for chain.", + k.Logger(sdkCtx).Info("couldn't get latest published snapshot for chain.", "chain-reference-id", chain.GetChainReferenceID(), "err", err, ) return err } - latestValset := transformSnapshotToCompass(latestSnapshot, chainReferenceID, k.Logger(ctx)) + latestValset := transformSnapshotToCompass(latestSnapshot, chainReferenceID, k.Logger(sdkCtx)) if latestPublishedSnapshot.GetId() == latestSnapshot.GetId() { - k.Logger(ctx).Info("ignoring valset for chain because it is already most recent", + k.Logger(sdkCtx).Info("ignoring valset for chain because it is already most recent", "chain-reference-id", chain.GetChainReferenceID(), "valset-id", latestValset.GetValsetID(), ) @@ -429,7 +434,7 @@ func (k Keeper) justInTimeValsetUpdate(ctx sdk.Context, chain *types.ChainInfo) } if !chain.IsActive() { - k.Logger(ctx).Info("ignoring valset for chain as the chain is not yet active", + k.Logger(sdkCtx).Info("ignoring valset for chain as the chain is not yet active", "chain-reference-id", chain.GetChainReferenceID(), "valset-id", latestValset.GetValsetID(), ) @@ -437,7 +442,7 @@ func (k Keeper) justInTimeValsetUpdate(ctx sdk.Context, chain *types.ChainInfo) } if !isEnoughToReachConsensus(latestValset) { - k.Logger(ctx).Info("ignoring valset for chain as there aren't enough validators to form a consensus for this chain", + k.Logger(sdkCtx).Info("ignoring valset for chain as there aren't enough validators to form a consensus for this chain", "chain-reference-id", chain.GetChainReferenceID(), "valset-id", latestValset.GetValsetID(), ) @@ -451,7 +456,7 @@ func (k Keeper) justInTimeValsetUpdate(ctx sdk.Context, chain *types.ChainInfo) err = k.msgSender.SendValsetMsgForChain(ctx, chain, latestValset, assignee) if err != nil { - k.Logger(ctx).Error("unable to send valset message for chain", + k.Logger(sdkCtx).Error("unable to send valset message for chain", "chain", chain.GetChainReferenceID(), "err", err, ) @@ -460,9 +465,11 @@ func (k Keeper) justInTimeValsetUpdate(ctx sdk.Context, chain *types.ChainInfo) return err } -func (k Keeper) PublishValsetToChain(ctx sdk.Context, valset types.Valset, chain *types.ChainInfo) error { +func (k Keeper) PublishValsetToChain(ctx context.Context, valset types.Valset, chain *types.ChainInfo) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + if !chain.IsActive() { - k.Logger(ctx).Info("ignoring valset for chain as the chain is not yet active", + k.Logger(sdkCtx).Info("ignoring valset for chain as the chain is not yet active", "chain-reference-id", chain.GetChainReferenceID(), "valset-id", valset.GetValsetID(), ) @@ -470,7 +477,7 @@ func (k Keeper) PublishValsetToChain(ctx sdk.Context, valset types.Valset, chain } if !isEnoughToReachConsensus(valset) { - k.Logger(ctx).Info("ignoring valset for chain as there aren't enough validators to form a consensus for this chain", + k.Logger(sdkCtx).Info("ignoring valset for chain as there aren't enough validators to form a consensus for this chain", "chain-reference-id", chain.GetChainReferenceID(), "valset-id", valset.GetValsetID(), ) @@ -479,7 +486,7 @@ func (k Keeper) PublishValsetToChain(ctx sdk.Context, valset types.Valset, chain assignee, err := k.PickValidatorForMessage(ctx, chain.GetChainReferenceID(), nil) if err != nil { - k.Logger(ctx).Error("error picking a validator to run the message", + k.Logger(sdkCtx).Error("error picking a validator to run the message", "chain-reference-id", chain.GetChainReferenceID(), "valset-id", valset.GetValsetID(), "error", err, @@ -489,7 +496,7 @@ func (k Keeper) PublishValsetToChain(ctx sdk.Context, valset types.Valset, chain err = k.msgSender.SendValsetMsgForChain(ctx, chain, valset, assignee) if err != nil { - k.Logger(ctx).Error("unable to send valset message for chain", + k.Logger(sdkCtx).Error("unable to send valset message for chain", "chain", chain.GetChainReferenceID(), "err", err, ) @@ -498,25 +505,27 @@ func (k Keeper) PublishValsetToChain(ctx sdk.Context, valset types.Valset, chain return nil } -func (k Keeper) PublishSnapshotToAllChains(ctx sdk.Context, snapshot *valsettypes.Snapshot, forcePublish bool) error { +func (k Keeper) PublishSnapshotToAllChains(ctx context.Context, snapshot *valsettypes.Snapshot, forcePublish bool) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + chainInfos, err := k.GetAllChainInfos(ctx) if err != nil { return err } - logger := k.Logger(ctx) + logger := k.Logger(sdkCtx) for _, chain := range chainInfos { valset := transformSnapshotToCompass(snapshot, chain.GetChainReferenceID(), logger) latestActiveValset, _ := k.Valset.GetLatestSnapshotOnChain(ctx, chain.GetChainReferenceID()) if latestActiveValset != nil && !forcePublish { - latestActiveValsetAge := ctx.BlockTime().Sub(latestActiveValset.CreatedAt) + latestActiveValsetAge := sdkCtx.BlockTime().Sub(latestActiveValset.CreatedAt) // If it's been less than 1 month since publishing a valset, don't publish keepWarmDays := 30 if latestActiveValsetAge < (time.Duration(keepWarmDays) * 24 * time.Hour) { - k.Logger(ctx).Info(fmt.Sprintf("ignoring valset for chain because chain has had a valset update in the past %d days", keepWarmDays), + k.Logger(sdkCtx).Info(fmt.Sprintf("ignoring valset for chain because chain has had a valset update in the past %d days", keepWarmDays), "chain-reference-id", chain.GetChainReferenceID(), - "current-block-height", ctx.BlockHeight(), + "current-block-height", sdkCtx.BlockHeight(), "current-published-valset-id", latestActiveValset.GetId(), "current-published-valset-created-time", latestActiveValset.CreatedAt, "valset-id", valset.GetValsetID(), @@ -527,13 +536,13 @@ func (k Keeper) PublishSnapshotToAllChains(ctx sdk.Context, snapshot *valsettype err := k.PublishValsetToChain(ctx, valset, chain) if err != nil { - k.Logger(ctx).Error(err.Error()) + k.Logger(sdkCtx).Error(err.Error()) } } return nil } -func (k Keeper) OnSnapshotBuilt(ctx sdk.Context, snapshot *valsettypes.Snapshot) { +func (k Keeper) OnSnapshotBuilt(ctx context.Context, snapshot *valsettypes.Snapshot) { err := k.PublishSnapshotToAllChains(ctx, snapshot, false) if err != nil { panic(err) @@ -551,25 +560,27 @@ func (m msgSender) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } -func (m msgSender) SendValsetMsgForChain(ctx sdk.Context, chainInfo *types.ChainInfo, valset types.Valset, assignee string) error { - m.Logger(ctx).Info("snapshot was built and a new update valset message is being sent over", +func (m msgSender) SendValsetMsgForChain(ctx context.Context, chainInfo *types.ChainInfo, valset types.Valset, assignee string) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + m.Logger(sdkCtx).Info("snapshot was built and a new update valset message is being sent over", "chainInfo-reference-id", chainInfo.GetChainReferenceID(), "valset-id", valset.GetValsetID(), ) // clear all other instances of the update valset from the queue - m.Logger(ctx).Info("clearing previous instances of the update valset from the queue") + m.Logger(sdkCtx).Info("clearing previous instances of the update valset from the queue") queueName := consensustypes.Queue(ConsensusTurnstoneMessage, xchainType, xchain.ReferenceID(chainInfo.GetChainReferenceID())) messages, err := m.ConsensusKeeper.GetMessagesFromQueue(ctx, queueName, 0) if err != nil { - m.Logger(ctx).Error("unable to get messages from queue", "err", err) + m.Logger(sdkCtx).Error("unable to get messages from queue", "err", err) return err } for _, msg := range messages { cmsg, err := msg.ConsensusMsg(m.cdc) if err != nil { - m.Logger(ctx).Error("unable to unpack message", "err", err) + m.Logger(sdkCtx).Error("unable to unpack message", "err", err) return err } @@ -581,7 +592,7 @@ func (m msgSender) SendValsetMsgForChain(ctx sdk.Context, chainInfo *types.Chain if _, ok := act.(*types.Message_UpdateValset); ok { err := m.ConsensusKeeper.DeleteJob(ctx, queueName, msg.GetId()) if err != nil { - m.Logger(ctx).Error("unable to delete message", "err", err) + m.Logger(sdkCtx).Error("unable to delete message", "err", err) return err } } @@ -603,29 +614,31 @@ func (m msgSender) SendValsetMsgForChain(ctx sdk.Context, chainInfo *types.Chain }, nil, ) if err != nil { - m.Logger(ctx).Error("unable to put message in the queue", "err", err) + m.Logger(sdkCtx).Error("unable to put message in the queue", "err", err) return err } - m.Logger(ctx).With("new-message-id", msgID).Debug("Valset update message added to consensus queue.") + m.Logger(sdkCtx).With("new-message-id", msgID).Debug("Valset update message added to consensus queue.") return nil } -func (k Keeper) CheckExternalBalancesForChain(ctx sdk.Context, chainReferenceID string) error { +func (k Keeper) CheckExternalBalancesForChain(ctx context.Context, chainReferenceID string) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + snapshot, err := k.Valset.GetCurrentSnapshot(ctx) if err != nil { return err } var msg types.ValidatorBalancesAttestation - msg.FromBlockTime = ctx.BlockTime().UTC() + msg.FromBlockTime = sdkCtx.BlockTime().UTC() for _, val := range snapshot.GetValidators() { for _, ext := range val.GetExternalChainInfos() { if ext.GetChainReferenceID() == chainReferenceID && ext.GetChainType() == "evm" { msg.ValAddresses = append(msg.ValAddresses, val.GetAddress()) msg.HexAddresses = append(msg.HexAddresses, ext.GetAddress()) - k.Logger(ctx).Debug("check-external-balances-for-chain", + k.Logger(sdkCtx).Debug("check-external-balances-for-chain", "chain-reference-id", chainReferenceID, "msg-val-address", val.GetAddress(), "msg-hex-address", ext.GetAddress(), @@ -662,7 +675,7 @@ func isEnoughToReachConsensus(val types.Valset) bool { } func transformSnapshotToCompass(snapshot *valsettypes.Snapshot, chainReferenceID string, logger log.Logger) types.Valset { - var totalShares sdk.Int + var totalShares sdkmath.Int if snapshot != nil { totalShares = snapshot.TotalShares } @@ -680,7 +693,7 @@ func transformSnapshotToCompass(snapshot *valsettypes.Snapshot, chainReferenceID return validators[i].ShareCount.GTE(validators[j].ShareCount) }) - totalPowerInt := sdk.NewInt(0) + totalPowerInt := sdkmath.NewInt(0) for _, val := range validators { totalPowerInt = totalPowerInt.Add(val.ShareCount) } @@ -712,13 +725,15 @@ func transformSnapshotToCompass(snapshot *valsettypes.Snapshot, chainReferenceID func (k Keeper) ModuleName() string { return types.ModuleName } -func generateSmartContractID(ctx sdk.Context) (res [32]byte) { - b := []byte(fmt.Sprintf("%d", ctx.BlockHeight())) +func generateSmartContractID(ctx context.Context) (res [32]byte) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + b := []byte(fmt.Sprintf("%d", sdkCtx.BlockHeight())) copy(res[:], b) return } -func (k Keeper) SetRelayWeights(ctx sdk.Context, chainReferenceID string, weights *types.RelayWeights) error { +func (k Keeper) SetRelayWeights(ctx context.Context, chainReferenceID string, weights *types.RelayWeights) error { chainInfo, err := k.GetChainInfo(ctx, chainReferenceID) if err != nil { return err @@ -729,7 +744,7 @@ func (k Keeper) SetRelayWeights(ctx sdk.Context, chainReferenceID string, weight return keeperutil.Save(k.chainInfoStore(ctx), k.cdc, []byte(chainReferenceID), chainInfo) } -func (k Keeper) GetRelayWeights(ctx sdk.Context, chainReferenceID string) (*types.RelayWeights, error) { +func (k Keeper) GetRelayWeights(ctx context.Context, chainReferenceID string) (*types.RelayWeights, error) { chainInfo, err := k.GetChainInfo(ctx, chainReferenceID) if err != nil { return &types.RelayWeights{}, err @@ -738,7 +753,7 @@ func (k Keeper) GetRelayWeights(ctx sdk.Context, chainReferenceID string) (*type return chainInfo.RelayWeights, nil } -func (k Keeper) GetEthAddressByValidator(ctx sdk.Context, validator sdk.ValAddress, chainReferenceId string) (ethAddress *gravitymoduletypes.EthAddress, found bool, err error) { +func (k Keeper) GetEthAddressByValidator(ctx context.Context, validator sdk.ValAddress, chainReferenceId string) (ethAddress *gravitymoduletypes.EthAddress, found bool, err error) { chainInfos, err := k.Valset.GetValidatorChainInfos(ctx, validator) if err != nil { return ethAddress, false, err @@ -756,7 +771,7 @@ func (k Keeper) GetEthAddressByValidator(ctx sdk.Context, validator sdk.ValAddre return ethAddress, false, nil } -func (k Keeper) GetValidatorAddressByEthAddress(ctx sdk.Context, ethAddr gravitymoduletypes.EthAddress, chainReferenceId string) (valAddr sdk.ValAddress, found bool, err error) { +func (k Keeper) GetValidatorAddressByEthAddress(ctx context.Context, ethAddr gravitymoduletypes.EthAddress, chainReferenceId string) (valAddr sdk.ValAddress, found bool, err error) { validatorsExternalAccounts, err := k.Valset.GetAllChainInfos(ctx) if err != nil { return valAddr, false, err diff --git a/x/evm/keeper/keeper_integration_test.go b/x/evm/keeper/keeper_integration_test.go index d833e7c5..63110fb0 100644 --- a/x/evm/keeper/keeper_integration_test.go +++ b/x/evm/keeper/keeper_integration_test.go @@ -1,1222 +1,1198 @@ package keeper_test -import ( - "fmt" - "io/ioutil" - "math/big" - "strings" - "testing" - "time" - - "github.com/VolumeFi/whoops" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "github.com/palomachain/paloma/app" - "github.com/palomachain/paloma/testutil" - "github.com/palomachain/paloma/testutil/rand" - "github.com/palomachain/paloma/testutil/sample" - consensustypes "github.com/palomachain/paloma/x/consensus/types" - "github.com/palomachain/paloma/x/evm/keeper" - "github.com/palomachain/paloma/x/evm/types" - valsettypes "github.com/palomachain/paloma/x/valset/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -var ( - contractAbi = string(whoops.Must(ioutil.ReadFile("testdata/sample-abi.json"))) - contractBytecodeStr = string(whoops.Must(ioutil.ReadFile("testdata/sample-bytecode.out"))) -) - -func genValidators(numValidators, totalConsPower int) []stakingtypes.Validator { - return testutil.GenValidators(numValidators, totalConsPower) -} - -func TestEndToEndForEvmArbitraryCall(t *testing.T) { - chainType, chainReferenceID := consensustypes.ChainTypeEVM, "eth-main" - a := app.NewTestApp(t, false) - ctx := a.NewContext(false, tmproto.Header{ - Height: 5, - }) - - newChain := &types.AddChainProposal{ - ChainReferenceID: "eth-main", - Title: "bla", - Description: "bla", - BlockHeight: uint64(123), - BlockHashAtHeight: "0x1234", - } - - err := a.EvmKeeper.AddSupportForNewChain( - ctx, - newChain.GetChainReferenceID(), - newChain.GetChainID(), - newChain.GetBlockHeight(), - newChain.GetBlockHashAtHeight(), - big.NewInt(55), - ) - require.NoError(t, err) - - err = a.EvmKeeper.ActivateChainReferenceID(ctx, newChain.ChainReferenceID, &types.SmartContract{Id: 123}, "addr", []byte("abc")) - require.NoError(t, err) - - validators := genValidators(25, 25000) - for _, val := range validators { - a.StakingKeeper.SetValidator(ctx, val) - } - - for _, validator := range validators { - valAddr, err := validator.GetConsAddr() - require.NoError(t, err) - pubKey, err := validator.ConsPubKey() - require.NoError(t, err) - err = a.ValsetKeeper.AddExternalChainInfo(ctx, validator.GetOperator(), []*valsettypes.ExternalChainInfo{ - { - ChainType: "evm", - ChainReferenceID: newChain.GetChainReferenceID(), - Address: valAddr.String(), - Pubkey: pubKey.Bytes(), - }, - }) - require.NoError(t, err) - } - - _, err = a.ValsetKeeper.TriggerSnapshotBuild(ctx) - require.NoError(t, err) - - smartContractAddr := common.BytesToAddress(rand.Bytes(5)) - _, err = a.EvmKeeper.AddSmartContractExecutionToConsensus( - ctx, - chainReferenceID, - "", - &types.SubmitLogicCall{ - Payload: func() []byte { - evm := whoops.Must(abi.JSON(strings.NewReader(sample.SimpleABI))) - return whoops.Must(evm.Pack("store", big.NewInt(1337))) - }(), - HexContractAddress: smartContractAddr.Hex(), - Abi: []byte(sample.SimpleABI), - Deadline: 1337, - }, - ) - - require.NoError(t, err) - - private, err := crypto.GenerateKey() - require.NoError(t, err) - - accAddr := crypto.PubkeyToAddress(private.PublicKey) - err = a.ValsetKeeper.AddExternalChainInfo(ctx, validators[0].GetOperator(), []*valsettypes.ExternalChainInfo{ - { - ChainType: chainType, - ChainReferenceID: chainReferenceID, - Address: accAddr.Hex(), - Pubkey: accAddr[:], - }, - }) - - require.NoError(t, err) - queue := consensustypes.Queue(keeper.ConsensusTurnstoneMessage, chainType, chainReferenceID) - msgs, err := a.ConsensusKeeper.GetMessagesForSigning(ctx, queue, validators[0].GetOperator()) - - for _, msg := range msgs { - sigbz, err := crypto.Sign( - crypto.Keccak256( - []byte(keeper.SignaturePrefix), - msg.GetBytesToSign(), - ), - private, - ) - require.NoError(t, err) - err = a.ConsensusKeeper.AddMessageSignature( - ctx, - validators[0].GetOperator(), - []*consensustypes.ConsensusMessageSignature{ - { - Id: msg.GetId(), - QueueTypeName: queue, - Signature: sigbz, - SignedByAddress: accAddr.Hex(), - }, - }, - ) - require.NoError(t, err) - } -} - -func TestFirstSnapshot_OnSnapshotBuilt(t *testing.T) { - a := app.NewTestApp(t, false) - ctx := a.NewContext(false, tmproto.Header{ - Height: 5, - Time: time.Now(), - }) - - newChain := &types.AddChainProposal{ - ChainReferenceID: "bob", - Title: "bla", - Description: "bla", - BlockHeight: uint64(123), - BlockHashAtHeight: "0x1234", - } - err := a.EvmKeeper.AddSupportForNewChain( - ctx, - newChain.GetChainReferenceID(), - newChain.GetChainID(), - newChain.GetBlockHeight(), - newChain.GetBlockHashAtHeight(), - big.NewInt(55), - ) - require.NoError(t, err) - err = a.EvmKeeper.ActivateChainReferenceID( - ctx, - newChain.ChainReferenceID, - &types.SmartContract{ - Id: 123, - }, - "addr", - []byte("abc"), - ) - require.NoError(t, err) - - validators := genValidators(25, 25000) - for _, val := range validators { - a.StakingKeeper.SetValidator(ctx, val) - err = a.ValsetKeeper.AddExternalChainInfo(ctx, val.GetOperator(), []*valsettypes.ExternalChainInfo{ - { - ChainType: "evm", - ChainReferenceID: "bob", - Address: rand.ETHAddress().Hex(), - Pubkey: []byte("pk" + rand.ETHAddress().Hex()), - }, - }) - require.NoError(t, err) - } - - queue := fmt.Sprintf("evm/%s/%s", newChain.GetChainReferenceID(), keeper.ConsensusTurnstoneMessage) - - msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 100) - require.NoError(t, err) - require.Empty(t, msgs) - - _, err = a.ValsetKeeper.TriggerSnapshotBuild(ctx) - require.NoError(t, err) - - msgs, err = a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 100) - require.NoError(t, err) - require.Len(t, msgs, 1) -} - -func TestRecentPublishedSnapshot_OnSnapshotBuilt(t *testing.T) { - a := app.NewTestApp(t, false) - ctx := a.NewContext(false, tmproto.Header{ - Height: 5, - Time: time.Now(), - }) - - newChain := &types.AddChainProposal{ - ChainReferenceID: "bob", - Title: "bla", - Description: "bla", - BlockHeight: uint64(123), - BlockHashAtHeight: "0x1234", - } - err := a.EvmKeeper.AddSupportForNewChain( - ctx, - newChain.GetChainReferenceID(), - newChain.GetChainID(), - newChain.GetBlockHeight(), - newChain.GetBlockHashAtHeight(), - big.NewInt(55), - ) - require.NoError(t, err) - err = a.EvmKeeper.ActivateChainReferenceID( - ctx, - newChain.ChainReferenceID, - &types.SmartContract{ - Id: 123, - }, - "addr", - []byte("abc"), - ) - require.NoError(t, err) - - validators := genValidators(25, 25000) - for _, val := range validators { - a.StakingKeeper.SetValidator(ctx, val) - err = a.ValsetKeeper.AddExternalChainInfo(ctx, val.GetOperator(), []*valsettypes.ExternalChainInfo{ - { - ChainType: "evm", - ChainReferenceID: "bob", - Address: rand.ETHAddress().Hex(), - Pubkey: []byte("pk" + rand.ETHAddress().Hex()), - }, - }) - require.NoError(t, err) - } - - queue := fmt.Sprintf("evm/%s/%s", newChain.GetChainReferenceID(), keeper.ConsensusTurnstoneMessage) - - msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 1) - require.NoError(t, err) - require.Empty(t, msgs) - - // Remove the listeners to set current state - snapshotListeners := a.ValsetKeeper.SnapshotListeners - a.ValsetKeeper.SnapshotListeners = []valsettypes.OnSnapshotBuiltListener{} - - _, err = a.ValsetKeeper.TriggerSnapshotBuild(ctx) - require.NoError(t, err) - - msgs, err = a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 100) - require.NoError(t, err) - require.Len(t, msgs, 0) - - latestSnapshot, err := a.ValsetKeeper.GetCurrentSnapshot(ctx) - require.NoError(t, err) - - latestSnapshot.Chains = []string{"bob"} - err = a.ValsetKeeper.SaveModifiedSnapshot(ctx, latestSnapshot) - require.NoError(t, err) - - // Add two validators to make this new snapshot worthy - validators = genValidators(2, 25000) - for _, val := range validators { - a.StakingKeeper.SetValidator(ctx, val) - err = a.ValsetKeeper.AddExternalChainInfo(ctx, val.GetOperator(), []*valsettypes.ExternalChainInfo{ - { - ChainType: "evm", - ChainReferenceID: "bob", - Address: rand.ETHAddress().Hex(), - Pubkey: []byte("pk" + rand.ETHAddress().Hex()), - }, - }) - require.NoError(t, err) - } - - // Add the listeners back on for the test - a.ValsetKeeper.SnapshotListeners = snapshotListeners - - _, err = a.ValsetKeeper.TriggerSnapshotBuild(ctx) - require.NoError(t, err) - - msgs, err = a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 100) - require.NoError(t, err) - require.Len(t, msgs, 0) // We don't expect a message because there is already a recent snapshot for the chain -} - -func TestOldPublishedSnapshot_OnSnapshotBuilt(t *testing.T) { - a := app.NewTestApp(t, false) - ctx := a.NewContext(false, tmproto.Header{ - Height: 5, - Time: time.Now(), - }) - - newChain := &types.AddChainProposal{ - ChainReferenceID: "bob", - Title: "bla", - Description: "bla", - BlockHeight: uint64(123), - BlockHashAtHeight: "0x1234", - } - err := a.EvmKeeper.AddSupportForNewChain( - ctx, - newChain.GetChainReferenceID(), - newChain.GetChainID(), - newChain.GetBlockHeight(), - newChain.GetBlockHashAtHeight(), - big.NewInt(55), - ) - require.NoError(t, err) - err = a.EvmKeeper.ActivateChainReferenceID( - ctx, - newChain.ChainReferenceID, - &types.SmartContract{ - Id: 123, - }, - "addr", - []byte("abc"), - ) - require.NoError(t, err) - - validators := genValidators(25, 25000) - for _, val := range validators { - a.StakingKeeper.SetValidator(ctx, val) - err = a.ValsetKeeper.AddExternalChainInfo(ctx, val.GetOperator(), []*valsettypes.ExternalChainInfo{ - { - ChainType: "evm", - ChainReferenceID: "bob", - Address: rand.ETHAddress().Hex(), - Pubkey: []byte("pk" + rand.ETHAddress().Hex()), - }, - }) - require.NoError(t, err) - } - - queue := fmt.Sprintf("evm/%s/%s", newChain.GetChainReferenceID(), keeper.ConsensusTurnstoneMessage) - - msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 1) - require.NoError(t, err) - require.Empty(t, msgs) - - // Remove the listeners to set current state - snapshotListeners := a.ValsetKeeper.SnapshotListeners - a.ValsetKeeper.SnapshotListeners = []valsettypes.OnSnapshotBuiltListener{} - - _, err = a.ValsetKeeper.TriggerSnapshotBuild(ctx) - require.NoError(t, err) - - msgs, err = a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 100) - require.NoError(t, err) - require.Len(t, msgs, 0) - - latestSnapshot, err := a.ValsetKeeper.GetCurrentSnapshot(ctx) - require.NoError(t, err) - - // Age the latest snapshot by 30 days, 1 minute, set as active on chain - latestSnapshot.Chains = []string{"bob"} - latestSnapshot.CreatedAt = ctx.BlockTime().Add(-((30 * 24 * time.Hour) + time.Minute)) - err = a.ValsetKeeper.SaveModifiedSnapshot(ctx, latestSnapshot) - require.NoError(t, err) - - // Add two validators to make this new snapshot worthy - validators = genValidators(2, 25000) - for _, val := range validators { - a.StakingKeeper.SetValidator(ctx, val) - err = a.ValsetKeeper.AddExternalChainInfo(ctx, val.GetOperator(), []*valsettypes.ExternalChainInfo{ - { - ChainType: "evm", - ChainReferenceID: "bob", - Address: rand.ETHAddress().Hex(), - Pubkey: []byte("pk" + rand.ETHAddress().Hex()), - }, - }) - require.NoError(t, err) - } - - // Add the listeners back on for the test - a.ValsetKeeper.SnapshotListeners = snapshotListeners - - _, err = a.ValsetKeeper.TriggerSnapshotBuild(ctx) - require.NoError(t, err) - - msgs, err = a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 100) - require.NoError(t, err) - require.Len(t, msgs, 1) // We expect a new message because the previous one is a week old -} - -func TestInactiveChain_OnSnapshotBuilt(t *testing.T) { - a := app.NewTestApp(t, false) - ctx := a.NewContext(false, tmproto.Header{ - Height: 5, - }) - - validators := genValidators(25, 25000) - for _, val := range validators { - a.StakingKeeper.SetValidator(ctx, val) - } - - queue := fmt.Sprintf("evm/%s/%s", "bob", keeper.ConsensusTurnstoneMessage) - - _, err := a.ValsetKeeper.TriggerSnapshotBuild(ctx) - require.NoError(t, err) - - _, err = a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 100) - require.Error(t, err) // We expect an error from this -} - -func TestAddingSupportForNewChain(t *testing.T) { - a := app.NewTestApp(t, false) - ctx := a.NewContext(false, tmproto.Header{ - Height: 5, - }) - - t.Run("with happy path there are no errors", func(t *testing.T) { - newChain := &types.AddChainProposal{ - ChainReferenceID: "bob", - Title: "bla", - Description: "bla", - BlockHeight: uint64(123), - BlockHashAtHeight: "0x1234", - } - err := a.EvmKeeper.AddSupportForNewChain( - ctx, - newChain.GetChainReferenceID(), - newChain.GetChainID(), - newChain.GetBlockHeight(), - newChain.GetBlockHashAtHeight(), - big.NewInt(55), - ) - require.NoError(t, err) - - gotChainInfo, err := a.EvmKeeper.GetChainInfo(ctx, newChain.GetChainReferenceID()) - require.NoError(t, err) - - require.Equal(t, newChain.GetChainReferenceID(), gotChainInfo.GetChainReferenceID()) - require.Equal(t, newChain.GetBlockHashAtHeight(), gotChainInfo.GetReferenceBlockHash()) - require.Equal(t, newChain.GetBlockHeight(), gotChainInfo.GetReferenceBlockHeight()) - t.Run("it returns an error if we try to add a chian whose chainID already exists", func(t *testing.T) { - newChain.ChainReferenceID = "something_new" - err := a.EvmKeeper.AddSupportForNewChain( - ctx, - newChain.GetChainReferenceID(), - newChain.GetChainID(), - newChain.GetBlockHeight(), - newChain.GetBlockHashAtHeight(), - big.NewInt(55), - ) - require.ErrorIs(t, err, keeper.ErrCannotAddSupportForChainThatExists) - }) - }) - - t.Run("when chainReferenceID already exists then it returns an error", func(t *testing.T) { - newChain := &types.AddChainProposal{ - ChainReferenceID: "bob", - Title: "bla", - Description: "bla", - BlockHeight: uint64(123), - BlockHashAtHeight: "0x1234", - } - err := a.EvmKeeper.AddSupportForNewChain( - ctx, - newChain.GetChainReferenceID(), - newChain.GetChainID(), - newChain.GetBlockHeight(), - newChain.GetBlockHashAtHeight(), - - big.NewInt(55), - ) - require.Error(t, err) - }) - - t.Run("activating chain", func(t *testing.T) { - t.Run("if the chain does not exist it returns the error", func(t *testing.T) { - err := a.EvmKeeper.ActivateChainReferenceID(ctx, "i don't exist", &types.SmartContract{}, "", []byte{}) - require.Error(t, err) - }) - t.Run("works when chain exists", func(t *testing.T) { - err := a.EvmKeeper.ActivateChainReferenceID(ctx, "bob", &types.SmartContract{Id: 123}, "addr", []byte("unique id")) - require.NoError(t, err) - gotChainInfo, err := a.EvmKeeper.GetChainInfo(ctx, "bob") - require.NoError(t, err) - - require.Equal(t, "addr", gotChainInfo.GetSmartContractAddr()) - require.Equal(t, []byte("unique id"), gotChainInfo.GetSmartContractUniqueID()) - }) - }) - - t.Run("removing chain", func(t *testing.T) { - t.Run("if the chain does not exist it returns the error", func(t *testing.T) { - err := a.EvmKeeper.RemoveSupportForChain(ctx, &types.RemoveChainProposal{ - ChainReferenceID: "i don't exist", - }) - require.Error(t, err) - }) - t.Run("works when chain exists", func(t *testing.T) { - err := a.EvmKeeper.RemoveSupportForChain(ctx, &types.RemoveChainProposal{ - ChainReferenceID: "bob", - }) - require.NoError(t, err) - _, err = a.EvmKeeper.GetChainInfo(ctx, "bob") - require.Error(t, keeper.ErrChainNotFound) - }) - }) -} - -func TestKeeper_ValidatorSupportsAllChains(t *testing.T) { - testcases := []struct { - name string - setup func(sdk.Context, app.TestApp) sdk.ValAddress - expected bool - }{ - { - name: "returns true when all chains supported", - setup: func(ctx sdk.Context, a app.TestApp) sdk.ValAddress { - for i, chainId := range []string{"chain-1", "chain-2"} { - newChain := &types.AddChainProposal{ - ChainReferenceID: chainId, - ChainID: uint64(i), - Title: "bla", - Description: "bla", - BlockHeight: uint64(123), - BlockHashAtHeight: "0x1234", - } - - err := a.EvmKeeper.AddSupportForNewChain( - ctx, - newChain.GetChainReferenceID(), - newChain.GetChainID(), - newChain.GetBlockHeight(), - newChain.GetBlockHashAtHeight(), - big.NewInt(55), - ) - require.NoError(t, err) - - err = a.EvmKeeper.ActivateChainReferenceID(ctx, newChain.ChainReferenceID, &types.SmartContract{Id: 123}, fmt.Sprintf("addr%d", i), []byte("abc")) - require.NoError(t, err) - } - - validator := genValidators(1, 1000)[0] - a.StakingKeeper.SetValidator(ctx, validator) - - private, err := crypto.GenerateKey() - require.NoError(t, err) - - accAddr := crypto.PubkeyToAddress(private.PublicKey) - - // Add support for both chains created - externalChains := make([]*valsettypes.ExternalChainInfo, 2) - for i, chainId := range []string{"chain-1", "chain-2"} { - externalChains[i] = &valsettypes.ExternalChainInfo{ - ChainType: "evm", - ChainReferenceID: chainId, - Address: accAddr.Hex(), - Pubkey: accAddr[:], - } - } - err = a.ValsetKeeper.AddExternalChainInfo(ctx, validator.GetOperator(), externalChains) - require.NoError(t, err) - - return validator.GetOperator() - }, - expected: true, - }, - { - name: "returns false when a chain is not supported", - setup: func(ctx sdk.Context, a app.TestApp) sdk.ValAddress { - for i, chainId := range []string{"chain-1", "chain-2"} { - newChain := &types.AddChainProposal{ - ChainReferenceID: chainId, - ChainID: uint64(i), - Title: "bla", - Description: "bla", - BlockHeight: uint64(123), - BlockHashAtHeight: "0x1234", - } - - err := a.EvmKeeper.AddSupportForNewChain( - ctx, - newChain.GetChainReferenceID(), - newChain.GetChainID(), - newChain.GetBlockHeight(), - newChain.GetBlockHashAtHeight(), - big.NewInt(55), - ) - require.NoError(t, err) - - err = a.EvmKeeper.ActivateChainReferenceID(ctx, newChain.ChainReferenceID, &types.SmartContract{Id: 123}, fmt.Sprintf("addr%d", i), []byte("abc")) - require.NoError(t, err) - } - - validator := genValidators(1, 1000)[0] - a.StakingKeeper.SetValidator(ctx, validator) - - private, err := crypto.GenerateKey() - require.NoError(t, err) - - accAddr := crypto.PubkeyToAddress(private.PublicKey) - - // Only add support for one of two chains created - err = a.ValsetKeeper.AddExternalChainInfo( - ctx, - validator.GetOperator(), - []*valsettypes.ExternalChainInfo{ - { - ChainType: "evm", - ChainReferenceID: "chain-1", - Address: accAddr.Hex(), - Pubkey: accAddr[:], - }, - }, - ) - require.NoError(t, err) - - return validator.GetOperator() - }, - expected: false, - }, - } - - asserter := assert.New(t) - for _, tt := range testcases { - t.Run(tt.name, func(t *testing.T) { - a := app.NewTestApp(t, false) - ctx := a.NewContext(false, tmproto.Header{ - Height: 5, - }) - - validatorAddress := tt.setup(ctx, a) - - actual := a.ValsetKeeper.ValidatorSupportsAllChains(ctx, validatorAddress) - asserter.Equal(tt.expected, actual) - }) - } -} - -func TestWithGinkgo(t *testing.T) { - RegisterFailHandler(Fail) - - RunSpecs(t, "EVM keeper") -} - -var _ = Describe("evm", func() { - // smartContractAddr := common.BytesToAddress(rand.Bytes(5)) - // chainType, chainReferenceID := consensustypes.ChainTypeEVM, "eth-main" - var a app.TestApp - var ctx sdk.Context - var validators []stakingtypes.Validator - newChain := &types.AddChainProposal{ - ChainReferenceID: "eth-main", - Title: "bla", - Description: "bla", - BlockHeight: uint64(123), - BlockHashAtHeight: "0x1234", - } - smartContract := &types.SmartContract{ - Id: 1, - AbiJSON: contractAbi, - Bytecode: common.FromHex(contractBytecodeStr), - } - smartContract2 := &types.SmartContract{ - Id: 2, - AbiJSON: contractAbi, - Bytecode: common.FromHex(contractBytecodeStr), - } - - BeforeEach(func() { - a = app.NewTestApp(GinkgoT(), false) - ctx = a.NewContext(false, tmproto.Header{ - Height: 5, - }) - }) - - Context("multiple chains and smart contracts", func() { - Describe("trying to add support for the same chain twice", func() { - It("returns an error", func() { - err := a.EvmKeeper.AddSupportForNewChain( - ctx, - newChain.GetChainReferenceID(), - newChain.GetChainID(), - newChain.GetBlockHeight(), - newChain.GetBlockHashAtHeight(), - big.NewInt(55), - ) - Expect(err).To(BeNil()) - - err = a.EvmKeeper.AddSupportForNewChain( - ctx, - newChain.GetChainReferenceID(), - newChain.GetChainID(), - newChain.GetBlockHeight(), - newChain.GetBlockHashAtHeight(), - big.NewInt(55), - ) - Expect(err).To(MatchError(keeper.ErrCannotAddSupportForChainThatExists)) - }) - }) - - Describe("ensuring that there can be two chains at the same time", func() { - chain1 := &types.AddChainProposal{ - ChainReferenceID: "chain1", - Title: "bla", - Description: "bla", - BlockHeight: uint64(456), - BlockHashAtHeight: "0x1234", - ChainID: 1, - } - chain2 := &types.AddChainProposal{ - ChainReferenceID: "chain2", - Title: "bla", - Description: "bla", - BlockHeight: uint64(123), - BlockHashAtHeight: "0x5678", - ChainID: 2, - } - BeforeEach(func() { - validators = genValidators(25, 25000) - for _, val := range validators { - a.StakingKeeper.SetValidator(ctx, val) - } - }) - - JustBeforeEach(func() { - for _, val := range validators { - private1, err := crypto.GenerateKey() - private2, err := crypto.GenerateKey() - Expect(err).To(BeNil()) - accAddr1 := crypto.PubkeyToAddress(private1.PublicKey) - accAddr2 := crypto.PubkeyToAddress(private2.PublicKey) - err = a.ValsetKeeper.AddExternalChainInfo(ctx, val.GetOperator(), []*valsettypes.ExternalChainInfo{ - { - ChainType: "evm", - ChainReferenceID: chain1.ChainReferenceID, - Address: accAddr1.Hex(), - Pubkey: []byte("pub key 1" + accAddr1.Hex()), - }, - { - ChainType: "evm", - ChainReferenceID: chain2.ChainReferenceID, - Address: accAddr2.Hex(), - Pubkey: []byte("pub key 2" + accAddr2.Hex()), - }, - }) - Expect(err).To(BeNil()) - } - _, err := a.ValsetKeeper.TriggerSnapshotBuild(ctx) - Expect(err).To(BeNil()) - }) - - BeforeEach(func() { - By("adding chain1 works") - err := a.EvmKeeper.AddSupportForNewChain( - ctx, - chain1.GetChainReferenceID(), - chain1.GetChainID(), - chain1.GetBlockHeight(), - chain1.GetBlockHashAtHeight(), - big.NewInt(55), - ) - Expect(err).To(BeNil()) - - By("adding chain2 works") - err = a.EvmKeeper.AddSupportForNewChain( - ctx, - chain2.GetChainReferenceID(), - chain2.GetChainID(), - chain2.GetBlockHeight(), - chain2.GetBlockHashAtHeight(), - big.NewInt(55), - ) - Expect(err).To(BeNil()) - }) - - Context("adding smart contract", func() { - It("adds a new smart contract deployment", func() { - By("simple assertion that two smart contracts share different ids", func() { - Expect(smartContract.GetId()).NotTo(Equal(smartContract2.GetId())) - }) - By("saving a new smart contract", func() { - Expect( - a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain1.GetChainReferenceID()), - ).To(BeFalse()) - Expect( - a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain2.GetChainReferenceID()), - ).To(BeFalse()) - - sc, err := a.EvmKeeper.SaveNewSmartContract(ctx, smartContract.GetAbiJSON(), smartContract.GetBytecode()) - Expect(err).To(BeNil()) - - err = a.EvmKeeper.SetAsCompassContract(ctx, sc) - Expect(err).To(BeNil()) - - Expect( - a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain1.GetChainReferenceID()), - ).To(BeTrue()) - Expect( - a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain2.GetChainReferenceID()), - ).To(BeTrue()) - }) - - By("removing a smart deployment for chain1 - it means that it was successfully uploaded", func() { - a.EvmKeeper.DeleteSmartContractDeploymentByContractID(ctx, smartContract.GetId(), chain1.GetChainReferenceID()) - Expect( - a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain1.GetChainReferenceID()), - ).To(BeFalse()) - Expect( - a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain2.GetChainReferenceID()), - ).To(BeTrue()) - }) - - By("activating a new smart contract it removes a deployment for chain1 but it doesn't for chain2", func() { - err := a.EvmKeeper.ActivateChainReferenceID(ctx, chain1.GetChainReferenceID(), smartContract, "addr1", []byte("id1")) - Expect(err).To(BeNil()) - Expect( - a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain1.GetChainReferenceID()), - ).To(BeFalse()) - Expect( - a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain2.GetChainReferenceID()), - ).To(BeTrue()) - - By("verify that the chain's smart contract id has been deployed", func() { - ci, err := a.EvmKeeper.GetChainInfo(ctx, chain1.GetChainReferenceID()) - Expect(err).To(BeNil()) - Expect(ci.GetActiveSmartContractID()).To(Equal(smartContract.GetId())) - }) - }) - - By("adding a new smart contract deployment deploys it to chain1 only", func() { - sc, err := a.EvmKeeper.SaveNewSmartContract(ctx, smartContract2.GetAbiJSON(), smartContract2.GetBytecode()) - Expect(err).To(BeNil()) - err = a.EvmKeeper.SetAsCompassContract(ctx, sc) - Expect(err).To(BeNil()) - Expect( - a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain1.GetChainReferenceID()), - ).To(BeTrue()) - }) - - By("activating a new-new smart contract it deploys it to chain 1", func() { - err := a.EvmKeeper.ActivateChainReferenceID(ctx, chain1.GetChainReferenceID(), smartContract2, "addr2", []byte("id2")) - Expect(err).To(BeNil()) - Expect( - a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain2.GetChainReferenceID()), - ).To(BeTrue()) - By("verify that the chain's smart contract id has been deployed", func() { - ci, err := a.EvmKeeper.GetChainInfo(ctx, chain1.GetChainReferenceID()) - Expect(err).To(BeNil()) - Expect(ci.GetActiveSmartContractID()).To(Equal(smartContract2.GetId())) - }) - }) - }) - }) - }) - }) - - Describe("on snapshot build", func() { - var snapshot *valsettypes.Snapshot - When("validator set is valid", func() { - BeforeEach(func() { - validators = genValidators(25, 25000) - for _, val := range validators { - a.StakingKeeper.SetValidator(ctx, val) - } - }) - - When("evm chain and smart contract both exist", func() { - BeforeEach(func() { - for _, val := range validators { - private, err := crypto.GenerateKey() - Expect(err).To(BeNil()) - accAddr := crypto.PubkeyToAddress(private.PublicKey) - err = a.ValsetKeeper.AddExternalChainInfo(ctx, val.GetOperator(), []*valsettypes.ExternalChainInfo{ - { - ChainType: "evm", - ChainReferenceID: newChain.ChainReferenceID, - Address: accAddr.Hex(), - Pubkey: []byte("pub key" + accAddr.Hex()), - }, - { - ChainType: "evm", - ChainReferenceID: "new-chain", - Address: accAddr.Hex(), - Pubkey: []byte("pub key" + accAddr.Hex()), - }, - }) - Expect(err).To(BeNil()) - } - var err error - snapshot, err = a.ValsetKeeper.TriggerSnapshotBuild(ctx) - Expect(err).To(BeNil()) - }) - - BeforeEach(func() { - err := a.EvmKeeper.AddSupportForNewChain( - ctx, - newChain.GetChainReferenceID(), - newChain.GetChainID(), - newChain.GetBlockHeight(), - newChain.GetBlockHashAtHeight(), - big.NewInt(55), - ) - Expect(err).To(BeNil()) - - sc, err := a.EvmKeeper.SaveNewSmartContract(ctx, smartContract.GetAbiJSON(), smartContract.GetBytecode()) - Expect(err).To(BeNil()) - err = a.EvmKeeper.SetAsCompassContract(ctx, sc) - Expect(err).To(BeNil()) - - err = a.EvmKeeper.ActivateChainReferenceID(ctx, newChain.ChainReferenceID, smartContract, "addr", []byte("abc")) - Expect(err).To(BeNil()) - - By("it should have upload smart contract message", func() { - msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, "evm/eth-main/evm-turnstone-message", 5) - - Expect(err).To(BeNil()) - Expect(len(msgs)).To(Equal(1)) - - con, err := msgs[0].ConsensusMsg(a.AppCodec()) - Expect(err).To(BeNil()) - - evmMsg, ok := con.(*types.Message) - Expect(ok).To(BeTrue()) - - _, ok = evmMsg.GetAction().(*types.Message_UploadSmartContract) - Expect(ok).To(BeTrue()) - - a.ConsensusKeeper.DeleteJob(ctx, "evm/eth-main/evm-turnstone-message", msgs[0].GetId()) - }) - }) - - It("expects update valset message to exist", func() { - a.EvmKeeper.OnSnapshotBuilt(ctx, snapshot) - msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, "evm/eth-main/evm-turnstone-message", 5) - - Expect(err).To(BeNil()) - Expect(len(msgs)).To(Equal(1)) - - con, err := msgs[0].ConsensusMsg(a.AppCodec()) - Expect(err).To(BeNil()) - - evmMsg, ok := con.(*types.Message) - Expect(ok).To(BeTrue()) - - _, ok = evmMsg.GetAction().(*types.Message_UpdateValset) - Expect(ok).To(BeTrue()) - }) - - When("adding another chain which is not yet active", func() { - BeforeEach(func() { - err := a.EvmKeeper.AddSupportForNewChain( - ctx, - "new-chain", - 123, - uint64(123), - "0x1234", - big.NewInt(55), - ) - Expect(err).To(BeNil()) - }) - - It("tries to deploy a smart contract to it", func() { - a.EvmKeeper.OnSnapshotBuilt(ctx, snapshot) - msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, "evm/new-chain/evm-turnstone-message", 5) - Expect(err).To(BeNil()) - Expect(len(msgs)).To(Equal(1)) - - con, err := msgs[0].ConsensusMsg(a.AppCodec()) - Expect(err).To(BeNil()) - - evmMsg, ok := con.(*types.Message) - Expect(ok).To(BeTrue()) - - _, ok = evmMsg.GetAction().(*types.Message_UploadSmartContract) - Expect(ok).To(BeTrue()) - }) - }) - - When("there is another upload valset already in", func() { - BeforeEach(func() { - err := a.EvmKeeper.AddSupportForNewChain( - ctx, - "new-chain", - 123, - uint64(123), - "0x1234", - big.NewInt(55), - ) - Expect(err).To(BeNil()) - err = a.EvmKeeper.ActivateChainReferenceID(ctx, "new-chain", &types.SmartContract{Id: 123}, "addr", []byte("abc")) - Expect(err).To(BeNil()) - for _, val := range validators { - private, err := crypto.GenerateKey() - Expect(err).To(BeNil()) - accAddr := crypto.PubkeyToAddress(private.PublicKey) - err = a.ValsetKeeper.AddExternalChainInfo(ctx, val.GetOperator(), []*valsettypes.ExternalChainInfo{ - { - ChainType: "evm", - ChainReferenceID: "new-chain", - Address: accAddr.Hex(), - Pubkey: []byte("pub key" + accAddr.Hex()), - }, - }) - Expect(err).To(BeNil()) - } - }) - BeforeEach(func() { - msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, "evm/new-chain/evm-turnstone-message", 5) - Expect(err).To(BeNil()) - for _, msg := range msgs { - // we are now clearing the deploy smart contract from the queue as we don't need it - a.ConsensusKeeper.DeleteJob(ctx, "evm/new-chain/evm-turnstone-message", msg.GetId()) - } - a.ConsensusKeeper.PutMessageInQueue(ctx, "evm/new-chain/evm-turnstone-message", &types.Message{ - TurnstoneID: "abc", - ChainReferenceID: "new-chain", - Action: &types.Message_UpdateValset{ - UpdateValset: &types.UpdateValset{ - Valset: &types.Valset{ - ValsetID: 777, - }, - }, - }, - }, nil) - }) - It("deletes the old smart deployment", func() { - a.EvmKeeper.OnSnapshotBuilt(ctx, snapshot) - msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, "evm/new-chain/evm-turnstone-message", 5) - Expect(err).To(BeNil()) - Expect(len(msgs)).To(Equal(1)) - - con, err := msgs[0].ConsensusMsg(a.AppCodec()) - Expect(err).To(BeNil()) - - evmMsg, ok := con.(*types.Message) - Expect(ok).To(BeTrue()) - - vset, ok := evmMsg.GetAction().(*types.Message_UpdateValset) - Expect(ok).To(BeTrue()) - Expect(vset.UpdateValset.GetValset().GetValsetID()).NotTo(Equal(uint64(777))) - Expect(len(vset.UpdateValset.GetValset().GetValidators())).NotTo(BeZero()) - }) - }) - }) - }) - - When("validator set is too tiny", func() { - BeforeEach(func() { - validators = genValidators(25, 25000)[:5] - for _, val := range validators { - a.StakingKeeper.SetValidator(ctx, val) - } - _, err := a.ValsetKeeper.TriggerSnapshotBuild(ctx) - Expect(err).To(BeNil()) - }) - - Context("evm chain and smart contract both exist", func() { - BeforeEach(func() { - err := a.EvmKeeper.AddSupportForNewChain( - ctx, - newChain.GetChainReferenceID(), - newChain.GetChainID(), - newChain.GetBlockHeight(), - newChain.GetBlockHashAtHeight(), - big.NewInt(55), - ) - Expect(err).To(BeNil()) - sc, err := a.EvmKeeper.SaveNewSmartContract(ctx, smartContract.GetAbiJSON(), smartContract.GetBytecode()) - Expect(err).To(BeNil()) - err = a.EvmKeeper.SetAsCompassContract(ctx, sc) - Expect(err).To(BeNil()) - }) - - It("doesn't put any message into a queue", func() { - msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, "evm/eth-main/evm-turnstone-message", 5) - Expect(err).To(BeNil()) - Expect(msgs).To(BeZero()) - }) - }) - }) - }) -}) - -var _ = Describe("change min on chain balance", func() { - var a app.TestApp - var ctx sdk.Context - newChain := &types.AddChainProposal{ - ChainReferenceID: "eth-main", - Title: "bla", - Description: "bla", - BlockHeight: uint64(123), - BlockHashAtHeight: "0x1234", - } - - BeforeEach(func() { - a = app.NewTestApp(GinkgoT(), false) - ctx = a.NewContext(false, tmproto.Header{ - Height: 5, - }) - }) - - When("chain info exists", func() { - BeforeEach(func() { - err := a.EvmKeeper.AddSupportForNewChain(ctx, newChain.GetChainReferenceID(), newChain.GetChainID(), 1, "a", big.NewInt(55)) - Expect(err).To(BeNil()) - }) - - BeforeEach(func() { - ci, err := a.EvmKeeper.GetChainInfo(ctx, newChain.GetChainReferenceID()) - Expect(err).To(BeNil()) - balance, err := ci.GetMinOnChainBalanceBigInt() - Expect(err).To(BeNil()) - Expect(balance.Text(10)).To(Equal(big.NewInt(55).Text(10))) - }) - - It("changes the on chain balance", func() { - err := a.EvmKeeper.ChangeMinOnChainBalance(ctx, newChain.GetChainReferenceID(), big.NewInt(888)) - Expect(err).To(BeNil()) - - ci, err := a.EvmKeeper.GetChainInfo(ctx, newChain.GetChainReferenceID()) - Expect(err).To(BeNil()) - balance, err := ci.GetMinOnChainBalanceBigInt() - Expect(err).To(BeNil()) - Expect(balance.Text(10)).To(Equal(big.NewInt(888).Text(10))) - }) - }) - - When("chain info does not exists", func() { - It("returns an error", func() { - err := a.EvmKeeper.ChangeMinOnChainBalance(ctx, newChain.GetChainReferenceID(), big.NewInt(888)) - Expect(err).To(MatchError(keeper.ErrChainNotFound)) - }) - }) -}) - -var _ = Describe("change relay weights", func() { - var a app.TestApp - var ctx sdk.Context - newChain := &types.AddChainProposal{ - ChainReferenceID: "eth-main", - Title: "bla", - Description: "bla", - BlockHeight: uint64(123), - BlockHashAtHeight: "0x1234", - } - - BeforeEach(func() { - a = app.NewTestApp(GinkgoT(), false) - ctx = a.NewContext(false, tmproto.Header{ - Height: 5, - }) - }) - - When("chain info exists", func() { - BeforeEach(func() { - err := a.EvmKeeper.AddSupportForNewChain(ctx, newChain.GetChainReferenceID(), newChain.GetChainID(), 1, "a", big.NewInt(55)) - Expect(err).To(BeNil()) - }) - - BeforeEach(func() { - ci, err := a.EvmKeeper.GetChainInfo(ctx, newChain.GetChainReferenceID()) - Expect(err).To(BeNil()) - weights := ci.GetRelayWeights() - Expect(weights).To(Equal(&types.RelayWeights{ - Fee: "1.0", - Uptime: "1.0", - SuccessRate: "1.0", - ExecutionTime: "1.0", - })) - }) - - It("changes the relay weights", func() { - newWeights := &types.RelayWeights{ - Fee: "0.12", - Uptime: "0.34", - SuccessRate: "0.56", - ExecutionTime: "0.78", - } - err := a.EvmKeeper.SetRelayWeights(ctx, newChain.GetChainReferenceID(), newWeights) - Expect(err).To(BeNil()) - - ci, err := a.EvmKeeper.GetChainInfo(ctx, newChain.GetChainReferenceID()) - Expect(err).To(BeNil()) - weights := ci.GetRelayWeights() - Expect(weights).To(Equal(newWeights)) - }) - }) - - When("chain info does not exists", func() { - It("returns an error", func() { - err := a.EvmKeeper.SetRelayWeights(ctx, newChain.GetChainReferenceID(), &types.RelayWeights{ - Fee: "0.12", - Uptime: "0.34", - SuccessRate: "0.56", - ExecutionTime: "0.78", - }) - Expect(err).To(MatchError(keeper.ErrChainNotFound)) - }) - }) -}) +// import ( +// "fmt" +// "io/ioutil" +// "math/big" +// "strings" +// "testing" +// "time" + +// "github.com/VolumeFi/whoops" +// sdk "github.com/cosmos/cosmos-sdk/types" +// stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +// "github.com/ethereum/go-ethereum/accounts/abi" +// "github.com/ethereum/go-ethereum/common" +// "github.com/ethereum/go-ethereum/crypto" +// . "github.com/onsi/ginkgo/v2" +// . "github.com/onsi/gomega" +// "github.com/palomachain/paloma/app" +// "github.com/palomachain/paloma/testutil" +// "github.com/palomachain/paloma/testutil/rand" +// "github.com/palomachain/paloma/testutil/sample" +// consensustypes "github.com/palomachain/paloma/x/consensus/types" +// "github.com/palomachain/paloma/x/evm/keeper" +// "github.com/palomachain/paloma/x/evm/types" +// valsettypes "github.com/palomachain/paloma/x/valset/types" +// "github.com/stretchr/testify/assert" +// "github.com/stretchr/testify/require" +// ) + +// var ( +// contractAbi = string(whoops.Must(ioutil.ReadFile("testdata/sample-abi.json"))) +// contractBytecodeStr = string(whoops.Must(ioutil.ReadFile("testdata/sample-bytecode.out"))) +// ) + +// func genValidators(numValidators, totalConsPower int) []stakingtypes.Validator { +// return testutil.GenValidators(numValidators, totalConsPower) +// } + +// func TestEndToEndForEvmArbitraryCall(t *testing.T) { +// chainType, chainReferenceID := consensustypes.ChainTypeEVM, "eth-main" +// a := app.NewTestApp(t, false) +// ctx := a.NewContext(false) + +// newChain := &types.AddChainProposal{ +// ChainReferenceID: "eth-main", +// Title: "bla", +// Description: "bla", +// BlockHeight: uint64(123), +// BlockHashAtHeight: "0x1234", +// } + +// err := a.EvmKeeper.AddSupportForNewChain( +// ctx, +// newChain.GetChainReferenceID(), +// newChain.GetChainID(), +// newChain.GetBlockHeight(), +// newChain.GetBlockHashAtHeight(), +// big.NewInt(55), +// ) +// require.NoError(t, err) + +// err = a.EvmKeeper.ActivateChainReferenceID(ctx, newChain.ChainReferenceID, &types.SmartContract{Id: 123}, "addr", []byte("abc")) +// require.NoError(t, err) + +// validators := genValidators(25, 25000) +// for _, val := range validators { +// a.StakingKeeper.SetValidator(ctx, val) +// } + +// for _, validator := range validators { +// valAddr, err := validator.GetConsAddr() +// require.NoError(t, err) +// pubKey, err := validator.ConsPubKey() +// require.NoError(t, err) +// err = a.ValsetKeeper.AddExternalChainInfo(ctx, validator.GetOperator(), []*valsettypes.ExternalChainInfo{ +// { +// ChainType: "evm", +// ChainReferenceID: newChain.GetChainReferenceID(), +// Address: valAddr.String(), +// Pubkey: pubKey.Bytes(), +// }, +// }) +// require.NoError(t, err) +// } + +// _, err = a.ValsetKeeper.TriggerSnapshotBuild(ctx) +// require.NoError(t, err) + +// smartContractAddr := common.BytesToAddress(rand.Bytes(5)) +// _, err = a.EvmKeeper.AddSmartContractExecutionToConsensus( +// ctx, +// chainReferenceID, +// "", +// &types.SubmitLogicCall{ +// Payload: func() []byte { +// evm := whoops.Must(abi.JSON(strings.NewReader(sample.SimpleABI))) +// return whoops.Must(evm.Pack("store", big.NewInt(1337))) +// }(), +// HexContractAddress: smartContractAddr.Hex(), +// Abi: []byte(sample.SimpleABI), +// Deadline: 1337, +// }, +// ) + +// require.NoError(t, err) + +// private, err := crypto.GenerateKey() +// require.NoError(t, err) + +// accAddr := crypto.PubkeyToAddress(private.PublicKey) +// err = a.ValsetKeeper.AddExternalChainInfo(ctx, validators[0].GetOperator(), []*valsettypes.ExternalChainInfo{ +// { +// ChainType: chainType, +// ChainReferenceID: chainReferenceID, +// Address: accAddr.Hex(), +// Pubkey: accAddr[:], +// }, +// }) + +// require.NoError(t, err) +// queue := consensustypes.Queue(keeper.ConsensusTurnstoneMessage, chainType, chainReferenceID) +// msgs, err := a.ConsensusKeeper.GetMessagesForSigning(ctx, queue, validators[0].GetOperator()) + +// for _, msg := range msgs { +// sigbz, err := crypto.Sign( +// crypto.Keccak256( +// []byte(keeper.SignaturePrefix), +// msg.GetBytesToSign(), +// ), +// private, +// ) +// require.NoError(t, err) +// err = a.ConsensusKeeper.AddMessageSignature( +// ctx, +// validators[0].GetOperator(), +// []*consensustypes.ConsensusMessageSignature{ +// { +// Id: msg.GetId(), +// QueueTypeName: queue, +// Signature: sigbz, +// SignedByAddress: accAddr.Hex(), +// }, +// }, +// ) +// require.NoError(t, err) +// } +// } + +// func TestFirstSnapshot_OnSnapshotBuilt(t *testing.T) { +// a := app.NewTestApp(t, false) +// ctx := a.NewContext(false) + +// newChain := &types.AddChainProposal{ +// ChainReferenceID: "bob", +// Title: "bla", +// Description: "bla", +// BlockHeight: uint64(123), +// BlockHashAtHeight: "0x1234", +// } +// err := a.EvmKeeper.AddSupportForNewChain( +// ctx, +// newChain.GetChainReferenceID(), +// newChain.GetChainID(), +// newChain.GetBlockHeight(), +// newChain.GetBlockHashAtHeight(), +// big.NewInt(55), +// ) +// require.NoError(t, err) +// err = a.EvmKeeper.ActivateChainReferenceID( +// ctx, +// newChain.ChainReferenceID, +// &types.SmartContract{ +// Id: 123, +// }, +// "addr", +// []byte("abc"), +// ) +// require.NoError(t, err) + +// validators := genValidators(25, 25000) +// for _, val := range validators { +// a.StakingKeeper.SetValidator(ctx, val) +// err = a.ValsetKeeper.AddExternalChainInfo(ctx, val.GetOperator(), []*valsettypes.ExternalChainInfo{ +// { +// ChainType: "evm", +// ChainReferenceID: "bob", +// Address: rand.ETHAddress().Hex(), +// Pubkey: []byte("pk" + rand.ETHAddress().Hex()), +// }, +// }) +// require.NoError(t, err) +// } + +// queue := fmt.Sprintf("evm/%s/%s", newChain.GetChainReferenceID(), keeper.ConsensusTurnstoneMessage) + +// msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 100) +// require.NoError(t, err) +// require.Empty(t, msgs) + +// _, err = a.ValsetKeeper.TriggerSnapshotBuild(ctx) +// require.NoError(t, err) + +// msgs, err = a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 100) +// require.NoError(t, err) +// require.Len(t, msgs, 1) +// } + +// func TestRecentPublishedSnapshot_OnSnapshotBuilt(t *testing.T) { +// a := app.NewTestApp(t, false) +// ctx := a.NewContext(false) + +// newChain := &types.AddChainProposal{ +// ChainReferenceID: "bob", +// Title: "bla", +// Description: "bla", +// BlockHeight: uint64(123), +// BlockHashAtHeight: "0x1234", +// } +// err := a.EvmKeeper.AddSupportForNewChain( +// ctx, +// newChain.GetChainReferenceID(), +// newChain.GetChainID(), +// newChain.GetBlockHeight(), +// newChain.GetBlockHashAtHeight(), +// big.NewInt(55), +// ) +// require.NoError(t, err) +// err = a.EvmKeeper.ActivateChainReferenceID( +// ctx, +// newChain.ChainReferenceID, +// &types.SmartContract{ +// Id: 123, +// }, +// "addr", +// []byte("abc"), +// ) +// require.NoError(t, err) + +// validators := genValidators(25, 25000) +// for _, val := range validators { +// a.StakingKeeper.SetValidator(ctx, val) +// err = a.ValsetKeeper.AddExternalChainInfo(ctx, val.GetOperator(), []*valsettypes.ExternalChainInfo{ +// { +// ChainType: "evm", +// ChainReferenceID: "bob", +// Address: rand.ETHAddress().Hex(), +// Pubkey: []byte("pk" + rand.ETHAddress().Hex()), +// }, +// }) +// require.NoError(t, err) +// } + +// queue := fmt.Sprintf("evm/%s/%s", newChain.GetChainReferenceID(), keeper.ConsensusTurnstoneMessage) + +// msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 1) +// require.NoError(t, err) +// require.Empty(t, msgs) + +// // Remove the listeners to set current state +// snapshotListeners := a.ValsetKeeper.SnapshotListeners +// a.ValsetKeeper.SnapshotListeners = []valsettypes.OnSnapshotBuiltListener{} + +// _, err = a.ValsetKeeper.TriggerSnapshotBuild(ctx) +// require.NoError(t, err) + +// msgs, err = a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 100) +// require.NoError(t, err) +// require.Len(t, msgs, 0) + +// latestSnapshot, err := a.ValsetKeeper.GetCurrentSnapshot(ctx) +// require.NoError(t, err) + +// latestSnapshot.Chains = []string{"bob"} +// err = a.ValsetKeeper.SaveModifiedSnapshot(ctx, latestSnapshot) +// require.NoError(t, err) + +// // Add two validators to make this new snapshot worthy +// validators = genValidators(2, 25000) +// for _, val := range validators { +// a.StakingKeeper.SetValidator(ctx, val) +// err = a.ValsetKeeper.AddExternalChainInfo(ctx, val.GetOperator(), []*valsettypes.ExternalChainInfo{ +// { +// ChainType: "evm", +// ChainReferenceID: "bob", +// Address: rand.ETHAddress().Hex(), +// Pubkey: []byte("pk" + rand.ETHAddress().Hex()), +// }, +// }) +// require.NoError(t, err) +// } + +// // Add the listeners back on for the test +// a.ValsetKeeper.SnapshotListeners = snapshotListeners + +// _, err = a.ValsetKeeper.TriggerSnapshotBuild(ctx) +// require.NoError(t, err) + +// msgs, err = a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 100) +// require.NoError(t, err) +// require.Len(t, msgs, 0) // We don't expect a message because there is already a recent snapshot for the chain +// } + +// func TestOldPublishedSnapshot_OnSnapshotBuilt(t *testing.T) { +// a := app.NewTestApp(t, false) +// ctx := a.NewContext(false) + +// newChain := &types.AddChainProposal{ +// ChainReferenceID: "bob", +// Title: "bla", +// Description: "bla", +// BlockHeight: uint64(123), +// BlockHashAtHeight: "0x1234", +// } +// err := a.EvmKeeper.AddSupportForNewChain( +// ctx, +// newChain.GetChainReferenceID(), +// newChain.GetChainID(), +// newChain.GetBlockHeight(), +// newChain.GetBlockHashAtHeight(), +// big.NewInt(55), +// ) +// require.NoError(t, err) +// err = a.EvmKeeper.ActivateChainReferenceID( +// ctx, +// newChain.ChainReferenceID, +// &types.SmartContract{ +// Id: 123, +// }, +// "addr", +// []byte("abc"), +// ) +// require.NoError(t, err) + +// validators := genValidators(25, 25000) +// for _, val := range validators { +// a.StakingKeeper.SetValidator(ctx, val) +// err = a.ValsetKeeper.AddExternalChainInfo(ctx, val.GetOperator(), []*valsettypes.ExternalChainInfo{ +// { +// ChainType: "evm", +// ChainReferenceID: "bob", +// Address: rand.ETHAddress().Hex(), +// Pubkey: []byte("pk" + rand.ETHAddress().Hex()), +// }, +// }) +// require.NoError(t, err) +// } + +// queue := fmt.Sprintf("evm/%s/%s", newChain.GetChainReferenceID(), keeper.ConsensusTurnstoneMessage) + +// msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 1) +// require.NoError(t, err) +// require.Empty(t, msgs) + +// // Remove the listeners to set current state +// snapshotListeners := a.ValsetKeeper.SnapshotListeners +// a.ValsetKeeper.SnapshotListeners = []valsettypes.OnSnapshotBuiltListener{} + +// _, err = a.ValsetKeeper.TriggerSnapshotBuild(ctx) +// require.NoError(t, err) + +// msgs, err = a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 100) +// require.NoError(t, err) +// require.Len(t, msgs, 0) + +// latestSnapshot, err := a.ValsetKeeper.GetCurrentSnapshot(ctx) +// require.NoError(t, err) + +// // Age the latest snapshot by 30 days, 1 minute, set as active on chain +// latestSnapshot.Chains = []string{"bob"} +// latestSnapshot.CreatedAt = ctx.BlockTime().Add(-((30 * 24 * time.Hour) + time.Minute)) +// err = a.ValsetKeeper.SaveModifiedSnapshot(ctx, latestSnapshot) +// require.NoError(t, err) + +// // Add two validators to make this new snapshot worthy +// validators = genValidators(2, 25000) +// for _, val := range validators { +// a.StakingKeeper.SetValidator(ctx, val) +// err = a.ValsetKeeper.AddExternalChainInfo(ctx, val.GetOperator(), []*valsettypes.ExternalChainInfo{ +// { +// ChainType: "evm", +// ChainReferenceID: "bob", +// Address: rand.ETHAddress().Hex(), +// Pubkey: []byte("pk" + rand.ETHAddress().Hex()), +// }, +// }) +// require.NoError(t, err) +// } + +// // Add the listeners back on for the test +// a.ValsetKeeper.SnapshotListeners = snapshotListeners + +// _, err = a.ValsetKeeper.TriggerSnapshotBuild(ctx) +// require.NoError(t, err) + +// msgs, err = a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 100) +// require.NoError(t, err) +// require.Len(t, msgs, 1) // We expect a new message because the previous one is a week old +// } + +// func TestInactiveChain_OnSnapshotBuilt(t *testing.T) { +// a := app.NewTestApp(t, false) +// ctx := a.NewContext(false) + +// validators := genValidators(25, 25000) +// for _, val := range validators { +// a.StakingKeeper.SetValidator(ctx, val) +// } + +// queue := fmt.Sprintf("evm/%s/%s", "bob", keeper.ConsensusTurnstoneMessage) + +// _, err := a.ValsetKeeper.TriggerSnapshotBuild(ctx) +// require.NoError(t, err) + +// _, err = a.ConsensusKeeper.GetMessagesFromQueue(ctx, queue, 100) +// require.Error(t, err) // We expect an error from this +// } + +// func TestAddingSupportForNewChain(t *testing.T) { +// a := app.NewTestApp(t, false) +// ctx := a.NewContext(false) + +// t.Run("with happy path there are no errors", func(t *testing.T) { +// newChain := &types.AddChainProposal{ +// ChainReferenceID: "bob", +// Title: "bla", +// Description: "bla", +// BlockHeight: uint64(123), +// BlockHashAtHeight: "0x1234", +// } +// err := a.EvmKeeper.AddSupportForNewChain( +// ctx, +// newChain.GetChainReferenceID(), +// newChain.GetChainID(), +// newChain.GetBlockHeight(), +// newChain.GetBlockHashAtHeight(), +// big.NewInt(55), +// ) +// require.NoError(t, err) + +// gotChainInfo, err := a.EvmKeeper.GetChainInfo(ctx, newChain.GetChainReferenceID()) +// require.NoError(t, err) + +// require.Equal(t, newChain.GetChainReferenceID(), gotChainInfo.GetChainReferenceID()) +// require.Equal(t, newChain.GetBlockHashAtHeight(), gotChainInfo.GetReferenceBlockHash()) +// require.Equal(t, newChain.GetBlockHeight(), gotChainInfo.GetReferenceBlockHeight()) +// t.Run("it returns an error if we try to add a chian whose chainID already exists", func(t *testing.T) { +// newChain.ChainReferenceID = "something_new" +// err := a.EvmKeeper.AddSupportForNewChain( +// ctx, +// newChain.GetChainReferenceID(), +// newChain.GetChainID(), +// newChain.GetBlockHeight(), +// newChain.GetBlockHashAtHeight(), +// big.NewInt(55), +// ) +// require.ErrorIs(t, err, keeper.ErrCannotAddSupportForChainThatExists) +// }) +// }) + +// t.Run("when chainReferenceID already exists then it returns an error", func(t *testing.T) { +// newChain := &types.AddChainProposal{ +// ChainReferenceID: "bob", +// Title: "bla", +// Description: "bla", +// BlockHeight: uint64(123), +// BlockHashAtHeight: "0x1234", +// } +// err := a.EvmKeeper.AddSupportForNewChain( +// ctx, +// newChain.GetChainReferenceID(), +// newChain.GetChainID(), +// newChain.GetBlockHeight(), +// newChain.GetBlockHashAtHeight(), + +// big.NewInt(55), +// ) +// require.Error(t, err) +// }) + +// t.Run("activating chain", func(t *testing.T) { +// t.Run("if the chain does not exist it returns the error", func(t *testing.T) { +// err := a.EvmKeeper.ActivateChainReferenceID(ctx, "i don't exist", &types.SmartContract{}, "", []byte{}) +// require.Error(t, err) +// }) +// t.Run("works when chain exists", func(t *testing.T) { +// err := a.EvmKeeper.ActivateChainReferenceID(ctx, "bob", &types.SmartContract{Id: 123}, "addr", []byte("unique id")) +// require.NoError(t, err) +// gotChainInfo, err := a.EvmKeeper.GetChainInfo(ctx, "bob") +// require.NoError(t, err) + +// require.Equal(t, "addr", gotChainInfo.GetSmartContractAddr()) +// require.Equal(t, []byte("unique id"), gotChainInfo.GetSmartContractUniqueID()) +// }) +// }) + +// t.Run("removing chain", func(t *testing.T) { +// t.Run("if the chain does not exist it returns the error", func(t *testing.T) { +// err := a.EvmKeeper.RemoveSupportForChain(ctx, &types.RemoveChainProposal{ +// ChainReferenceID: "i don't exist", +// }) +// require.Error(t, err) +// }) +// t.Run("works when chain exists", func(t *testing.T) { +// err := a.EvmKeeper.RemoveSupportForChain(ctx, &types.RemoveChainProposal{ +// ChainReferenceID: "bob", +// }) +// require.NoError(t, err) +// _, err = a.EvmKeeper.GetChainInfo(ctx, "bob") +// require.Error(t, keeper.ErrChainNotFound) +// }) +// }) +// } + +// func TestKeeper_ValidatorSupportsAllChains(t *testing.T) { +// testcases := []struct { +// name string +// setup func(sdk.Context, app.TestApp) sdk.ValAddress +// expected bool +// }{ +// { +// name: "returns true when all chains supported", +// setup: func(ctx sdk.Context, a app.TestApp) sdk.ValAddress { +// for i, chainId := range []string{"chain-1", "chain-2"} { +// newChain := &types.AddChainProposal{ +// ChainReferenceID: chainId, +// ChainID: uint64(i), +// Title: "bla", +// Description: "bla", +// BlockHeight: uint64(123), +// BlockHashAtHeight: "0x1234", +// } + +// err := a.EvmKeeper.AddSupportForNewChain( +// ctx, +// newChain.GetChainReferenceID(), +// newChain.GetChainID(), +// newChain.GetBlockHeight(), +// newChain.GetBlockHashAtHeight(), +// big.NewInt(55), +// ) +// require.NoError(t, err) + +// err = a.EvmKeeper.ActivateChainReferenceID(ctx, newChain.ChainReferenceID, &types.SmartContract{Id: 123}, fmt.Sprintf("addr%d", i), []byte("abc")) +// require.NoError(t, err) +// } + +// validator := genValidators(1, 1000)[0] +// a.StakingKeeper.SetValidator(ctx, validator) + +// private, err := crypto.GenerateKey() +// require.NoError(t, err) + +// accAddr := crypto.PubkeyToAddress(private.PublicKey) + +// // Add support for both chains created +// externalChains := make([]*valsettypes.ExternalChainInfo, 2) +// for i, chainId := range []string{"chain-1", "chain-2"} { +// externalChains[i] = &valsettypes.ExternalChainInfo{ +// ChainType: "evm", +// ChainReferenceID: chainId, +// Address: accAddr.Hex(), +// Pubkey: accAddr[:], +// } +// } +// err = a.ValsetKeeper.AddExternalChainInfo(ctx, validator.GetOperator(), externalChains) +// require.NoError(t, err) + +// return validator.GetOperator() +// }, +// expected: true, +// }, +// { +// name: "returns false when a chain is not supported", +// setup: func(ctx sdk.Context, a app.TestApp) sdk.ValAddress { +// for i, chainId := range []string{"chain-1", "chain-2"} { +// newChain := &types.AddChainProposal{ +// ChainReferenceID: chainId, +// ChainID: uint64(i), +// Title: "bla", +// Description: "bla", +// BlockHeight: uint64(123), +// BlockHashAtHeight: "0x1234", +// } + +// err := a.EvmKeeper.AddSupportForNewChain( +// ctx, +// newChain.GetChainReferenceID(), +// newChain.GetChainID(), +// newChain.GetBlockHeight(), +// newChain.GetBlockHashAtHeight(), +// big.NewInt(55), +// ) +// require.NoError(t, err) + +// err = a.EvmKeeper.ActivateChainReferenceID(ctx, newChain.ChainReferenceID, &types.SmartContract{Id: 123}, fmt.Sprintf("addr%d", i), []byte("abc")) +// require.NoError(t, err) +// } + +// validator := genValidators(1, 1000)[0] +// a.StakingKeeper.SetValidator(ctx, validator) + +// private, err := crypto.GenerateKey() +// require.NoError(t, err) + +// accAddr := crypto.PubkeyToAddress(private.PublicKey) + +// // Only add support for one of two chains created +// err = a.ValsetKeeper.AddExternalChainInfo( +// ctx, +// validator.GetOperator(), +// []*valsettypes.ExternalChainInfo{ +// { +// ChainType: "evm", +// ChainReferenceID: "chain-1", +// Address: accAddr.Hex(), +// Pubkey: accAddr[:], +// }, +// }, +// ) +// require.NoError(t, err) + +// return validator.GetOperator() +// }, +// expected: false, +// }, +// } + +// asserter := assert.New(t) +// for _, tt := range testcases { +// t.Run(tt.name, func(t *testing.T) { +// a := app.NewTestApp(t, false) +// ctx := a.NewContext(false) + +// validatorAddress := tt.setup(ctx, a) + +// actual := a.ValsetKeeper.ValidatorSupportsAllChains(ctx, validatorAddress) +// asserter.Equal(tt.expected, actual) +// }) +// } +// } + +// func TestWithGinkgo(t *testing.T) { +// RegisterFailHandler(Fail) + +// RunSpecs(t, "EVM keeper") +// } + +// var _ = Describe("evm", func() { +// // smartContractAddr := common.BytesToAddress(rand.Bytes(5)) +// // chainType, chainReferenceID := consensustypes.ChainTypeEVM, "eth-main" +// var a app.TestApp +// var ctx sdk.Context +// var validators []stakingtypes.Validator +// newChain := &types.AddChainProposal{ +// ChainReferenceID: "eth-main", +// Title: "bla", +// Description: "bla", +// BlockHeight: uint64(123), +// BlockHashAtHeight: "0x1234", +// } +// smartContract := &types.SmartContract{ +// Id: 1, +// AbiJSON: contractAbi, +// Bytecode: common.FromHex(contractBytecodeStr), +// } +// smartContract2 := &types.SmartContract{ +// Id: 2, +// AbiJSON: contractAbi, +// Bytecode: common.FromHex(contractBytecodeStr), +// } + +// BeforeEach(func() { +// a = app.NewTestApp(GinkgoT(), false) +// ctx = a.NewContext(false) +// }) + +// Context("multiple chains and smart contracts", func() { +// Describe("trying to add support for the same chain twice", func() { +// It("returns an error", func() { +// err := a.EvmKeeper.AddSupportForNewChain( +// ctx, +// newChain.GetChainReferenceID(), +// newChain.GetChainID(), +// newChain.GetBlockHeight(), +// newChain.GetBlockHashAtHeight(), +// big.NewInt(55), +// ) +// Expect(err).To(BeNil()) + +// err = a.EvmKeeper.AddSupportForNewChain( +// ctx, +// newChain.GetChainReferenceID(), +// newChain.GetChainID(), +// newChain.GetBlockHeight(), +// newChain.GetBlockHashAtHeight(), +// big.NewInt(55), +// ) +// Expect(err).To(MatchError(keeper.ErrCannotAddSupportForChainThatExists)) +// }) +// }) + +// Describe("ensuring that there can be two chains at the same time", func() { +// chain1 := &types.AddChainProposal{ +// ChainReferenceID: "chain1", +// Title: "bla", +// Description: "bla", +// BlockHeight: uint64(456), +// BlockHashAtHeight: "0x1234", +// ChainID: 1, +// } +// chain2 := &types.AddChainProposal{ +// ChainReferenceID: "chain2", +// Title: "bla", +// Description: "bla", +// BlockHeight: uint64(123), +// BlockHashAtHeight: "0x5678", +// ChainID: 2, +// } +// BeforeEach(func() { +// validators = genValidators(25, 25000) +// for _, val := range validators { +// a.StakingKeeper.SetValidator(ctx, val) +// } +// }) + +// JustBeforeEach(func() { +// for _, val := range validators { +// private1, err := crypto.GenerateKey() +// private2, err := crypto.GenerateKey() +// Expect(err).To(BeNil()) +// accAddr1 := crypto.PubkeyToAddress(private1.PublicKey) +// accAddr2 := crypto.PubkeyToAddress(private2.PublicKey) +// err = a.ValsetKeeper.AddExternalChainInfo(ctx, val.GetOperator(), []*valsettypes.ExternalChainInfo{ +// { +// ChainType: "evm", +// ChainReferenceID: chain1.ChainReferenceID, +// Address: accAddr1.Hex(), +// Pubkey: []byte("pub key 1" + accAddr1.Hex()), +// }, +// { +// ChainType: "evm", +// ChainReferenceID: chain2.ChainReferenceID, +// Address: accAddr2.Hex(), +// Pubkey: []byte("pub key 2" + accAddr2.Hex()), +// }, +// }) +// Expect(err).To(BeNil()) +// } +// _, err := a.ValsetKeeper.TriggerSnapshotBuild(ctx) +// Expect(err).To(BeNil()) +// }) + +// BeforeEach(func() { +// By("adding chain1 works") +// err := a.EvmKeeper.AddSupportForNewChain( +// ctx, +// chain1.GetChainReferenceID(), +// chain1.GetChainID(), +// chain1.GetBlockHeight(), +// chain1.GetBlockHashAtHeight(), +// big.NewInt(55), +// ) +// Expect(err).To(BeNil()) + +// By("adding chain2 works") +// err = a.EvmKeeper.AddSupportForNewChain( +// ctx, +// chain2.GetChainReferenceID(), +// chain2.GetChainID(), +// chain2.GetBlockHeight(), +// chain2.GetBlockHashAtHeight(), +// big.NewInt(55), +// ) +// Expect(err).To(BeNil()) +// }) + +// Context("adding smart contract", func() { +// It("adds a new smart contract deployment", func() { +// By("simple assertion that two smart contracts share different ids", func() { +// Expect(smartContract.GetId()).NotTo(Equal(smartContract2.GetId())) +// }) +// By("saving a new smart contract", func() { +// Expect( +// a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain1.GetChainReferenceID()), +// ).To(BeFalse()) +// Expect( +// a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain2.GetChainReferenceID()), +// ).To(BeFalse()) + +// sc, err := a.EvmKeeper.SaveNewSmartContract(ctx, smartContract.GetAbiJSON(), smartContract.GetBytecode()) +// Expect(err).To(BeNil()) + +// err = a.EvmKeeper.SetAsCompassContract(ctx, sc) +// Expect(err).To(BeNil()) + +// Expect( +// a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain1.GetChainReferenceID()), +// ).To(BeTrue()) +// Expect( +// a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain2.GetChainReferenceID()), +// ).To(BeTrue()) +// }) + +// By("removing a smart deployment for chain1 - it means that it was successfully uploaded", func() { +// a.EvmKeeper.DeleteSmartContractDeploymentByContractID(ctx, smartContract.GetId(), chain1.GetChainReferenceID()) +// Expect( +// a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain1.GetChainReferenceID()), +// ).To(BeFalse()) +// Expect( +// a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain2.GetChainReferenceID()), +// ).To(BeTrue()) +// }) + +// By("activating a new smart contract it removes a deployment for chain1 but it doesn't for chain2", func() { +// err := a.EvmKeeper.ActivateChainReferenceID(ctx, chain1.GetChainReferenceID(), smartContract, "addr1", []byte("id1")) +// Expect(err).To(BeNil()) +// Expect( +// a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain1.GetChainReferenceID()), +// ).To(BeFalse()) +// Expect( +// a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain2.GetChainReferenceID()), +// ).To(BeTrue()) + +// By("verify that the chain's smart contract id has been deployed", func() { +// ci, err := a.EvmKeeper.GetChainInfo(ctx, chain1.GetChainReferenceID()) +// Expect(err).To(BeNil()) +// Expect(ci.GetActiveSmartContractID()).To(Equal(smartContract.GetId())) +// }) +// }) + +// By("adding a new smart contract deployment deploys it to chain1 only", func() { +// sc, err := a.EvmKeeper.SaveNewSmartContract(ctx, smartContract2.GetAbiJSON(), smartContract2.GetBytecode()) +// Expect(err).To(BeNil()) +// err = a.EvmKeeper.SetAsCompassContract(ctx, sc) +// Expect(err).To(BeNil()) +// Expect( +// a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain1.GetChainReferenceID()), +// ).To(BeTrue()) +// }) + +// By("activating a new-new smart contract it deploys it to chain 1", func() { +// err := a.EvmKeeper.ActivateChainReferenceID(ctx, chain1.GetChainReferenceID(), smartContract2, "addr2", []byte("id2")) +// Expect(err).To(BeNil()) +// Expect( +// a.EvmKeeper.HasAnySmartContractDeployment(ctx, chain2.GetChainReferenceID()), +// ).To(BeTrue()) +// By("verify that the chain's smart contract id has been deployed", func() { +// ci, err := a.EvmKeeper.GetChainInfo(ctx, chain1.GetChainReferenceID()) +// Expect(err).To(BeNil()) +// Expect(ci.GetActiveSmartContractID()).To(Equal(smartContract2.GetId())) +// }) +// }) +// }) +// }) +// }) +// }) + +// Describe("on snapshot build", func() { +// var snapshot *valsettypes.Snapshot +// When("validator set is valid", func() { +// BeforeEach(func() { +// validators = genValidators(25, 25000) +// for _, val := range validators { +// a.StakingKeeper.SetValidator(ctx, val) +// } +// }) + +// When("evm chain and smart contract both exist", func() { +// BeforeEach(func() { +// for _, val := range validators { +// private, err := crypto.GenerateKey() +// Expect(err).To(BeNil()) +// accAddr := crypto.PubkeyToAddress(private.PublicKey) +// err = a.ValsetKeeper.AddExternalChainInfo(ctx, val.GetOperator(), []*valsettypes.ExternalChainInfo{ +// { +// ChainType: "evm", +// ChainReferenceID: newChain.ChainReferenceID, +// Address: accAddr.Hex(), +// Pubkey: []byte("pub key" + accAddr.Hex()), +// }, +// { +// ChainType: "evm", +// ChainReferenceID: "new-chain", +// Address: accAddr.Hex(), +// Pubkey: []byte("pub key" + accAddr.Hex()), +// }, +// }) +// Expect(err).To(BeNil()) +// } +// var err error +// snapshot, err = a.ValsetKeeper.TriggerSnapshotBuild(ctx) +// Expect(err).To(BeNil()) +// }) + +// BeforeEach(func() { +// err := a.EvmKeeper.AddSupportForNewChain( +// ctx, +// newChain.GetChainReferenceID(), +// newChain.GetChainID(), +// newChain.GetBlockHeight(), +// newChain.GetBlockHashAtHeight(), +// big.NewInt(55), +// ) +// Expect(err).To(BeNil()) + +// sc, err := a.EvmKeeper.SaveNewSmartContract(ctx, smartContract.GetAbiJSON(), smartContract.GetBytecode()) +// Expect(err).To(BeNil()) +// err = a.EvmKeeper.SetAsCompassContract(ctx, sc) +// Expect(err).To(BeNil()) + +// err = a.EvmKeeper.ActivateChainReferenceID(ctx, newChain.ChainReferenceID, smartContract, "addr", []byte("abc")) +// Expect(err).To(BeNil()) + +// By("it should have upload smart contract message", func() { +// msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, "evm/eth-main/evm-turnstone-message", 5) + +// Expect(err).To(BeNil()) +// Expect(len(msgs)).To(Equal(1)) + +// con, err := msgs[0].ConsensusMsg(a.AppCodec()) +// Expect(err).To(BeNil()) + +// evmMsg, ok := con.(*types.Message) +// Expect(ok).To(BeTrue()) + +// _, ok = evmMsg.GetAction().(*types.Message_UploadSmartContract) +// Expect(ok).To(BeTrue()) + +// a.ConsensusKeeper.DeleteJob(ctx, "evm/eth-main/evm-turnstone-message", msgs[0].GetId()) +// }) +// }) + +// It("expects update valset message to exist", func() { +// a.EvmKeeper.OnSnapshotBuilt(ctx, snapshot) +// msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, "evm/eth-main/evm-turnstone-message", 5) + +// Expect(err).To(BeNil()) +// Expect(len(msgs)).To(Equal(1)) + +// con, err := msgs[0].ConsensusMsg(a.AppCodec()) +// Expect(err).To(BeNil()) + +// evmMsg, ok := con.(*types.Message) +// Expect(ok).To(BeTrue()) + +// _, ok = evmMsg.GetAction().(*types.Message_UpdateValset) +// Expect(ok).To(BeTrue()) +// }) + +// When("adding another chain which is not yet active", func() { +// BeforeEach(func() { +// err := a.EvmKeeper.AddSupportForNewChain( +// ctx, +// "new-chain", +// 123, +// uint64(123), +// "0x1234", +// big.NewInt(55), +// ) +// Expect(err).To(BeNil()) +// }) + +// It("tries to deploy a smart contract to it", func() { +// a.EvmKeeper.OnSnapshotBuilt(ctx, snapshot) +// msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, "evm/new-chain/evm-turnstone-message", 5) +// Expect(err).To(BeNil()) +// Expect(len(msgs)).To(Equal(1)) + +// con, err := msgs[0].ConsensusMsg(a.AppCodec()) +// Expect(err).To(BeNil()) + +// evmMsg, ok := con.(*types.Message) +// Expect(ok).To(BeTrue()) + +// _, ok = evmMsg.GetAction().(*types.Message_UploadSmartContract) +// Expect(ok).To(BeTrue()) +// }) +// }) + +// When("there is another upload valset already in", func() { +// BeforeEach(func() { +// err := a.EvmKeeper.AddSupportForNewChain( +// ctx, +// "new-chain", +// 123, +// uint64(123), +// "0x1234", +// big.NewInt(55), +// ) +// Expect(err).To(BeNil()) +// err = a.EvmKeeper.ActivateChainReferenceID(ctx, "new-chain", &types.SmartContract{Id: 123}, "addr", []byte("abc")) +// Expect(err).To(BeNil()) +// for _, val := range validators { +// private, err := crypto.GenerateKey() +// Expect(err).To(BeNil()) +// accAddr := crypto.PubkeyToAddress(private.PublicKey) +// err = a.ValsetKeeper.AddExternalChainInfo(ctx, val.GetOperator(), []*valsettypes.ExternalChainInfo{ +// { +// ChainType: "evm", +// ChainReferenceID: "new-chain", +// Address: accAddr.Hex(), +// Pubkey: []byte("pub key" + accAddr.Hex()), +// }, +// }) +// Expect(err).To(BeNil()) +// } +// }) +// BeforeEach(func() { +// msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, "evm/new-chain/evm-turnstone-message", 5) +// Expect(err).To(BeNil()) +// for _, msg := range msgs { +// // we are now clearing the deploy smart contract from the queue as we don't need it +// a.ConsensusKeeper.DeleteJob(ctx, "evm/new-chain/evm-turnstone-message", msg.GetId()) +// } +// a.ConsensusKeeper.PutMessageInQueue(ctx, "evm/new-chain/evm-turnstone-message", &types.Message{ +// TurnstoneID: "abc", +// ChainReferenceID: "new-chain", +// Action: &types.Message_UpdateValset{ +// UpdateValset: &types.UpdateValset{ +// Valset: &types.Valset{ +// ValsetID: 777, +// }, +// }, +// }, +// }, nil) +// }) +// It("deletes the old smart deployment", func() { +// a.EvmKeeper.OnSnapshotBuilt(ctx, snapshot) +// msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, "evm/new-chain/evm-turnstone-message", 5) +// Expect(err).To(BeNil()) +// Expect(len(msgs)).To(Equal(1)) + +// con, err := msgs[0].ConsensusMsg(a.AppCodec()) +// Expect(err).To(BeNil()) + +// evmMsg, ok := con.(*types.Message) +// Expect(ok).To(BeTrue()) + +// vset, ok := evmMsg.GetAction().(*types.Message_UpdateValset) +// Expect(ok).To(BeTrue()) +// Expect(vset.UpdateValset.GetValset().GetValsetID()).NotTo(Equal(uint64(777))) +// Expect(len(vset.UpdateValset.GetValset().GetValidators())).NotTo(BeZero()) +// }) +// }) +// }) +// }) + +// When("validator set is too tiny", func() { +// BeforeEach(func() { +// validators = genValidators(25, 25000)[:5] +// for _, val := range validators { +// a.StakingKeeper.SetValidator(ctx, val) +// } +// _, err := a.ValsetKeeper.TriggerSnapshotBuild(ctx) +// Expect(err).To(BeNil()) +// }) + +// Context("evm chain and smart contract both exist", func() { +// BeforeEach(func() { +// err := a.EvmKeeper.AddSupportForNewChain( +// ctx, +// newChain.GetChainReferenceID(), +// newChain.GetChainID(), +// newChain.GetBlockHeight(), +// newChain.GetBlockHashAtHeight(), +// big.NewInt(55), +// ) +// Expect(err).To(BeNil()) +// sc, err := a.EvmKeeper.SaveNewSmartContract(ctx, smartContract.GetAbiJSON(), smartContract.GetBytecode()) +// Expect(err).To(BeNil()) +// err = a.EvmKeeper.SetAsCompassContract(ctx, sc) +// Expect(err).To(BeNil()) +// }) + +// It("doesn't put any message into a queue", func() { +// msgs, err := a.ConsensusKeeper.GetMessagesFromQueue(ctx, "evm/eth-main/evm-turnstone-message", 5) +// Expect(err).To(BeNil()) +// Expect(msgs).To(BeZero()) +// }) +// }) +// }) +// }) +// }) + +// var _ = Describe("change min on chain balance", func() { +// var a app.TestApp +// var ctx sdk.Context +// newChain := &types.AddChainProposal{ +// ChainReferenceID: "eth-main", +// Title: "bla", +// Description: "bla", +// BlockHeight: uint64(123), +// BlockHashAtHeight: "0x1234", +// } + +// BeforeEach(func() { +// a = app.NewTestApp(GinkgoT(), false) +// ctx = a.NewContext(false) +// }) + +// When("chain info exists", func() { +// BeforeEach(func() { +// err := a.EvmKeeper.AddSupportForNewChain(ctx, newChain.GetChainReferenceID(), newChain.GetChainID(), 1, "a", big.NewInt(55)) +// Expect(err).To(BeNil()) +// }) + +// BeforeEach(func() { +// ci, err := a.EvmKeeper.GetChainInfo(ctx, newChain.GetChainReferenceID()) +// Expect(err).To(BeNil()) +// balance, err := ci.GetMinOnChainBalanceBigInt() +// Expect(err).To(BeNil()) +// Expect(balance.Text(10)).To(Equal(big.NewInt(55).Text(10))) +// }) + +// It("changes the on chain balance", func() { +// err := a.EvmKeeper.ChangeMinOnChainBalance(ctx, newChain.GetChainReferenceID(), big.NewInt(888)) +// Expect(err).To(BeNil()) + +// ci, err := a.EvmKeeper.GetChainInfo(ctx, newChain.GetChainReferenceID()) +// Expect(err).To(BeNil()) +// balance, err := ci.GetMinOnChainBalanceBigInt() +// Expect(err).To(BeNil()) +// Expect(balance.Text(10)).To(Equal(big.NewInt(888).Text(10))) +// }) +// }) + +// When("chain info does not exists", func() { +// It("returns an error", func() { +// err := a.EvmKeeper.ChangeMinOnChainBalance(ctx, newChain.GetChainReferenceID(), big.NewInt(888)) +// Expect(err).To(MatchError(keeper.ErrChainNotFound)) +// }) +// }) +// }) + +// var _ = Describe("change relay weights", func() { +// var a app.TestApp +// var ctx sdk.Context +// newChain := &types.AddChainProposal{ +// ChainReferenceID: "eth-main", +// Title: "bla", +// Description: "bla", +// BlockHeight: uint64(123), +// BlockHashAtHeight: "0x1234", +// } + +// BeforeEach(func() { +// a = app.NewTestApp(GinkgoT(), false) +// ctx = a.NewContext(false) +// }) + +// When("chain info exists", func() { +// BeforeEach(func() { +// err := a.EvmKeeper.AddSupportForNewChain(ctx, newChain.GetChainReferenceID(), newChain.GetChainID(), 1, "a", big.NewInt(55)) +// Expect(err).To(BeNil()) +// }) + +// BeforeEach(func() { +// ci, err := a.EvmKeeper.GetChainInfo(ctx, newChain.GetChainReferenceID()) +// Expect(err).To(BeNil()) +// weights := ci.GetRelayWeights() +// Expect(weights).To(Equal(&types.RelayWeights{ +// Fee: "1.0", +// Uptime: "1.0", +// SuccessRate: "1.0", +// ExecutionTime: "1.0", +// })) +// }) + +// It("changes the relay weights", func() { +// newWeights := &types.RelayWeights{ +// Fee: "0.12", +// Uptime: "0.34", +// SuccessRate: "0.56", +// ExecutionTime: "0.78", +// } +// err := a.EvmKeeper.SetRelayWeights(ctx, newChain.GetChainReferenceID(), newWeights) +// Expect(err).To(BeNil()) + +// ci, err := a.EvmKeeper.GetChainInfo(ctx, newChain.GetChainReferenceID()) +// Expect(err).To(BeNil()) +// weights := ci.GetRelayWeights() +// Expect(weights).To(Equal(newWeights)) +// }) +// }) + +// When("chain info does not exists", func() { +// It("returns an error", func() { +// err := a.EvmKeeper.SetRelayWeights(ctx, newChain.GetChainReferenceID(), &types.RelayWeights{ +// Fee: "0.12", +// Uptime: "0.34", +// SuccessRate: "0.56", +// ExecutionTime: "0.78", +// }) +// Expect(err).To(MatchError(keeper.ErrChainNotFound)) +// }) +// }) +// }) diff --git a/x/evm/keeper/keeper_test.go b/x/evm/keeper/keeper_test.go index ab9e628a..187f0fea 100644 --- a/x/evm/keeper/keeper_test.go +++ b/x/evm/keeper/keeper_test.go @@ -6,6 +6,7 @@ import ( "testing" "time" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" "github.com/palomachain/paloma/x/evm/types/mocks" @@ -33,7 +34,7 @@ func getValidators(num int, chains []validatorChainInfo) []valsettypes.Validator } validators[i] = valsettypes.Validator{ State: valsettypes.ValidatorState_ACTIVE, - ShareCount: sdk.NewInt(25000), + ShareCount: sdkmath.NewInt(25000), ExternalChainInfos: chainInfos, } } @@ -45,7 +46,7 @@ func buildKeeper(t *testing.T) (*Keeper, sdk.Context, mockedServices) { unpublishedSnapshot := &valsettypes.Snapshot{ Id: 1, - TotalShares: sdk.NewInt(75000), + TotalShares: sdkmath.NewInt(75000), Validators: getValidators( 3, []validatorChainInfo{ @@ -138,11 +139,11 @@ func TestKeeper_PreJobExecution(t *testing.T) { unpublishedSnapshot := &valsettypes.Snapshot{ Id: 1, - TotalShares: sdk.NewInt(75000), + TotalShares: sdkmath.NewInt(75000), Validators: []valsettypes.Validator{ { State: valsettypes.ValidatorState_ACTIVE, - ShareCount: sdk.NewInt(25000), + ShareCount: sdkmath.NewInt(25000), ExternalChainInfos: []*valsettypes.ExternalChainInfo{ { ChainType: "evm", @@ -152,7 +153,7 @@ func TestKeeper_PreJobExecution(t *testing.T) { }, { State: valsettypes.ValidatorState_ACTIVE, - ShareCount: sdk.NewInt(25000), + ShareCount: sdkmath.NewInt(25000), ExternalChainInfos: []*valsettypes.ExternalChainInfo{ { ChainType: "evm", @@ -162,7 +163,7 @@ func TestKeeper_PreJobExecution(t *testing.T) { }, { State: valsettypes.ValidatorState_ACTIVE, - ShareCount: sdk.NewInt(25000), + ShareCount: sdkmath.NewInt(25000), ExternalChainInfos: []*valsettypes.ExternalChainInfo{ { ChainType: "evm", @@ -212,11 +213,11 @@ func TestKeeper_PreJobExecution(t *testing.T) { publishedSnapshot := &valsettypes.Snapshot{ Id: 1, Chains: []string{"test-chain"}, - TotalShares: sdk.NewInt(75000), + TotalShares: sdkmath.NewInt(75000), Validators: []valsettypes.Validator{ { State: valsettypes.ValidatorState_ACTIVE, - ShareCount: sdk.NewInt(25000), + ShareCount: sdkmath.NewInt(25000), ExternalChainInfos: []*valsettypes.ExternalChainInfo{ { ChainType: "evm", @@ -226,7 +227,7 @@ func TestKeeper_PreJobExecution(t *testing.T) { }, { State: valsettypes.ValidatorState_ACTIVE, - ShareCount: sdk.NewInt(25000), + ShareCount: sdkmath.NewInt(25000), ExternalChainInfos: []*valsettypes.ExternalChainInfo{ { ChainType: "evm", @@ -236,7 +237,7 @@ func TestKeeper_PreJobExecution(t *testing.T) { }, { State: valsettypes.ValidatorState_ACTIVE, - ShareCount: sdk.NewInt(25000), + ShareCount: sdkmath.NewInt(25000), ExternalChainInfos: []*valsettypes.ExternalChainInfo{ { ChainType: "evm", @@ -263,11 +264,11 @@ func TestKeeper_PreJobExecution(t *testing.T) { unpublishedSnapshot := &valsettypes.Snapshot{ Id: 1, - TotalShares: sdk.NewInt(75000), + TotalShares: sdkmath.NewInt(75000), Validators: []valsettypes.Validator{ { State: valsettypes.ValidatorState_ACTIVE, - ShareCount: sdk.NewInt(25000), + ShareCount: sdkmath.NewInt(25000), ExternalChainInfos: []*valsettypes.ExternalChainInfo{ { ChainType: "evm", @@ -277,7 +278,7 @@ func TestKeeper_PreJobExecution(t *testing.T) { }, { State: valsettypes.ValidatorState_ACTIVE, - ShareCount: sdk.NewInt(25000), + ShareCount: sdkmath.NewInt(25000), ExternalChainInfos: []*valsettypes.ExternalChainInfo{ { ChainType: "evm", @@ -287,7 +288,7 @@ func TestKeeper_PreJobExecution(t *testing.T) { }, { State: valsettypes.ValidatorState_ACTIVE, - ShareCount: sdk.NewInt(25000), + ShareCount: sdkmath.NewInt(25000), ExternalChainInfos: []*valsettypes.ExternalChainInfo{ { ChainType: "evm", @@ -488,7 +489,7 @@ func TestKeeper_PublishSnapshotToAllChains(t *testing.T) { publishedSnapshot := &valsettypes.Snapshot{ Id: 1, Chains: []string{"test-chain"}, - TotalShares: sdk.NewInt(75000), + TotalShares: sdkmath.NewInt(75000), Validators: validators, CreatedAt: time.Now().Add(time.Duration(-28*24) * time.Hour), // 28 days ago } @@ -516,7 +517,7 @@ func TestKeeper_PublishSnapshotToAllChains(t *testing.T) { publishedSnapshot := &valsettypes.Snapshot{ Id: 1, Chains: []string{"test-chain"}, - TotalShares: sdk.NewInt(75000), + TotalShares: sdkmath.NewInt(75000), Validators: validators, CreatedAt: time.Now().Add(time.Duration(-28*24) * time.Hour), // 28 days ago } @@ -538,7 +539,7 @@ func TestKeeper_PublishSnapshotToAllChains(t *testing.T) { ctx = ctx.WithBlockTime(time.Now()) newSnapshot := &valsettypes.Snapshot{ Id: 2, - TotalShares: sdk.NewInt(75000), + TotalShares: sdkmath.NewInt(75000), Validators: getValidators( 3, []validatorChainInfo{ diff --git a/x/evm/keeper/msg_assigner.go b/x/evm/keeper/msg_assigner.go index 62ede41b..04e09339 100644 --- a/x/evm/keeper/msg_assigner.go +++ b/x/evm/keeper/msg_assigner.go @@ -1,11 +1,13 @@ package keeper import ( + "context" "errors" "math" "sort" sdk "github.com/cosmos/cosmos-sdk/types" + xchain "github.com/palomachain/paloma/internal/x-chain" "github.com/palomachain/paloma/util/slice" "github.com/palomachain/paloma/x/evm/types" @@ -212,9 +214,9 @@ func rankValidators(validatorsInfos map[string]ValidatorInfo, relayWeights types return ranked } -func pickValidator(ctx sdk.Context, validatorsInfos map[string]ValidatorInfo, weights types.RelayWeightsFloat64) string { +func pickValidator(ctx context.Context, validatorsInfos map[string]ValidatorInfo, weights types.RelayWeightsFloat64) string { scored := rankValidators(validatorsInfos, weights) - + sdkCtx := sdk.UnwrapSDKContext(ctx) highScore := 0 var highScorers []string @@ -231,10 +233,10 @@ func pickValidator(ctx sdk.Context, validatorsInfos map[string]ValidatorInfo, we // All else equal, grab one of our high scorers, but not always the same one sort.Strings(highScorers) - return highScorers[int(ctx.BlockHeight())%len(highScorers)] + return highScorers[int(sdkCtx.BlockHeight())%len(highScorers)] } -func (ma MsgAssigner) PickValidatorForMessage(ctx sdk.Context, weights *types.RelayWeights, chainID string, req *xchain.JobRequirements) (string, error) { +func (ma MsgAssigner) PickValidatorForMessage(ctx context.Context, weights *types.RelayWeights, chainID string, req *xchain.JobRequirements) (string, error) { currentSnapshot, err := ma.ValsetKeeper.GetCurrentSnapshot(ctx) if err != nil { return "", err diff --git a/x/evm/keeper/msg_assigner_test.go b/x/evm/keeper/msg_assigner_test.go index 0696e6c7..fc07624c 100644 --- a/x/evm/keeper/msg_assigner_test.go +++ b/x/evm/keeper/msg_assigner_test.go @@ -6,7 +6,8 @@ import ( "math" "testing" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + sdkmath "cosmossdk.io/math" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" xchain "github.com/palomachain/paloma/internal/x-chain" @@ -546,7 +547,7 @@ func TestPickValidatorForMessage(t *testing.T) { snapshot := &valsettypes.Snapshot{ Id: 1, Chains: []string{"test-chain"}, - TotalShares: sdk.NewInt(75000), + TotalShares: sdkmath.NewInt(75000), Validators: []valsettypes.Validator{ { Address: sdk.ValAddress("testvalidator1"), @@ -631,7 +632,7 @@ func TestPickValidatorForMessage(t *testing.T) { snapshot := &valsettypes.Snapshot{ Id: 1, Chains: []string{"test-chain"}, - TotalShares: sdk.NewInt(75000), + TotalShares: sdkmath.NewInt(75000), Validators: []valsettypes.Validator{ { Address: sdk.ValAddress("testvalidator1"), @@ -676,7 +677,7 @@ func TestPickValidatorForMessage(t *testing.T) { snapshot := &valsettypes.Snapshot{ Id: 1, Chains: []string{"test-chain"}, - TotalShares: sdk.NewInt(75000), + TotalShares: sdkmath.NewInt(75000), Validators: []valsettypes.Validator{ { Address: sdk.ValAddress("testvalidator1"), diff --git a/x/evm/keeper/msg_server_remove_smart_contract_deployment_test.go b/x/evm/keeper/msg_server_remove_smart_contract_deployment_test.go index e31f829b..7c673e00 100644 --- a/x/evm/keeper/msg_server_remove_smart_contract_deployment_test.go +++ b/x/evm/keeper/msg_server_remove_smart_contract_deployment_test.go @@ -5,6 +5,7 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" + sdkmath "cosmossdk.io/math" "github.com/ethereum/go-ethereum/common" "github.com/palomachain/paloma/x/evm/types" valsettypes "github.com/palomachain/paloma/x/valset/types" @@ -15,7 +16,7 @@ import ( func addDeploymentToKeeper(t *testing.T, ctx sdk.Context, k *Keeper, mockServices mockedServices) { unpublishedSnapshot := &valsettypes.Snapshot{ Id: 1, - TotalShares: sdk.NewInt(75000), + TotalShares: sdkmath.NewInt(75000), Validators: getValidators( 3, []validatorChainInfo{ diff --git a/x/evm/keeper/params.go b/x/evm/keeper/params.go index 6ec325e2..5d5ab4c2 100644 --- a/x/evm/keeper/params.go +++ b/x/evm/keeper/params.go @@ -1,16 +1,17 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" + "context" + // sdk "github.com/cosmos/cosmos-sdk/types" "github.com/palomachain/paloma/x/evm/types" ) // GetParams get all parameters as types.Params -func (k Keeper) GetParams(ctx sdk.Context) types.Params { +func (k Keeper) GetParams(ctx context.Context) types.Params { return types.NewParams() } // SetParams set the params -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramstore.SetParamSet(ctx, ¶ms) +func (k Keeper) SetParams(ctx context.Context, params types.Params) error { + return nil } diff --git a/x/evm/keeper/scheduler_job.go b/x/evm/keeper/scheduler_job.go index 49ee9d8b..5f47135c 100644 --- a/x/evm/keeper/scheduler_job.go +++ b/x/evm/keeper/scheduler_job.go @@ -58,6 +58,7 @@ func (k Keeper) VerifyJob(ctx sdk.Context, definition, payload []byte, chainRefe // ExecuteJob schedules the definition and payload for execution via consensus queue func (k Keeper) ExecuteJob(ctx sdk.Context, jcfg *xchain.JobConfiguration) (uint64, error) { + def, load, err := k.unmarshalJob(jcfg.Definition, jcfg.Payload, jcfg.RefID) if err != nil { return 0, err diff --git a/x/evm/keeper/setup_test.go b/x/evm/keeper/setup_test.go index 089ba3aa..d2d7d699 100644 --- a/x/evm/keeper/setup_test.go +++ b/x/evm/keeper/setup_test.go @@ -1,15 +1,16 @@ package keeper import ( - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmdb "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" - typesparams "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/palomachain/paloma/testutil" "github.com/palomachain/paloma/x/evm/types" "github.com/palomachain/paloma/x/evm/types/mocks" @@ -23,11 +24,13 @@ type mockedServices struct { } func NewEvmKeeper(t testutil.TB) (*Keeper, mockedServices, sdk.Context) { - storeKey := sdk.NewKVStoreKey(types.StoreKey) + storeKey := storetypes.NewKVStoreKey(types.StoreKey) + storeService := runtime.NewKVStoreService(storeKey) + memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) require.NoError(t, stateStore.LoadLatestVersion()) @@ -37,13 +40,6 @@ func NewEvmKeeper(t testutil.TB) (*Keeper, mockedServices, sdk.Context) { types.RegisterInterfaces(registry) - paramsSubspace := typesparams.NewSubspace(appCodec, - types.Amino, - storeKey, - memStoreKey, - "EvmParams", - ) - ms := mockedServices{ ConsensusKeeper: mocks.NewConsensusKeeper(t), ValsetKeeper: mocks.NewValsetKeeper(t), @@ -51,11 +47,10 @@ func NewEvmKeeper(t testutil.TB) (*Keeper, mockedServices, sdk.Context) { } k := NewKeeper( appCodec, - storeKey, - memStoreKey, - paramsSubspace, + storeService, ms.ConsensusKeeper, ms.ValsetKeeper, + "authority", ) k.msgSender = ms.MsgSender diff --git a/x/evm/keeper/smart_contract_deployment.go b/x/evm/keeper/smart_contract_deployment.go index 8fc83153..f830b975 100644 --- a/x/evm/keeper/smart_contract_deployment.go +++ b/x/evm/keeper/smart_contract_deployment.go @@ -1,13 +1,17 @@ package keeper import ( + "context" "errors" "fmt" "strings" sdkmath "cosmossdk.io/math" + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/VolumeFi/whoops" - "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/accounts/abi" xchain "github.com/palomachain/paloma/internal/x-chain" @@ -18,7 +22,7 @@ import ( var lastSmartContractKey = []byte{0x1} -func (k Keeper) AllSmartContractsDeployments(ctx sdk.Context) ([]*types.SmartContractDeployment, error) { +func (k Keeper) AllSmartContractsDeployments(ctx context.Context) ([]*types.SmartContractDeployment, error) { _, res, err := keeperutil.IterAll[*types.SmartContractDeployment]( k.provideSmartContractDeploymentStore(ctx), k.cdc, @@ -26,7 +30,8 @@ func (k Keeper) AllSmartContractsDeployments(ctx sdk.Context) ([]*types.SmartCon return res, err } -func (k Keeper) HasAnySmartContractDeployment(ctx sdk.Context, chainReferenceID string) (found bool) { +func (k Keeper) HasAnySmartContractDeployment(ctx context.Context, chainReferenceID string) (found bool) { + sdkCtx := sdk.UnwrapSDKContext(ctx) if err := keeperutil.IterAllFnc( k.provideSmartContractDeploymentStore(ctx), k.cdc, @@ -38,7 +43,7 @@ func (k Keeper) HasAnySmartContractDeployment(ctx sdk.Context, chainReferenceID return true }, ); err != nil { - k.Logger(ctx).Error( + k.Logger(sdkCtx).Error( "error getting smart contract from deployment store by chain Ref", "err", err, "chainReferenceID", chainReferenceID, @@ -47,17 +52,19 @@ func (k Keeper) HasAnySmartContractDeployment(ctx sdk.Context, chainReferenceID return } -func (k Keeper) DeleteSmartContractDeploymentByContractID(ctx sdk.Context, smartContractID uint64, chainReferenceID string) { +func (k Keeper) DeleteSmartContractDeploymentByContractID(ctx context.Context, smartContractID uint64, chainReferenceID string) { + sdkCtx := sdk.UnwrapSDKContext(ctx) _, key := k.getSmartContractDeploymentByContractID(ctx, smartContractID, chainReferenceID) if key == nil { return } - k.Logger(ctx).Info("removing a smart contract deployment", "smart-contract-id", smartContractID, "chain-reference-id", chainReferenceID) + k.Logger(sdkCtx).Info("removing a smart contract deployment", "smart-contract-id", smartContractID, "chain-reference-id", chainReferenceID) k.provideSmartContractDeploymentStore(ctx).Delete(key) } -func (k Keeper) SetSmartContractDeploymentStatusByContractID(ctx sdk.Context, smartContractID uint64, chainReferenceID string, status types.SmartContractDeployment_Status) error { - logger := k.Logger(ctx).WithFields("smart-contract-id", smartContractID, "chain-reference-id", chainReferenceID, "new-smart-contract-status", status) +func (k Keeper) SetSmartContractDeploymentStatusByContractID(ctx context.Context, smartContractID uint64, chainReferenceID string, status types.SmartContractDeployment_Status) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + logger := k.Logger(sdkCtx).WithFields("smart-contract-id", smartContractID, "chain-reference-id", chainReferenceID, "new-smart-contract-status", status) v, key := k.getSmartContractDeploymentByContractID(ctx, smartContractID, chainReferenceID) if key == nil { return keeperutil.ErrNotFound @@ -73,14 +80,15 @@ func (k Keeper) SetSmartContractDeploymentStatusByContractID(ctx sdk.Context, sm return nil } -func (k Keeper) GetLastCompassContract(ctx sdk.Context) (*types.SmartContract, error) { +func (k Keeper) GetLastCompassContract(ctx context.Context) (*types.SmartContract, error) { kv := k.provideLastCompassContractStore(ctx) id := kv.Get(lastSmartContractKey) return keeperutil.Load[*types.SmartContract](k.provideSmartContractStore(ctx), k.cdc, id) } -func (k Keeper) SetAsCompassContract(ctx sdk.Context, smartContract *types.SmartContract) error { - k.Logger(ctx).Info("setting smart contract as the latest one", "smart-contract-id", smartContract.GetId()) +func (k Keeper) SetAsCompassContract(ctx context.Context, smartContract *types.SmartContract) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + k.Logger(sdkCtx).Info("setting smart contract as the latest one", "smart-contract-id", smartContract.GetId()) err := k.setAsLastCompassContract(ctx, smartContract) if err != nil { return fmt.Errorf("failed to set contract as last smart contract: %w", err) @@ -97,14 +105,15 @@ func (k Keeper) SetAsCompassContract(ctx sdk.Context, smartContract *types.Smart return nil } -func (k Keeper) SaveNewSmartContract(ctx sdk.Context, abiJSON string, bytecode []byte) (*types.SmartContract, error) { +func (k Keeper) SaveNewSmartContract(ctx context.Context, abiJSON string, bytecode []byte) (*types.SmartContract, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) smartContract := &types.SmartContract{ - Id: k.ider.IncrementNextID(ctx, "smart-contract"), + Id: k.ider.IncrementNextID(sdkCtx, "smart-contract"), AbiJSON: abiJSON, Bytecode: bytecode, } - k.Logger(ctx).Info("saving new smart contract", "smart-contract-id", smartContract.GetId()) + k.Logger(sdkCtx).Info("saving new smart contract", "smart-contract-id", smartContract.GetId()) err := k.createSmartContract(ctx, smartContract) if err != nil { return nil, err @@ -113,27 +122,29 @@ func (k Keeper) SaveNewSmartContract(ctx sdk.Context, abiJSON string, bytecode [ return smartContract, nil } -func (k Keeper) TryDeployingLastCompassContractToAllChains(ctx sdk.Context) { +func (k Keeper) TryDeployingLastCompassContractToAllChains(ctx context.Context) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + smartContract, err := k.GetLastCompassContract(ctx) if err != nil { - k.Logger(ctx).Error("error while getting latest smart contract", "err", err) + k.Logger(sdkCtx).Error("error while getting latest smart contract", "err", err) return } err = k.tryDeployingSmartContractToAllChains(ctx, smartContract) if err != nil { - k.Logger(ctx).Error("error while trying to deploy smart contract to all chains", + k.Logger(sdkCtx).Error("error while trying to deploy smart contract to all chains", "err", err, "smart-contract-id", smartContract.GetId(), ) return } - k.Logger(ctx).Info("trying to deploy smart contract to all chains", + k.Logger(sdkCtx).Info("trying to deploy smart contract to all chains", "smart-contract-id", smartContract.GetId(), ) } func (k Keeper) AddSmartContractExecutionToConsensus( - ctx sdk.Context, + ctx context.Context, chainReferenceID, turnstoneID string, logicCall *types.SubmitLogicCall, @@ -163,7 +174,9 @@ func (k Keeper) AddSmartContractExecutionToConsensus( }, nil) } -func (k Keeper) deploySmartContractToChain(ctx sdk.Context, chainInfo *types.ChainInfo, smartContract *types.SmartContract) (retErr error) { +func (k Keeper) deploySmartContractToChain(ctx context.Context, chainInfo *types.ChainInfo, smartContract *types.SmartContract) (retErr error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + defer func() { args := []any{ "chain-reference-id", chainInfo.GetChainReferenceID(), @@ -174,12 +187,12 @@ func (k Keeper) deploySmartContractToChain(ctx sdk.Context, chainInfo *types.Cha } if retErr != nil { - k.Logger(ctx).Error("error adding a message to deploy smart contract to chain", args...) + k.Logger(sdkCtx).Error("error adding a message to deploy smart contract to chain", args...) } else { - k.Logger(ctx).Info("added a new smart contract deployment to queue", args...) + k.Logger(sdkCtx).Info("added a new smart contract deployment to queue", args...) } }() - logger := k.Logger(ctx) + logger := k.Logger(sdkCtx) contractABI, err := abi.JSON(strings.NewReader(smartContract.GetAbiJSON())) if err != nil { return err @@ -199,7 +212,7 @@ func (k Keeper) deploySmartContractToChain(ctx sdk.Context, chainInfo *types.Cha if err != nil { if errors.Is(err, keeperutil.ErrNotFound) { - logger.With("error", err).Info("cannot deploy due to no consensus") + logger.WithFields("error", err).Info("cannot deploy due to no consensus") return nil } @@ -213,7 +226,7 @@ func (k Keeper) deploySmartContractToChain(ctx sdk.Context, chainInfo *types.Cha "valset-power-size", len(valset.Powers), ) if !isEnoughToReachConsensus(valset) { - k.Logger(ctx).Info( + k.Logger(sdkCtx).Info( "skipping deployment as there are not enough validators to form a consensus", "chain-id", chainInfo.GetChainReferenceID(), "smart-contract-id", smartContract.GetId(), @@ -285,29 +298,30 @@ func (k Keeper) deploySmartContractToChain(ctx sdk.Context, chainInfo *types.Cha return err } -func (k Keeper) getSmartContract(ctx sdk.Context, id uint64) (*types.SmartContract, error) { +func (k Keeper) getSmartContract(ctx context.Context, id uint64) (*types.SmartContract, error) { return keeperutil.Load[*types.SmartContract](k.provideSmartContractStore(ctx), k.cdc, keeperutil.Uint64ToByte(id)) } -func (k Keeper) createSmartContract(ctx sdk.Context, smartContract *types.SmartContract) error { +func (k Keeper) createSmartContract(ctx context.Context, smartContract *types.SmartContract) error { return keeperutil.Save(k.provideSmartContractStore(ctx), k.cdc, keeperutil.Uint64ToByte(smartContract.GetId()), smartContract) } -func (k Keeper) setAsLastCompassContract(ctx sdk.Context, smartContract *types.SmartContract) error { +func (k Keeper) setAsLastCompassContract(ctx context.Context, smartContract *types.SmartContract) error { kv := k.provideLastCompassContractStore(ctx) kv.Set(lastSmartContractKey, keeperutil.Uint64ToByte(smartContract.GetId())) return nil } -func (k Keeper) tryDeployingSmartContractToAllChains(ctx sdk.Context, smartContract *types.SmartContract) error { +func (k Keeper) tryDeployingSmartContractToAllChains(ctx context.Context, smartContract *types.SmartContract) error { var g whoops.Group + sdkCtx := sdk.UnwrapSDKContext(ctx) chainInfos, err := k.GetAllChainInfos(ctx) if err != nil { return err } for _, chainInfo := range chainInfos { - k.Logger(ctx).Info("trying to deploy smart contract to EVM chain", "smart-contract-id", smartContract.GetId(), "chain-reference-id", chainInfo.GetChainReferenceID()) + k.Logger(sdkCtx).Info("trying to deploy smart contract to EVM chain", "smart-contract-id", smartContract.GetId(), "chain-reference-id", chainInfo.GetChainReferenceID()) if k.HasAnySmartContractDeployment(ctx, chainInfo.GetChainReferenceID()) { // TODO: Only wait if the status is IN_FLIGHT // TODO: We probably want to still delete the deployment in case of error AS LONG as we haven't sent a move ownership message @@ -318,7 +332,7 @@ func (k Keeper) tryDeployingSmartContractToAllChains(ctx sdk.Context, smartContr // the chain has the newer version of the chain, so skipping the "old" smart contract upgrade continue } - k.Logger(ctx).Info("deploying smart contracts actually", + k.Logger(sdkCtx).Info("deploying smart contracts actually", "smart-contract-id", smartContract.GetId(), "chain-reference-id", chainInfo.GetChainReferenceID()) g.Add(k.deploySmartContractToChain(ctx, chainInfo, smartContract)) @@ -332,13 +346,14 @@ func (k Keeper) tryDeployingSmartContractToAllChains(ctx sdk.Context, smartContr } func (k Keeper) createSmartContractDeployment( - ctx sdk.Context, + ctx context.Context, smartContract *types.SmartContract, chainInfo *types.ChainInfo, uniqueID []byte, ) *types.SmartContractDeployment { + sdkCtx := sdk.UnwrapSDKContext(ctx) if foundItem, _ := k.getSmartContractDeploymentByContractID(ctx, smartContract.GetId(), chainInfo.GetChainReferenceID()); foundItem != nil { - k.Logger(ctx).Error( + k.Logger(sdkCtx).Error( "smart contract is already deploying", "smart-contract-id", smartContract.GetId(), "smart-contract-status", foundItem.GetStatus(), @@ -354,7 +369,7 @@ func (k Keeper) createSmartContractDeployment( UniqueID: uniqueID, } - id := k.ider.IncrementNextID(ctx, "smart-contract-deploying") + id := k.ider.IncrementNextID(sdkCtx, "smart-contract-deploying") if err := keeperutil.Save( k.provideSmartContractDeploymentStore(ctx), @@ -362,15 +377,16 @@ func (k Keeper) createSmartContractDeployment( keeperutil.Uint64ToByte(id), item, ); err != nil { - k.Logger(ctx).Error("error setting smart contract in deployment store", "err", err) + k.Logger(sdkCtx).Error("error setting smart contract in deployment store", "err", err) } - k.Logger(ctx).Info("setting smart contract in deployment state", "smart-contract-id", smartContract.GetId(), "chain-reference-id", chainInfo.GetChainReferenceID()) + k.Logger(sdkCtx).Info("setting smart contract in deployment state", "smart-contract-id", smartContract.GetId(), "chain-reference-id", chainInfo.GetChainReferenceID()) return item } -func (k Keeper) getSmartContractDeploymentByContractID(ctx sdk.Context, smartContractID uint64, chainReferenceID string) (res *types.SmartContractDeployment, key []byte) { +func (k Keeper) getSmartContractDeploymentByContractID(ctx context.Context, smartContractID uint64, chainReferenceID string) (res *types.SmartContractDeployment, key []byte) { + sdkCtx := sdk.UnwrapSDKContext(ctx) if err := keeperutil.IterAllFnc( k.provideSmartContractDeploymentStore(ctx), k.cdc, @@ -383,7 +399,7 @@ func (k Keeper) getSmartContractDeploymentByContractID(ctx sdk.Context, smartCon return true }, ); err != nil { - k.Logger(ctx).Error( + k.Logger(sdkCtx).Error( "error getting smart contract from deployment store by contractID, chainRef", "err", err, "smartContractID", smartContractID, @@ -393,14 +409,17 @@ func (k Keeper) getSmartContractDeploymentByContractID(ctx sdk.Context, smartCon return } -func (k Keeper) provideSmartContractDeploymentStore(ctx sdk.Context) sdk.KVStore { - return prefix.NewStore(ctx.KVStore(k.storeKey), []byte("smart-contract-deployment")) +func (k Keeper) provideSmartContractDeploymentStore(ctx context.Context) storetypes.KVStore { + s := runtime.KVStoreAdapter(k.storeKey.OpenKVStore(ctx)) + return prefix.NewStore(s, []byte("smart-contract-deployment")) } -func (k Keeper) provideSmartContractStore(ctx sdk.Context) sdk.KVStore { - return prefix.NewStore(ctx.KVStore(k.storeKey), []byte("smart-contracts")) +func (k Keeper) provideSmartContractStore(ctx context.Context) storetypes.KVStore { + kvstore := runtime.KVStoreAdapter(k.storeKey.OpenKVStore(ctx)) + return prefix.NewStore(kvstore, []byte("smart-contracts")) } -func (k Keeper) provideLastCompassContractStore(ctx sdk.Context) sdk.KVStore { - return prefix.NewStore(ctx.KVStore(k.storeKey), []byte("latest-smart-contract")) +func (k Keeper) provideLastCompassContractStore(ctx context.Context) storetypes.KVStore { + kvstore := runtime.KVStoreAdapter(k.storeKey.OpenKVStore(ctx)) + return prefix.NewStore(kvstore, []byte("latest-smart-contract")) } diff --git a/x/evm/keeper/treasury.go b/x/evm/keeper/treasury.go index 63ea834e..7303caf8 100644 --- a/x/evm/keeper/treasury.go +++ b/x/evm/keeper/treasury.go @@ -1,14 +1,15 @@ package keeper import ( + "context" + "github.com/VolumeFi/whoops" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/palomachain/paloma/x/consensus/keeper/consensus" consensustypes "github.com/palomachain/paloma/x/consensus/types" "github.com/palomachain/paloma/x/evm/types" ) -func (k Keeper) CollectJobFundEvents(ctx sdk.Context) error { +func (k Keeper) CollectJobFundEvents(ctx context.Context) error { return whoops.Try(func() { var g whoops.Group for _, ci := range whoops.Must(k.GetAllChainInfos(ctx)) { @@ -33,6 +34,6 @@ func (k Keeper) CollectJobFundEvents(ctx sdk.Context) error { }) } -func (k Keeper) attestCollectedFunds(ctx sdk.Context, q consensus.Queuer, msg consensustypes.QueuedSignedMessageI) (retErr error) { +func (k Keeper) attestCollectedFunds(ctx context.Context, q consensus.Queuer, msg consensustypes.QueuedSignedMessageI) (retErr error) { return nil } diff --git a/x/evm/module.go b/x/evm/module.go index 5f409e0f..dac63991 100644 --- a/x/evm/module.go +++ b/x/evm/module.go @@ -4,6 +4,9 @@ import ( "encoding/json" "fmt" + "context" + + "cosmossdk.io/core/appmodule" abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -19,14 +22,25 @@ import ( ) var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.HasServices = AppModule{} + _ module.HasInvariants = AppModule{} + _ module.HasABCIGenesis = AppModule{} + _ module.HasConsensusVersion = AppModule{} + _ module.HasName = AppModule{} + + _ appmodule.HasEndBlocker = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} + _ appmodule.AppModule = AppModule{} ) // ---------------------------------------------------------------------------- // AppModuleBasic // ---------------------------------------------------------------------------- +func (m AppModule) IsOnePerModuleType() {} +func (m AppModule) IsAppModule() {} + // AppModuleBasic implements the AppModuleBasic interface for the capability module. type AppModuleBasic struct { cdc codec.BinaryCodec @@ -133,10 +147,10 @@ func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} // InitGenesis performs the capability module's genesis initialization It returns // no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { var genState types.GenesisState // Initialize global index to index in genesis state - cdc.MustUnmarshalJSON(gs, &genState) + cdc.MustUnmarshalJSON(data, &genState) InitGenesis(ctx, am.keeper, genState) @@ -153,27 +167,28 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw 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) {} +func (am AppModule) BeginBlock(context.Context) error { return nil } // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - am.keeper.TryDeployingLastCompassContractToAllChains(ctx) +func (am AppModule) EndBlock(ctx context.Context) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + am.keeper.TryDeployingLastCompassContractToAllChains(sdkCtx) - if ctx.BlockHeight()%300 == 0 { + if sdkCtx.BlockHeight()%300 == 0 { func() { - cis, err := am.keeper.GetAllChainInfos(ctx) + cis, err := am.keeper.GetAllChainInfos(sdkCtx) if err != nil { - am.keeper.Logger(ctx).Error("error while trying to get all chain infos to check external balances", "error", err) + am.keeper.Logger(sdkCtx).Error("error while trying to get all chain infos to check external balances", "error", err) return } for _, ci := range cis { - err := am.keeper.CheckExternalBalancesForChain(ctx, ci.GetChainReferenceID()) + err := am.keeper.CheckExternalBalancesForChain(sdkCtx, ci.GetChainReferenceID()) if err != nil { - am.keeper.Logger(ctx).Error("error while adding request to get the external chain balance for chain", "error", err, "chain-reference-id", ci.GetChainReferenceID()) + am.keeper.Logger(sdkCtx).Error("error while adding request to get the external chain balance for chain", "error", err, "chain-reference-id", ci.GetChainReferenceID()) } } }() } - return []abci.ValidatorUpdate{} + return nil } diff --git a/x/evm/types/chain_info.pb.go b/x/evm/types/chain_info.pb.go index ec68a1dd..bc2817b4 100644 --- a/x/evm/types/chain_info.pb.go +++ b/x/evm/types/chain_info.pb.go @@ -5,19 +5,16 @@ package types import ( fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. -var ( - _ = proto.Marshal - _ = fmt.Errorf - _ = math.Inf -) +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. @@ -111,11 +108,9 @@ func (*ChainInfo) ProtoMessage() {} func (*ChainInfo) Descriptor() ([]byte, []int) { return fileDescriptor_61bfdb7d30bf7e88, []int{0} } - func (m *ChainInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *ChainInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ChainInfo.Marshal(b, m, deterministic) @@ -128,15 +123,12 @@ func (m *ChainInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } - func (m *ChainInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_ChainInfo.Merge(m, src) } - func (m *ChainInfo) XXX_Size() int { return m.Size() } - func (m *ChainInfo) XXX_DiscardUnknown() { xxx_messageInfo_ChainInfo.DiscardUnknown(m) } @@ -253,11 +245,9 @@ func (*SmartContract) ProtoMessage() {} func (*SmartContract) Descriptor() ([]byte, []int) { return fileDescriptor_61bfdb7d30bf7e88, []int{1} } - func (m *SmartContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *SmartContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_SmartContract.Marshal(b, m, deterministic) @@ -270,15 +260,12 @@ func (m *SmartContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } - func (m *SmartContract) XXX_Merge(src proto.Message) { xxx_messageInfo_SmartContract.Merge(m, src) } - func (m *SmartContract) XXX_Size() int { return m.Size() } - func (m *SmartContract) XXX_DiscardUnknown() { xxx_messageInfo_SmartContract.DiscardUnknown(m) } @@ -326,11 +313,9 @@ func (*SmartContractDeployment) ProtoMessage() {} func (*SmartContractDeployment) Descriptor() ([]byte, []int) { return fileDescriptor_61bfdb7d30bf7e88, []int{2} } - func (m *SmartContractDeployment) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *SmartContractDeployment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_SmartContractDeployment.Marshal(b, m, deterministic) @@ -343,15 +328,12 @@ func (m *SmartContractDeployment) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } - func (m *SmartContractDeployment) XXX_Merge(src proto.Message) { xxx_messageInfo_SmartContractDeployment.Merge(m, src) } - func (m *SmartContractDeployment) XXX_Size() int { return m.Size() } - func (m *SmartContractDeployment) XXX_DiscardUnknown() { xxx_messageInfo_SmartContractDeployment.DiscardUnknown(m) } @@ -662,7 +644,6 @@ func encodeVarintChainInfo(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *ChainInfo) Size() (n int) { if m == nil { return 0 @@ -769,11 +750,9 @@ func (m *SmartContractDeployment) Size() (n int) { func sovChainInfo(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } - func sozChainInfo(x uint64) (n int) { return sovChainInfo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } - func (m *ChainInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1217,7 +1196,6 @@ func (m *ChainInfo) Unmarshal(dAtA []byte) error { } return nil } - func (m *SmartContract) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1353,7 +1331,6 @@ func (m *SmartContract) Unmarshal(dAtA []byte) error { } return nil } - func (m *SmartContractDeployment) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1508,7 +1485,6 @@ func (m *SmartContractDeployment) Unmarshal(dAtA []byte) error { } return nil } - func skipChainInfo(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/evm/types/errors.go b/x/evm/types/errors.go index 1facf9de..8c0011d5 100644 --- a/x/evm/types/errors.go +++ b/x/evm/types/errors.go @@ -3,8 +3,8 @@ package types // DONTCOVER import ( + sdkerrors "cosmossdk.io/errors" "github.com/VolumeFi/whoops" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // x/evm module sentinel errors diff --git a/x/evm/types/expected_keepers.go b/x/evm/types/expected_keepers.go index 8e98645a..54846361 100644 --- a/x/evm/types/expected_keepers.go +++ b/x/evm/types/expected_keepers.go @@ -1,49 +1,50 @@ package types import ( + "context" "math/big" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/palomachain/paloma/x/consensus/keeper/consensus" consensustypes "github.com/palomachain/paloma/x/consensus/types" valsettypes "github.com/palomachain/paloma/x/valset/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) +// type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. + type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins // Methods imported from bank should be defined here } -//go:generate mockery --name=ConsensusKeeper type ConsensusKeeper interface { - PutMessageInQueue(ctx sdk.Context, queueTypeName string, msg consensus.ConsensusMsg, opts *consensus.PutOptions) (uint64, error) - RemoveConsensusQueue(ctx sdk.Context, queueTypeName string) error - GetMessagesFromQueue(ctx sdk.Context, queueTypeName string, n int) (msgs []consensustypes.QueuedSignedMessageI, err error) - DeleteJob(ctx sdk.Context, queueTypeName string, id uint64) (err error) + PutMessageInQueue(ctx context.Context, queueTypeName string, msg consensus.ConsensusMsg, opts *consensus.PutOptions) (uint64, error) + RemoveConsensusQueue(ctx context.Context, queueTypeName string) error + GetMessagesFromQueue(ctx context.Context, queueTypeName string, n int) (msgs []consensustypes.QueuedSignedMessageI, err error) + DeleteJob(ctx context.Context, queueTypeName string, id uint64) (err error) } -//go:generate mockery --name=ValsetKeeper type ValsetKeeper interface { - FindSnapshotByID(ctx sdk.Context, id uint64) (*valsettypes.Snapshot, error) - GetCurrentSnapshot(ctx sdk.Context) (*valsettypes.Snapshot, error) - SetSnapshotOnChain(ctx sdk.Context, snapshotID uint64, chainReferenceID string) error - GetLatestSnapshotOnChain(ctx sdk.Context, chainReferenceID string) (*valsettypes.Snapshot, error) - KeepValidatorAlive(ctx sdk.Context, valAddr sdk.ValAddress, pigeonVersion string) error - Jail(ctx sdk.Context, valAddr sdk.ValAddress, reason string) error - IsJailed(ctx sdk.Context, val sdk.ValAddress) bool - SetValidatorBalance(ctx sdk.Context, valAddr sdk.ValAddress, chainType string, chainReferenceID string, externalAddress string, balance *big.Int) error - GetValidatorChainInfos(ctx sdk.Context, valAddr sdk.ValAddress) ([]*valsettypes.ExternalChainInfo, error) - GetAllChainInfos(ctx sdk.Context) ([]*valsettypes.ValidatorExternalAccounts, error) + FindSnapshotByID(ctx context.Context, id uint64) (*valsettypes.Snapshot, error) + GetCurrentSnapshot(ctx context.Context) (*valsettypes.Snapshot, error) + SetSnapshotOnChain(ctx context.Context, snapshotID uint64, chainReferenceID string) error + GetLatestSnapshotOnChain(ctx context.Context, chainReferenceID string) (*valsettypes.Snapshot, error) + KeepValidatorAlive(ctx context.Context, valAddr sdk.ValAddress, pigeonVersion string) error + Jail(ctx context.Context, valAddr sdk.ValAddress, reason string) error + IsJailed(ctx context.Context, val sdk.ValAddress) bool + SetValidatorBalance(ctx context.Context, valAddr sdk.ValAddress, chainType string, chainReferenceID string, externalAddress string, balance *big.Int) error + GetValidatorChainInfos(ctx context.Context, valAddr sdk.ValAddress) ([]*valsettypes.ExternalChainInfo, error) + GetAllChainInfos(ctx context.Context) ([]*valsettypes.ValidatorExternalAccounts, error) } +//go:generate mockery --name=ConsensusKeeper type SchedulerKeeper interface { - ScheduleNow(ctx sdk.Context, jobID string, in []byte, SenderAddress sdk.AccAddress, contractAddress sdk.AccAddress) error + ScheduleNow(ctx context.Context, jobID string, in []byte, SenderAddress sdk.AccAddress, contractAddress sdk.AccAddress) error } diff --git a/x/evm/types/mocks/ConsensusKeeper.go b/x/evm/types/mocks/ConsensusKeeper.go index 9038cc09..798962d8 100644 --- a/x/evm/types/mocks/ConsensusKeeper.go +++ b/x/evm/types/mocks/ConsensusKeeper.go @@ -1,11 +1,13 @@ -// Code generated by mockery v2.35.3. DO NOT EDIT. +// Code generated by mockery v2.38.0. DO NOT EDIT. package mocks import ( - types "github.com/cosmos/cosmos-sdk/types" consensus "github.com/palomachain/paloma/x/consensus/keeper/consensus" consensustypes "github.com/palomachain/paloma/x/consensus/types" + + context "context" + mock "github.com/stretchr/testify/mock" ) @@ -15,11 +17,15 @@ type ConsensusKeeper struct { } // DeleteJob provides a mock function with given fields: ctx, queueTypeName, id -func (_m *ConsensusKeeper) DeleteJob(ctx types.Context, queueTypeName string, id uint64) error { +func (_m *ConsensusKeeper) DeleteJob(ctx context.Context, queueTypeName string, id uint64) error { ret := _m.Called(ctx, queueTypeName, id) + if len(ret) == 0 { + panic("no return value specified for DeleteJob") + } + var r0 error - if rf, ok := ret.Get(0).(func(types.Context, string, uint64) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, string, uint64) error); ok { r0 = rf(ctx, queueTypeName, id) } else { r0 = ret.Error(0) @@ -29,15 +35,19 @@ func (_m *ConsensusKeeper) DeleteJob(ctx types.Context, queueTypeName string, id } // GetMessagesFromQueue provides a mock function with given fields: ctx, queueTypeName, n -func (_m *ConsensusKeeper) GetMessagesFromQueue(ctx types.Context, queueTypeName string, n int) ([]consensustypes.QueuedSignedMessageI, error) { +func (_m *ConsensusKeeper) GetMessagesFromQueue(ctx context.Context, queueTypeName string, n int) ([]consensustypes.QueuedSignedMessageI, error) { ret := _m.Called(ctx, queueTypeName, n) + if len(ret) == 0 { + panic("no return value specified for GetMessagesFromQueue") + } + var r0 []consensustypes.QueuedSignedMessageI var r1 error - if rf, ok := ret.Get(0).(func(types.Context, string, int) ([]consensustypes.QueuedSignedMessageI, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, string, int) ([]consensustypes.QueuedSignedMessageI, error)); ok { return rf(ctx, queueTypeName, n) } - if rf, ok := ret.Get(0).(func(types.Context, string, int) []consensustypes.QueuedSignedMessageI); ok { + if rf, ok := ret.Get(0).(func(context.Context, string, int) []consensustypes.QueuedSignedMessageI); ok { r0 = rf(ctx, queueTypeName, n) } else { if ret.Get(0) != nil { @@ -45,7 +55,7 @@ func (_m *ConsensusKeeper) GetMessagesFromQueue(ctx types.Context, queueTypeName } } - if rf, ok := ret.Get(1).(func(types.Context, string, int) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, string, int) error); ok { r1 = rf(ctx, queueTypeName, n) } else { r1 = ret.Error(1) @@ -55,21 +65,25 @@ func (_m *ConsensusKeeper) GetMessagesFromQueue(ctx types.Context, queueTypeName } // PutMessageInQueue provides a mock function with given fields: ctx, queueTypeName, msg, opts -func (_m *ConsensusKeeper) PutMessageInQueue(ctx types.Context, queueTypeName string, msg consensustypes.ConsensusMsg, opts *consensus.PutOptions) (uint64, error) { +func (_m *ConsensusKeeper) PutMessageInQueue(ctx context.Context, queueTypeName string, msg consensustypes.ConsensusMsg, opts *consensus.PutOptions) (uint64, error) { ret := _m.Called(ctx, queueTypeName, msg, opts) + if len(ret) == 0 { + panic("no return value specified for PutMessageInQueue") + } + var r0 uint64 var r1 error - if rf, ok := ret.Get(0).(func(types.Context, string, consensustypes.ConsensusMsg, *consensus.PutOptions) (uint64, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, string, consensustypes.ConsensusMsg, *consensus.PutOptions) (uint64, error)); ok { return rf(ctx, queueTypeName, msg, opts) } - if rf, ok := ret.Get(0).(func(types.Context, string, consensustypes.ConsensusMsg, *consensus.PutOptions) uint64); ok { + if rf, ok := ret.Get(0).(func(context.Context, string, consensustypes.ConsensusMsg, *consensus.PutOptions) uint64); ok { r0 = rf(ctx, queueTypeName, msg, opts) } else { r0 = ret.Get(0).(uint64) } - if rf, ok := ret.Get(1).(func(types.Context, string, consensustypes.ConsensusMsg, *consensus.PutOptions) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, string, consensustypes.ConsensusMsg, *consensus.PutOptions) error); ok { r1 = rf(ctx, queueTypeName, msg, opts) } else { r1 = ret.Error(1) @@ -79,11 +93,15 @@ func (_m *ConsensusKeeper) PutMessageInQueue(ctx types.Context, queueTypeName st } // RemoveConsensusQueue provides a mock function with given fields: ctx, queueTypeName -func (_m *ConsensusKeeper) RemoveConsensusQueue(ctx types.Context, queueTypeName string) error { +func (_m *ConsensusKeeper) RemoveConsensusQueue(ctx context.Context, queueTypeName string) error { ret := _m.Called(ctx, queueTypeName) + if len(ret) == 0 { + panic("no return value specified for RemoveConsensusQueue") + } + var r0 error - if rf, ok := ret.Get(0).(func(types.Context, string) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { r0 = rf(ctx, queueTypeName) } else { r0 = ret.Error(0) @@ -97,8 +115,7 @@ func (_m *ConsensusKeeper) RemoveConsensusQueue(ctx types.Context, queueTypeName func NewConsensusKeeper(t interface { mock.TestingT Cleanup(func()) -}, -) *ConsensusKeeper { +}) *ConsensusKeeper { mock := &ConsensusKeeper{} mock.Mock.Test(t) diff --git a/x/evm/types/mocks/MsgSender.go b/x/evm/types/mocks/MsgSender.go index 987538b0..1c8478f6 100644 --- a/x/evm/types/mocks/MsgSender.go +++ b/x/evm/types/mocks/MsgSender.go @@ -1,12 +1,12 @@ -// Code generated by mockery v2.20.0. DO NOT EDIT. +// Code generated by mockery v2.38.0. DO NOT EDIT. package mocks import ( - evmtypes "github.com/palomachain/paloma/x/evm/types" - mock "github.com/stretchr/testify/mock" + context "context" - types "github.com/cosmos/cosmos-sdk/types" + types "github.com/palomachain/paloma/x/evm/types" + mock "github.com/stretchr/testify/mock" ) // MsgSender is an autogenerated mock type for the MsgSender type @@ -15,11 +15,15 @@ type MsgSender struct { } // SendValsetMsgForChain provides a mock function with given fields: ctx, chainInfo, valset, assignee -func (_m *MsgSender) SendValsetMsgForChain(ctx types.Context, chainInfo *evmtypes.ChainInfo, valset evmtypes.Valset, assignee string) error { +func (_m *MsgSender) SendValsetMsgForChain(ctx context.Context, chainInfo *types.ChainInfo, valset types.Valset, assignee string) error { ret := _m.Called(ctx, chainInfo, valset, assignee) + if len(ret) == 0 { + panic("no return value specified for SendValsetMsgForChain") + } + var r0 error - if rf, ok := ret.Get(0).(func(types.Context, *evmtypes.ChainInfo, evmtypes.Valset, string) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, *types.ChainInfo, types.Valset, string) error); ok { r0 = rf(ctx, chainInfo, valset, assignee) } else { r0 = ret.Error(0) @@ -28,13 +32,12 @@ func (_m *MsgSender) SendValsetMsgForChain(ctx types.Context, chainInfo *evmtype return r0 } -type mockConstructorTestingTNewMsgSender interface { +// NewMsgSender creates a new instance of MsgSender. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMsgSender(t interface { mock.TestingT Cleanup(func()) -} - -// NewMsgSender creates a new instance of MsgSender. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewMsgSender(t mockConstructorTestingTNewMsgSender) *MsgSender { +}) *MsgSender { mock := &MsgSender{} mock.Mock.Test(t) diff --git a/x/evm/types/mocks/ValsetKeeper.go b/x/evm/types/mocks/ValsetKeeper.go index 4803a57b..155d30f2 100644 --- a/x/evm/types/mocks/ValsetKeeper.go +++ b/x/evm/types/mocks/ValsetKeeper.go @@ -1,13 +1,16 @@ -// Code generated by mockery v2.35.3. DO NOT EDIT. +// Code generated by mockery v2.38.0. DO NOT EDIT. package mocks import ( + context "context" big "math/big" - types "github.com/cosmos/cosmos-sdk/types" - valsettypes "github.com/palomachain/paloma/x/valset/types" + cosmos_sdktypes "github.com/cosmos/cosmos-sdk/types" + mock "github.com/stretchr/testify/mock" + + types "github.com/palomachain/paloma/x/valset/types" ) // ValsetKeeper is an autogenerated mock type for the ValsetKeeper type @@ -16,23 +19,27 @@ type ValsetKeeper struct { } // FindSnapshotByID provides a mock function with given fields: ctx, id -func (_m *ValsetKeeper) FindSnapshotByID(ctx types.Context, id uint64) (*valsettypes.Snapshot, error) { +func (_m *ValsetKeeper) FindSnapshotByID(ctx context.Context, id uint64) (*types.Snapshot, error) { ret := _m.Called(ctx, id) - var r0 *valsettypes.Snapshot + if len(ret) == 0 { + panic("no return value specified for FindSnapshotByID") + } + + var r0 *types.Snapshot var r1 error - if rf, ok := ret.Get(0).(func(types.Context, uint64) (*valsettypes.Snapshot, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, uint64) (*types.Snapshot, error)); ok { return rf(ctx, id) } - if rf, ok := ret.Get(0).(func(types.Context, uint64) *valsettypes.Snapshot); ok { + if rf, ok := ret.Get(0).(func(context.Context, uint64) *types.Snapshot); ok { r0 = rf(ctx, id) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*valsettypes.Snapshot) + r0 = ret.Get(0).(*types.Snapshot) } } - if rf, ok := ret.Get(1).(func(types.Context, uint64) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { r1 = rf(ctx, id) } else { r1 = ret.Error(1) @@ -42,23 +49,27 @@ func (_m *ValsetKeeper) FindSnapshotByID(ctx types.Context, id uint64) (*valsett } // GetAllChainInfos provides a mock function with given fields: ctx -func (_m *ValsetKeeper) GetAllChainInfos(ctx types.Context) ([]*valsettypes.ValidatorExternalAccounts, error) { +func (_m *ValsetKeeper) GetAllChainInfos(ctx context.Context) ([]*types.ValidatorExternalAccounts, error) { ret := _m.Called(ctx) - var r0 []*valsettypes.ValidatorExternalAccounts + if len(ret) == 0 { + panic("no return value specified for GetAllChainInfos") + } + + var r0 []*types.ValidatorExternalAccounts var r1 error - if rf, ok := ret.Get(0).(func(types.Context) ([]*valsettypes.ValidatorExternalAccounts, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context) ([]*types.ValidatorExternalAccounts, error)); ok { return rf(ctx) } - if rf, ok := ret.Get(0).(func(types.Context) []*valsettypes.ValidatorExternalAccounts); ok { + if rf, ok := ret.Get(0).(func(context.Context) []*types.ValidatorExternalAccounts); ok { r0 = rf(ctx) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]*valsettypes.ValidatorExternalAccounts) + r0 = ret.Get(0).([]*types.ValidatorExternalAccounts) } } - if rf, ok := ret.Get(1).(func(types.Context) error); ok { + if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { r1 = ret.Error(1) @@ -68,23 +79,27 @@ func (_m *ValsetKeeper) GetAllChainInfos(ctx types.Context) ([]*valsettypes.Vali } // GetCurrentSnapshot provides a mock function with given fields: ctx -func (_m *ValsetKeeper) GetCurrentSnapshot(ctx types.Context) (*valsettypes.Snapshot, error) { +func (_m *ValsetKeeper) GetCurrentSnapshot(ctx context.Context) (*types.Snapshot, error) { ret := _m.Called(ctx) - var r0 *valsettypes.Snapshot + if len(ret) == 0 { + panic("no return value specified for GetCurrentSnapshot") + } + + var r0 *types.Snapshot var r1 error - if rf, ok := ret.Get(0).(func(types.Context) (*valsettypes.Snapshot, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context) (*types.Snapshot, error)); ok { return rf(ctx) } - if rf, ok := ret.Get(0).(func(types.Context) *valsettypes.Snapshot); ok { + if rf, ok := ret.Get(0).(func(context.Context) *types.Snapshot); ok { r0 = rf(ctx) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*valsettypes.Snapshot) + r0 = ret.Get(0).(*types.Snapshot) } } - if rf, ok := ret.Get(1).(func(types.Context) error); ok { + if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { r1 = ret.Error(1) @@ -94,23 +109,27 @@ func (_m *ValsetKeeper) GetCurrentSnapshot(ctx types.Context) (*valsettypes.Snap } // GetLatestSnapshotOnChain provides a mock function with given fields: ctx, chainReferenceID -func (_m *ValsetKeeper) GetLatestSnapshotOnChain(ctx types.Context, chainReferenceID string) (*valsettypes.Snapshot, error) { +func (_m *ValsetKeeper) GetLatestSnapshotOnChain(ctx context.Context, chainReferenceID string) (*types.Snapshot, error) { ret := _m.Called(ctx, chainReferenceID) - var r0 *valsettypes.Snapshot + if len(ret) == 0 { + panic("no return value specified for GetLatestSnapshotOnChain") + } + + var r0 *types.Snapshot var r1 error - if rf, ok := ret.Get(0).(func(types.Context, string) (*valsettypes.Snapshot, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, string) (*types.Snapshot, error)); ok { return rf(ctx, chainReferenceID) } - if rf, ok := ret.Get(0).(func(types.Context, string) *valsettypes.Snapshot); ok { + if rf, ok := ret.Get(0).(func(context.Context, string) *types.Snapshot); ok { r0 = rf(ctx, chainReferenceID) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*valsettypes.Snapshot) + r0 = ret.Get(0).(*types.Snapshot) } } - if rf, ok := ret.Get(1).(func(types.Context, string) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, chainReferenceID) } else { r1 = ret.Error(1) @@ -120,23 +139,27 @@ func (_m *ValsetKeeper) GetLatestSnapshotOnChain(ctx types.Context, chainReferen } // GetValidatorChainInfos provides a mock function with given fields: ctx, valAddr -func (_m *ValsetKeeper) GetValidatorChainInfos(ctx types.Context, valAddr types.ValAddress) ([]*valsettypes.ExternalChainInfo, error) { +func (_m *ValsetKeeper) GetValidatorChainInfos(ctx context.Context, valAddr cosmos_sdktypes.ValAddress) ([]*types.ExternalChainInfo, error) { ret := _m.Called(ctx, valAddr) - var r0 []*valsettypes.ExternalChainInfo + if len(ret) == 0 { + panic("no return value specified for GetValidatorChainInfos") + } + + var r0 []*types.ExternalChainInfo var r1 error - if rf, ok := ret.Get(0).(func(types.Context, types.ValAddress) ([]*valsettypes.ExternalChainInfo, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, cosmos_sdktypes.ValAddress) ([]*types.ExternalChainInfo, error)); ok { return rf(ctx, valAddr) } - if rf, ok := ret.Get(0).(func(types.Context, types.ValAddress) []*valsettypes.ExternalChainInfo); ok { + if rf, ok := ret.Get(0).(func(context.Context, cosmos_sdktypes.ValAddress) []*types.ExternalChainInfo); ok { r0 = rf(ctx, valAddr) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]*valsettypes.ExternalChainInfo) + r0 = ret.Get(0).([]*types.ExternalChainInfo) } } - if rf, ok := ret.Get(1).(func(types.Context, types.ValAddress) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, cosmos_sdktypes.ValAddress) error); ok { r1 = rf(ctx, valAddr) } else { r1 = ret.Error(1) @@ -146,11 +169,15 @@ func (_m *ValsetKeeper) GetValidatorChainInfos(ctx types.Context, valAddr types. } // IsJailed provides a mock function with given fields: ctx, val -func (_m *ValsetKeeper) IsJailed(ctx types.Context, val types.ValAddress) bool { +func (_m *ValsetKeeper) IsJailed(ctx context.Context, val cosmos_sdktypes.ValAddress) bool { ret := _m.Called(ctx, val) + if len(ret) == 0 { + panic("no return value specified for IsJailed") + } + var r0 bool - if rf, ok := ret.Get(0).(func(types.Context, types.ValAddress) bool); ok { + if rf, ok := ret.Get(0).(func(context.Context, cosmos_sdktypes.ValAddress) bool); ok { r0 = rf(ctx, val) } else { r0 = ret.Get(0).(bool) @@ -160,11 +187,15 @@ func (_m *ValsetKeeper) IsJailed(ctx types.Context, val types.ValAddress) bool { } // Jail provides a mock function with given fields: ctx, valAddr, reason -func (_m *ValsetKeeper) Jail(ctx types.Context, valAddr types.ValAddress, reason string) error { +func (_m *ValsetKeeper) Jail(ctx context.Context, valAddr cosmos_sdktypes.ValAddress, reason string) error { ret := _m.Called(ctx, valAddr, reason) + if len(ret) == 0 { + panic("no return value specified for Jail") + } + var r0 error - if rf, ok := ret.Get(0).(func(types.Context, types.ValAddress, string) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, cosmos_sdktypes.ValAddress, string) error); ok { r0 = rf(ctx, valAddr, reason) } else { r0 = ret.Error(0) @@ -174,11 +205,15 @@ func (_m *ValsetKeeper) Jail(ctx types.Context, valAddr types.ValAddress, reason } // KeepValidatorAlive provides a mock function with given fields: ctx, valAddr, pigeonVersion -func (_m *ValsetKeeper) KeepValidatorAlive(ctx types.Context, valAddr types.ValAddress, pigeonVersion string) error { +func (_m *ValsetKeeper) KeepValidatorAlive(ctx context.Context, valAddr cosmos_sdktypes.ValAddress, pigeonVersion string) error { ret := _m.Called(ctx, valAddr, pigeonVersion) + if len(ret) == 0 { + panic("no return value specified for KeepValidatorAlive") + } + var r0 error - if rf, ok := ret.Get(0).(func(types.Context, types.ValAddress, string) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, cosmos_sdktypes.ValAddress, string) error); ok { r0 = rf(ctx, valAddr, pigeonVersion) } else { r0 = ret.Error(0) @@ -188,11 +223,15 @@ func (_m *ValsetKeeper) KeepValidatorAlive(ctx types.Context, valAddr types.ValA } // SetSnapshotOnChain provides a mock function with given fields: ctx, snapshotID, chainReferenceID -func (_m *ValsetKeeper) SetSnapshotOnChain(ctx types.Context, snapshotID uint64, chainReferenceID string) error { +func (_m *ValsetKeeper) SetSnapshotOnChain(ctx context.Context, snapshotID uint64, chainReferenceID string) error { ret := _m.Called(ctx, snapshotID, chainReferenceID) + if len(ret) == 0 { + panic("no return value specified for SetSnapshotOnChain") + } + var r0 error - if rf, ok := ret.Get(0).(func(types.Context, uint64, string) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, uint64, string) error); ok { r0 = rf(ctx, snapshotID, chainReferenceID) } else { r0 = ret.Error(0) @@ -202,11 +241,15 @@ func (_m *ValsetKeeper) SetSnapshotOnChain(ctx types.Context, snapshotID uint64, } // SetValidatorBalance provides a mock function with given fields: ctx, valAddr, chainType, chainReferenceID, externalAddress, balance -func (_m *ValsetKeeper) SetValidatorBalance(ctx types.Context, valAddr types.ValAddress, chainType string, chainReferenceID string, externalAddress string, balance *big.Int) error { +func (_m *ValsetKeeper) SetValidatorBalance(ctx context.Context, valAddr cosmos_sdktypes.ValAddress, chainType string, chainReferenceID string, externalAddress string, balance *big.Int) error { ret := _m.Called(ctx, valAddr, chainType, chainReferenceID, externalAddress, balance) + if len(ret) == 0 { + panic("no return value specified for SetValidatorBalance") + } + var r0 error - if rf, ok := ret.Get(0).(func(types.Context, types.ValAddress, string, string, string, *big.Int) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, cosmos_sdktypes.ValAddress, string, string, string, *big.Int) error); ok { r0 = rf(ctx, valAddr, chainType, chainReferenceID, externalAddress, balance) } else { r0 = ret.Error(0) @@ -220,8 +263,7 @@ func (_m *ValsetKeeper) SetValidatorBalance(ctx types.Context, valAddr types.Val func NewValsetKeeper(t interface { mock.TestingT Cleanup(func()) -}, -) *ValsetKeeper { +}) *ValsetKeeper { mock := &ValsetKeeper{} mock.Mock.Test(t) diff --git a/x/evm/types/msg_assigner.go b/x/evm/types/msg_assigner.go index 4df33213..91cb8d9f 100644 --- a/x/evm/types/msg_assigner.go +++ b/x/evm/types/msg_assigner.go @@ -1,10 +1,11 @@ package types import ( - sdk "github.com/cosmos/cosmos-sdk/types" + "context" + xchain "github.com/palomachain/paloma/internal/x-chain" ) type MsgAssigner interface { - PickValidatorForMessage(ctx sdk.Context, weights *RelayWeights, chainID string, requirements *xchain.JobRequirements) (string, error) + PickValidatorForMessage(ctx context.Context, weights *RelayWeights, chainID string, requirements *xchain.JobRequirements) (string, error) } diff --git a/x/evm/types/msg_sender.go b/x/evm/types/msg_sender.go index 06eab994..15bf9e35 100644 --- a/x/evm/types/msg_sender.go +++ b/x/evm/types/msg_sender.go @@ -1,7 +1,9 @@ package types -import sdk "github.com/cosmos/cosmos-sdk/types" +import "context" + +//go:generate mockery --name=MsgSender type MsgSender interface { - SendValsetMsgForChain(ctx sdk.Context, chainInfo *ChainInfo, valset Valset, assignee string) error + SendValsetMsgForChain(ctx context.Context, chainInfo *ChainInfo, valset Valset, assignee string) error } diff --git a/x/evm/types/params.go b/x/evm/types/params.go index 357196ad..4f3215e3 100644 --- a/x/evm/types/params.go +++ b/x/evm/types/params.go @@ -2,7 +2,6 @@ package types import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "gopkg.in/yaml.v2" ) var _ paramtypes.ParamSet = (*Params)(nil) @@ -31,9 +30,3 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { func (p Params) Validate() error { return nil } - -// String implements the Stringer interface. -func (p Params) String() string { - out, _ := yaml.Marshal(p) - return string(out) -} diff --git a/x/evm/types/params.pb.go b/x/evm/types/params.pb.go index f65a9c80..d6cb18ad 100644 --- a/x/evm/types/params.pb.go +++ b/x/evm/types/params.pb.go @@ -27,8 +27,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Params struct { } -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} +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_a12098455d1f774b, []int{0} } @@ -68,17 +69,16 @@ func init() { } var fileDescriptor_a12098455d1f774b = []byte{ - // 150 bytes of a gzipped FileDescriptorProto + // 144 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2e, 0x48, 0xcc, 0xc9, 0xcf, 0x4d, 0x4c, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x87, 0xb0, 0xf5, 0x53, 0xcb, 0x72, 0xf5, 0x0b, 0x12, 0x8b, 0x12, 0x73, 0x8b, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0xc4, 0x90, 0x14, 0xe9, 0x41, 0xd8, 0x7a, 0xa9, 0x65, 0xb9, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x25, 0xfa, 0x20, - 0x16, 0x44, 0xb5, 0x12, 0x1f, 0x17, 0x5b, 0x00, 0x58, 0xb7, 0x15, 0xcb, 0x8c, 0x05, 0xf2, 0x0c, - 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, 0x8f, 0xc5, 0x1d, 0x15, 0x60, 0x97, 0x94, 0x54, - 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xcd, 0x36, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x2d, 0x29, - 0x2b, 0x39, 0xb0, 0x00, 0x00, 0x00, + 0x16, 0x44, 0xb5, 0x12, 0x07, 0x17, 0x5b, 0x00, 0x58, 0xb7, 0x93, 0xf3, 0x89, 0x47, 0x72, 0x8c, + 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, + 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x69, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, + 0xe7, 0xea, 0x63, 0x71, 0x41, 0x05, 0xd8, 0x0d, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, + 0x53, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x79, 0xfa, 0x11, 0xf7, 0xaa, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/evm/types/turnstone.pb.go b/x/evm/types/turnstone.pb.go index a42e6cbb..f08c4793 100644 --- a/x/evm/types/turnstone.pb.go +++ b/x/evm/types/turnstone.pb.go @@ -5,20 +5,17 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. -var ( - _ = proto.Marshal - _ = fmt.Errorf - _ = math.Inf -) +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. @@ -39,11 +36,9 @@ func (*Valset) ProtoMessage() {} func (*Valset) Descriptor() ([]byte, []int) { return fileDescriptor_86cc126a804337fd, []int{0} } - func (m *Valset) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *Valset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Valset.Marshal(b, m, deterministic) @@ -56,15 +51,12 @@ func (m *Valset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } - func (m *Valset) XXX_Merge(src proto.Message) { xxx_messageInfo_Valset.Merge(m, src) } - func (m *Valset) XXX_Size() int { return m.Size() } - func (m *Valset) XXX_DiscardUnknown() { xxx_messageInfo_Valset.DiscardUnknown(m) } @@ -109,11 +101,9 @@ func (*SubmitLogicCall) ProtoMessage() {} func (*SubmitLogicCall) Descriptor() ([]byte, []int) { return fileDescriptor_86cc126a804337fd, []int{1} } - func (m *SubmitLogicCall) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *SubmitLogicCall) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_SubmitLogicCall.Marshal(b, m, deterministic) @@ -126,15 +116,12 @@ func (m *SubmitLogicCall) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } - func (m *SubmitLogicCall) XXX_Merge(src proto.Message) { xxx_messageInfo_SubmitLogicCall.Merge(m, src) } - func (m *SubmitLogicCall) XXX_Size() int { return m.Size() } - func (m *SubmitLogicCall) XXX_DiscardUnknown() { xxx_messageInfo_SubmitLogicCall.DiscardUnknown(m) } @@ -207,11 +194,9 @@ func (*SubmitLogicCall_ExecutionRequirements) ProtoMessage() {} func (*SubmitLogicCall_ExecutionRequirements) Descriptor() ([]byte, []int) { return fileDescriptor_86cc126a804337fd, []int{1, 0} } - func (m *SubmitLogicCall_ExecutionRequirements) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *SubmitLogicCall_ExecutionRequirements) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_SubmitLogicCall_ExecutionRequirements.Marshal(b, m, deterministic) @@ -224,15 +209,12 @@ func (m *SubmitLogicCall_ExecutionRequirements) XXX_Marshal(b []byte, determinis return b[:n], nil } } - func (m *SubmitLogicCall_ExecutionRequirements) XXX_Merge(src proto.Message) { xxx_messageInfo_SubmitLogicCall_ExecutionRequirements.Merge(m, src) } - func (m *SubmitLogicCall_ExecutionRequirements) XXX_Size() int { return m.Size() } - func (m *SubmitLogicCall_ExecutionRequirements) XXX_DiscardUnknown() { xxx_messageInfo_SubmitLogicCall_ExecutionRequirements.DiscardUnknown(m) } @@ -256,11 +238,9 @@ func (*UpdateValset) ProtoMessage() {} func (*UpdateValset) Descriptor() ([]byte, []int) { return fileDescriptor_86cc126a804337fd, []int{2} } - func (m *UpdateValset) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *UpdateValset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_UpdateValset.Marshal(b, m, deterministic) @@ -273,15 +253,12 @@ func (m *UpdateValset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } - func (m *UpdateValset) XXX_Merge(src proto.Message) { xxx_messageInfo_UpdateValset.Merge(m, src) } - func (m *UpdateValset) XXX_Size() int { return m.Size() } - func (m *UpdateValset) XXX_DiscardUnknown() { xxx_messageInfo_UpdateValset.DiscardUnknown(m) } @@ -308,11 +285,9 @@ func (*UploadSmartContract) ProtoMessage() {} func (*UploadSmartContract) Descriptor() ([]byte, []int) { return fileDescriptor_86cc126a804337fd, []int{3} } - func (m *UploadSmartContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *UploadSmartContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_UploadSmartContract.Marshal(b, m, deterministic) @@ -325,15 +300,12 @@ func (m *UploadSmartContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } - func (m *UploadSmartContract) XXX_Merge(src proto.Message) { xxx_messageInfo_UploadSmartContract.Merge(m, src) } - func (m *UploadSmartContract) XXX_Size() int { return m.Size() } - func (m *UploadSmartContract) XXX_DiscardUnknown() { xxx_messageInfo_UploadSmartContract.DiscardUnknown(m) } @@ -388,11 +360,9 @@ func (*Message) ProtoMessage() {} func (*Message) Descriptor() ([]byte, []int) { return fileDescriptor_86cc126a804337fd, []int{4} } - func (m *Message) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Message.Marshal(b, m, deterministic) @@ -405,15 +375,12 @@ func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } - func (m *Message) XXX_Merge(src proto.Message) { xxx_messageInfo_Message.Merge(m, src) } - func (m *Message) XXX_Size() int { return m.Size() } - func (m *Message) XXX_DiscardUnknown() { xxx_messageInfo_Message.DiscardUnknown(m) } @@ -527,11 +494,9 @@ func (*TxExecutedProof) ProtoMessage() {} func (*TxExecutedProof) Descriptor() ([]byte, []int) { return fileDescriptor_86cc126a804337fd, []int{5} } - func (m *TxExecutedProof) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *TxExecutedProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_TxExecutedProof.Marshal(b, m, deterministic) @@ -544,15 +509,12 @@ func (m *TxExecutedProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } - func (m *TxExecutedProof) XXX_Merge(src proto.Message) { xxx_messageInfo_TxExecutedProof.Merge(m, src) } - func (m *TxExecutedProof) XXX_Size() int { return m.Size() } - func (m *TxExecutedProof) XXX_DiscardUnknown() { xxx_messageInfo_TxExecutedProof.DiscardUnknown(m) } @@ -576,11 +538,9 @@ func (*SmartContractExecutionErrorProof) ProtoMessage() {} func (*SmartContractExecutionErrorProof) Descriptor() ([]byte, []int) { return fileDescriptor_86cc126a804337fd, []int{6} } - func (m *SmartContractExecutionErrorProof) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *SmartContractExecutionErrorProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_SmartContractExecutionErrorProof.Marshal(b, m, deterministic) @@ -593,15 +553,12 @@ func (m *SmartContractExecutionErrorProof) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } - func (m *SmartContractExecutionErrorProof) XXX_Merge(src proto.Message) { xxx_messageInfo_SmartContractExecutionErrorProof.Merge(m, src) } - func (m *SmartContractExecutionErrorProof) XXX_Size() int { return m.Size() } - func (m *SmartContractExecutionErrorProof) XXX_DiscardUnknown() { xxx_messageInfo_SmartContractExecutionErrorProof.DiscardUnknown(m) } @@ -626,11 +583,9 @@ func (*TransferERC20Ownership) ProtoMessage() {} func (*TransferERC20Ownership) Descriptor() ([]byte, []int) { return fileDescriptor_86cc126a804337fd, []int{7} } - func (m *TransferERC20Ownership) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *TransferERC20Ownership) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_TransferERC20Ownership.Marshal(b, m, deterministic) @@ -643,15 +598,12 @@ func (m *TransferERC20Ownership) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } - func (m *TransferERC20Ownership) XXX_Merge(src proto.Message) { xxx_messageInfo_TransferERC20Ownership.Merge(m, src) } - func (m *TransferERC20Ownership) XXX_Size() int { return m.Size() } - func (m *TransferERC20Ownership) XXX_DiscardUnknown() { xxx_messageInfo_TransferERC20Ownership.DiscardUnknown(m) } @@ -1071,7 +1023,6 @@ func (m *Message_SubmitLogicCall) MarshalToSizedBuffer(dAtA []byte) (int, error) } return len(dAtA) - i, nil } - func (m *Message_UpdateValset) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) @@ -1093,7 +1044,6 @@ func (m *Message_UpdateValset) MarshalToSizedBuffer(dAtA []byte) (int, error) { } return len(dAtA) - i, nil } - func (m *Message_UploadSmartContract) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) @@ -1115,7 +1065,6 @@ func (m *Message_UploadSmartContract) MarshalToSizedBuffer(dAtA []byte) (int, er } return len(dAtA) - i, nil } - func (m *Message_TransferERC20Ownership) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) @@ -1137,7 +1086,6 @@ func (m *Message_TransferERC20Ownership) MarshalToSizedBuffer(dAtA []byte) (int, } return len(dAtA) - i, nil } - func (m *TxExecutedProof) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1244,7 +1192,6 @@ func encodeVarintTurnstone(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *Valset) Size() (n int) { if m == nil { return 0 @@ -1396,7 +1343,6 @@ func (m *Message_SubmitLogicCall) Size() (n int) { } return n } - func (m *Message_UpdateValset) Size() (n int) { if m == nil { return 0 @@ -1409,7 +1355,6 @@ func (m *Message_UpdateValset) Size() (n int) { } return n } - func (m *Message_UploadSmartContract) Size() (n int) { if m == nil { return 0 @@ -1422,7 +1367,6 @@ func (m *Message_UploadSmartContract) Size() (n int) { } return n } - func (m *Message_TransferERC20Ownership) Size() (n int) { if m == nil { return 0 @@ -1435,7 +1379,6 @@ func (m *Message_TransferERC20Ownership) Size() (n int) { } return n } - func (m *TxExecutedProof) Size() (n int) { if m == nil { return 0 @@ -1481,11 +1424,9 @@ func (m *TransferERC20Ownership) Size() (n int) { func sovTurnstone(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } - func sozTurnstone(x uint64) (n int) { return sovTurnstone(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } - func (m *Valset) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1663,7 +1604,6 @@ func (m *Valset) Unmarshal(dAtA []byte) error { } return nil } - func (m *SubmitLogicCall) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1953,7 +1893,6 @@ func (m *SubmitLogicCall) Unmarshal(dAtA []byte) error { } return nil } - func (m *SubmitLogicCall_ExecutionRequirements) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2024,7 +1963,6 @@ func (m *SubmitLogicCall_ExecutionRequirements) Unmarshal(dAtA []byte) error { } return nil } - func (m *UpdateValset) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2111,7 +2049,6 @@ func (m *UpdateValset) Unmarshal(dAtA []byte) error { } return nil } - func (m *UploadSmartContract) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2281,7 +2218,6 @@ func (m *UploadSmartContract) Unmarshal(dAtA []byte) error { } return nil } - func (m *Message) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2600,7 +2536,6 @@ func (m *Message) Unmarshal(dAtA []byte) error { } return nil } - func (m *TxExecutedProof) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2685,7 +2620,6 @@ func (m *TxExecutedProof) Unmarshal(dAtA []byte) error { } return nil } - func (m *SmartContractExecutionErrorProof) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2768,7 +2702,6 @@ func (m *SmartContractExecutionErrorProof) Unmarshal(dAtA []byte) error { } return nil } - func (m *TransferERC20Ownership) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2872,7 +2805,6 @@ func (m *TransferERC20Ownership) Unmarshal(dAtA []byte) error { } return nil } - func skipTurnstone(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/evm/types/tx.pb.go b/x/evm/types/tx.pb.go index 837987f4..5b3956f0 100644 --- a/x/evm/types/tx.pb.go +++ b/x/evm/types/tx.pb.go @@ -6,10 +6,8 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -17,14 +15,15 @@ import ( 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 - _ = fmt.Errorf - _ = math.Inf -) +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. @@ -47,11 +46,9 @@ func (*MsgDeployNewSmartContractRequest) ProtoMessage() {} func (*MsgDeployNewSmartContractRequest) Descriptor() ([]byte, []int) { return fileDescriptor_631cfc68eb1fd278, []int{0} } - func (m *MsgDeployNewSmartContractRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgDeployNewSmartContractRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgDeployNewSmartContractRequest.Marshal(b, m, deterministic) @@ -64,15 +61,12 @@ func (m *MsgDeployNewSmartContractRequest) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } - func (m *MsgDeployNewSmartContractRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgDeployNewSmartContractRequest.Merge(m, src) } - func (m *MsgDeployNewSmartContractRequest) XXX_Size() int { return m.Size() } - func (m *MsgDeployNewSmartContractRequest) XXX_DiscardUnknown() { xxx_messageInfo_MsgDeployNewSmartContractRequest.DiscardUnknown(m) } @@ -122,7 +116,8 @@ func (m *MsgDeployNewSmartContractRequest) GetMetadata() types.MsgMetadata { return types.MsgMetadata{} } -type DeployNewSmartContractResponse struct{} +type DeployNewSmartContractResponse struct { +} func (m *DeployNewSmartContractResponse) Reset() { *m = DeployNewSmartContractResponse{} } func (m *DeployNewSmartContractResponse) String() string { return proto.CompactTextString(m) } @@ -130,11 +125,9 @@ func (*DeployNewSmartContractResponse) ProtoMessage() {} func (*DeployNewSmartContractResponse) Descriptor() ([]byte, []int) { return fileDescriptor_631cfc68eb1fd278, []int{1} } - func (m *DeployNewSmartContractResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *DeployNewSmartContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_DeployNewSmartContractResponse.Marshal(b, m, deterministic) @@ -147,15 +140,12 @@ func (m *DeployNewSmartContractResponse) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } - func (m *DeployNewSmartContractResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_DeployNewSmartContractResponse.Merge(m, src) } - func (m *DeployNewSmartContractResponse) XXX_Size() int { return m.Size() } - func (m *DeployNewSmartContractResponse) XXX_DiscardUnknown() { xxx_messageInfo_DeployNewSmartContractResponse.DiscardUnknown(m) } @@ -177,11 +167,9 @@ func (*MsgRemoveSmartContractDeploymentRequest) ProtoMessage() {} func (*MsgRemoveSmartContractDeploymentRequest) Descriptor() ([]byte, []int) { return fileDescriptor_631cfc68eb1fd278, []int{2} } - func (m *MsgRemoveSmartContractDeploymentRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgRemoveSmartContractDeploymentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgRemoveSmartContractDeploymentRequest.Marshal(b, m, deterministic) @@ -194,15 +182,12 @@ func (m *MsgRemoveSmartContractDeploymentRequest) XXX_Marshal(b []byte, determin return b[:n], nil } } - func (m *MsgRemoveSmartContractDeploymentRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgRemoveSmartContractDeploymentRequest.Merge(m, src) } - func (m *MsgRemoveSmartContractDeploymentRequest) XXX_Size() int { return m.Size() } - func (m *MsgRemoveSmartContractDeploymentRequest) XXX_DiscardUnknown() { xxx_messageInfo_MsgRemoveSmartContractDeploymentRequest.DiscardUnknown(m) } @@ -238,7 +223,8 @@ func (m *MsgRemoveSmartContractDeploymentRequest) GetMetadata() types.MsgMetadat return types.MsgMetadata{} } -type RemoveSmartContractDeploymentResponse struct{} +type RemoveSmartContractDeploymentResponse struct { +} func (m *RemoveSmartContractDeploymentResponse) Reset() { *m = RemoveSmartContractDeploymentResponse{} } func (m *RemoveSmartContractDeploymentResponse) String() string { return proto.CompactTextString(m) } @@ -246,11 +232,9 @@ func (*RemoveSmartContractDeploymentResponse) ProtoMessage() {} func (*RemoveSmartContractDeploymentResponse) Descriptor() ([]byte, []int) { return fileDescriptor_631cfc68eb1fd278, []int{3} } - func (m *RemoveSmartContractDeploymentResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *RemoveSmartContractDeploymentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RemoveSmartContractDeploymentResponse.Marshal(b, m, deterministic) @@ -263,15 +247,12 @@ func (m *RemoveSmartContractDeploymentResponse) XXX_Marshal(b []byte, determinis return b[:n], nil } } - func (m *RemoveSmartContractDeploymentResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_RemoveSmartContractDeploymentResponse.Merge(m, src) } - func (m *RemoveSmartContractDeploymentResponse) XXX_Size() int { return m.Size() } - func (m *RemoveSmartContractDeploymentResponse) XXX_DiscardUnknown() { xxx_messageInfo_RemoveSmartContractDeploymentResponse.DiscardUnknown(m) } @@ -288,44 +269,44 @@ func init() { func init() { proto.RegisterFile("palomachain/paloma/evm/tx.proto", fileDescriptor_631cfc68eb1fd278) } var fileDescriptor_631cfc68eb1fd278 = []byte{ - // 467 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xc1, 0x6e, 0xd3, 0x30, - 0x18, 0xc7, 0xeb, 0xae, 0xeb, 0xe0, 0xdb, 0x01, 0x64, 0x4d, 0x53, 0x14, 0x41, 0x16, 0x55, 0x62, - 0x2b, 0x1c, 0x12, 0x69, 0x48, 0x88, 0x0b, 0x42, 0xea, 0x7a, 0xd8, 0x90, 0x32, 0xa4, 0xf4, 0xc6, - 0xcd, 0x75, 0x3f, 0xb2, 0x48, 0xb5, 0x1d, 0x62, 0x2f, 0xb4, 0xaf, 0xc0, 0x89, 0x37, 0xe0, 0x25, - 0x78, 0x88, 0x1d, 0x77, 0xe4, 0x84, 0x50, 0x2b, 0x5e, 0x03, 0xa1, 0xc6, 0xdd, 0x94, 0x41, 0xda, - 0x4d, 0xda, 0xed, 0xcb, 0xff, 0xfb, 0xff, 0x2d, 0x7f, 0x3f, 0xdb, 0x81, 0xbd, 0x8c, 0x8d, 0x95, - 0x60, 0xfc, 0x8c, 0xa5, 0x32, 0xb4, 0x75, 0x88, 0x85, 0x08, 0xcd, 0x24, 0xc8, 0x72, 0x65, 0x14, - 0xdd, 0xad, 0x18, 0x02, 0x5b, 0x07, 0x58, 0x08, 0x77, 0x27, 0x51, 0x89, 0x2a, 0x2d, 0xe1, 0xa2, - 0xb2, 0x6e, 0x77, 0xbf, 0x66, 0xb9, 0x82, 0x8d, 0x35, 0x9a, 0x90, 0x2b, 0x21, 0x94, 0xb4, 0xbe, - 0xce, 0x1f, 0x02, 0x7e, 0xa4, 0x93, 0x3e, 0x66, 0x63, 0x35, 0x3d, 0xc5, 0xcf, 0x03, 0xc1, 0x72, - 0x73, 0xa4, 0xa4, 0xc9, 0x19, 0x37, 0x31, 0x7e, 0x3a, 0x47, 0x6d, 0xe8, 0x13, 0xd8, 0xe2, 0x39, - 0x32, 0xa3, 0x72, 0x87, 0xf8, 0xa4, 0xfb, 0xb0, 0xd7, 0x74, 0x48, 0x7c, 0x25, 0xd1, 0x1d, 0xd8, - 0x34, 0xa9, 0x19, 0xa3, 0xd3, 0x5c, 0xf4, 0x62, 0xfb, 0x41, 0x7d, 0xd8, 0x1e, 0xa1, 0xe6, 0x79, - 0x9a, 0x99, 0x54, 0x49, 0x67, 0xa3, 0xec, 0x55, 0x25, 0xea, 0xc0, 0x16, 0x1b, 0xa6, 0xef, 0x06, - 0xef, 0x4f, 0x9d, 0x56, 0xd9, 0xbd, 0xfa, 0x5c, 0x64, 0x87, 0x53, 0x83, 0x5c, 0x8d, 0xf0, 0x18, - 0x27, 0xce, 0xa6, 0xcd, 0x56, 0x24, 0x7a, 0x0c, 0x0f, 0x04, 0x1a, 0x36, 0x62, 0x86, 0x39, 0x6d, - 0x9f, 0x74, 0xb7, 0x0f, 0xf7, 0x83, 0x1a, 0x3e, 0x76, 0xe2, 0x20, 0xd2, 0x49, 0xb4, 0x74, 0xf7, - 0x5a, 0x17, 0x3f, 0xf7, 0x1a, 0xf1, 0x75, 0xba, 0xe3, 0x83, 0xb7, 0x6a, 0x78, 0x9d, 0x29, 0xa9, - 0xb1, 0xf3, 0x9b, 0xc0, 0x41, 0xa4, 0x93, 0x18, 0x85, 0x2a, 0xf0, 0x86, 0xc5, 0x06, 0x05, 0xca, - 0x6b, 0x52, 0x2e, 0xb4, 0x07, 0x28, 0x47, 0x58, 0x05, 0xb5, 0x54, 0x68, 0x17, 0x1e, 0xe9, 0x6a, - 0xfa, 0xa4, 0x5f, 0x12, 0x6b, 0xc5, 0xff, 0xca, 0xf4, 0x05, 0x3c, 0x2e, 0xc7, 0x88, 0xf1, 0x23, - 0xe6, 0x28, 0x39, 0x9e, 0xf4, 0x97, 0x00, 0xff, 0xd3, 0x6f, 0x90, 0x68, 0xdd, 0x8b, 0xc4, 0x01, - 0x3c, 0xbb, 0x65, 0x46, 0x0b, 0xe4, 0xf0, 0x7b, 0x13, 0x36, 0x22, 0x9d, 0xd0, 0x2f, 0x04, 0x76, - 0xeb, 0xd9, 0xd1, 0xd7, 0x41, 0xfd, 0x6d, 0x0d, 0x6e, 0xbb, 0x6b, 0xee, 0xab, 0x55, 0xc9, 0xf5, - 0xa7, 0x44, 0xbf, 0x11, 0x78, 0xba, 0x76, 0xfb, 0xf4, 0xed, 0x9a, 0x3d, 0xdd, 0xe5, 0x70, 0xdd, - 0x37, 0xab, 0x16, 0xb8, 0x13, 0xb6, 0xde, 0xd1, 0xc5, 0xcc, 0x23, 0x97, 0x33, 0x8f, 0xfc, 0x9a, - 0x79, 0xe4, 0xeb, 0xdc, 0x6b, 0x5c, 0xce, 0xbd, 0xc6, 0x8f, 0xb9, 0xd7, 0xf8, 0xf0, 0x3c, 0x49, - 0xcd, 0xd9, 0xf9, 0x30, 0xe0, 0x4a, 0x84, 0x35, 0xef, 0x76, 0x62, 0x7f, 0x04, 0xd3, 0x0c, 0xf5, - 0xb0, 0x5d, 0x3e, 0xdb, 0x97, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xb2, 0x25, 0x0d, 0x30, 0x2f, - 0x04, 0x00, 0x00, + // 497 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0xce, 0xa6, 0x69, 0x0a, 0xdb, 0x03, 0x68, 0x55, 0x15, 0x63, 0x81, 0x6b, 0x05, 0xd1, 0x06, + 0x0e, 0xb6, 0x28, 0x12, 0xe2, 0x82, 0x90, 0xd2, 0x1c, 0x5a, 0x24, 0x17, 0xc9, 0xb9, 0x71, 0x41, + 0x9b, 0xcd, 0xe0, 0x5a, 0xca, 0x7a, 0x8c, 0x77, 0x6b, 0x92, 0x57, 0xe0, 0xc4, 0x1b, 0xf0, 0x12, + 0x3c, 0x44, 0x8f, 0x3d, 0x72, 0x42, 0x28, 0x11, 0xaf, 0x81, 0x50, 0xbc, 0x6e, 0xe5, 0x82, 0x93, + 0x56, 0xe2, 0x94, 0x9d, 0xef, 0x27, 0x9e, 0xf9, 0xd6, 0x63, 0xba, 0x93, 0xf2, 0x31, 0x4a, 0x2e, + 0x4e, 0x78, 0x9c, 0xf8, 0xe6, 0xec, 0x43, 0x2e, 0x7d, 0x3d, 0xf1, 0xd2, 0x0c, 0x35, 0xb2, 0xed, + 0x8a, 0xc0, 0x33, 0x67, 0x0f, 0x72, 0x69, 0x6f, 0x45, 0x18, 0x61, 0x21, 0xf1, 0x17, 0x27, 0xa3, + 0xb6, 0xef, 0x0b, 0x54, 0x12, 0xd5, 0x7b, 0x43, 0x98, 0xa2, 0xa4, 0xee, 0x99, 0xca, 0x97, 0x2a, + 0xf2, 0xf3, 0x67, 0x8b, 0x9f, 0x92, 0xd8, 0xad, 0x69, 0x21, 0xe7, 0x63, 0x05, 0xda, 0x17, 0x28, + 0x25, 0x26, 0xa5, 0xee, 0xd1, 0x92, 0x56, 0x53, 0x9e, 0x71, 0x59, 0x3e, 0xa5, 0xf3, 0x9b, 0x50, + 0x37, 0x50, 0x51, 0x1f, 0xd2, 0x31, 0x4e, 0x8f, 0xe1, 0xd3, 0x40, 0xf2, 0x4c, 0x1f, 0x60, 0xa2, + 0x33, 0x2e, 0x74, 0x08, 0x1f, 0x4f, 0x41, 0x69, 0xf6, 0x80, 0x6e, 0x88, 0x0c, 0xb8, 0xc6, 0xcc, + 0x22, 0x2e, 0xe9, 0xde, 0xee, 0x35, 0x2d, 0x12, 0x5e, 0x40, 0x6c, 0x8b, 0xae, 0xeb, 0x58, 0x8f, + 0xc1, 0x6a, 0x2e, 0xb8, 0xd0, 0x14, 0xcc, 0xa5, 0x9b, 0x23, 0x50, 0x22, 0x8b, 0x53, 0x1d, 0x63, + 0x62, 0xad, 0x15, 0x5c, 0x15, 0x62, 0x16, 0xdd, 0xe0, 0xc3, 0xf8, 0xcd, 0xe0, 0xed, 0xb1, 0xd5, + 0x2a, 0xd8, 0x8b, 0x72, 0xe1, 0x1d, 0x4e, 0x35, 0x08, 0x1c, 0xc1, 0x21, 0x4c, 0xac, 0x75, 0xe3, + 0xad, 0x40, 0xec, 0x90, 0xde, 0x92, 0xa0, 0xf9, 0x88, 0x6b, 0x6e, 0xb5, 0x5d, 0xd2, 0xdd, 0xdc, + 0xdf, 0xf5, 0x6a, 0x82, 0x37, 0xb1, 0x78, 0x81, 0x8a, 0x82, 0x52, 0xdd, 0x6b, 0x9d, 0xfd, 0xd8, + 0x69, 0x84, 0x97, 0xee, 0x8e, 0x4b, 0x9d, 0x65, 0xc3, 0xab, 0x14, 0x13, 0x05, 0x9d, 0x5f, 0x84, + 0xee, 0x05, 0x2a, 0x0a, 0x41, 0x62, 0x0e, 0x57, 0x24, 0xc6, 0x28, 0x21, 0xb9, 0x4c, 0xca, 0xa6, + 0xed, 0x01, 0x24, 0x23, 0xa8, 0x06, 0x55, 0x22, 0xac, 0x4b, 0xef, 0xa8, 0xaa, 0xfb, 0xa8, 0x5f, + 0x24, 0xd6, 0x0a, 0xff, 0x86, 0xd9, 0x53, 0x7a, 0xb7, 0x18, 0x23, 0x84, 0x0f, 0x90, 0x41, 0x22, + 0xe0, 0xa8, 0x5f, 0x06, 0xf8, 0x0f, 0x7e, 0x25, 0x89, 0xd6, 0x7f, 0x25, 0xb1, 0x47, 0x1f, 0x5f, + 0x33, 0xa3, 0x09, 0x64, 0xff, 0x5b, 0x93, 0xae, 0x05, 0x2a, 0x62, 0x9f, 0x09, 0xdd, 0xae, 0xcf, + 0x8e, 0xbd, 0xf4, 0xea, 0xd7, 0xc0, 0xbb, 0xee, 0x5d, 0xb3, 0x5f, 0x2c, 0x73, 0xae, 0xbe, 0x25, + 0xf6, 0x95, 0xd0, 0x87, 0x2b, 0xdb, 0x67, 0xaf, 0x57, 0xf4, 0x74, 0x93, 0xcb, 0xb5, 0x5f, 0x2d, + 0xfb, 0x83, 0x1b, 0xc5, 0xd6, 0x3b, 0x38, 0x9b, 0x39, 0xe4, 0x7c, 0xe6, 0x90, 0x9f, 0x33, 0x87, + 0x7c, 0x99, 0x3b, 0x8d, 0xf3, 0xb9, 0xd3, 0xf8, 0x3e, 0x77, 0x1a, 0xef, 0x9e, 0x44, 0xb1, 0x3e, + 0x39, 0x1d, 0x7a, 0x02, 0xa5, 0x5f, 0xb3, 0xb4, 0x13, 0xf3, 0x85, 0x99, 0xa6, 0xa0, 0x86, 0xed, + 0x62, 0x6d, 0x9f, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xab, 0xda, 0x40, 0x52, 0x88, 0x04, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. -var ( - _ context.Context - _ grpc.ClientConn -) +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. @@ -372,12 +353,12 @@ type MsgServer interface { } // UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct{} +type UnimplementedMsgServer struct { +} func (*UnimplementedMsgServer) DeployNewSmartContract(ctx context.Context, req *MsgDeployNewSmartContractRequest) (*DeployNewSmartContractResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeployNewSmartContract not implemented") } - func (*UnimplementedMsgServer) RemoveSmartContractDeployment(ctx context.Context, req *MsgRemoveSmartContractDeploymentRequest) (*RemoveSmartContractDeploymentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveSmartContractDeployment not implemented") } @@ -616,7 +597,6 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *MsgDeployNewSmartContractRequest) Size() (n int) { if m == nil { return 0 @@ -691,11 +671,9 @@ func (m *RemoveSmartContractDeploymentResponse) Size() (n int) { 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 *MsgDeployNewSmartContractRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -939,7 +917,6 @@ func (m *MsgDeployNewSmartContractRequest) Unmarshal(dAtA []byte) error { } return nil } - func (m *DeployNewSmartContractResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -990,7 +967,6 @@ func (m *DeployNewSmartContractResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgRemoveSmartContractDeploymentRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1157,7 +1133,6 @@ func (m *MsgRemoveSmartContractDeploymentRequest) Unmarshal(dAtA []byte) error { } return nil } - func (m *RemoveSmartContractDeploymentResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1208,7 +1183,6 @@ func (m *RemoveSmartContractDeploymentResponse) Unmarshal(dAtA []byte) error { } return nil } - func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/gravity/types/msgs.pb.go b/x/gravity/types/msgs.pb.go index 268464bd..be9adfc0 100644 --- a/x/gravity/types/msgs.pb.go +++ b/x/gravity/types/msgs.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-proto" types2 "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -22,14 +18,15 @@ import ( 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 - _ = fmt.Errorf - _ = math.Inf -) +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. @@ -59,11 +56,9 @@ func (*MsgSendToEth) ProtoMessage() {} func (*MsgSendToEth) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{0} } - func (m *MsgSendToEth) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgSendToEth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgSendToEth.Marshal(b, m, deterministic) @@ -76,15 +71,12 @@ func (m *MsgSendToEth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } - func (m *MsgSendToEth) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgSendToEth.Merge(m, src) } - func (m *MsgSendToEth) XXX_Size() int { return m.Size() } - func (m *MsgSendToEth) XXX_DiscardUnknown() { xxx_messageInfo_MsgSendToEth.DiscardUnknown(m) } @@ -127,7 +119,8 @@ func (m *MsgSendToEth) GetMetadata() types1.MsgMetadata { return types1.MsgMetadata{} } -type MsgSendToEthResponse struct{} +type MsgSendToEthResponse struct { +} func (m *MsgSendToEthResponse) Reset() { *m = MsgSendToEthResponse{} } func (m *MsgSendToEthResponse) String() string { return proto.CompactTextString(m) } @@ -135,11 +128,9 @@ func (*MsgSendToEthResponse) ProtoMessage() {} func (*MsgSendToEthResponse) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{1} } - func (m *MsgSendToEthResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgSendToEthResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgSendToEthResponse.Marshal(b, m, deterministic) @@ -152,15 +143,12 @@ func (m *MsgSendToEthResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } - func (m *MsgSendToEthResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgSendToEthResponse.Merge(m, src) } - func (m *MsgSendToEthResponse) XXX_Size() int { return m.Size() } - func (m *MsgSendToEthResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgSendToEthResponse.DiscardUnknown(m) } @@ -190,11 +178,9 @@ func (*MsgConfirmBatch) ProtoMessage() {} func (*MsgConfirmBatch) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{2} } - func (m *MsgConfirmBatch) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgConfirmBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgConfirmBatch.Marshal(b, m, deterministic) @@ -207,15 +193,12 @@ func (m *MsgConfirmBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } - func (m *MsgConfirmBatch) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgConfirmBatch.Merge(m, src) } - func (m *MsgConfirmBatch) XXX_Size() int { return m.Size() } - func (m *MsgConfirmBatch) XXX_DiscardUnknown() { xxx_messageInfo_MsgConfirmBatch.DiscardUnknown(m) } @@ -264,7 +247,8 @@ func (m *MsgConfirmBatch) GetMetadata() types1.MsgMetadata { return types1.MsgMetadata{} } -type MsgConfirmBatchResponse struct{} +type MsgConfirmBatchResponse struct { +} func (m *MsgConfirmBatchResponse) Reset() { *m = MsgConfirmBatchResponse{} } func (m *MsgConfirmBatchResponse) String() string { return proto.CompactTextString(m) } @@ -272,11 +256,9 @@ func (*MsgConfirmBatchResponse) ProtoMessage() {} func (*MsgConfirmBatchResponse) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{3} } - func (m *MsgConfirmBatchResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgConfirmBatchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgConfirmBatchResponse.Marshal(b, m, deterministic) @@ -289,15 +271,12 @@ func (m *MsgConfirmBatchResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } - func (m *MsgConfirmBatchResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgConfirmBatchResponse.Merge(m, src) } - func (m *MsgConfirmBatchResponse) XXX_Size() int { return m.Size() } - func (m *MsgConfirmBatchResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgConfirmBatchResponse.DiscardUnknown(m) } @@ -327,11 +306,9 @@ func (*MsgSendToPalomaClaim) ProtoMessage() {} func (*MsgSendToPalomaClaim) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{4} } - func (m *MsgSendToPalomaClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgSendToPalomaClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgSendToPalomaClaim.Marshal(b, m, deterministic) @@ -344,15 +321,12 @@ func (m *MsgSendToPalomaClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } - func (m *MsgSendToPalomaClaim) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgSendToPalomaClaim.Merge(m, src) } - func (m *MsgSendToPalomaClaim) XXX_Size() int { return m.Size() } - func (m *MsgSendToPalomaClaim) XXX_DiscardUnknown() { xxx_messageInfo_MsgSendToPalomaClaim.DiscardUnknown(m) } @@ -415,7 +389,8 @@ func (m *MsgSendToPalomaClaim) GetMetadata() types1.MsgMetadata { return types1.MsgMetadata{} } -type MsgSendToPalomaClaimResponse struct{} +type MsgSendToPalomaClaimResponse struct { +} func (m *MsgSendToPalomaClaimResponse) Reset() { *m = MsgSendToPalomaClaimResponse{} } func (m *MsgSendToPalomaClaimResponse) String() string { return proto.CompactTextString(m) } @@ -423,11 +398,9 @@ func (*MsgSendToPalomaClaimResponse) ProtoMessage() {} func (*MsgSendToPalomaClaimResponse) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{5} } - func (m *MsgSendToPalomaClaimResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgSendToPalomaClaimResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgSendToPalomaClaimResponse.Marshal(b, m, deterministic) @@ -440,15 +413,12 @@ func (m *MsgSendToPalomaClaimResponse) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } - func (m *MsgSendToPalomaClaimResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgSendToPalomaClaimResponse.Merge(m, src) } - func (m *MsgSendToPalomaClaimResponse) XXX_Size() int { return m.Size() } - func (m *MsgSendToPalomaClaimResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgSendToPalomaClaimResponse.DiscardUnknown(m) } @@ -473,11 +443,9 @@ func (*MsgBatchSendToEthClaim) ProtoMessage() {} func (*MsgBatchSendToEthClaim) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{6} } - func (m *MsgBatchSendToEthClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgBatchSendToEthClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgBatchSendToEthClaim.Marshal(b, m, deterministic) @@ -490,15 +458,12 @@ func (m *MsgBatchSendToEthClaim) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } - func (m *MsgBatchSendToEthClaim) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgBatchSendToEthClaim.Merge(m, src) } - func (m *MsgBatchSendToEthClaim) XXX_Size() int { return m.Size() } - func (m *MsgBatchSendToEthClaim) XXX_DiscardUnknown() { xxx_messageInfo_MsgBatchSendToEthClaim.DiscardUnknown(m) } @@ -554,7 +519,8 @@ func (m *MsgBatchSendToEthClaim) GetMetadata() types1.MsgMetadata { return types1.MsgMetadata{} } -type MsgBatchSendToEthClaimResponse struct{} +type MsgBatchSendToEthClaimResponse struct { +} func (m *MsgBatchSendToEthClaimResponse) Reset() { *m = MsgBatchSendToEthClaimResponse{} } func (m *MsgBatchSendToEthClaimResponse) String() string { return proto.CompactTextString(m) } @@ -562,11 +528,9 @@ func (*MsgBatchSendToEthClaimResponse) ProtoMessage() {} func (*MsgBatchSendToEthClaimResponse) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{7} } - func (m *MsgBatchSendToEthClaimResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgBatchSendToEthClaimResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgBatchSendToEthClaimResponse.Marshal(b, m, deterministic) @@ -579,15 +543,12 @@ func (m *MsgBatchSendToEthClaimResponse) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } - func (m *MsgBatchSendToEthClaimResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgBatchSendToEthClaimResponse.Merge(m, src) } - func (m *MsgBatchSendToEthClaimResponse) XXX_Size() int { return m.Size() } - func (m *MsgBatchSendToEthClaimResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgBatchSendToEthClaimResponse.DiscardUnknown(m) } @@ -609,11 +570,9 @@ func (*MsgCancelSendToEth) ProtoMessage() {} func (*MsgCancelSendToEth) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{8} } - func (m *MsgCancelSendToEth) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgCancelSendToEth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgCancelSendToEth.Marshal(b, m, deterministic) @@ -626,15 +585,12 @@ func (m *MsgCancelSendToEth) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } - func (m *MsgCancelSendToEth) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgCancelSendToEth.Merge(m, src) } - func (m *MsgCancelSendToEth) XXX_Size() int { return m.Size() } - func (m *MsgCancelSendToEth) XXX_DiscardUnknown() { xxx_messageInfo_MsgCancelSendToEth.DiscardUnknown(m) } @@ -663,7 +619,8 @@ func (m *MsgCancelSendToEth) GetMetadata() types1.MsgMetadata { return types1.MsgMetadata{} } -type MsgCancelSendToEthResponse struct{} +type MsgCancelSendToEthResponse struct { +} func (m *MsgCancelSendToEthResponse) Reset() { *m = MsgCancelSendToEthResponse{} } func (m *MsgCancelSendToEthResponse) String() string { return proto.CompactTextString(m) } @@ -671,11 +628,9 @@ func (*MsgCancelSendToEthResponse) ProtoMessage() {} func (*MsgCancelSendToEthResponse) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{9} } - func (m *MsgCancelSendToEthResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgCancelSendToEthResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgCancelSendToEthResponse.Marshal(b, m, deterministic) @@ -688,15 +643,12 @@ func (m *MsgCancelSendToEthResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } - func (m *MsgCancelSendToEthResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgCancelSendToEthResponse.Merge(m, src) } - func (m *MsgCancelSendToEthResponse) XXX_Size() int { return m.Size() } - func (m *MsgCancelSendToEthResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgCancelSendToEthResponse.DiscardUnknown(m) } @@ -721,11 +673,9 @@ func (*MsgSubmitBadSignatureEvidence) ProtoMessage() {} func (*MsgSubmitBadSignatureEvidence) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{10} } - func (m *MsgSubmitBadSignatureEvidence) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgSubmitBadSignatureEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgSubmitBadSignatureEvidence.Marshal(b, m, deterministic) @@ -738,15 +688,12 @@ func (m *MsgSubmitBadSignatureEvidence) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } - func (m *MsgSubmitBadSignatureEvidence) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgSubmitBadSignatureEvidence.Merge(m, src) } - func (m *MsgSubmitBadSignatureEvidence) XXX_Size() int { return m.Size() } - func (m *MsgSubmitBadSignatureEvidence) XXX_DiscardUnknown() { xxx_messageInfo_MsgSubmitBadSignatureEvidence.DiscardUnknown(m) } @@ -789,7 +736,8 @@ func (m *MsgSubmitBadSignatureEvidence) GetMetadata() types1.MsgMetadata { return types1.MsgMetadata{} } -type MsgSubmitBadSignatureEvidenceResponse struct{} +type MsgSubmitBadSignatureEvidenceResponse struct { +} func (m *MsgSubmitBadSignatureEvidenceResponse) Reset() { *m = MsgSubmitBadSignatureEvidenceResponse{} } func (m *MsgSubmitBadSignatureEvidenceResponse) String() string { return proto.CompactTextString(m) } @@ -797,11 +745,9 @@ func (*MsgSubmitBadSignatureEvidenceResponse) ProtoMessage() {} func (*MsgSubmitBadSignatureEvidenceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{11} } - func (m *MsgSubmitBadSignatureEvidenceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgSubmitBadSignatureEvidenceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgSubmitBadSignatureEvidenceResponse.Marshal(b, m, deterministic) @@ -814,15 +760,12 @@ func (m *MsgSubmitBadSignatureEvidenceResponse) XXX_Marshal(b []byte, determinis return b[:n], nil } } - func (m *MsgSubmitBadSignatureEvidenceResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgSubmitBadSignatureEvidenceResponse.Merge(m, src) } - func (m *MsgSubmitBadSignatureEvidenceResponse) XXX_Size() int { return m.Size() } - func (m *MsgSubmitBadSignatureEvidenceResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgSubmitBadSignatureEvidenceResponse.DiscardUnknown(m) } @@ -840,11 +783,9 @@ func (*EventSetOperatorAddress) ProtoMessage() {} func (*EventSetOperatorAddress) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{12} } - func (m *EventSetOperatorAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *EventSetOperatorAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_EventSetOperatorAddress.Marshal(b, m, deterministic) @@ -857,15 +798,12 @@ func (m *EventSetOperatorAddress) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } - func (m *EventSetOperatorAddress) XXX_Merge(src proto.Message) { xxx_messageInfo_EventSetOperatorAddress.Merge(m, src) } - func (m *EventSetOperatorAddress) XXX_Size() int { return m.Size() } - func (m *EventSetOperatorAddress) XXX_DiscardUnknown() { xxx_messageInfo_EventSetOperatorAddress.DiscardUnknown(m) } @@ -897,11 +835,9 @@ func (*EventBatchCreated) ProtoMessage() {} func (*EventBatchCreated) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{13} } - func (m *EventBatchCreated) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *EventBatchCreated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_EventBatchCreated.Marshal(b, m, deterministic) @@ -914,15 +850,12 @@ func (m *EventBatchCreated) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } - func (m *EventBatchCreated) XXX_Merge(src proto.Message) { xxx_messageInfo_EventBatchCreated.Merge(m, src) } - func (m *EventBatchCreated) XXX_Size() int { return m.Size() } - func (m *EventBatchCreated) XXX_DiscardUnknown() { xxx_messageInfo_EventBatchCreated.DiscardUnknown(m) } @@ -954,11 +887,9 @@ func (*EventBatchConfirmKey) ProtoMessage() {} func (*EventBatchConfirmKey) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{14} } - func (m *EventBatchConfirmKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *EventBatchConfirmKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_EventBatchConfirmKey.Marshal(b, m, deterministic) @@ -971,15 +902,12 @@ func (m *EventBatchConfirmKey) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } - func (m *EventBatchConfirmKey) XXX_Merge(src proto.Message) { xxx_messageInfo_EventBatchConfirmKey.Merge(m, src) } - func (m *EventBatchConfirmKey) XXX_Size() int { return m.Size() } - func (m *EventBatchConfirmKey) XXX_DiscardUnknown() { xxx_messageInfo_EventBatchConfirmKey.DiscardUnknown(m) } @@ -1010,11 +938,9 @@ func (*EventBatchSendToEthClaim) ProtoMessage() {} func (*EventBatchSendToEthClaim) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{15} } - func (m *EventBatchSendToEthClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *EventBatchSendToEthClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_EventBatchSendToEthClaim.Marshal(b, m, deterministic) @@ -1027,15 +953,12 @@ func (m *EventBatchSendToEthClaim) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } - func (m *EventBatchSendToEthClaim) XXX_Merge(src proto.Message) { xxx_messageInfo_EventBatchSendToEthClaim.Merge(m, src) } - func (m *EventBatchSendToEthClaim) XXX_Size() int { return m.Size() } - func (m *EventBatchSendToEthClaim) XXX_DiscardUnknown() { xxx_messageInfo_EventBatchSendToEthClaim.DiscardUnknown(m) } @@ -1061,11 +984,9 @@ func (*EventClaim) ProtoMessage() {} func (*EventClaim) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{16} } - func (m *EventClaim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *EventClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_EventClaim.Marshal(b, m, deterministic) @@ -1078,15 +999,12 @@ func (m *EventClaim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } - func (m *EventClaim) XXX_Merge(src proto.Message) { xxx_messageInfo_EventClaim.Merge(m, src) } - func (m *EventClaim) XXX_Size() int { return m.Size() } - func (m *EventClaim) XXX_DiscardUnknown() { xxx_messageInfo_EventClaim.DiscardUnknown(m) } @@ -1126,11 +1044,9 @@ func (*EventBadSignatureEvidence) ProtoMessage() {} func (*EventBadSignatureEvidence) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{17} } - func (m *EventBadSignatureEvidence) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *EventBadSignatureEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_EventBadSignatureEvidence.Marshal(b, m, deterministic) @@ -1143,15 +1059,12 @@ func (m *EventBadSignatureEvidence) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } - func (m *EventBadSignatureEvidence) XXX_Merge(src proto.Message) { xxx_messageInfo_EventBadSignatureEvidence.Merge(m, src) } - func (m *EventBadSignatureEvidence) XXX_Size() int { return m.Size() } - func (m *EventBadSignatureEvidence) XXX_DiscardUnknown() { xxx_messageInfo_EventBadSignatureEvidence.DiscardUnknown(m) } @@ -1192,11 +1105,9 @@ func (*EventMultisigUpdateRequest) ProtoMessage() {} func (*EventMultisigUpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{18} } - func (m *EventMultisigUpdateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *EventMultisigUpdateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_EventMultisigUpdateRequest.Marshal(b, m, deterministic) @@ -1209,15 +1120,12 @@ func (m *EventMultisigUpdateRequest) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } - func (m *EventMultisigUpdateRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_EventMultisigUpdateRequest.Merge(m, src) } - func (m *EventMultisigUpdateRequest) XXX_Size() int { return m.Size() } - func (m *EventMultisigUpdateRequest) XXX_DiscardUnknown() { xxx_messageInfo_EventMultisigUpdateRequest.DiscardUnknown(m) } @@ -1263,11 +1171,9 @@ func (*EventSignatureSlashing) ProtoMessage() {} func (*EventSignatureSlashing) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{19} } - func (m *EventSignatureSlashing) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *EventSignatureSlashing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_EventSignatureSlashing.Marshal(b, m, deterministic) @@ -1280,15 +1186,12 @@ func (m *EventSignatureSlashing) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } - func (m *EventSignatureSlashing) XXX_Merge(src proto.Message) { xxx_messageInfo_EventSignatureSlashing.Merge(m, src) } - func (m *EventSignatureSlashing) XXX_Size() int { return m.Size() } - func (m *EventSignatureSlashing) XXX_DiscardUnknown() { xxx_messageInfo_EventSignatureSlashing.DiscardUnknown(m) } @@ -1320,11 +1223,9 @@ func (*EventOutgoingTxId) ProtoMessage() {} func (*EventOutgoingTxId) Descriptor() ([]byte, []int) { return fileDescriptor_36e63b8bd447daaa, []int{20} } - func (m *EventOutgoingTxId) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *EventOutgoingTxId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_EventOutgoingTxId.Marshal(b, m, deterministic) @@ -1337,15 +1238,12 @@ func (m *EventOutgoingTxId) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } - func (m *EventOutgoingTxId) XXX_Merge(src proto.Message) { xxx_messageInfo_EventOutgoingTxId.Merge(m, src) } - func (m *EventOutgoingTxId) XXX_Size() int { return m.Size() } - func (m *EventOutgoingTxId) XXX_DiscardUnknown() { xxx_messageInfo_EventOutgoingTxId.DiscardUnknown(m) } @@ -1480,10 +1378,8 @@ var fileDescriptor_36e63b8bd447daaa = []byte{ } // Reference imports to suppress errors if they are not otherwise used. -var ( - _ context.Context - _ grpc.ClientConn -) +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. @@ -1574,28 +1470,24 @@ type MsgServer interface { } // UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct{} +type UnimplementedMsgServer struct { +} func (*UnimplementedMsgServer) SendToEth(ctx context.Context, req *MsgSendToEth) (*MsgSendToEthResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SendToEth not implemented") } - func (*UnimplementedMsgServer) ConfirmBatch(ctx context.Context, req *MsgConfirmBatch) (*MsgConfirmBatchResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ConfirmBatch not implemented") } - func (*UnimplementedMsgServer) SendToPalomaClaim(ctx context.Context, req *MsgSendToPalomaClaim) (*MsgSendToPalomaClaimResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SendToPalomaClaim not implemented") } - func (*UnimplementedMsgServer) BatchSendToEthClaim(ctx context.Context, req *MsgBatchSendToEthClaim) (*MsgBatchSendToEthClaimResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method BatchSendToEthClaim not implemented") } - func (*UnimplementedMsgServer) CancelSendToEth(ctx context.Context, req *MsgCancelSendToEth) (*MsgCancelSendToEthResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CancelSendToEth not implemented") } - func (*UnimplementedMsgServer) SubmitBadSignatureEvidence(ctx context.Context, req *MsgSubmitBadSignatureEvidence) (*MsgSubmitBadSignatureEvidenceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitBadSignatureEvidence not implemented") } @@ -2646,7 +2538,6 @@ func encodeVarintMsgs(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *MsgSendToEth) Size() (n int) { if m == nil { return 0 @@ -3040,11 +2931,9 @@ func (m *EventOutgoingTxId) Size() (n int) { func sovMsgs(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } - func sozMsgs(x uint64) (n int) { return sovMsgs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } - func (m *MsgSendToEth) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3257,7 +3146,6 @@ func (m *MsgSendToEth) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgSendToEthResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3308,7 +3196,6 @@ func (m *MsgSendToEthResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgConfirmBatch) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3539,7 +3426,6 @@ func (m *MsgConfirmBatch) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgConfirmBatchResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3590,7 +3476,6 @@ func (m *MsgConfirmBatchResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgSendToPalomaClaim) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3906,7 +3791,6 @@ func (m *MsgSendToPalomaClaim) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgSendToPalomaClaimResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3957,7 +3841,6 @@ func (m *MsgSendToPalomaClaimResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgBatchSendToEthClaim) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4194,7 +4077,6 @@ func (m *MsgBatchSendToEthClaim) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgBatchSendToEthClaimResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4245,7 +4127,6 @@ func (m *MsgBatchSendToEthClaimResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgCancelSendToEth) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4380,7 +4261,6 @@ func (m *MsgCancelSendToEth) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgCancelSendToEthResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4431,7 +4311,6 @@ func (m *MsgCancelSendToEthResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgSubmitBadSignatureEvidence) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4647,7 +4526,6 @@ func (m *MsgSubmitBadSignatureEvidence) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgSubmitBadSignatureEvidenceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4698,7 +4576,6 @@ func (m *MsgSubmitBadSignatureEvidenceResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *EventSetOperatorAddress) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4813,7 +4690,6 @@ func (m *EventSetOperatorAddress) Unmarshal(dAtA []byte) error { } return nil } - func (m *EventBatchCreated) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4928,7 +4804,6 @@ func (m *EventBatchCreated) Unmarshal(dAtA []byte) error { } return nil } - func (m *EventBatchConfirmKey) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5043,7 +4918,6 @@ func (m *EventBatchConfirmKey) Unmarshal(dAtA []byte) error { } return nil } - func (m *EventBatchSendToEthClaim) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5126,7 +5000,6 @@ func (m *EventBatchSendToEthClaim) Unmarshal(dAtA []byte) error { } return nil } - func (m *EventClaim) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5273,7 +5146,6 @@ func (m *EventClaim) Unmarshal(dAtA []byte) error { } return nil } - func (m *EventBadSignatureEvidence) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5420,7 +5292,6 @@ func (m *EventBadSignatureEvidence) Unmarshal(dAtA []byte) error { } return nil } - func (m *EventMultisigUpdateRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5599,7 +5470,6 @@ func (m *EventMultisigUpdateRequest) Unmarshal(dAtA []byte) error { } return nil } - func (m *EventSignatureSlashing) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5714,7 +5584,6 @@ func (m *EventSignatureSlashing) Unmarshal(dAtA []byte) error { } return nil } - func (m *EventOutgoingTxId) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5829,7 +5698,6 @@ func (m *EventOutgoingTxId) Unmarshal(dAtA []byte) error { } return nil } - func skipMsgs(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/gravity/types/query.pb.go b/x/gravity/types/query.pb.go index d63ef1e2..6def63b7 100644 --- a/x/gravity/types/query.pb.go +++ b/x/gravity/types/query.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -17,14 +13,15 @@ import ( 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 - _ = fmt.Errorf - _ = math.Inf -) +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. @@ -32,7 +29,8 @@ var ( // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type QueryParamsRequest struct{} +type QueryParamsRequest struct { +} func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } @@ -40,11 +38,9 @@ func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{0} } - func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) @@ -57,15 +53,12 @@ func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } - func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryParamsRequest.Merge(m, src) } - func (m *QueryParamsRequest) XXX_Size() int { return m.Size() } - func (m *QueryParamsRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) } @@ -82,11 +75,9 @@ func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{1} } - func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) @@ -99,15 +90,12 @@ func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } - func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryParamsResponse.Merge(m, src) } - func (m *QueryParamsResponse) XXX_Size() int { return m.Size() } - func (m *QueryParamsResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) } @@ -128,7 +116,6 @@ type QueryLastPendingBatchRequestByAddrRequest struct { func (m *QueryLastPendingBatchRequestByAddrRequest) Reset() { *m = QueryLastPendingBatchRequestByAddrRequest{} } - func (m *QueryLastPendingBatchRequestByAddrRequest) String() string { return proto.CompactTextString(m) } @@ -136,11 +123,9 @@ func (*QueryLastPendingBatchRequestByAddrRequest) ProtoMessage() {} func (*QueryLastPendingBatchRequestByAddrRequest) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{2} } - func (m *QueryLastPendingBatchRequestByAddrRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryLastPendingBatchRequestByAddrRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLastPendingBatchRequestByAddrRequest.Marshal(b, m, deterministic) @@ -153,15 +138,12 @@ func (m *QueryLastPendingBatchRequestByAddrRequest) XXX_Marshal(b []byte, determ return b[:n], nil } } - func (m *QueryLastPendingBatchRequestByAddrRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLastPendingBatchRequestByAddrRequest.Merge(m, src) } - func (m *QueryLastPendingBatchRequestByAddrRequest) XXX_Size() int { return m.Size() } - func (m *QueryLastPendingBatchRequestByAddrRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryLastPendingBatchRequestByAddrRequest.DiscardUnknown(m) } @@ -182,7 +164,6 @@ type QueryLastPendingBatchRequestByAddrResponse struct { func (m *QueryLastPendingBatchRequestByAddrResponse) Reset() { *m = QueryLastPendingBatchRequestByAddrResponse{} } - func (m *QueryLastPendingBatchRequestByAddrResponse) String() string { return proto.CompactTextString(m) } @@ -190,11 +171,9 @@ func (*QueryLastPendingBatchRequestByAddrResponse) ProtoMessage() {} func (*QueryLastPendingBatchRequestByAddrResponse) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{3} } - func (m *QueryLastPendingBatchRequestByAddrResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryLastPendingBatchRequestByAddrResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLastPendingBatchRequestByAddrResponse.Marshal(b, m, deterministic) @@ -207,15 +186,12 @@ func (m *QueryLastPendingBatchRequestByAddrResponse) XXX_Marshal(b []byte, deter return b[:n], nil } } - func (m *QueryLastPendingBatchRequestByAddrResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLastPendingBatchRequestByAddrResponse.Merge(m, src) } - func (m *QueryLastPendingBatchRequestByAddrResponse) XXX_Size() int { return m.Size() } - func (m *QueryLastPendingBatchRequestByAddrResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryLastPendingBatchRequestByAddrResponse.DiscardUnknown(m) } @@ -240,11 +216,9 @@ func (*QueryOutgoingTxBatchesRequest) ProtoMessage() {} func (*QueryOutgoingTxBatchesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{4} } - func (m *QueryOutgoingTxBatchesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryOutgoingTxBatchesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryOutgoingTxBatchesRequest.Marshal(b, m, deterministic) @@ -257,15 +231,12 @@ func (m *QueryOutgoingTxBatchesRequest) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } - func (m *QueryOutgoingTxBatchesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryOutgoingTxBatchesRequest.Merge(m, src) } - func (m *QueryOutgoingTxBatchesRequest) XXX_Size() int { return m.Size() } - func (m *QueryOutgoingTxBatchesRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryOutgoingTxBatchesRequest.DiscardUnknown(m) } @@ -296,11 +267,9 @@ func (*QueryOutgoingTxBatchesResponse) ProtoMessage() {} func (*QueryOutgoingTxBatchesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{5} } - func (m *QueryOutgoingTxBatchesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryOutgoingTxBatchesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryOutgoingTxBatchesResponse.Marshal(b, m, deterministic) @@ -313,15 +282,12 @@ func (m *QueryOutgoingTxBatchesResponse) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } - func (m *QueryOutgoingTxBatchesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryOutgoingTxBatchesResponse.Merge(m, src) } - func (m *QueryOutgoingTxBatchesResponse) XXX_Size() int { return m.Size() } - func (m *QueryOutgoingTxBatchesResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryOutgoingTxBatchesResponse.DiscardUnknown(m) } @@ -346,11 +312,9 @@ func (*QueryBatchRequestByNonceRequest) ProtoMessage() {} func (*QueryBatchRequestByNonceRequest) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{6} } - func (m *QueryBatchRequestByNonceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryBatchRequestByNonceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryBatchRequestByNonceRequest.Marshal(b, m, deterministic) @@ -363,15 +327,12 @@ func (m *QueryBatchRequestByNonceRequest) XXX_Marshal(b []byte, deterministic bo return b[:n], nil } } - func (m *QueryBatchRequestByNonceRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryBatchRequestByNonceRequest.Merge(m, src) } - func (m *QueryBatchRequestByNonceRequest) XXX_Size() int { return m.Size() } - func (m *QueryBatchRequestByNonceRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryBatchRequestByNonceRequest.DiscardUnknown(m) } @@ -402,11 +363,9 @@ func (*QueryBatchRequestByNonceResponse) ProtoMessage() {} func (*QueryBatchRequestByNonceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{7} } - func (m *QueryBatchRequestByNonceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryBatchRequestByNonceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryBatchRequestByNonceResponse.Marshal(b, m, deterministic) @@ -419,15 +378,12 @@ func (m *QueryBatchRequestByNonceResponse) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } - func (m *QueryBatchRequestByNonceResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryBatchRequestByNonceResponse.Merge(m, src) } - func (m *QueryBatchRequestByNonceResponse) XXX_Size() int { return m.Size() } - func (m *QueryBatchRequestByNonceResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryBatchRequestByNonceResponse.DiscardUnknown(m) } @@ -452,11 +408,9 @@ func (*QueryBatchConfirmsRequest) ProtoMessage() {} func (*QueryBatchConfirmsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{8} } - func (m *QueryBatchConfirmsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryBatchConfirmsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryBatchConfirmsRequest.Marshal(b, m, deterministic) @@ -469,15 +423,12 @@ func (m *QueryBatchConfirmsRequest) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } - func (m *QueryBatchConfirmsRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryBatchConfirmsRequest.Merge(m, src) } - func (m *QueryBatchConfirmsRequest) XXX_Size() int { return m.Size() } - func (m *QueryBatchConfirmsRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryBatchConfirmsRequest.DiscardUnknown(m) } @@ -508,11 +459,9 @@ func (*QueryBatchConfirmsResponse) ProtoMessage() {} func (*QueryBatchConfirmsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{9} } - func (m *QueryBatchConfirmsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryBatchConfirmsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryBatchConfirmsResponse.Marshal(b, m, deterministic) @@ -525,15 +474,12 @@ func (m *QueryBatchConfirmsResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } - func (m *QueryBatchConfirmsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryBatchConfirmsResponse.Merge(m, src) } - func (m *QueryBatchConfirmsResponse) XXX_Size() int { return m.Size() } - func (m *QueryBatchConfirmsResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryBatchConfirmsResponse.DiscardUnknown(m) } @@ -547,7 +493,8 @@ func (m *QueryBatchConfirmsResponse) GetConfirms() []MsgConfirmBatch { return nil } -type QueryLastEventNonceRequest struct{} +type QueryLastEventNonceRequest struct { +} func (m *QueryLastEventNonceRequest) Reset() { *m = QueryLastEventNonceRequest{} } func (m *QueryLastEventNonceRequest) String() string { return proto.CompactTextString(m) } @@ -555,11 +502,9 @@ func (*QueryLastEventNonceRequest) ProtoMessage() {} func (*QueryLastEventNonceRequest) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{10} } - func (m *QueryLastEventNonceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryLastEventNonceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLastEventNonceRequest.Marshal(b, m, deterministic) @@ -572,15 +517,12 @@ func (m *QueryLastEventNonceRequest) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } - func (m *QueryLastEventNonceRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLastEventNonceRequest.Merge(m, src) } - func (m *QueryLastEventNonceRequest) XXX_Size() int { return m.Size() } - func (m *QueryLastEventNonceRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryLastEventNonceRequest.DiscardUnknown(m) } @@ -597,11 +539,9 @@ func (*QueryLastEventNonceByAddrRequest) ProtoMessage() {} func (*QueryLastEventNonceByAddrRequest) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{11} } - func (m *QueryLastEventNonceByAddrRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryLastEventNonceByAddrRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLastEventNonceByAddrRequest.Marshal(b, m, deterministic) @@ -614,15 +554,12 @@ func (m *QueryLastEventNonceByAddrRequest) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } - func (m *QueryLastEventNonceByAddrRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLastEventNonceByAddrRequest.Merge(m, src) } - func (m *QueryLastEventNonceByAddrRequest) XXX_Size() int { return m.Size() } - func (m *QueryLastEventNonceByAddrRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryLastEventNonceByAddrRequest.DiscardUnknown(m) } @@ -646,11 +583,9 @@ func (*QueryLastEventNonceResponse) ProtoMessage() {} func (*QueryLastEventNonceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{12} } - func (m *QueryLastEventNonceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryLastEventNonceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLastEventNonceResponse.Marshal(b, m, deterministic) @@ -663,15 +598,12 @@ func (m *QueryLastEventNonceResponse) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } - func (m *QueryLastEventNonceResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLastEventNonceResponse.Merge(m, src) } - func (m *QueryLastEventNonceResponse) XXX_Size() int { return m.Size() } - func (m *QueryLastEventNonceResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryLastEventNonceResponse.DiscardUnknown(m) } @@ -696,11 +628,9 @@ func (*QueryERC20ToDenomRequest) ProtoMessage() {} func (*QueryERC20ToDenomRequest) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{13} } - func (m *QueryERC20ToDenomRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryERC20ToDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryERC20ToDenomRequest.Marshal(b, m, deterministic) @@ -713,15 +643,12 @@ func (m *QueryERC20ToDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } - func (m *QueryERC20ToDenomRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryERC20ToDenomRequest.Merge(m, src) } - func (m *QueryERC20ToDenomRequest) XXX_Size() int { return m.Size() } - func (m *QueryERC20ToDenomRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryERC20ToDenomRequest.DiscardUnknown(m) } @@ -752,11 +679,9 @@ func (*QueryERC20ToDenomResponse) ProtoMessage() {} func (*QueryERC20ToDenomResponse) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{14} } - func (m *QueryERC20ToDenomResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryERC20ToDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryERC20ToDenomResponse.Marshal(b, m, deterministic) @@ -769,15 +694,12 @@ func (m *QueryERC20ToDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } - func (m *QueryERC20ToDenomResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryERC20ToDenomResponse.Merge(m, src) } - func (m *QueryERC20ToDenomResponse) XXX_Size() int { return m.Size() } - func (m *QueryERC20ToDenomResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryERC20ToDenomResponse.DiscardUnknown(m) } @@ -802,11 +724,9 @@ func (*QueryDenomToERC20Request) ProtoMessage() {} func (*QueryDenomToERC20Request) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{15} } - func (m *QueryDenomToERC20Request) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryDenomToERC20Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryDenomToERC20Request.Marshal(b, m, deterministic) @@ -819,15 +739,12 @@ func (m *QueryDenomToERC20Request) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } - func (m *QueryDenomToERC20Request) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryDenomToERC20Request.Merge(m, src) } - func (m *QueryDenomToERC20Request) XXX_Size() int { return m.Size() } - func (m *QueryDenomToERC20Request) XXX_DiscardUnknown() { xxx_messageInfo_QueryDenomToERC20Request.DiscardUnknown(m) } @@ -858,11 +775,9 @@ func (*QueryDenomToERC20Response) ProtoMessage() {} func (*QueryDenomToERC20Response) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{16} } - func (m *QueryDenomToERC20Response) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryDenomToERC20Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryDenomToERC20Response.Marshal(b, m, deterministic) @@ -875,15 +790,12 @@ func (m *QueryDenomToERC20Response) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } - func (m *QueryDenomToERC20Response) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryDenomToERC20Response.Merge(m, src) } - func (m *QueryDenomToERC20Response) XXX_Size() int { return m.Size() } - func (m *QueryDenomToERC20Response) XXX_DiscardUnknown() { xxx_messageInfo_QueryDenomToERC20Response.DiscardUnknown(m) } @@ -913,11 +825,9 @@ func (*QueryLastObservedEthBlockRequest) ProtoMessage() {} func (*QueryLastObservedEthBlockRequest) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{17} } - func (m *QueryLastObservedEthBlockRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryLastObservedEthBlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLastObservedEthBlockRequest.Marshal(b, m, deterministic) @@ -930,15 +840,12 @@ func (m *QueryLastObservedEthBlockRequest) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } - func (m *QueryLastObservedEthBlockRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLastObservedEthBlockRequest.Merge(m, src) } - func (m *QueryLastObservedEthBlockRequest) XXX_Size() int { return m.Size() } - func (m *QueryLastObservedEthBlockRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryLastObservedEthBlockRequest.DiscardUnknown(m) } @@ -964,11 +871,9 @@ func (*QueryLastObservedEthBlockResponse) ProtoMessage() {} func (*QueryLastObservedEthBlockResponse) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{18} } - func (m *QueryLastObservedEthBlockResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryLastObservedEthBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLastObservedEthBlockResponse.Marshal(b, m, deterministic) @@ -981,15 +886,12 @@ func (m *QueryLastObservedEthBlockResponse) XXX_Marshal(b []byte, deterministic return b[:n], nil } } - func (m *QueryLastObservedEthBlockResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLastObservedEthBlockResponse.Merge(m, src) } - func (m *QueryLastObservedEthBlockResponse) XXX_Size() int { return m.Size() } - func (m *QueryLastObservedEthBlockResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryLastObservedEthBlockResponse.DiscardUnknown(m) } @@ -1019,11 +921,9 @@ func (*QueryLastObservedEthNonceRequest) ProtoMessage() {} func (*QueryLastObservedEthNonceRequest) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{19} } - func (m *QueryLastObservedEthNonceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryLastObservedEthNonceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLastObservedEthNonceRequest.Marshal(b, m, deterministic) @@ -1036,15 +936,12 @@ func (m *QueryLastObservedEthNonceRequest) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } - func (m *QueryLastObservedEthNonceRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLastObservedEthNonceRequest.Merge(m, src) } - func (m *QueryLastObservedEthNonceRequest) XXX_Size() int { return m.Size() } - func (m *QueryLastObservedEthNonceRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryLastObservedEthNonceRequest.DiscardUnknown(m) } @@ -1070,11 +967,9 @@ func (*QueryLastObservedEthNonceResponse) ProtoMessage() {} func (*QueryLastObservedEthNonceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{20} } - func (m *QueryLastObservedEthNonceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryLastObservedEthNonceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryLastObservedEthNonceResponse.Marshal(b, m, deterministic) @@ -1087,15 +982,12 @@ func (m *QueryLastObservedEthNonceResponse) XXX_Marshal(b []byte, deterministic return b[:n], nil } } - func (m *QueryLastObservedEthNonceResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryLastObservedEthNonceResponse.Merge(m, src) } - func (m *QueryLastObservedEthNonceResponse) XXX_Size() int { return m.Size() } - func (m *QueryLastObservedEthNonceResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryLastObservedEthNonceResponse.DiscardUnknown(m) } @@ -1140,11 +1032,9 @@ func (*QueryAttestationsRequest) ProtoMessage() {} func (*QueryAttestationsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{21} } - func (m *QueryAttestationsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryAttestationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryAttestationsRequest.Marshal(b, m, deterministic) @@ -1157,15 +1047,12 @@ func (m *QueryAttestationsRequest) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } - func (m *QueryAttestationsRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryAttestationsRequest.Merge(m, src) } - func (m *QueryAttestationsRequest) XXX_Size() int { return m.Size() } - func (m *QueryAttestationsRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryAttestationsRequest.DiscardUnknown(m) } @@ -1224,11 +1111,9 @@ func (*QueryAttestationsResponse) ProtoMessage() {} func (*QueryAttestationsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{22} } - func (m *QueryAttestationsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryAttestationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryAttestationsResponse.Marshal(b, m, deterministic) @@ -1241,15 +1126,12 @@ func (m *QueryAttestationsResponse) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } - func (m *QueryAttestationsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryAttestationsResponse.Merge(m, src) } - func (m *QueryAttestationsResponse) XXX_Size() int { return m.Size() } - func (m *QueryAttestationsResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryAttestationsResponse.DiscardUnknown(m) } @@ -1263,7 +1145,8 @@ func (m *QueryAttestationsResponse) GetAttestations() []Attestation { return nil } -type QueryErc20ToDenoms struct{} +type QueryErc20ToDenoms struct { +} func (m *QueryErc20ToDenoms) Reset() { *m = QueryErc20ToDenoms{} } func (m *QueryErc20ToDenoms) String() string { return proto.CompactTextString(m) } @@ -1271,11 +1154,9 @@ func (*QueryErc20ToDenoms) ProtoMessage() {} func (*QueryErc20ToDenoms) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{23} } - func (m *QueryErc20ToDenoms) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryErc20ToDenoms) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryErc20ToDenoms.Marshal(b, m, deterministic) @@ -1288,15 +1169,12 @@ func (m *QueryErc20ToDenoms) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } - func (m *QueryErc20ToDenoms) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryErc20ToDenoms.Merge(m, src) } - func (m *QueryErc20ToDenoms) XXX_Size() int { return m.Size() } - func (m *QueryErc20ToDenoms) XXX_DiscardUnknown() { xxx_messageInfo_QueryErc20ToDenoms.DiscardUnknown(m) } @@ -1313,11 +1191,9 @@ func (*QueryErc20ToDenomsResponse) ProtoMessage() {} func (*QueryErc20ToDenomsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{24} } - func (m *QueryErc20ToDenomsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryErc20ToDenomsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryErc20ToDenomsResponse.Marshal(b, m, deterministic) @@ -1330,15 +1206,12 @@ func (m *QueryErc20ToDenomsResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } - func (m *QueryErc20ToDenomsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryErc20ToDenomsResponse.Merge(m, src) } - func (m *QueryErc20ToDenomsResponse) XXX_Size() int { return m.Size() } - func (m *QueryErc20ToDenomsResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryErc20ToDenomsResponse.DiscardUnknown(m) } @@ -1362,11 +1235,9 @@ func (*QueryPendingSendToEth) ProtoMessage() {} func (*QueryPendingSendToEth) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{25} } - func (m *QueryPendingSendToEth) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryPendingSendToEth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryPendingSendToEth.Marshal(b, m, deterministic) @@ -1379,15 +1250,12 @@ func (m *QueryPendingSendToEth) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } - func (m *QueryPendingSendToEth) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryPendingSendToEth.Merge(m, src) } - func (m *QueryPendingSendToEth) XXX_Size() int { return m.Size() } - func (m *QueryPendingSendToEth) XXX_DiscardUnknown() { xxx_messageInfo_QueryPendingSendToEth.DiscardUnknown(m) } @@ -1412,11 +1280,9 @@ func (*QueryPendingSendToEthResponse) ProtoMessage() {} func (*QueryPendingSendToEthResponse) Descriptor() ([]byte, []int) { return fileDescriptor_a3b0def5f4d1670a, []int{26} } - func (m *QueryPendingSendToEthResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *QueryPendingSendToEthResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_QueryPendingSendToEthResponse.Marshal(b, m, deterministic) @@ -1429,15 +1295,12 @@ func (m *QueryPendingSendToEthResponse) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } - func (m *QueryPendingSendToEthResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryPendingSendToEthResponse.Merge(m, src) } - func (m *QueryPendingSendToEthResponse) XXX_Size() int { return m.Size() } - func (m *QueryPendingSendToEthResponse) XXX_DiscardUnknown() { xxx_messageInfo_QueryPendingSendToEthResponse.DiscardUnknown(m) } @@ -1573,10 +1436,8 @@ var fileDescriptor_a3b0def5f4d1670a = []byte{ } // Reference imports to suppress errors if they are not otherwise used. -var ( - _ context.Context - _ grpc.ClientConn -) +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. @@ -1755,60 +1616,48 @@ type QueryServer interface { } // UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct{} +type UnimplementedQueryServer struct { +} func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } - func (*UnimplementedQueryServer) LastPendingBatchRequestByAddr(ctx context.Context, req *QueryLastPendingBatchRequestByAddrRequest) (*QueryLastPendingBatchRequestByAddrResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LastPendingBatchRequestByAddr not implemented") } - func (*UnimplementedQueryServer) LastEventNonce(ctx context.Context, req *QueryLastEventNonceRequest) (*QueryLastEventNonceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LastEventNonce not implemented") } - func (*UnimplementedQueryServer) LastEventNonceByAddr(ctx context.Context, req *QueryLastEventNonceByAddrRequest) (*QueryLastEventNonceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LastEventNonceByAddr not implemented") } - func (*UnimplementedQueryServer) OutgoingTxBatches(ctx context.Context, req *QueryOutgoingTxBatchesRequest) (*QueryOutgoingTxBatchesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method OutgoingTxBatches not implemented") } - func (*UnimplementedQueryServer) BatchRequestByNonce(ctx context.Context, req *QueryBatchRequestByNonceRequest) (*QueryBatchRequestByNonceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method BatchRequestByNonce not implemented") } - func (*UnimplementedQueryServer) BatchConfirms(ctx context.Context, req *QueryBatchConfirmsRequest) (*QueryBatchConfirmsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method BatchConfirms not implemented") } - func (*UnimplementedQueryServer) ERC20ToDenom(ctx context.Context, req *QueryERC20ToDenomRequest) (*QueryERC20ToDenomResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ERC20ToDenom not implemented") } - func (*UnimplementedQueryServer) DenomToERC20(ctx context.Context, req *QueryDenomToERC20Request) (*QueryDenomToERC20Response, error) { return nil, status.Errorf(codes.Unimplemented, "method DenomToERC20 not implemented") } - func (*UnimplementedQueryServer) GetLastObservedEthBlock(ctx context.Context, req *QueryLastObservedEthBlockRequest) (*QueryLastObservedEthBlockResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLastObservedEthBlock not implemented") } - func (*UnimplementedQueryServer) GetLastObservedEthNonce(ctx context.Context, req *QueryLastObservedEthNonceRequest) (*QueryLastObservedEthNonceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLastObservedEthNonce not implemented") } - func (*UnimplementedQueryServer) GetAttestations(ctx context.Context, req *QueryAttestationsRequest) (*QueryAttestationsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAttestations not implemented") } - func (*UnimplementedQueryServer) GetErc20ToDenoms(ctx context.Context, req *QueryErc20ToDenoms) (*QueryErc20ToDenomsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetErc20ToDenoms not implemented") } - func (*UnimplementedQueryServer) GetPendingSendToEth(ctx context.Context, req *QueryPendingSendToEth) (*QueryPendingSendToEthResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetPendingSendToEth not implemented") } @@ -3059,7 +2908,6 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *QueryParamsRequest) Size() (n int) { if m == nil { return 0 @@ -3445,11 +3293,9 @@ func (m *QueryPendingSendToEthResponse) Size() (n int) { func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } - func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } - func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3500,7 +3346,6 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3584,7 +3429,6 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryLastPendingBatchRequestByAddrRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3667,7 +3511,6 @@ func (m *QueryLastPendingBatchRequestByAddrRequest) Unmarshal(dAtA []byte) error } return nil } - func (m *QueryLastPendingBatchRequestByAddrResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3752,7 +3595,6 @@ func (m *QueryLastPendingBatchRequestByAddrResponse) Unmarshal(dAtA []byte) erro } return nil } - func (m *QueryOutgoingTxBatchesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3867,7 +3709,6 @@ func (m *QueryOutgoingTxBatchesRequest) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryOutgoingTxBatchesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3952,7 +3793,6 @@ func (m *QueryOutgoingTxBatchesResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryBatchRequestByNonceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4054,7 +3894,6 @@ func (m *QueryBatchRequestByNonceRequest) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryBatchRequestByNonceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4138,7 +3977,6 @@ func (m *QueryBatchRequestByNonceResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryBatchConfirmsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4240,7 +4078,6 @@ func (m *QueryBatchConfirmsRequest) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryBatchConfirmsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4325,7 +4162,6 @@ func (m *QueryBatchConfirmsResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryLastEventNonceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4376,7 +4212,6 @@ func (m *QueryLastEventNonceRequest) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryLastEventNonceByAddrRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4459,7 +4294,6 @@ func (m *QueryLastEventNonceByAddrRequest) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryLastEventNonceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4529,7 +4363,6 @@ func (m *QueryLastEventNonceResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryERC20ToDenomRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4644,7 +4477,6 @@ func (m *QueryERC20ToDenomRequest) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryERC20ToDenomResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4727,7 +4559,6 @@ func (m *QueryERC20ToDenomResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryDenomToERC20Request) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4842,7 +4673,6 @@ func (m *QueryDenomToERC20Request) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryDenomToERC20Response) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4925,7 +4755,6 @@ func (m *QueryDenomToERC20Response) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryLastObservedEthBlockRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4996,7 +4825,6 @@ func (m *QueryLastObservedEthBlockRequest) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryLastObservedEthBlockResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5066,7 +4894,6 @@ func (m *QueryLastObservedEthBlockResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryLastObservedEthNonceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5137,7 +4964,6 @@ func (m *QueryLastObservedEthNonceRequest) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryLastObservedEthNonceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5207,7 +5033,6 @@ func (m *QueryLastObservedEthNonceResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryAttestationsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5399,7 +5224,6 @@ func (m *QueryAttestationsRequest) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryAttestationsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5484,7 +5308,6 @@ func (m *QueryAttestationsResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryErc20ToDenoms) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5535,7 +5358,6 @@ func (m *QueryErc20ToDenoms) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryErc20ToDenomsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5620,7 +5442,6 @@ func (m *QueryErc20ToDenomsResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryPendingSendToEth) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5703,7 +5524,6 @@ func (m *QueryPendingSendToEth) Unmarshal(dAtA []byte) error { } return nil } - func (m *QueryPendingSendToEthResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5822,7 +5642,6 @@ func (m *QueryPendingSendToEthResponse) Unmarshal(dAtA []byte) error { } return nil } - func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/paloma/types/tx.pb.go b/x/paloma/types/tx.pb.go index 989a1594..12b91834 100644 --- a/x/paloma/types/tx.pb.go +++ b/x/paloma/types/tx.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -17,14 +13,15 @@ import ( 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 - _ = fmt.Errorf - _ = math.Inf -) +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. @@ -73,11 +70,9 @@ func (*MsgAddStatusUpdate) ProtoMessage() {} func (*MsgAddStatusUpdate) Descriptor() ([]byte, []int) { return fileDescriptor_8dc46060aeb172a8, []int{0} } - func (m *MsgAddStatusUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgAddStatusUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgAddStatusUpdate.Marshal(b, m, deterministic) @@ -90,15 +85,12 @@ func (m *MsgAddStatusUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } - func (m *MsgAddStatusUpdate) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgAddStatusUpdate.Merge(m, src) } - func (m *MsgAddStatusUpdate) XXX_Size() int { return m.Size() } - func (m *MsgAddStatusUpdate) XXX_DiscardUnknown() { xxx_messageInfo_MsgAddStatusUpdate.DiscardUnknown(m) } @@ -134,7 +126,8 @@ func (m *MsgAddStatusUpdate) GetMetadata() types.MsgMetadata { return types.MsgMetadata{} } -type EmptyResponse struct{} +type EmptyResponse struct { +} func (m *EmptyResponse) Reset() { *m = EmptyResponse{} } func (m *EmptyResponse) String() string { return proto.CompactTextString(m) } @@ -142,11 +135,9 @@ func (*EmptyResponse) ProtoMessage() {} func (*EmptyResponse) Descriptor() ([]byte, []int) { return fileDescriptor_8dc46060aeb172a8, []int{1} } - func (m *EmptyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *EmptyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_EmptyResponse.Marshal(b, m, deterministic) @@ -159,15 +150,12 @@ func (m *EmptyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } - func (m *EmptyResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_EmptyResponse.Merge(m, src) } - func (m *EmptyResponse) XXX_Size() int { return m.Size() } - func (m *EmptyResponse) XXX_DiscardUnknown() { xxx_messageInfo_EmptyResponse.DiscardUnknown(m) } @@ -212,10 +200,8 @@ var fileDescriptor_8dc46060aeb172a8 = []byte{ } // Reference imports to suppress errors if they are not otherwise used. -var ( - _ context.Context - _ grpc.ClientConn -) +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. @@ -251,7 +237,8 @@ type MsgServer interface { } // UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct{} +type UnimplementedMsgServer struct { +} func (*UnimplementedMsgServer) AddStatusUpdate(ctx context.Context, req *MsgAddStatusUpdate) (*EmptyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddStatusUpdate not implemented") @@ -378,7 +365,6 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *MsgAddStatusUpdate) Size() (n int) { if m == nil { return 0 @@ -413,11 +399,9 @@ func (m *EmptyResponse) Size() (n int) { 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 *MsgAddStatusUpdate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -584,7 +568,6 @@ func (m *MsgAddStatusUpdate) Unmarshal(dAtA []byte) error { } return nil } - func (m *EmptyResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -635,7 +618,6 @@ func (m *EmptyResponse) Unmarshal(dAtA []byte) error { } return nil } - func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/scheduler/types/tx.pb.go b/x/scheduler/types/tx.pb.go index 3cbfe2f7..b6d1d60a 100644 --- a/x/scheduler/types/tx.pb.go +++ b/x/scheduler/types/tx.pb.go @@ -6,10 +6,6 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -17,14 +13,15 @@ import ( 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 - _ = fmt.Errorf - _ = math.Inf -) +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. @@ -44,11 +41,9 @@ func (*MsgCreateJob) ProtoMessage() {} func (*MsgCreateJob) Descriptor() ([]byte, []int) { return fileDescriptor_5f63022306b4a0a9, []int{0} } - func (m *MsgCreateJob) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgCreateJob) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgCreateJob.Marshal(b, m, deterministic) @@ -61,15 +56,12 @@ func (m *MsgCreateJob) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } - func (m *MsgCreateJob) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgCreateJob.Merge(m, src) } - func (m *MsgCreateJob) XXX_Size() int { return m.Size() } - func (m *MsgCreateJob) XXX_DiscardUnknown() { xxx_messageInfo_MsgCreateJob.DiscardUnknown(m) } @@ -98,7 +90,8 @@ func (m *MsgCreateJob) GetMetadata() types.MsgMetadata { return types.MsgMetadata{} } -type MsgCreateJobResponse struct{} +type MsgCreateJobResponse struct { +} func (m *MsgCreateJobResponse) Reset() { *m = MsgCreateJobResponse{} } func (m *MsgCreateJobResponse) String() string { return proto.CompactTextString(m) } @@ -106,11 +99,9 @@ func (*MsgCreateJobResponse) ProtoMessage() {} func (*MsgCreateJobResponse) Descriptor() ([]byte, []int) { return fileDescriptor_5f63022306b4a0a9, []int{1} } - func (m *MsgCreateJobResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgCreateJobResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgCreateJobResponse.Marshal(b, m, deterministic) @@ -123,15 +114,12 @@ func (m *MsgCreateJobResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } - func (m *MsgCreateJobResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgCreateJobResponse.Merge(m, src) } - func (m *MsgCreateJobResponse) XXX_Size() int { return m.Size() } - func (m *MsgCreateJobResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgCreateJobResponse.DiscardUnknown(m) } @@ -151,11 +139,9 @@ func (*MsgExecuteJob) ProtoMessage() {} func (*MsgExecuteJob) Descriptor() ([]byte, []int) { return fileDescriptor_5f63022306b4a0a9, []int{2} } - func (m *MsgExecuteJob) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgExecuteJob) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgExecuteJob.Marshal(b, m, deterministic) @@ -168,15 +154,12 @@ func (m *MsgExecuteJob) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } - func (m *MsgExecuteJob) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgExecuteJob.Merge(m, src) } - func (m *MsgExecuteJob) XXX_Size() int { return m.Size() } - func (m *MsgExecuteJob) XXX_DiscardUnknown() { xxx_messageInfo_MsgExecuteJob.DiscardUnknown(m) } @@ -223,11 +206,9 @@ func (*MsgExecuteJobResponse) ProtoMessage() {} func (*MsgExecuteJobResponse) Descriptor() ([]byte, []int) { return fileDescriptor_5f63022306b4a0a9, []int{3} } - func (m *MsgExecuteJobResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgExecuteJobResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgExecuteJobResponse.Marshal(b, m, deterministic) @@ -240,15 +221,12 @@ func (m *MsgExecuteJobResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } - func (m *MsgExecuteJobResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgExecuteJobResponse.Merge(m, src) } - func (m *MsgExecuteJobResponse) XXX_Size() int { return m.Size() } - func (m *MsgExecuteJobResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgExecuteJobResponse.DiscardUnknown(m) } @@ -303,10 +281,8 @@ var fileDescriptor_5f63022306b4a0a9 = []byte{ } // Reference imports to suppress errors if they are not otherwise used. -var ( - _ context.Context - _ grpc.ClientConn -) +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. @@ -353,12 +329,12 @@ type MsgServer interface { } // UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct{} +type UnimplementedMsgServer struct { +} func (*UnimplementedMsgServer) CreateJob(ctx context.Context, req *MsgCreateJob) (*MsgCreateJobResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateJob not implemented") } - func (*UnimplementedMsgServer) ExecuteJob(ctx context.Context, req *MsgExecuteJob) (*MsgExecuteJobResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ExecuteJob not implemented") } @@ -588,7 +564,6 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *MsgCreateJob) Size() (n int) { if m == nil { return 0 @@ -655,11 +630,9 @@ func (m *MsgExecuteJobResponse) Size() (n int) { 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 *MsgCreateJob) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -811,7 +784,6 @@ func (m *MsgCreateJob) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgCreateJobResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -862,7 +834,6 @@ func (m *MsgCreateJobResponse) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgExecuteJob) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1044,7 +1015,6 @@ func (m *MsgExecuteJob) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgExecuteJobResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1114,7 +1084,6 @@ func (m *MsgExecuteJobResponse) Unmarshal(dAtA []byte) error { } return nil } - func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/valset/types/common.pb.go b/x/valset/types/common.pb.go index c765ea6f..18f5d624 100644 --- a/x/valset/types/common.pb.go +++ b/x/valset/types/common.pb.go @@ -5,20 +5,17 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" io "io" math "math" math_bits "math/bits" - - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" ) // Reference imports to suppress errors if they are not otherwise used. -var ( - _ = proto.Marshal - _ = fmt.Errorf - _ = math.Inf -) +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. @@ -41,11 +38,9 @@ func (*MsgMetadata) ProtoMessage() {} func (*MsgMetadata) Descriptor() ([]byte, []int) { return fileDescriptor_51034c49bc8984d6, []int{0} } - func (m *MsgMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgMetadata.Marshal(b, m, deterministic) @@ -58,15 +53,12 @@ func (m *MsgMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } - func (m *MsgMetadata) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgMetadata.Merge(m, src) } - func (m *MsgMetadata) XXX_Size() int { return m.Size() } - func (m *MsgMetadata) XXX_DiscardUnknown() { xxx_messageInfo_MsgMetadata.DiscardUnknown(m) } @@ -148,7 +140,6 @@ func encodeVarintCommon(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *MsgMetadata) Size() (n int) { if m == nil { return 0 @@ -171,11 +162,9 @@ func (m *MsgMetadata) Size() (n int) { func sovCommon(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } - func sozCommon(x uint64) (n int) { return sovCommon(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } - func (m *MsgMetadata) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -290,7 +279,6 @@ func (m *MsgMetadata) Unmarshal(dAtA []byte) error { } return nil } - func skipCommon(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/valset/types/snapshot.pb.go b/x/valset/types/snapshot.pb.go index 82c095ce..454ec15f 100644 --- a/x/valset/types/snapshot.pb.go +++ b/x/valset/types/snapshot.pb.go @@ -4,6 +4,7 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types" @@ -59,7 +60,7 @@ func (ValidatorState) EnumDescriptor() ([]byte, []int) { } type Validator struct { - ShareCount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=shareCount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"shareCount"` + ShareCount cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=shareCount,proto3,customtype=cosmossdk.io/math.Int" json:"shareCount"` State ValidatorState `protobuf:"varint,2,opt,name=state,proto3,enum=palomachain.paloma.valset.ValidatorState" json:"state,omitempty"` ExternalChainInfos []*ExternalChainInfo `protobuf:"bytes,3,rep,name=externalChainInfos,proto3" json:"externalChainInfos,omitempty"` Address github_com_cosmos_cosmos_sdk_types.ValAddress `protobuf:"bytes,4,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ValAddress" json:"address,omitempty"` @@ -172,12 +173,12 @@ func (m *ValidatorExternalAccounts) GetExternalChainInfo() []*ExternalChainInfo } type Snapshot struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` - Validators []Validator `protobuf:"bytes,3,rep,name=validators,proto3" json:"validators"` - TotalShares github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=totalShares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"totalShares"` - CreatedAt time.Time `protobuf:"bytes,5,opt,name=createdAt,proto3,stdtime" json:"createdAt"` - Chains []string `protobuf:"bytes,6,rep,name=chains,proto3" json:"chains,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + Validators []Validator `protobuf:"bytes,3,rep,name=validators,proto3" json:"validators"` + TotalShares cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=totalShares,proto3,customtype=cosmossdk.io/math.Int" json:"totalShares"` + CreatedAt time.Time `protobuf:"bytes,5,opt,name=createdAt,proto3,stdtime" json:"createdAt"` + Chains []string `protobuf:"bytes,6,rep,name=chains,proto3" json:"chains,omitempty"` } func (m *Snapshot) Reset() { *m = Snapshot{} } @@ -345,47 +346,47 @@ func init() { } var fileDescriptor_5e751d08b53d6c50 = []byte{ - // 634 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xd1, 0x4e, 0xdb, 0x3c, - 0x14, 0xae, 0xd3, 0xd2, 0x9f, 0x98, 0x5f, 0xa8, 0xb3, 0x26, 0x14, 0xd0, 0x94, 0x56, 0xd5, 0x34, - 0x75, 0x08, 0x12, 0xd1, 0x3d, 0xc0, 0xd4, 0x42, 0x27, 0x95, 0x4d, 0x6c, 0x32, 0x88, 0x0b, 0x34, - 0x69, 0x72, 0x12, 0x93, 0x44, 0xa4, 0x71, 0x14, 0xbb, 0x08, 0xde, 0x82, 0x07, 0xd9, 0x4b, 0x4c, - 0x9a, 0x34, 0x2e, 0xb9, 0x9c, 0x76, 0xc1, 0x26, 0x78, 0x8b, 0x5d, 0x4d, 0xb6, 0x93, 0x52, 0x46, - 0x37, 0xb1, 0xed, 0x2a, 0xfe, 0xe2, 0xf3, 0x9d, 0xe3, 0xef, 0x7c, 0xc7, 0x86, 0x9d, 0x8c, 0x24, - 0x6c, 0x44, 0xfc, 0x88, 0xc4, 0xa9, 0xab, 0xd7, 0xee, 0x31, 0x49, 0x38, 0x15, 0x2e, 0x4f, 0x49, - 0xc6, 0x23, 0x26, 0x9c, 0x2c, 0x67, 0x82, 0xa1, 0xe5, 0xa9, 0x48, 0x47, 0xaf, 0x1d, 0x1d, 0xb9, - 0xf2, 0x30, 0x64, 0x21, 0x53, 0x51, 0xae, 0x5c, 0x69, 0xc2, 0xca, 0xb2, 0xcf, 0xf8, 0x88, 0xf1, - 0x77, 0x7a, 0x43, 0x83, 0x62, 0xab, 0x19, 0x32, 0x16, 0x26, 0xd4, 0x55, 0xc8, 0x1b, 0x1f, 0xba, - 0x22, 0x1e, 0x51, 0x2e, 0xc8, 0x28, 0x2b, 0x02, 0x6c, 0x1d, 0xee, 0x7a, 0x84, 0x53, 0xf7, 0x78, - 0xc3, 0xa3, 0x82, 0x6c, 0xb8, 0x3e, 0x93, 0x95, 0xe5, 0x7e, 0xfb, 0x93, 0x01, 0xcd, 0x7d, 0x92, - 0xc4, 0x01, 0x11, 0x2c, 0x47, 0x3b, 0x10, 0xf2, 0x88, 0xe4, 0x74, 0x93, 0x8d, 0x53, 0x61, 0x81, - 0x16, 0xe8, 0xfc, 0xdf, 0x77, 0xce, 0x2f, 0x9b, 0x95, 0x2f, 0x97, 0xcd, 0x27, 0x61, 0x2c, 0xa2, - 0xb1, 0xe7, 0xf8, 0x6c, 0x54, 0x9c, 0xa1, 0xf8, 0xac, 0xf3, 0xe0, 0xc8, 0x15, 0xa7, 0x19, 0xe5, - 0xce, 0x30, 0x15, 0x78, 0x2a, 0x03, 0x7a, 0x0e, 0xe7, 0xb8, 0x20, 0x82, 0x5a, 0x46, 0x0b, 0x74, - 0x16, 0xbb, 0x4f, 0x9d, 0x5f, 0x4a, 0x77, 0x26, 0x87, 0xd8, 0x95, 0x04, 0xac, 0x79, 0xe8, 0x2d, - 0x44, 0xf4, 0x44, 0xd0, 0x3c, 0x25, 0xc9, 0xa6, 0x24, 0x0d, 0xd3, 0x43, 0xc6, 0xad, 0x6a, 0xab, - 0xda, 0x59, 0xe8, 0xae, 0xfd, 0x26, 0xdb, 0xe0, 0x67, 0x12, 0x9e, 0x91, 0x07, 0xbd, 0x84, 0xff, - 0x91, 0x20, 0xc8, 0x29, 0xe7, 0x56, 0x4d, 0x69, 0xdd, 0xf8, 0x7e, 0xd9, 0x5c, 0xbf, 0x87, 0xce, - 0x7d, 0x92, 0xf4, 0x34, 0x11, 0x97, 0x19, 0xda, 0x1f, 0x01, 0x5c, 0x9e, 0x88, 0x28, 0xeb, 0xf7, - 0x7c, 0x5f, 0x36, 0xe2, 0x56, 0x29, 0xf0, 0xaf, 0xa5, 0xd0, 0x01, 0x7c, 0x70, 0x47, 0xa0, 0x65, - 0xfc, 0x45, 0x53, 0xee, 0xa6, 0x69, 0xbf, 0x37, 0xe0, 0xfc, 0x6e, 0x31, 0xb0, 0x68, 0x11, 0x1a, - 0x71, 0xa0, 0x0e, 0x5c, 0xc3, 0x46, 0x1c, 0xa0, 0x25, 0x58, 0x8f, 0x68, 0x1c, 0x46, 0x42, 0x19, - 0x5a, 0xc5, 0x05, 0x42, 0xdb, 0x10, 0x1e, 0x97, 0xd2, 0x4b, 0x7b, 0x1e, 0xdf, 0xc7, 0xec, 0x7e, - 0x4d, 0x4e, 0x17, 0x9e, 0x62, 0xa3, 0x37, 0x70, 0x41, 0x30, 0x41, 0x92, 0x5d, 0x39, 0x46, 0xa5, - 0x31, 0x7f, 0x3a, 0x84, 0xd3, 0x29, 0x50, 0x1f, 0x9a, 0x7e, 0x4e, 0x89, 0xa0, 0x41, 0x4f, 0x58, - 0x73, 0x2d, 0xd0, 0x59, 0xe8, 0xae, 0x38, 0xfa, 0xe2, 0x38, 0xe5, 0xc5, 0x71, 0xf6, 0xca, 0x8b, - 0xd3, 0x9f, 0x97, 0xb5, 0xce, 0xbe, 0x36, 0x01, 0xbe, 0xa1, 0x49, 0xe5, 0x4a, 0x08, 0xb7, 0xea, - 0xad, 0x6a, 0xc7, 0xc4, 0x05, 0x6a, 0x7f, 0x00, 0x33, 0xbc, 0x40, 0x8f, 0xa0, 0xa9, 0xf6, 0xf7, - 0x4e, 0x33, 0xaa, 0xda, 0x67, 0xe2, 0x9b, 0x1f, 0x68, 0x15, 0x36, 0x14, 0xc0, 0xf4, 0x90, 0xe6, - 0x34, 0xf5, 0xe9, 0x70, 0x4b, 0xf5, 0xd3, 0xc4, 0x77, 0xfe, 0x23, 0xeb, 0x66, 0x6e, 0xaa, 0x2a, - 0x64, 0x32, 0x04, 0x4b, 0xb0, 0x9e, 0x8d, 0xbd, 0x23, 0x7a, 0xaa, 0x5b, 0x84, 0x0b, 0x24, 0x19, - 0x1e, 0x49, 0x48, 0xea, 0x53, 0xa5, 0xd5, 0xc4, 0x25, 0x94, 0x0c, 0x91, 0x93, 0x58, 0x4c, 0x34, - 0x68, 0xb4, 0xda, 0x85, 0x8b, 0xb7, 0x6f, 0x1f, 0x9a, 0x87, 0xb5, 0x9d, 0xd7, 0x3b, 0x83, 0x46, - 0x05, 0x41, 0x58, 0xef, 0x6d, 0xee, 0x0d, 0xf7, 0x07, 0x0d, 0x20, 0xd7, 0xdb, 0xbd, 0xe1, 0xab, - 0xc1, 0x56, 0xc3, 0xe8, 0xbf, 0x38, 0xbf, 0xb2, 0xc1, 0xc5, 0x95, 0x0d, 0xbe, 0x5d, 0xd9, 0xe0, - 0xec, 0xda, 0xae, 0x5c, 0x5c, 0xdb, 0x95, 0xcf, 0xd7, 0x76, 0xe5, 0x60, 0x6d, 0xca, 0xa2, 0x19, - 0x6f, 0xe2, 0x49, 0xf9, 0x2a, 0x2a, 0xb3, 0xbc, 0xba, 0x32, 0xe0, 0xd9, 0x8f, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x59, 0x9d, 0xf6, 0xdb, 0x3f, 0x05, 0x00, 0x00, + // 640 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4f, 0x4f, 0xdb, 0x30, + 0x14, 0xaf, 0xd3, 0xd2, 0x11, 0x33, 0xa1, 0xce, 0xda, 0x50, 0x40, 0x5b, 0x5a, 0x55, 0x3b, 0x74, + 0x08, 0x12, 0xd1, 0x9d, 0x27, 0xd4, 0x42, 0x27, 0x95, 0x4d, 0x4c, 0x32, 0x88, 0x03, 0x9a, 0x34, + 0x39, 0x89, 0x69, 0x22, 0x92, 0x38, 0x8a, 0x5d, 0x04, 0xdf, 0x82, 0xfb, 0xbe, 0xc7, 0xee, 0x93, + 0x76, 0xe0, 0xc8, 0x71, 0xda, 0x81, 0x4d, 0xf0, 0x2d, 0x76, 0x9a, 0x6c, 0x27, 0xa5, 0x0c, 0xf6, + 0x47, 0xdb, 0x29, 0xfe, 0xe5, 0xbd, 0xdf, 0x7b, 0xfe, 0xbd, 0x3f, 0x86, 0x9d, 0x8c, 0xc4, 0x2c, + 0x21, 0x7e, 0x48, 0xa2, 0xd4, 0xd5, 0x67, 0xf7, 0x88, 0xc4, 0x9c, 0x0a, 0x97, 0xa7, 0x24, 0xe3, + 0x21, 0x13, 0x4e, 0x96, 0x33, 0xc1, 0xd0, 0xe2, 0x94, 0xa7, 0xa3, 0xcf, 0x8e, 0xf6, 0x5c, 0x7a, + 0x38, 0x62, 0x23, 0xa6, 0xbc, 0x5c, 0x79, 0xd2, 0x84, 0xa5, 0x45, 0x9f, 0xf1, 0x84, 0xf1, 0x77, + 0xda, 0xa0, 0x41, 0x61, 0x6a, 0x8e, 0x18, 0x1b, 0xc5, 0xd4, 0x55, 0xc8, 0x1b, 0x1f, 0xb8, 0x22, + 0x4a, 0x28, 0x17, 0x24, 0xc9, 0x0a, 0x07, 0x5b, 0xbb, 0xbb, 0x1e, 0xe1, 0xd4, 0x3d, 0x5a, 0xf3, + 0xa8, 0x20, 0x6b, 0xae, 0xcf, 0x64, 0x66, 0x69, 0x6f, 0x7f, 0x30, 0xa0, 0xb9, 0x47, 0xe2, 0x28, + 0x20, 0x82, 0xe5, 0xe8, 0x05, 0x84, 0x3c, 0x24, 0x39, 0xdd, 0x60, 0xe3, 0x54, 0x58, 0xa0, 0x05, + 0x3a, 0xf7, 0xfb, 0x4f, 0xce, 0x2e, 0x9a, 0x95, 0x2f, 0x17, 0xcd, 0x47, 0x3a, 0x12, 0x0f, 0x0e, + 0x9d, 0x88, 0xb9, 0x09, 0x11, 0xa1, 0x33, 0x4c, 0x05, 0x9e, 0x22, 0xa0, 0x75, 0x38, 0xc3, 0x05, + 0x11, 0xd4, 0x32, 0x5a, 0xa0, 0x33, 0xdf, 0x7d, 0xe6, 0xfc, 0x52, 0xa9, 0x33, 0xc9, 0xb9, 0x23, + 0x09, 0x58, 0xf3, 0xd0, 0x5b, 0x88, 0xe8, 0xb1, 0xa0, 0x79, 0x4a, 0xe2, 0x0d, 0x49, 0x1a, 0xa6, + 0x07, 0x8c, 0x5b, 0xd5, 0x56, 0xb5, 0x33, 0xd7, 0x5d, 0xf9, 0x4d, 0xb4, 0xc1, 0xcf, 0x24, 0x7c, + 0x47, 0x1c, 0xf4, 0x0a, 0xde, 0x23, 0x41, 0x90, 0x53, 0xce, 0xad, 0x9a, 0x92, 0xb6, 0xf6, 0xfd, + 0xa2, 0xb9, 0x3a, 0x8a, 0x44, 0x38, 0xf6, 0x1c, 0x9f, 0x25, 0x45, 0x69, 0x8b, 0xcf, 0x2a, 0x0f, + 0x0e, 0x5d, 0x71, 0x92, 0x51, 0x2e, 0x2f, 0xdb, 0xd3, 0x44, 0x5c, 0x46, 0x68, 0x7f, 0x02, 0x70, + 0x71, 0x22, 0xa2, 0xcc, 0xdf, 0xf3, 0x7d, 0x59, 0x88, 0x1b, 0xa9, 0xc0, 0xff, 0xa6, 0x42, 0xfb, + 0xf0, 0xc1, 0x2d, 0x81, 0x96, 0xf1, 0x0f, 0x45, 0xb9, 0x1d, 0xa6, 0xfd, 0xde, 0x80, 0xb3, 0x3b, + 0xc5, 0x7c, 0xa2, 0x79, 0x68, 0x44, 0x81, 0xba, 0x70, 0x0d, 0x1b, 0x51, 0x80, 0x16, 0x60, 0x3d, + 0xa4, 0xd1, 0x28, 0x14, 0xaa, 0xa1, 0x55, 0x5c, 0x20, 0xb4, 0x05, 0xe1, 0x51, 0x29, 0xbd, 0x6c, + 0xcf, 0xd3, 0xbf, 0x69, 0x76, 0xbf, 0x26, 0x87, 0x09, 0x4f, 0xb1, 0xd1, 0x3a, 0x9c, 0x13, 0x4c, + 0x90, 0x78, 0x47, 0x8e, 0x51, 0xd9, 0x98, 0x3f, 0xcc, 0xdc, 0x34, 0x03, 0xf5, 0xa1, 0xe9, 0xe7, + 0x94, 0x08, 0x1a, 0xf4, 0x84, 0x35, 0xd3, 0x02, 0x9d, 0xb9, 0xee, 0x92, 0xa3, 0xd7, 0xc2, 0x29, + 0xd7, 0xc2, 0xd9, 0x2d, 0xd7, 0xa2, 0x3f, 0x2b, 0x43, 0x9f, 0x7e, 0x6d, 0x02, 0x7c, 0x4d, 0x93, + 0x42, 0xd5, 0xbd, 0xb9, 0x55, 0x6f, 0x55, 0x3b, 0x26, 0x2e, 0x50, 0xfb, 0x23, 0xb8, 0xa3, 0xf4, + 0xe8, 0x31, 0x34, 0x95, 0x7d, 0xf7, 0x24, 0xa3, 0xaa, 0x5a, 0x26, 0xbe, 0xfe, 0x81, 0x96, 0x61, + 0x43, 0x01, 0x4c, 0x0f, 0x68, 0x4e, 0x53, 0x9f, 0x0e, 0x37, 0x55, 0xf9, 0x4c, 0x7c, 0xeb, 0x3f, + 0xb2, 0xae, 0xc7, 0xa4, 0xaa, 0x5c, 0x26, 0x3d, 0x5f, 0x80, 0xf5, 0x6c, 0xec, 0x1d, 0xd2, 0x13, + 0x5d, 0x11, 0x5c, 0x20, 0xc9, 0xf0, 0x48, 0x4c, 0x52, 0x9f, 0x2a, 0xad, 0x26, 0x2e, 0xa1, 0x64, + 0x88, 0x9c, 0x44, 0x62, 0xa2, 0x41, 0xa3, 0xe5, 0x2e, 0x9c, 0xbf, 0xb9, 0x6c, 0x68, 0x16, 0xd6, + 0xb6, 0xdf, 0x6c, 0x0f, 0x1a, 0x15, 0x04, 0x61, 0xbd, 0xb7, 0xb1, 0x3b, 0xdc, 0x1b, 0x34, 0x80, + 0x3c, 0x6f, 0xf5, 0x86, 0xaf, 0x07, 0x9b, 0x0d, 0xa3, 0xff, 0xf2, 0xec, 0xd2, 0x06, 0xe7, 0x97, + 0x36, 0xf8, 0x76, 0x69, 0x83, 0xd3, 0x2b, 0xbb, 0x72, 0x7e, 0x65, 0x57, 0x3e, 0x5f, 0xd9, 0x95, + 0xfd, 0x95, 0xa9, 0x19, 0xbe, 0xe3, 0xc5, 0x3b, 0x2e, 0xdf, 0x3c, 0x35, 0xcd, 0x5e, 0x5d, 0x35, + 0xe0, 0xf9, 0x8f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x61, 0x12, 0xf3, 0x9c, 0x1d, 0x05, 0x00, 0x00, } func (m *Validator) Marshal() (dAtA []byte, err error) { diff --git a/x/valset/types/tx.pb.go b/x/valset/types/tx.pb.go index d9ce2457..b02751a8 100644 --- a/x/valset/types/tx.pb.go +++ b/x/valset/types/tx.pb.go @@ -6,24 +6,21 @@ package types import ( context "context" fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "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 - _ = fmt.Errorf - _ = math.Inf -) +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. @@ -43,11 +40,9 @@ func (*MsgAddExternalChainInfoForValidator) ProtoMessage() {} func (*MsgAddExternalChainInfoForValidator) Descriptor() ([]byte, []int) { return fileDescriptor_ade79cb2279aed8e, []int{0} } - func (m *MsgAddExternalChainInfoForValidator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgAddExternalChainInfoForValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgAddExternalChainInfoForValidator.Marshal(b, m, deterministic) @@ -60,15 +55,12 @@ func (m *MsgAddExternalChainInfoForValidator) XXX_Marshal(b []byte, deterministi return b[:n], nil } } - func (m *MsgAddExternalChainInfoForValidator) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgAddExternalChainInfoForValidator.Merge(m, src) } - func (m *MsgAddExternalChainInfoForValidator) XXX_Size() int { return m.Size() } - func (m *MsgAddExternalChainInfoForValidator) XXX_DiscardUnknown() { xxx_messageInfo_MsgAddExternalChainInfoForValidator.DiscardUnknown(m) } @@ -97,12 +89,12 @@ func (m *MsgAddExternalChainInfoForValidator) GetMetadata() MsgMetadata { return MsgMetadata{} } -type MsgAddExternalChainInfoForValidatorResponse struct{} +type MsgAddExternalChainInfoForValidatorResponse struct { +} func (m *MsgAddExternalChainInfoForValidatorResponse) Reset() { *m = MsgAddExternalChainInfoForValidatorResponse{} } - func (m *MsgAddExternalChainInfoForValidatorResponse) String() string { return proto.CompactTextString(m) } @@ -110,11 +102,9 @@ func (*MsgAddExternalChainInfoForValidatorResponse) ProtoMessage() {} func (*MsgAddExternalChainInfoForValidatorResponse) Descriptor() ([]byte, []int) { return fileDescriptor_ade79cb2279aed8e, []int{1} } - func (m *MsgAddExternalChainInfoForValidatorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgAddExternalChainInfoForValidatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgAddExternalChainInfoForValidatorResponse.Marshal(b, m, deterministic) @@ -127,15 +117,12 @@ func (m *MsgAddExternalChainInfoForValidatorResponse) XXX_Marshal(b []byte, dete return b[:n], nil } } - func (m *MsgAddExternalChainInfoForValidatorResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgAddExternalChainInfoForValidatorResponse.Merge(m, src) } - func (m *MsgAddExternalChainInfoForValidatorResponse) XXX_Size() int { return m.Size() } - func (m *MsgAddExternalChainInfoForValidatorResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgAddExternalChainInfoForValidatorResponse.DiscardUnknown(m) } @@ -154,11 +141,9 @@ func (*MsgKeepAlive) ProtoMessage() {} func (*MsgKeepAlive) Descriptor() ([]byte, []int) { return fileDescriptor_ade79cb2279aed8e, []int{2} } - func (m *MsgKeepAlive) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgKeepAlive) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgKeepAlive.Marshal(b, m, deterministic) @@ -171,15 +156,12 @@ func (m *MsgKeepAlive) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } - func (m *MsgKeepAlive) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgKeepAlive.Merge(m, src) } - func (m *MsgKeepAlive) XXX_Size() int { return m.Size() } - func (m *MsgKeepAlive) XXX_DiscardUnknown() { xxx_messageInfo_MsgKeepAlive.DiscardUnknown(m) } @@ -208,7 +190,8 @@ func (m *MsgKeepAlive) GetMetadata() MsgMetadata { return MsgMetadata{} } -type MsgKeepAliveResponse struct{} +type MsgKeepAliveResponse struct { +} func (m *MsgKeepAliveResponse) Reset() { *m = MsgKeepAliveResponse{} } func (m *MsgKeepAliveResponse) String() string { return proto.CompactTextString(m) } @@ -216,11 +199,9 @@ func (*MsgKeepAliveResponse) ProtoMessage() {} func (*MsgKeepAliveResponse) Descriptor() ([]byte, []int) { return fileDescriptor_ade79cb2279aed8e, []int{3} } - func (m *MsgKeepAliveResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MsgKeepAliveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgKeepAliveResponse.Marshal(b, m, deterministic) @@ -233,15 +214,12 @@ func (m *MsgKeepAliveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } - func (m *MsgKeepAliveResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgKeepAliveResponse.Merge(m, src) } - func (m *MsgKeepAliveResponse) XXX_Size() int { return m.Size() } - func (m *MsgKeepAliveResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgKeepAliveResponse.DiscardUnknown(m) } @@ -289,10 +267,8 @@ var fileDescriptor_ade79cb2279aed8e = []byte{ } // Reference imports to suppress errors if they are not otherwise used. -var ( - _ context.Context - _ grpc.ClientConn -) +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. @@ -339,12 +315,12 @@ type MsgServer interface { } // UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct{} +type UnimplementedMsgServer struct { +} func (*UnimplementedMsgServer) AddExternalChainInfoForValidator(ctx context.Context, req *MsgAddExternalChainInfoForValidator) (*MsgAddExternalChainInfoForValidatorResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddExternalChainInfoForValidator not implemented") } - func (*UnimplementedMsgServer) KeepAlive(ctx context.Context, req *MsgKeepAlive) (*MsgKeepAliveResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method KeepAlive not implemented") } @@ -564,7 +540,6 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *MsgAddExternalChainInfoForValidator) Size() (n int) { if m == nil { return 0 @@ -626,11 +601,9 @@ func (m *MsgKeepAliveResponse) Size() (n int) { 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 *MsgAddExternalChainInfoForValidator) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -780,7 +753,6 @@ func (m *MsgAddExternalChainInfoForValidator) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgAddExternalChainInfoForValidatorResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -831,7 +803,6 @@ func (m *MsgAddExternalChainInfoForValidatorResponse) Unmarshal(dAtA []byte) err } return nil } - func (m *MsgKeepAlive) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -979,7 +950,6 @@ func (m *MsgKeepAlive) Unmarshal(dAtA []byte) error { } return nil } - func (m *MsgKeepAliveResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1030,7 +1000,6 @@ func (m *MsgKeepAliveResponse) Unmarshal(dAtA []byte) error { } return nil } - func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0