From 23a9e585ccbde213fb97080e76555d8e71b33fd9 Mon Sep 17 00:00:00 2001 From: Raul Bernal Date: Tue, 30 Nov 2021 11:28:07 +0100 Subject: [PATCH] Revert "SDK v.0.44.3 & Tendrmint v0.34.14 & IBC v.1.2.3" --- app.go | 654 ------------------- app/app.go | 50 +- app/simulation_test.go | 112 ---- bcnad/main.go | 24 - docs/static/openapi.yml | 46 -- export.go | 185 ------ genesis.go | 21 - go.mod | 25 +- go.sum | 83 ++- proto/bcna/bitcannaid.proto | 3 + proto/bcna/genesis.proto | 12 +- proto/bcna/params.proto | 12 - proto/bcna/query.proto | 18 +- proto/bcna/supplychain.proto | 3 + simulation_test.go | 112 ---- testutil/keeper/bcna.go | 16 +- testutil/nullify/nullify.go | 57 -- x/bcna/client/cli/query.go | 1 - x/bcna/client/cli/query_bitcannaid_test.go | 27 +- x/bcna/client/cli/query_params.go | 34 - x/bcna/client/cli/query_supplychain_test.go | 27 +- x/bcna/client/cli/tx.go | 1 - x/bcna/client/cli/tx_bitcannaid.go | 3 +- x/bcna/client/cli/tx_bitcannaid_test.go | 6 +- x/bcna/client/cli/tx_supplychain.go | 3 +- x/bcna/client/cli/tx_supplychain_test.go | 6 +- x/bcna/genesis.go | 2 - x/bcna/genesis_test.go | 12 +- x/bcna/keeper/bitcannaid_test.go | 11 +- x/bcna/keeper/grpc_query_bitcannaid_test.go | 20 +- x/bcna/keeper/grpc_query_params.go | 19 - x/bcna/keeper/grpc_query_params_test.go | 21 - x/bcna/keeper/grpc_query_supplychain_test.go | 20 +- x/bcna/keeper/keeper.go | 22 +- x/bcna/keeper/params.go | 16 - x/bcna/keeper/params_test.go | 18 - x/bcna/keeper/supplychain_test.go | 11 +- x/bcna/module.go | 13 +- x/bcna/module_simulation.go | 175 ----- x/bcna/simulation/bitcannaid.go | 134 ---- x/bcna/simulation/simap.go | 15 - x/bcna/simulation/supplychain.go | 134 ---- x/bcna/types/bitcannaid.pb.go | 23 +- x/bcna/types/codec.go | 2 +- x/bcna/types/expected_keepers.go | 17 - x/bcna/types/genesis.go | 3 +- x/bcna/types/genesis.pb.go | 108 +-- x/bcna/types/genesis_test.go | 1 - x/bcna/types/messages_bitcannaid.go | 12 +- x/bcna/types/messages_supplychain.go | 12 +- x/bcna/types/params.go | 39 -- x/bcna/types/params.pb.go | 264 -------- x/bcna/types/query.pb.go | 424 ++---------- x/bcna/types/query.pb.gw.go | 65 -- x/bcna/types/supplychain.pb.go | 26 +- 55 files changed, 228 insertions(+), 2952 deletions(-) delete mode 100644 app.go delete mode 100644 app/simulation_test.go delete mode 100644 bcnad/main.go delete mode 100644 export.go delete mode 100644 genesis.go delete mode 100644 proto/bcna/params.proto delete mode 100644 simulation_test.go delete mode 100644 testutil/nullify/nullify.go delete mode 100644 x/bcna/client/cli/query_params.go delete mode 100644 x/bcna/keeper/grpc_query_params.go delete mode 100644 x/bcna/keeper/grpc_query_params_test.go delete mode 100644 x/bcna/keeper/params.go delete mode 100644 x/bcna/keeper/params_test.go delete mode 100644 x/bcna/module_simulation.go delete mode 100644 x/bcna/simulation/bitcannaid.go delete mode 100644 x/bcna/simulation/simap.go delete mode 100644 x/bcna/simulation/supplychain.go delete mode 100644 x/bcna/types/params.go delete mode 100644 x/bcna/types/params.pb.go diff --git a/app.go b/app.go deleted file mode 100644 index b3cc91eb..00000000 --- a/app.go +++ /dev/null @@ -1,654 +0,0 @@ -package app - -import ( - "io" - "net/http" - "os" - "path/filepath" - - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" - "github.com/cosmos/cosmos-sdk/client/rpc" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/server/api" - "github.com/cosmos/cosmos-sdk/server/config" - servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/auth" - "github.com/cosmos/cosmos-sdk/x/auth/ante" - authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" - authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting" - "github.com/cosmos/cosmos-sdk/x/bank" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/capability" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - "github.com/cosmos/cosmos-sdk/x/crisis" - crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" - crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" - distr "github.com/cosmos/cosmos-sdk/x/distribution" - distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client" - distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/evidence" - evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" - feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" - "github.com/cosmos/cosmos-sdk/x/genutil" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/cosmos/cosmos-sdk/x/gov" - govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/mint" - mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/cosmos/cosmos-sdk/x/params" - paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - "github.com/cosmos/cosmos-sdk/x/slashing" - slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/cosmos/cosmos-sdk/x/staking" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/ibc-go/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/modules/core" - ibcclient "github.com/cosmos/ibc-go/modules/core/02-client" - ibcporttypes "github.com/cosmos/ibc-go/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/modules/core/24-host" - ibckeeper "github.com/cosmos/ibc-go/modules/core/keeper" - "github.com/spf13/cast" - abci "github.com/tendermint/tendermint/abci/types" - tmjson "github.com/tendermint/tendermint/libs/json" - "github.com/tendermint/tendermint/libs/log" - tmos "github.com/tendermint/tendermint/libs/os" - dbm "github.com/tendermint/tm-db" - - "github.com/tendermint/spm/cosmoscmd" - "github.com/tendermint/spm/openapiconsole" - - "github.com/BitCannaGlobal/bcna/docs" - - bcnamodule "github.com/BitCannaGlobal/bcna/x/bcna" - bcnamodulekeeper "github.com/BitCannaGlobal/bcna/x/bcna/keeper" - bcnamoduletypes "github.com/BitCannaGlobal/bcna/x/bcna/types" - // this line is used by starport scaffolding # stargate/app/moduleImport -) - -const ( - AccountAddressPrefix = "bcna" - Name = "bcna" -) - -// this line is used by starport scaffolding # stargate/wasm/app/enabledProposals - -func getGovProposalHandlers() []govclient.ProposalHandler { - var govProposalHandlers []govclient.ProposalHandler - // this line is used by starport scaffolding # stargate/app/govProposalHandlers - - govProposalHandlers = append(govProposalHandlers, - paramsclient.ProposalHandler, - distrclient.ProposalHandler, - upgradeclient.ProposalHandler, - upgradeclient.CancelProposalHandler, - // this line is used by starport scaffolding # stargate/app/govProposalHandler - ) - - return govProposalHandlers -} - -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.AppModuleBasic{}, - bank.AppModuleBasic{}, - capability.AppModuleBasic{}, - staking.AppModuleBasic{}, - mint.AppModuleBasic{}, - distr.AppModuleBasic{}, - gov.NewAppModuleBasic(getGovProposalHandlers()...), - params.AppModuleBasic{}, - crisis.AppModuleBasic{}, - slashing.AppModuleBasic{}, - feegrantmodule.AppModuleBasic{}, - ibc.AppModuleBasic{}, - upgrade.AppModuleBasic{}, - evidence.AppModuleBasic{}, - transfer.AppModuleBasic{}, - vesting.AppModuleBasic{}, - bcnamodule.AppModuleBasic{}, - // this line is used by starport scaffolding # stargate/app/moduleBasic - ) - - // module account permissions - maccPerms = map[string][]string{ - authtypes.FeeCollectorName: nil, - distrtypes.ModuleName: nil, - minttypes.ModuleName: {authtypes.Minter}, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - govtypes.ModuleName: {authtypes.Burner}, - ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - // this line is used by starport scaffolding # stargate/app/maccPerms - } -) - -var ( - _ cosmoscmd.App = (*App)(nil) - _ servertypes.Application = (*App)(nil) - _ simapp.App = (*App)(nil) -) - -func init() { - userHomeDir, err := os.UserHomeDir() - if err != nil { - panic(err) - } - - DefaultNodeHome = filepath.Join(userHomeDir, "."+Name) -} - -// App extends an ABCI application, but with most of its parameters exported. -// They are exported for convenience in creating helper functions, as object -// capabilities aren't needed for testing. -type App struct { - *baseapp.BaseApp - - cdc *codec.LegacyAmino - appCodec codec.Codec - interfaceRegistry types.InterfaceRegistry - - invCheckPeriod uint - - // keys to access the substores - keys map[string]*sdk.KVStoreKey - tkeys map[string]*sdk.TransientStoreKey - memKeys map[string]*sdk.MemoryStoreKey - - // keepers - AccountKeeper authkeeper.AccountKeeper - BankKeeper bankkeeper.Keeper - CapabilityKeeper *capabilitykeeper.Keeper - StakingKeeper stakingkeeper.Keeper - SlashingKeeper slashingkeeper.Keeper - MintKeeper mintkeeper.Keeper - DistrKeeper distrkeeper.Keeper - GovKeeper govkeeper.Keeper - CrisisKeeper crisiskeeper.Keeper - UpgradeKeeper upgradekeeper.Keeper - ParamsKeeper paramskeeper.Keeper - IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly - EvidenceKeeper evidencekeeper.Keeper - TransferKeeper ibctransferkeeper.Keeper - FeeGrantKeeper feegrantkeeper.Keeper - - // make scoped keepers public for test purposes - ScopedIBCKeeper capabilitykeeper.ScopedKeeper - ScopedTransferKeeper capabilitykeeper.ScopedKeeper - - BcnaKeeper bcnamodulekeeper.Keeper - // this line is used by starport scaffolding # stargate/app/keeperDeclaration - - // mm is the module manager - mm *module.Manager - - // sm is the simulation manager - sm *module.SimulationManager -} - -// New returns a reference to an initialized blockchain app -func New( - logger log.Logger, - db dbm.DB, - traceStore io.Writer, - loadLatest bool, - skipUpgradeHeights map[int64]bool, - homePath string, - invCheckPeriod uint, - encodingConfig cosmoscmd.EncodingConfig, - appOpts servertypes.AppOptions, - baseAppOptions ...func(*baseapp.BaseApp), -) cosmoscmd.App { - appCodec := encodingConfig.Marshaler - cdc := encodingConfig.Amino - interfaceRegistry := encodingConfig.InterfaceRegistry - - bApp := baseapp.NewBaseApp(Name, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) - bApp.SetCommitMultiStoreTracer(traceStore) - bApp.SetVersion(version.Version) - bApp.SetInterfaceRegistry(interfaceRegistry) - - keys := sdk.NewKVStoreKeys( - authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, - minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, - govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, - evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, - bcnamoduletypes.StoreKey, - // this line is used by starport scaffolding # stargate/app/storeKey - ) - tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) - - app := &App{ - BaseApp: bApp, - cdc: cdc, - appCodec: appCodec, - interfaceRegistry: interfaceRegistry, - invCheckPeriod: invCheckPeriod, - keys: keys, - tkeys: tkeys, - memKeys: memKeys, - } - - app.ParamsKeeper = initParamsKeeper(appCodec, cdc, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) - - // set the BaseApp's parameter store - bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramskeeper.ConsensusParamsKeyTable())) - - // add capability keeper and ScopeToModule for ibc module - app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey]) - - // grant capabilities for the ibc and ibc-transfer modules - scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) - scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) - // this line is used by starport scaffolding # stargate/app/scopedKeeper - - // add keepers - app.AccountKeeper = authkeeper.NewAccountKeeper( - appCodec, keys[authtypes.StoreKey], app.GetSubspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, maccPerms, - ) - app.BankKeeper = bankkeeper.NewBaseKeeper( - appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.ModuleAccountAddrs(), - ) - stakingKeeper := stakingkeeper.NewKeeper( - appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName), - ) - app.MintKeeper = mintkeeper.NewKeeper( - appCodec, keys[minttypes.StoreKey], app.GetSubspace(minttypes.ModuleName), &stakingKeeper, - app.AccountKeeper, app.BankKeeper, authtypes.FeeCollectorName, - ) - app.DistrKeeper = distrkeeper.NewKeeper( - appCodec, keys[distrtypes.StoreKey], app.GetSubspace(distrtypes.ModuleName), app.AccountKeeper, app.BankKeeper, - &stakingKeeper, authtypes.FeeCollectorName, app.ModuleAccountAddrs(), - ) - app.SlashingKeeper = slashingkeeper.NewKeeper( - appCodec, keys[slashingtypes.StoreKey], &stakingKeeper, app.GetSubspace(slashingtypes.ModuleName), - ) - app.CrisisKeeper = crisiskeeper.NewKeeper( - app.GetSubspace(crisistypes.ModuleName), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, - ) - - app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper) - app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp) - - // register the staking hooks - // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks - app.StakingKeeper = *stakingKeeper.SetHooks( - stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()), - ) - - // ... other modules keepers - - // Create IBC Keeper - app.IBCKeeper = ibckeeper.NewKeeper( - appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper, - ) - - // register the proposal types - //AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) - govRouter := govtypes.NewRouter() - govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). - AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) - - // Create Transfer Keepers - app.TransferKeeper = ibctransferkeeper.NewKeeper( - appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), - app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, - app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, - ) - transferModule := transfer.NewAppModule(app.TransferKeeper) - - // Create evidence Keeper for to register the IBC light client misbehaviour evidence route - evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, keys[evidencetypes.StoreKey], &app.StakingKeeper, app.SlashingKeeper, - ) - // If evidence needs to be handled for the app, set routes in router here and seal - app.EvidenceKeeper = *evidenceKeeper - - app.GovKeeper = govkeeper.NewKeeper( - appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, - &stakingKeeper, govRouter, - ) - - app.BcnaKeeper = *bcnamodulekeeper.NewKeeper( - appCodec, - keys[bcnamoduletypes.StoreKey], - keys[bcnamoduletypes.MemStoreKey], - app.GetSubspace(bcnamoduletypes.ModuleName), - ) - bcnaModule := bcnamodule.NewAppModule(appCodec, app.BcnaKeeper, app.AccountKeeper, app.BankKeeper) - - // this line is used by starport scaffolding # stargate/app/keeperDefinition - - // Create static IBC router, add transfer route, then set and seal it - ibcRouter := ibcporttypes.NewRouter() - ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferModule) - // this line is used by starport scaffolding # ibc/app/router - app.IBCKeeper.SetRouter(ibcRouter) - - /**** Module Options ****/ - - // NOTE: we may consider parsing `appOpts` inside module constructors. For the moment - // we prefer to be more strict in what arguments the modules expect. - var skipGenesisInvariants = cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) - - // NOTE: Any module instantiated in the module manager that is later modified - // must be passed by reference here. - - app.mm = module.NewManager( - genutil.NewAppModule( - app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, - encodingConfig.TxConfig, - ), - auth.NewAppModule(appCodec, app.AccountKeeper, nil), - vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), - bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), - capability.NewAppModule(appCodec, *app.CapabilityKeeper), - feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants), - gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), - mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), - upgrade.NewAppModule(app.UpgradeKeeper), - evidence.NewAppModule(app.EvidenceKeeper), - ibc.NewAppModule(app.IBCKeeper), - params.NewAppModule(app.ParamsKeeper), - transferModule, - bcnaModule, - // this line is used by starport scaffolding # stargate/app/appModule - ) - - // 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( - upgradetypes.ModuleName, capabilitytypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, - evidencetypes.ModuleName, stakingtypes.ModuleName, ibchost.ModuleName, - feegrant.ModuleName, - ) - - app.mm.SetOrderEndBlockers(crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName) - - // NOTE: The genutils module must occur after staking so that pools are - // properly initialized with tokens from genesis accounts. - // 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( - capabilitytypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - distrtypes.ModuleName, - stakingtypes.ModuleName, - slashingtypes.ModuleName, - govtypes.ModuleName, - minttypes.ModuleName, - crisistypes.ModuleName, - ibchost.ModuleName, - genutiltypes.ModuleName, - evidencetypes.ModuleName, - ibctransfertypes.ModuleName, - bcnamoduletypes.ModuleName, - // this line is used by starport scaffolding # stargate/app/initGenesis - ) - - app.mm.RegisterInvariants(&app.CrisisKeeper) - app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) - app.mm.RegisterServices(module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())) - - // create the simulation manager and define the order of the modules for deterministic simulations - app.sm = module.NewSimulationManager( - auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts), - bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), - capability.NewAppModule(appCodec, *app.CapabilityKeeper), - feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), - mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - params.NewAppModule(app.ParamsKeeper), - evidence.NewAppModule(app.EvidenceKeeper), - ibc.NewAppModule(app.IBCKeeper), - transferModule, - bcnaModule, - // this line is used by starport scaffolding # stargate/app/appModule - ) - app.sm.RegisterStoreDecoders() - - // initialize stores - app.MountKVStores(keys) - app.MountTransientStores(tkeys) - app.MountMemoryStores(memKeys) - - // initialize BaseApp - app.SetInitChainer(app.InitChainer) - app.SetBeginBlocker(app.BeginBlocker) - - anteHandler, err := ante.NewAnteHandler( - ante.HandlerOptions{ - AccountKeeper: app.AccountKeeper, - BankKeeper: app.BankKeeper, - SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), - FeegrantKeeper: app.FeeGrantKeeper, - SigGasConsumer: ante.DefaultSigVerificationGasConsumer, - }, - ) - if err != nil { - panic(err) - } - - app.SetAnteHandler(anteHandler) - app.SetEndBlocker(app.EndBlocker) - - if loadLatest { - if err := app.LoadLatestVersion(); err != nil { - tmos.Exit(err.Error()) - } - } - - app.ScopedIBCKeeper = scopedIBCKeeper - app.ScopedTransferKeeper = scopedTransferKeeper - // this line is used by starport scaffolding # stargate/app/beforeInitReturn - - return app -} - -// Name returns the name of the App -func (app *App) Name() string { return app.BaseApp.Name() } - -// GetBaseApp returns the base app of the application -func (app App) GetBaseApp() *baseapp.BaseApp { return app.BaseApp } - -// BeginBlocker application updates every begin block -func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { - return app.mm.BeginBlock(ctx, req) -} - -// EndBlocker application updates every end block -func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { - return app.mm.EndBlock(ctx, req) -} - -// InitChainer application update at chain initialization -func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { - var genesisState GenesisState - if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { - panic(err) - } - app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) - return app.mm.InitGenesis(ctx, app.appCodec, genesisState) -} - -// LoadHeight loads a particular height -func (app *App) LoadHeight(height int64) error { - return app.LoadVersion(height) -} - -// ModuleAccountAddrs returns all the app's module account addresses. -func (app *App) ModuleAccountAddrs() map[string]bool { - modAccAddrs := make(map[string]bool) - for acc := range maccPerms { - modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true - } - - return modAccAddrs -} - -// LegacyAmino returns SimApp's amino codec. -// -// NOTE: This is solely to be used for testing purposes as it may be desirable -// for modules to register their own custom testing types. -func (app *App) LegacyAmino() *codec.LegacyAmino { - return app.cdc -} - -// AppCodec returns an app codec. -// -// NOTE: This is solely to be used for testing purposes as it may be desirable -// for modules to register their own custom testing types. -func (app *App) AppCodec() codec.Codec { - return app.appCodec -} - -// InterfaceRegistry returns an InterfaceRegistry -func (app *App) InterfaceRegistry() types.InterfaceRegistry { - return app.interfaceRegistry -} - -// GetKey returns the KVStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetKey(storeKey string) *sdk.KVStoreKey { - return app.keys[storeKey] -} - -// GetTKey returns the TransientStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetTKey(storeKey string) *sdk.TransientStoreKey { - return app.tkeys[storeKey] -} - -// GetMemKey returns the MemStoreKey for the provided mem key. -// -// NOTE: This is solely used for testing purposes. -func (app *App) GetMemKey(storeKey string) *sdk.MemoryStoreKey { - return app.memKeys[storeKey] -} - -// GetSubspace returns a param subspace for a given module name. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetSubspace(moduleName string) paramstypes.Subspace { - subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) - return subspace -} - -// RegisterAPIRoutes registers all application module routes with the provided -// API server. -func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { - clientCtx := apiSvr.ClientCtx - rpc.RegisterRoutes(clientCtx, apiSvr.Router) - // Register legacy tx routes. - authrest.RegisterTxRoutes(clientCtx, apiSvr.Router) - // Register new tx routes from grpc-gateway. - authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - // Register new tendermint queries routes from grpc-gateway. - tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - - // Register legacy and grpc-gateway routes for all modules. - ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router) - ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - - // register app's OpenAPI routes. - apiSvr.Router.Handle("/static/openapi.yml", http.FileServer(http.FS(docs.Docs))) - apiSvr.Router.HandleFunc("/", openapiconsole.Handler(Name, "/static/openapi.yml")) -} - -// RegisterTxService implements the Application.RegisterTxService method. -func (app *App) RegisterTxService(clientCtx client.Context) { - authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) -} - -// RegisterTendermintService implements the Application.RegisterTendermintService method. -func (app *App) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.interfaceRegistry) -} - -// GetMaccPerms returns a copy of the module account permissions -func GetMaccPerms() map[string][]string { - dupMaccPerms := make(map[string][]string) - for k, v := range maccPerms { - dupMaccPerms[k] = v - } - return dupMaccPerms -} - -// initParamsKeeper init params keeper and its subspaces -func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey sdk.StoreKey) paramskeeper.Keeper { - paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) - - paramsKeeper.Subspace(authtypes.ModuleName) - paramsKeeper.Subspace(banktypes.ModuleName) - paramsKeeper.Subspace(stakingtypes.ModuleName) - paramsKeeper.Subspace(minttypes.ModuleName) - paramsKeeper.Subspace(distrtypes.ModuleName) - paramsKeeper.Subspace(slashingtypes.ModuleName) - paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable()) - paramsKeeper.Subspace(crisistypes.ModuleName) - paramsKeeper.Subspace(ibctransfertypes.ModuleName) - paramsKeeper.Subspace(ibchost.ModuleName) - paramsKeeper.Subspace(bcnamoduletypes.ModuleName) - // this line is used by starport scaffolding # stargate/app/paramSubspace - - return paramsKeeper -} - -// SimulationManager implements the SimulationApp interface -func (app *App) SimulationManager() *module.SimulationManager { - return app.sm -} diff --git a/app/app.go b/app/app.go index b3cc91eb..b0451f00 100644 --- a/app/app.go +++ b/app/app.go @@ -15,7 +15,6 @@ import ( "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" @@ -23,7 +22,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/ante" authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" @@ -161,9 +159,8 @@ var ( ) var ( - _ cosmoscmd.App = (*App)(nil) + _ cosmoscmd.CosmosApp = (*App)(nil) _ servertypes.Application = (*App)(nil) - _ simapp.App = (*App)(nil) ) func init() { @@ -216,14 +213,11 @@ type App struct { BcnaKeeper bcnamodulekeeper.Keeper // this line is used by starport scaffolding # stargate/app/keeperDeclaration - // mm is the module manager + // the module manager mm *module.Manager - - // sm is the simulation manager - sm *module.SimulationManager } -// New returns a reference to an initialized blockchain app +// New returns a reference to an initialized Gaia. func New( logger log.Logger, db dbm.DB, @@ -322,14 +316,13 @@ func New( ) // register the proposal types - //AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) govRouter := govtypes.NewRouter() govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) - + // Create Transfer Keepers app.TransferKeeper = ibctransferkeeper.NewKeeper( appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), @@ -354,9 +347,8 @@ func New( appCodec, keys[bcnamoduletypes.StoreKey], keys[bcnamoduletypes.MemStoreKey], - app.GetSubspace(bcnamoduletypes.ModuleName), ) - bcnaModule := bcnamodule.NewAppModule(appCodec, app.BcnaKeeper, app.AccountKeeper, app.BankKeeper) + bcnaModule := bcnamodule.NewAppModule(appCodec, app.BcnaKeeper) // this line is used by starport scaffolding # stargate/app/keeperDefinition @@ -439,26 +431,6 @@ func New( app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) app.mm.RegisterServices(module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())) - // create the simulation manager and define the order of the modules for deterministic simulations - app.sm = module.NewSimulationManager( - auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts), - bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), - capability.NewAppModule(appCodec, *app.CapabilityKeeper), - feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), - mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - params.NewAppModule(app.ParamsKeeper), - evidence.NewAppModule(app.EvidenceKeeper), - ibc.NewAppModule(app.IBCKeeper), - transferModule, - bcnaModule, - // this line is used by starport scaffolding # stargate/app/appModule - ) - app.sm.RegisterStoreDecoders() - // initialize stores app.MountKVStores(keys) app.MountTransientStores(tkeys) @@ -500,9 +472,6 @@ func New( // Name returns the name of the App func (app *App) Name() string { return app.BaseApp.Name() } -// GetBaseApp returns the base app of the application -func (app App) GetBaseApp() *baseapp.BaseApp { return app.BaseApp } - // BeginBlocker application updates every begin block func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { return app.mm.BeginBlock(ctx, req) @@ -546,7 +515,7 @@ func (app *App) LegacyAmino() *codec.LegacyAmino { return app.cdc } -// AppCodec returns an app codec. +// AppCodec returns Gaia's app codec. // // NOTE: This is solely to be used for testing purposes as it may be desirable // for modules to register their own custom testing types. @@ -554,7 +523,7 @@ func (app *App) AppCodec() codec.Codec { return app.appCodec } -// InterfaceRegistry returns an InterfaceRegistry +// InterfaceRegistry returns Gaia's InterfaceRegistry func (app *App) InterfaceRegistry() types.InterfaceRegistry { return app.interfaceRegistry } @@ -647,8 +616,3 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino return paramsKeeper } - -// SimulationManager implements the SimulationApp interface -func (app *App) SimulationManager() *module.SimulationManager { - return app.sm -} diff --git a/app/simulation_test.go b/app/simulation_test.go deleted file mode 100644 index 7d0184d7..00000000 --- a/app/simulation_test.go +++ /dev/null @@ -1,112 +0,0 @@ -package app_test - -import ( - "os" - "testing" - "time" - - "github.com/BitCannaGlobal/bcna/app" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simulationtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/stretchr/testify/require" - "github.com/tendermint/spm/cosmoscmd" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtypes "github.com/tendermint/tendermint/types" -) - -func init() { - simapp.GetSimulatorFlags() -} - -type SimApp interface { - cosmoscmd.App - GetBaseApp() *baseapp.BaseApp - AppCodec() codec.Codec - SimulationManager() *module.SimulationManager - ModuleAccountAddrs() map[string]bool - Name() string - LegacyAmino() *codec.LegacyAmino - BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock - EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock - InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain -} - -var defaultConsensusParams = &abci.ConsensusParams{ - Block: &abci.BlockParams{ - MaxBytes: 200000, - MaxGas: 2000000, - }, - Evidence: &tmproto.EvidenceParams{ - MaxAgeNumBlocks: 302400, - MaxAgeDuration: 504 * time.Hour, // 3 weeks is the max duration - MaxBytes: 10000, - }, - Validator: &tmproto.ValidatorParams{ - PubKeyTypes: []string{ - tmtypes.ABCIPubKeyTypeEd25519, - }, - }, -} - -// go test -benchmem -run=^$ -bench ^BenchmarkSimulation -Commit=true -cpuprofile cpu.out -func BenchmarkSimulation(b *testing.B) { - simapp.FlagEnabledValue = true - simapp.FlagNumBlocksValue = 200 - simapp.FlagBlockSizeValue = 50 - simapp.FlagCommitValue = true - simapp.FlagVerboseValue = true - - config, db, dir, logger, _, err := simapp.SetupSimulation("goleveldb-app-sim", "Simulation") - require.NoError(b, err, "simulation setup failed") - - b.Cleanup(func() { - db.Close() - err = os.RemoveAll(dir) - require.NoError(b, err) - }) - - encoding := cosmoscmd.MakeEncodingConfig(app.ModuleBasics) - - app := app.New( - logger, - db, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - 0, - encoding, - simapp.EmptyAppOptions{}, - ) - - simApp, ok := app.(SimApp) - require.True(b, ok, "can't use simapp") - - // Run randomized simulations - _, simParams, simErr := simulation.SimulateFromSeed( - b, - os.Stdout, - simApp.GetBaseApp(), - simapp.AppStateFn(simApp.AppCodec(), simApp.SimulationManager()), - simulationtypes.RandomAccounts, - simapp.SimulationOperations(simApp, simApp.AppCodec(), config), - simApp.ModuleAccountAddrs(), - config, - simApp.AppCodec(), - ) - - // export state and simParams before the simulation error is checked - err = simapp.CheckExportSimulation(simApp, config, simParams) - require.NoError(b, err) - require.NoError(b, simErr) - - if config.Commit { - simapp.PrintStats(db) - } -} diff --git a/bcnad/main.go b/bcnad/main.go deleted file mode 100644 index 2d2d8be9..00000000 --- a/bcnad/main.go +++ /dev/null @@ -1,24 +0,0 @@ -package main - -import ( - "os" - - "github.com/BitCannaGlobal/bcna/app" - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - "github.com/tendermint/spm/cosmoscmd" -) - -func main() { - rootCmd, _ := cosmoscmd.NewRootCmd( - app.Name, - app.AccountAddressPrefix, - app.DefaultNodeHome, - app.Name, - app.ModuleBasics, - app.New, - // this line is used by starport scaffolding # root/arguments - ) - if err := svrcmd.Execute(rootCmd, app.DefaultNodeHome); err != nil { - os.Exit(1) - } -} diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 7bfb44cd..efcf9f9d 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -177,42 +177,6 @@ paths: format: uint64 tags: - Query - /BitCannaGlobal/bcna/bcna/params: - get: - summary: Parameters queries the parameters of the module. - operationId: BitCannaGlobalBcnaBcnaParams - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query /BitCannaGlobal/bcna/bcna/supplychain: get: summary: Queries a list of supplychain items. @@ -12920,9 +12884,6 @@ definitions: type: object BitCannaGlobal.bcna.bcna.MsgUpdateSupplychainResponse: type: object - BitCannaGlobal.bcna.bcna.Params: - type: object - description: Params defines the parameters for the module. BitCannaGlobal.bcna.bcna.QueryAllBitcannaidResponse: type: object properties: @@ -13041,13 +13002,6 @@ definitions: type: string creator: type: string - BitCannaGlobal.bcna.bcna.QueryParamsResponse: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - description: QueryParamsResponse is response type for the Query/Params RPC method. BitCannaGlobal.bcna.bcna.Supplychain: type: object properties: diff --git a/export.go b/export.go deleted file mode 100644 index a744e549..00000000 --- a/export.go +++ /dev/null @@ -1,185 +0,0 @@ -package app - -import ( - "encoding/json" - "log" - - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - - servertypes "github.com/cosmos/cosmos-sdk/server/types" - sdk "github.com/cosmos/cosmos-sdk/types" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/cosmos/cosmos-sdk/x/staking" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -// ExportAppStateAndValidators exports the state of the application for a genesis -// file. -func (app *App) ExportAppStateAndValidators( - forZeroHeight bool, jailAllowedAddrs []string, -) (servertypes.ExportedApp, error) { - - // as if they could withdraw from the start of the next block - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) - - // We export at last height + 1, because that's the height at which - // Tendermint will start InitChain. - height := app.LastBlockHeight() + 1 - if forZeroHeight { - height = 0 - app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) - } - - genState := app.mm.ExportGenesis(ctx, app.appCodec) - appState, err := json.MarshalIndent(genState, "", " ") - if err != nil { - return servertypes.ExportedApp{}, err - } - - validators, err := staking.WriteValidators(ctx, app.StakingKeeper) - if err != nil { - return servertypes.ExportedApp{}, err - } - return servertypes.ExportedApp{ - AppState: appState, - Validators: validators, - Height: height, - ConsensusParams: app.BaseApp.GetConsensusParams(ctx), - }, nil -} - -// prepare for fresh start at zero height -// NOTE zero height genesis is a temporary feature which will be deprecated -// in favour of export at a block height -func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { - applyAllowedAddrs := false - - // check if there is a allowed address list - if len(jailAllowedAddrs) > 0 { - applyAllowedAddrs = true - } - - allowedAddrsMap := make(map[string]bool) - - for _, addr := range jailAllowedAddrs { - _, err := sdk.ValAddressFromBech32(addr) - if err != nil { - log.Fatal(err) - } - allowedAddrsMap[addr] = true - } - - /* Just to be safe, assert the invariants on current state. */ - app.CrisisKeeper.AssertInvariants(ctx) - - /* Handle fee distribution state. */ - - // withdraw all validator commission - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - _, err := app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) - if err != nil { - panic(err) - } - return false - }) - - // withdraw all delegator rewards - dels := app.StakingKeeper.GetAllDelegations(ctx) - for _, delegation := range dels { - _, err := app.DistrKeeper.WithdrawDelegationRewards(ctx, delegation.GetDelegatorAddr(), delegation.GetValidatorAddr()) - if err != nil { - panic(err) - } - } - - // clear validator slash events - app.DistrKeeper.DeleteAllValidatorSlashEvents(ctx) - - // clear validator historical rewards - app.DistrKeeper.DeleteAllValidatorHistoricalRewards(ctx) - - // set context height to zero - height := ctx.BlockHeight() - ctx = ctx.WithBlockHeight(0) - - // reinitialize all validators - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - // donate any unwithdrawn outstanding reward fraction tokens to the community pool - scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) - feePool := app.DistrKeeper.GetFeePool(ctx) - feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) - app.DistrKeeper.SetFeePool(ctx, feePool) - - app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()) - return false - }) - - // reinitialize all delegations - for _, del := range dels { - app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, del.GetDelegatorAddr(), del.GetValidatorAddr()) - app.DistrKeeper.Hooks().AfterDelegationModified(ctx, del.GetDelegatorAddr(), del.GetValidatorAddr()) - } - - // reset context height - ctx = ctx.WithBlockHeight(height) - - /* Handle staking state. */ - - // iterate through redelegations, reset creation height - app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { - for i := range red.Entries { - red.Entries[i].CreationHeight = 0 - } - app.StakingKeeper.SetRedelegation(ctx, red) - return false - }) - - // iterate through unbonding delegations, reset creation height - app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { - for i := range ubd.Entries { - ubd.Entries[i].CreationHeight = 0 - } - app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) - return false - }) - - // Iterate through validators by power descending, reset bond heights, and - // update bond intra-tx counters. - store := ctx.KVStore(app.keys[stakingtypes.StoreKey]) - iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) - counter := int16(0) - - for ; iter.Valid(); iter.Next() { - addr := sdk.ValAddress(iter.Key()[1:]) - validator, found := app.StakingKeeper.GetValidator(ctx, addr) - if !found { - panic("expected validator, not found") - } - - validator.UnbondingHeight = 0 - if applyAllowedAddrs && !allowedAddrsMap[addr.String()] { - validator.Jailed = true - } - - app.StakingKeeper.SetValidator(ctx, validator) - counter++ - } - - iter.Close() - - if _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx); err != nil { - panic(err) - } - - /* Handle slashing state. */ - - // reset start height on signing infos - app.SlashingKeeper.IterateValidatorSigningInfos( - ctx, - func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { - info.StartHeight = 0 - app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info) - return false - }, - ) -} diff --git a/genesis.go b/genesis.go deleted file mode 100644 index 5bf0c1da..00000000 --- a/genesis.go +++ /dev/null @@ -1,21 +0,0 @@ -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 -// messages key'd by a identifier string. -// The identifier is used to determine which module genesis information belongs -// to so it may be appropriately routed during init chain. -// Within this application default genesis information is retrieved from -// 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/go.mod b/go.mod index 4eb57c88..18acaabc 100644 --- a/go.mod +++ b/go.mod @@ -3,29 +3,28 @@ module github.com/BitCannaGlobal/bcna go 1.16 require ( - github.com/cosmos/cosmos-sdk v0.44.3 - github.com/cosmos/ibc-go v1.2.3 + github.com/99designs/keyring v1.1.6 // indirect + github.com/cosmos/cosmos-sdk v0.44.2 + github.com/cosmos/go-bip39 v1.0.0 // indirect + github.com/cosmos/iavl v0.17.1 // indirect + github.com/cosmos/ibc-go v1.2.0 github.com/gogo/protobuf v1.3.3 + github.com/golang/protobuf v1.5.2 github.com/google/go-cmp v0.5.6 // indirect github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/spf13/cast v1.4.1 + github.com/spf13/cast v1.3.1 github.com/spf13/cobra v1.2.1 github.com/stretchr/testify v1.7.0 - github.com/tendermint/spm v0.1.8 - github.com/tendermint/tendermint v0.34.14 + github.com/tendermint/spm v0.1.5 + github.com/tendermint/tendermint v0.34.13 github.com/tendermint/tm-db v0.6.4 - google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 - google.golang.org/grpc v1.42.0 -) - -require ( - github.com/golang/protobuf v1.5.2 - gopkg.in/yaml.v2 v2.4.0 + google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83 + google.golang.org/grpc v1.40.0 ) replace ( + github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 google.golang.org/grpc => google.golang.org/grpc v1.33.2 ) diff --git a/go.sum b/go.sum index 1747dba8..f4cd2659 100644 --- a/go.sum +++ b/go.sum @@ -45,10 +45,6 @@ contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EU dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-beta.2 h1:/BZRNzm8N4K4eWfK28dL4yescorxtO7YG1yun8fy+pI= filippo.io/edwards25519 v1.0.0-beta.2/go.mod h1:X+pm78QAUPtFLi1z9PYIlS/bdDnvbCOGKtZ+ACWEf7o= -github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= -github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/99designs/keyring v1.1.6 h1:kVDC2uCgVwecxCk+9zoCt2uEL6dt+dfVzMvGgnVcIuM= -github.com/99designs/keyring v1.1.6/go.mod h1:16e0ds7LGQQcT59QqkTg72Hh5ShM51Byv5PEmW6uoRU= github.com/Antonboom/errname v0.1.4/go.mod h1:jRXo3m0E0EuCnK3wbsSVH3X55Z4iTDLl6ZfCxwFj4TM= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= @@ -211,20 +207,26 @@ github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cosmos/cosmos-sdk v0.44.0 h1:eOSjACNtTnThEJ62IsS+pMm3OIU6hgMVqrp4TZClLZo= +github.com/cosmos/cosmos-sdk v0.44.0/go.mod h1:orG0jzFJ2KsDfzLd/X0JSOMzF4Oxc/BQz2GkcYF4gRE= +github.com/cosmos/cosmos-sdk v0.44.1 h1:UspmTMwKNGf6mH8k388v2T5csP9BYpPJkbQ/eG30PtM= +github.com/cosmos/cosmos-sdk v0.44.1/go.mod h1:fwQJdw+aECatpTvQTo1tSfHEsxACdZYU80QCZUPnHr4= +github.com/cosmos/cosmos-sdk v0.44.2 h1:EWoj9h9Q9t7uqS3LyqzZWWwnSEodUJlYDMloDoPBD3Y= github.com/cosmos/cosmos-sdk v0.44.2/go.mod h1:fwQJdw+aECatpTvQTo1tSfHEsxACdZYU80QCZUPnHr4= -github.com/cosmos/cosmos-sdk v0.44.3 h1:F71n1jCqPi4F0wXg8AU4AUdUF8llw0x3D3o6aLt/j2A= -github.com/cosmos/cosmos-sdk v0.44.3/go.mod h1:bA3+VenaR/l/vDiYzaiwbWvRPWHMBX2jG0ygiFtiBp0= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/iavl v0.15.0-rc3.0.20201009144442-230e9bdf52cd/go.mod h1:3xOIaNNX19p0QrX0VqWa6voPRoJRGGYtny+DH8NEPvE= github.com/cosmos/iavl v0.15.0-rc5/go.mod h1:WqoPL9yPTQ85QBMT45OOUzPxG/U/JcJoN7uMjgxke/I= github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mVvSA4= +github.com/cosmos/iavl v0.16.0 h1:ICIOB8xysirTX27GmVAaoeSpeozzgSu9d49w36xkVJA= +github.com/cosmos/iavl v0.16.0/go.mod h1:2A8O/Jz9YwtjqXMO0CjnnbTYEEaovE8jWcwrakH3PoE= github.com/cosmos/iavl v0.17.1 h1:b/Cl8h1PRMvsu24+TYNlKchIu7W6tmxIBGe6E9u2Ybw= github.com/cosmos/iavl v0.17.1/go.mod h1:7aisPZK8yCpQdy3PMvKeO+bhq1NwDjUwjzxwwROUxFk= -github.com/cosmos/ibc-go v1.2.2/go.mod h1:XmYjsRFOs6Q9Cz+CSsX21icNoH27vQKb3squgnCOCbs= -github.com/cosmos/ibc-go v1.2.3 h1:+Xdhshvls9c6NQNAj7jz5YUtpqCd7AwadEImpaeVReo= -github.com/cosmos/ibc-go v1.2.3/go.mod h1:TNJMo+fPU4GmpAGxqedjuA1l6izRLGPvuIRLpWAbXuE= +github.com/cosmos/ibc-go v1.2.0 h1:0RgxmKzCzIH9SwDp4ckL5VrzlO1KJ5hO0AsOAzOiWE4= +github.com/cosmos/ibc-go v1.2.0/go.mod h1:wGjeNd+T4kpGrt0OC8DTiE/qXLrlmTPNpdoYsBZUjKI= +github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= +github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= @@ -306,9 +308,8 @@ github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVB github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= -github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/fullstorydev/grpcurl v1.6.0/go.mod h1:ZQ+ayqbKMJNhzLmbpCiurTVlaK2M/3nqZCxaQ2Ze/sM= github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASxc7x3E= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= @@ -407,9 +408,8 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3 h1:ur2rms48b3Ep1dxh7aUV2FZEQ8jEVO2F6ILKx8ofkAg= github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8= @@ -470,6 +470,7 @@ github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gookit/color v1.4.2/go.mod h1:fqRyamkC1W8uxl+lxCQxOT09l/vYfZ+QeiX3rKQHCoQ= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gordonklaus/ineffassign v0.0.0-20210225214923-2e10b2664254/go.mod h1:M9mZEtGIsR1oDaZagNPNG9iq9n2HrhZ17dsXk73V3Lw= @@ -563,6 +564,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.4/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/improbable-eng/grpc-web v0.14.0 h1:GdoK+cXABdB+1keuqsV1drSFO2XLYIxqt/4Rj8SWGBk= +github.com/improbable-eng/grpc-web v0.14.0/go.mod h1:6hRR09jOEG81ADP5wCQju1z71g6OL4eEvELdran/3cs= github.com/improbable-eng/grpc-web v0.14.1 h1:NrN4PY71A6tAz2sKDvC5JCauENWp0ykG8Oq1H3cpFvw= github.com/improbable-eng/grpc-web v0.14.1/go.mod h1:zEjGHa8DAlkoOXmswrNvhUGEYQA9UI7DhrGeHR1DMGU= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= @@ -575,7 +578,8 @@ github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jhump/protoreflect v1.6.1/go.mod h1:RZQ/lnuN+zqeRVpQigTwO6o0AJUkxbnSnpuG7toUTG4= -github.com/jhump/protoreflect v1.9.0 h1:npqHz788dryJiR/l6K/RUQAyh2SwV91+d1dnh4RjO9w= +github.com/jhump/protoreflect v1.8.2 h1:k2xE7wcUomeqwY0LDCYA16y4WWfyTcMx5mKhk0d4ua0= +github.com/jhump/protoreflect v1.8.2/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= github.com/jhump/protoreflect v1.9.0/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= github.com/jingyugao/rowserrcheck v1.1.0/go.mod h1:TOQpc2SLx6huPfoFGK3UOnEG+u02D3C1GeosjupAKCA= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= @@ -598,6 +602,7 @@ github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMW github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= @@ -606,11 +611,14 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/julz/importas v0.0.0-20210419104244-841f0c0fe66d/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= +github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/errcheck v1.6.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/kkdai/bstream v1.0.0/go.mod h1:FDnDOHt5Yx4p3FaHcioFT0QjDOtgUpvjeZqAs+NVZZA= +github.com/klauspost/compress v1.10.3 h1:OP96hzwJVBIHYU52pVTI6CczrxPvrGfgqF9N5eTO0Q8= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= @@ -638,10 +646,10 @@ github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/letsencrypt/pkcs11key/v4 v4.0.0/go.mod h1:EFUvBDay26dErnNb70Nd0/VW3tJiIbETBPTl9ATXQag= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= @@ -668,6 +676,8 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA= +github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -693,7 +703,6 @@ github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLT github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= @@ -702,9 +711,8 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo= -github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= @@ -745,8 +753,8 @@ github.com/nishanths/exhaustive v0.2.3/go.mod h1:bhIX678Nx8inLM9PbpvK1yv6oGtoP8B github.com/nishanths/predeclared v0.0.0-20190419143655-18a43bb90ffc/go.mod h1:62PewwiQTlm/7Rj+cxVYqZvDIUc+JjZq6GHAC1fsObQ= github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= github.com/nishanths/predeclared v0.2.1/go.mod h1:HvkGJcA3naj4lOwnFXFDkFxVtSqQMB9sbB1usJ+xjQE= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= @@ -760,15 +768,15 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/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 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -804,9 +812,8 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= -github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= @@ -926,7 +933,9 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -940,13 +949,14 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= -github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= +github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -960,6 +970,8 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.8.0 h1:QRwDgoG8xX+kp69di68D+YYTCWfYEckbZRfUlEIAal0= +github.com/spf13/viper v1.8.0/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/ssgreg/nlreturn/v2 v2.1.0/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= @@ -996,14 +1008,15 @@ github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RM github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= 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/tendermint/spm v0.1.8 h1:ya0o4Um6Hht2LC1X/y0+9Rz0Q8DyUhRIIXR9vgDUTGA= -github.com/tendermint/spm v0.1.8/go.mod h1:iHgfQ5YOI6ONc9E7ugGQolVdfSMHpeXfZ/OpXuN/42Q= +github.com/tendermint/spm v0.1.5 h1:/MkM8SOsHBkX1kbo74a2WNmrViLaEem/OzBHI5v6l1c= +github.com/tendermint/spm v0.1.5/go.mod h1:+rHrI1axfSX1R0DY6KA4IbrHPgJ0WVNJKhey71ulXO8= github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg= github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ= +github.com/tendermint/tendermint v0.34.10/go.mod h1:aeHL7alPh4uTBIJQ8mgFEE8VwJLXI1VD3rVOmH2Mcy0= +github.com/tendermint/tendermint v0.34.12/go.mod h1:aeHL7alPh4uTBIJQ8mgFEE8VwJLXI1VD3rVOmH2Mcy0= +github.com/tendermint/tendermint v0.34.13 h1:fu+tsHudbOr5PvepjH0q47Jae59hQAvn3IqAHv2EbC8= github.com/tendermint/tendermint v0.34.13/go.mod h1:6RVVRBqwtKhA+H59APKumO+B7Nye4QXSFc6+TYxAxCI= -github.com/tendermint/tendermint v0.34.14 h1:GCXmlS8Bqd2Ix3TQCpwYLUNHe+Y+QyJsm5YE+S/FkPo= -github.com/tendermint/tendermint v0.34.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0= github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8= github.com/tendermint/tm-db v0.6.4 h1:3N2jlnYQkXNQclQwd/eKV/NzlqPlfK21cpRRIx80XXQ= @@ -1115,10 +1128,10 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1315,7 +1328,6 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210903071746-97244b99971b h1:3Dq0eVHn0uaQJmPO+/aYPI/fRMqdrVDbu7MQcku54gg= @@ -1524,8 +1536,8 @@ google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1 h1:b9mVrqYfq3P4bCdaLg1qtBnPzUYgglsIdjZkL/fQVOE= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83 h1:3V2dxSZpz4zozWWUq36vUxXEKnSYitEH2LdsAx+RUmg= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -1556,9 +1568,8 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.63.2 h1:tGK/CyBg7SMzb60vP1M03vNZ3VDu3wGQJwn7Sxi9r3c= -gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= diff --git a/proto/bcna/bitcannaid.proto b/proto/bcna/bitcannaid.proto index 041f4a6c..1a886a30 100644 --- a/proto/bcna/bitcannaid.proto +++ b/proto/bcna/bitcannaid.proto @@ -3,6 +3,9 @@ package BitCannaGlobal.bcna.bcna; option go_package = "github.com/BitCannaGlobal/bcna/x/bcna/types"; +import "gogoproto/gogo.proto"; + + message Bitcannaid { uint64 id = 1; string bcnaid = 2; diff --git a/proto/bcna/genesis.proto b/proto/bcna/genesis.proto index 3951d025..70b47c34 100644 --- a/proto/bcna/genesis.proto +++ b/proto/bcna/genesis.proto @@ -1,20 +1,18 @@ syntax = "proto3"; package BitCannaGlobal.bcna.bcna; -import "gogoproto/gogo.proto"; -import "bcna/params.proto"; import "bcna/bitcannaid.proto"; import "bcna/supplychain.proto"; // this line is used by starport scaffolding # genesis/proto/import +import "gogoproto/gogo.proto"; option go_package = "github.com/BitCannaGlobal/bcna/x/bcna/types"; // GenesisState defines the bcna module's genesis state. message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; - repeated Bitcannaid bitcannaidList = 2 [(gogoproto.nullable) = false]; - uint64 bitcannaidCount = 3; - repeated Supplychain supplychainList = 4 [(gogoproto.nullable) = false]; - uint64 supplychainCount = 5; + repeated Bitcannaid bitcannaidList = 1 [(gogoproto.nullable) = false]; + uint64 bitcannaidCount = 2; + repeated Supplychain supplychainList = 3 [(gogoproto.nullable) = false]; + uint64 supplychainCount = 4; // this line is used by starport scaffolding # genesis/proto/state } diff --git a/proto/bcna/params.proto b/proto/bcna/params.proto deleted file mode 100644 index ebf01281..00000000 --- a/proto/bcna/params.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -package BitCannaGlobal.bcna.bcna; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/BitCannaGlobal/bcna/x/bcna/types"; - -// Params defines the parameters for the module. -message Params { - option (gogoproto.goproto_stringer) = false; - -} \ No newline at end of file diff --git a/proto/bcna/query.proto b/proto/bcna/query.proto index d37cec2d..705ade10 100644 --- a/proto/bcna/query.proto +++ b/proto/bcna/query.proto @@ -1,23 +1,18 @@ syntax = "proto3"; package BitCannaGlobal.bcna.bcna; -import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; -import "bcna/params.proto"; import "bcna/bitcannaid.proto"; import "bcna/supplychain.proto"; // this line is used by starport scaffolding # 1 +import "gogoproto/gogo.proto"; option go_package = "github.com/BitCannaGlobal/bcna/x/bcna/types"; // Query defines the gRPC querier service. service Query { - // Parameters queries the parameters of the module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/BitCannaGlobal/bcna/bcna/params"; - } - // Queries a bitcannaid by id. + // Queries a bitcannaid by id. rpc Bitcannaid(QueryGetBitcannaidRequest) returns (QueryGetBitcannaidResponse) { option (google.api.http).get = "/BitCannaGlobal/bcna/bcna/bitcannaid/{id}"; } @@ -40,15 +35,6 @@ service Query { // this line is used by starport scaffolding # 2 } -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; -} - message QueryGetBitcannaidRequest { uint64 id = 1; } diff --git a/proto/bcna/supplychain.proto b/proto/bcna/supplychain.proto index f5a0bb22..9b90f1a9 100644 --- a/proto/bcna/supplychain.proto +++ b/proto/bcna/supplychain.proto @@ -3,6 +3,9 @@ package BitCannaGlobal.bcna.bcna; option go_package = "github.com/BitCannaGlobal/bcna/x/bcna/types"; +import "gogoproto/gogo.proto"; + + message Supplychain { uint64 id = 1; string product = 2; diff --git a/simulation_test.go b/simulation_test.go deleted file mode 100644 index 7d0184d7..00000000 --- a/simulation_test.go +++ /dev/null @@ -1,112 +0,0 @@ -package app_test - -import ( - "os" - "testing" - "time" - - "github.com/BitCannaGlobal/bcna/app" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simulationtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/stretchr/testify/require" - "github.com/tendermint/spm/cosmoscmd" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtypes "github.com/tendermint/tendermint/types" -) - -func init() { - simapp.GetSimulatorFlags() -} - -type SimApp interface { - cosmoscmd.App - GetBaseApp() *baseapp.BaseApp - AppCodec() codec.Codec - SimulationManager() *module.SimulationManager - ModuleAccountAddrs() map[string]bool - Name() string - LegacyAmino() *codec.LegacyAmino - BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock - EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock - InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain -} - -var defaultConsensusParams = &abci.ConsensusParams{ - Block: &abci.BlockParams{ - MaxBytes: 200000, - MaxGas: 2000000, - }, - Evidence: &tmproto.EvidenceParams{ - MaxAgeNumBlocks: 302400, - MaxAgeDuration: 504 * time.Hour, // 3 weeks is the max duration - MaxBytes: 10000, - }, - Validator: &tmproto.ValidatorParams{ - PubKeyTypes: []string{ - tmtypes.ABCIPubKeyTypeEd25519, - }, - }, -} - -// go test -benchmem -run=^$ -bench ^BenchmarkSimulation -Commit=true -cpuprofile cpu.out -func BenchmarkSimulation(b *testing.B) { - simapp.FlagEnabledValue = true - simapp.FlagNumBlocksValue = 200 - simapp.FlagBlockSizeValue = 50 - simapp.FlagCommitValue = true - simapp.FlagVerboseValue = true - - config, db, dir, logger, _, err := simapp.SetupSimulation("goleveldb-app-sim", "Simulation") - require.NoError(b, err, "simulation setup failed") - - b.Cleanup(func() { - db.Close() - err = os.RemoveAll(dir) - require.NoError(b, err) - }) - - encoding := cosmoscmd.MakeEncodingConfig(app.ModuleBasics) - - app := app.New( - logger, - db, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - 0, - encoding, - simapp.EmptyAppOptions{}, - ) - - simApp, ok := app.(SimApp) - require.True(b, ok, "can't use simapp") - - // Run randomized simulations - _, simParams, simErr := simulation.SimulateFromSeed( - b, - os.Stdout, - simApp.GetBaseApp(), - simapp.AppStateFn(simApp.AppCodec(), simApp.SimulationManager()), - simulationtypes.RandomAccounts, - simapp.SimulationOperations(simApp, simApp.AppCodec(), config), - simApp.ModuleAccountAddrs(), - config, - simApp.AppCodec(), - ) - - // export state and simParams before the simulation error is checked - err = simapp.CheckExportSimulation(simApp, config, simParams) - require.NoError(b, err) - require.NoError(b, simErr) - - if config.Commit { - simapp.PrintStats(db) - } -} diff --git a/testutil/keeper/bcna.go b/testutil/keeper/bcna.go index 39893414..2b9a87f1 100644 --- a/testutil/keeper/bcna.go +++ b/testutil/keeper/bcna.go @@ -10,7 +10,6 @@ import ( "github.com/cosmos/cosmos-sdk/store" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - typesparams "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/libs/log" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -28,25 +27,12 @@ func BcnaKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { require.NoError(t, stateStore.LoadLatestVersion()) registry := codectypes.NewInterfaceRegistry() - cdc := codec.NewProtoCodec(registry) - - paramsSubspace := typesparams.NewSubspace(cdc, - types.Amino, - storeKey, - memStoreKey, - "BcnaParams", - ) k := keeper.NewKeeper( - cdc, + codec.NewProtoCodec(registry), storeKey, memStoreKey, - paramsSubspace, ) ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) - - // Initialize params - k.SetParams(ctx, types.DefaultParams()) - return k, ctx } diff --git a/testutil/nullify/nullify.go b/testutil/nullify/nullify.go deleted file mode 100644 index 3b968c09..00000000 --- a/testutil/nullify/nullify.go +++ /dev/null @@ -1,57 +0,0 @@ -// Package nullify provides methods to init nil values structs for test assertion. -package nullify - -import ( - "reflect" - "unsafe" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var ( - coinType = reflect.TypeOf(sdk.Coin{}) - coinsType = reflect.TypeOf(sdk.Coins{}) -) - -// Fill analyze all struct fields and slices with -// reflection and initialize the nil and empty slices, -// structs, and pointers. -func Fill(x interface{}) interface{} { - v := reflect.Indirect(reflect.ValueOf(x)) - switch v.Kind() { - case reflect.Slice: - for i := 0; i < v.Len(); i++ { - obj := v.Index(i) - objPt := reflect.NewAt(obj.Type(), unsafe.Pointer(obj.UnsafeAddr())).Interface() - objPt = Fill(objPt) - obj.Set(reflect.ValueOf(objPt)) - } - case reflect.Struct: - for i := 0; i < v.NumField(); i++ { - f := reflect.Indirect(v.Field(i)) - if !f.CanSet() { - continue - } - switch f.Kind() { - case reflect.Slice: - f.Set(reflect.MakeSlice(f.Type(), 0, 0)) - case reflect.Struct: - switch f.Type() { - case coinType: - coin := reflect.New(coinType).Interface() - s := reflect.ValueOf(coin).Elem() - f.Set(s) - case coinsType: - coins := reflect.New(coinsType).Interface() - s := reflect.ValueOf(coins).Elem() - f.Set(s) - default: - objPt := reflect.NewAt(f.Type(), unsafe.Pointer(f.UnsafeAddr())).Interface() - s := Fill(objPt) - f.Set(reflect.ValueOf(s)) - } - } - } - } - return reflect.Indirect(v).Interface() -} diff --git a/x/bcna/client/cli/query.go b/x/bcna/client/cli/query.go index ab9044c3..49972139 100644 --- a/x/bcna/client/cli/query.go +++ b/x/bcna/client/cli/query.go @@ -24,7 +24,6 @@ func GetQueryCmd(queryRoute string) *cobra.Command { RunE: client.ValidateCmd, } - cmd.AddCommand(CmdQueryParams()) cmd.AddCommand(CmdListBitcannaid()) cmd.AddCommand(CmdShowBitcannaid()) cmd.AddCommand(CmdListSupplychain()) diff --git a/x/bcna/client/cli/query_bitcannaid_test.go b/x/bcna/client/cli/query_bitcannaid_test.go index 4f191ad9..64aee8bd 100644 --- a/x/bcna/client/cli/query_bitcannaid_test.go +++ b/x/bcna/client/cli/query_bitcannaid_test.go @@ -12,7 +12,6 @@ import ( "google.golang.org/grpc/status" "github.com/BitCannaGlobal/bcna/testutil/network" - "github.com/BitCannaGlobal/bcna/testutil/nullify" "github.com/BitCannaGlobal/bcna/x/bcna/client/cli" "github.com/BitCannaGlobal/bcna/x/bcna/types" ) @@ -24,11 +23,9 @@ func networkWithBitcannaidObjects(t *testing.T, n int) (*network.Network, []type require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) for i := 0; i < n; i++ { - bitcannaid := types.Bitcannaid{ + state.BitcannaidList = append(state.BitcannaidList, types.Bitcannaid{ Id: uint64(i), - } - nullify.Fill(&bitcannaid) - state.BitcannaidList = append(state.BitcannaidList, bitcannaid) + }) } buf, err := cfg.Codec.MarshalJSON(&state) require.NoError(t, err) @@ -77,10 +74,7 @@ func TestShowBitcannaid(t *testing.T) { var resp types.QueryGetBitcannaidResponse require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) require.NotNil(t, resp.Bitcannaid) - require.Equal(t, - nullify.Fill(&tc.obj), - nullify.Fill(&resp.Bitcannaid), - ) + require.Equal(t, tc.obj, resp.Bitcannaid) } }) } @@ -114,10 +108,7 @@ func TestListBitcannaid(t *testing.T) { var resp types.QueryAllBitcannaidResponse require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) require.LessOrEqual(t, len(resp.Bitcannaid), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.Bitcannaid), - ) + require.Subset(t, objs, resp.Bitcannaid) } }) t.Run("ByKey", func(t *testing.T) { @@ -130,10 +121,7 @@ func TestListBitcannaid(t *testing.T) { var resp types.QueryAllBitcannaidResponse require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) require.LessOrEqual(t, len(resp.Bitcannaid), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.Bitcannaid), - ) + require.Subset(t, objs, resp.Bitcannaid) next = resp.Pagination.NextKey } }) @@ -145,9 +133,6 @@ func TestListBitcannaid(t *testing.T) { require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) require.NoError(t, err) require.Equal(t, len(objs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(objs), - nullify.Fill(resp.Bitcannaid), - ) + require.Equal(t, objs, resp.Bitcannaid) }) } diff --git a/x/bcna/client/cli/query_params.go b/x/bcna/client/cli/query_params.go deleted file mode 100644 index fcad42c0..00000000 --- a/x/bcna/client/cli/query_params.go +++ /dev/null @@ -1,34 +0,0 @@ -package cli - -import ( - "context" - - "github.com/BitCannaGlobal/bcna/x/bcna/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" -) - -func CmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "shows the parameters of the module", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/bcna/client/cli/query_supplychain_test.go b/x/bcna/client/cli/query_supplychain_test.go index 52717c24..02a6e252 100644 --- a/x/bcna/client/cli/query_supplychain_test.go +++ b/x/bcna/client/cli/query_supplychain_test.go @@ -12,7 +12,6 @@ import ( "google.golang.org/grpc/status" "github.com/BitCannaGlobal/bcna/testutil/network" - "github.com/BitCannaGlobal/bcna/testutil/nullify" "github.com/BitCannaGlobal/bcna/x/bcna/client/cli" "github.com/BitCannaGlobal/bcna/x/bcna/types" ) @@ -24,11 +23,9 @@ func networkWithSupplychainObjects(t *testing.T, n int) (*network.Network, []typ require.NoError(t, cfg.Codec.UnmarshalJSON(cfg.GenesisState[types.ModuleName], &state)) for i := 0; i < n; i++ { - supplychain := types.Supplychain{ + state.SupplychainList = append(state.SupplychainList, types.Supplychain{ Id: uint64(i), - } - nullify.Fill(&supplychain) - state.SupplychainList = append(state.SupplychainList, supplychain) + }) } buf, err := cfg.Codec.MarshalJSON(&state) require.NoError(t, err) @@ -77,10 +74,7 @@ func TestShowSupplychain(t *testing.T) { var resp types.QueryGetSupplychainResponse require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) require.NotNil(t, resp.Supplychain) - require.Equal(t, - nullify.Fill(&tc.obj), - nullify.Fill(&resp.Supplychain), - ) + require.Equal(t, tc.obj, resp.Supplychain) } }) } @@ -114,10 +108,7 @@ func TestListSupplychain(t *testing.T) { var resp types.QueryAllSupplychainResponse require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) require.LessOrEqual(t, len(resp.Supplychain), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.Supplychain), - ) + require.Subset(t, objs, resp.Supplychain) } }) t.Run("ByKey", func(t *testing.T) { @@ -130,10 +121,7 @@ func TestListSupplychain(t *testing.T) { var resp types.QueryAllSupplychainResponse require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) require.LessOrEqual(t, len(resp.Supplychain), step) - require.Subset(t, - nullify.Fill(objs), - nullify.Fill(resp.Supplychain), - ) + require.Subset(t, objs, resp.Supplychain) next = resp.Pagination.NextKey } }) @@ -145,9 +133,6 @@ func TestListSupplychain(t *testing.T) { require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) require.NoError(t, err) require.Equal(t, len(objs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(objs), - nullify.Fill(resp.Supplychain), - ) + require.Equal(t, objs, resp.Supplychain) }) } diff --git a/x/bcna/client/cli/tx.go b/x/bcna/client/cli/tx.go index 8fe02127..63f7e628 100644 --- a/x/bcna/client/cli/tx.go +++ b/x/bcna/client/cli/tx.go @@ -17,7 +17,6 @@ var ( const ( flagPacketTimeoutTimestamp = "packet-timeout-timestamp" - listSeparator = "," ) // GetTxCmd returns the transaction commands for this module diff --git a/x/bcna/client/cli/tx_bitcannaid.go b/x/bcna/client/cli/tx_bitcannaid.go index 3132e460..632fa90f 100644 --- a/x/bcna/client/cli/tx_bitcannaid.go +++ b/x/bcna/client/cli/tx_bitcannaid.go @@ -3,11 +3,12 @@ package cli import ( "strconv" + "github.com/spf13/cobra" + "github.com/BitCannaGlobal/bcna/x/bcna/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/spf13/cobra" ) func CmdCreateBitcannaid() *cobra.Command { diff --git a/x/bcna/client/cli/tx_bitcannaid_test.go b/x/bcna/client/cli/tx_bitcannaid_test.go index 89749d31..47fd7056 100644 --- a/x/bcna/client/cli/tx_bitcannaid_test.go +++ b/x/bcna/client/cli/tx_bitcannaid_test.go @@ -47,7 +47,7 @@ func TestCreateBitcannaid(t *testing.T) { } else { require.NoError(t, err) var resp sdk.TxResponse - require.NoError(t, ctx.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &resp)) require.Equal(t, tc.code, resp.Code) } }) @@ -103,7 +103,7 @@ func TestUpdateBitcannaid(t *testing.T) { } else { require.NoError(t, err) var resp sdk.TxResponse - require.NoError(t, ctx.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &resp)) require.Equal(t, tc.code, resp.Code) } }) @@ -156,7 +156,7 @@ func TestDeleteBitcannaid(t *testing.T) { } else { require.NoError(t, err) var resp sdk.TxResponse - require.NoError(t, ctx.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &resp)) require.Equal(t, tc.code, resp.Code) } }) diff --git a/x/bcna/client/cli/tx_supplychain.go b/x/bcna/client/cli/tx_supplychain.go index 28de62dd..d8c8f35c 100644 --- a/x/bcna/client/cli/tx_supplychain.go +++ b/x/bcna/client/cli/tx_supplychain.go @@ -3,11 +3,12 @@ package cli import ( "strconv" + "github.com/spf13/cobra" + "github.com/BitCannaGlobal/bcna/x/bcna/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/spf13/cobra" ) func CmdCreateSupplychain() *cobra.Command { diff --git a/x/bcna/client/cli/tx_supplychain_test.go b/x/bcna/client/cli/tx_supplychain_test.go index 4ce1527f..6f5e9c00 100644 --- a/x/bcna/client/cli/tx_supplychain_test.go +++ b/x/bcna/client/cli/tx_supplychain_test.go @@ -47,7 +47,7 @@ func TestCreateSupplychain(t *testing.T) { } else { require.NoError(t, err) var resp sdk.TxResponse - require.NoError(t, ctx.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &resp)) require.Equal(t, tc.code, resp.Code) } }) @@ -103,7 +103,7 @@ func TestUpdateSupplychain(t *testing.T) { } else { require.NoError(t, err) var resp sdk.TxResponse - require.NoError(t, ctx.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &resp)) require.Equal(t, tc.code, resp.Code) } }) @@ -156,7 +156,7 @@ func TestDeleteSupplychain(t *testing.T) { } else { require.NoError(t, err) var resp sdk.TxResponse - require.NoError(t, ctx.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, ctx.JSONCodec.UnmarshalJSON(out.Bytes(), &resp)) require.Equal(t, tc.code, resp.Code) } }) diff --git a/x/bcna/genesis.go b/x/bcna/genesis.go index 06bf0bdc..b8aef728 100644 --- a/x/bcna/genesis.go +++ b/x/bcna/genesis.go @@ -24,13 +24,11 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) // Set supplychain count k.SetSupplychainCount(ctx, genState.SupplychainCount) // this line is used by starport scaffolding # genesis/module/init - k.SetParams(ctx, genState.Params) } // ExportGenesis returns the capability module's exported genesis. func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() - genesis.Params = k.GetParams(ctx) genesis.BitcannaidList = k.GetAllBitcannaid(ctx) genesis.BitcannaidCount = k.GetBitcannaidCount(ctx) diff --git a/x/bcna/genesis_test.go b/x/bcna/genesis_test.go index 0c24b4a3..da992c92 100644 --- a/x/bcna/genesis_test.go +++ b/x/bcna/genesis_test.go @@ -4,7 +4,6 @@ import ( "testing" keepertest "github.com/BitCannaGlobal/bcna/testutil/keeper" - "github.com/BitCannaGlobal/bcna/testutil/nullify" "github.com/BitCannaGlobal/bcna/x/bcna" "github.com/BitCannaGlobal/bcna/x/bcna/types" "github.com/stretchr/testify/require" @@ -12,8 +11,6 @@ import ( func TestGenesis(t *testing.T) { genesisState := types.GenesisState{ - Params: types.DefaultParams(), - BitcannaidList: []types.Bitcannaid{ { Id: 0, @@ -40,12 +37,11 @@ func TestGenesis(t *testing.T) { got := bcna.ExportGenesis(ctx, *k) require.NotNil(t, got) - nullify.Fill(&genesisState) - nullify.Fill(got) - - require.ElementsMatch(t, genesisState.BitcannaidList, got.BitcannaidList) + require.Len(t, got.BitcannaidList, len(genesisState.BitcannaidList)) + require.Subset(t, genesisState.BitcannaidList, got.BitcannaidList) require.Equal(t, genesisState.BitcannaidCount, got.BitcannaidCount) - require.ElementsMatch(t, genesisState.SupplychainList, got.SupplychainList) + require.Len(t, got.SupplychainList, len(genesisState.SupplychainList)) + require.Subset(t, genesisState.SupplychainList, got.SupplychainList) require.Equal(t, genesisState.SupplychainCount, got.SupplychainCount) // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/bcna/keeper/bitcannaid_test.go b/x/bcna/keeper/bitcannaid_test.go index 21c3fff3..aefa5437 100644 --- a/x/bcna/keeper/bitcannaid_test.go +++ b/x/bcna/keeper/bitcannaid_test.go @@ -4,7 +4,6 @@ import ( "testing" keepertest "github.com/BitCannaGlobal/bcna/testutil/keeper" - "github.com/BitCannaGlobal/bcna/testutil/nullify" "github.com/BitCannaGlobal/bcna/x/bcna/keeper" "github.com/BitCannaGlobal/bcna/x/bcna/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -25,10 +24,7 @@ func TestBitcannaidGet(t *testing.T) { for _, item := range items { got, found := keeper.GetBitcannaid(ctx, item.Id) require.True(t, found) - require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&got), - ) + require.Equal(t, item, got) } } @@ -45,10 +41,7 @@ func TestBitcannaidRemove(t *testing.T) { func TestBitcannaidGetAll(t *testing.T) { keeper, ctx := keepertest.BcnaKeeper(t) items := createNBitcannaid(keeper, ctx, 10) - require.ElementsMatch(t, - nullify.Fill(items), - nullify.Fill(keeper.GetAllBitcannaid(ctx)), - ) + require.ElementsMatch(t, items, keeper.GetAllBitcannaid(ctx)) } func TestBitcannaidCount(t *testing.T) { diff --git a/x/bcna/keeper/grpc_query_bitcannaid_test.go b/x/bcna/keeper/grpc_query_bitcannaid_test.go index 944cc067..0446da47 100644 --- a/x/bcna/keeper/grpc_query_bitcannaid_test.go +++ b/x/bcna/keeper/grpc_query_bitcannaid_test.go @@ -11,7 +11,6 @@ import ( "google.golang.org/grpc/status" keepertest "github.com/BitCannaGlobal/bcna/testutil/keeper" - "github.com/BitCannaGlobal/bcna/testutil/nullify" "github.com/BitCannaGlobal/bcna/x/bcna/types" ) @@ -51,10 +50,7 @@ func TestBitcannaidQuerySingle(t *testing.T) { require.ErrorIs(t, err, tc.err) } else { require.NoError(t, err) - require.Equal(t, - nullify.Fill(tc.response), - nullify.Fill(response), - ) + require.Equal(t, tc.response, response) } }) } @@ -81,10 +77,7 @@ func TestBitcannaidQueryPaginated(t *testing.T) { resp, err := keeper.BitcannaidAll(wctx, request(nil, uint64(i), uint64(step), false)) require.NoError(t, err) require.LessOrEqual(t, len(resp.Bitcannaid), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.Bitcannaid), - ) + require.Subset(t, msgs, resp.Bitcannaid) } }) t.Run("ByKey", func(t *testing.T) { @@ -94,10 +87,7 @@ func TestBitcannaidQueryPaginated(t *testing.T) { resp, err := keeper.BitcannaidAll(wctx, request(next, 0, uint64(step), false)) require.NoError(t, err) require.LessOrEqual(t, len(resp.Bitcannaid), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.Bitcannaid), - ) + require.Subset(t, msgs, resp.Bitcannaid) next = resp.Pagination.NextKey } }) @@ -105,10 +95,6 @@ func TestBitcannaidQueryPaginated(t *testing.T) { resp, err := keeper.BitcannaidAll(wctx, request(nil, 0, 0, true)) require.NoError(t, err) require.Equal(t, len(msgs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(msgs), - nullify.Fill(resp.Bitcannaid), - ) }) t.Run("InvalidRequest", func(t *testing.T) { _, err := keeper.BitcannaidAll(wctx, nil) diff --git a/x/bcna/keeper/grpc_query_params.go b/x/bcna/keeper/grpc_query_params.go deleted file mode 100644 index ed80c1f5..00000000 --- a/x/bcna/keeper/grpc_query_params.go +++ /dev/null @@ -1,19 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/BitCannaGlobal/bcna/x/bcna/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(c) - - return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil -} diff --git a/x/bcna/keeper/grpc_query_params_test.go b/x/bcna/keeper/grpc_query_params_test.go deleted file mode 100644 index bea50844..00000000 --- a/x/bcna/keeper/grpc_query_params_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package keeper_test - -import ( - "testing" - - testkeeper "github.com/BitCannaGlobal/bcna/testutil/keeper" - "github.com/BitCannaGlobal/bcna/x/bcna/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" -) - -func TestParamsQuery(t *testing.T) { - keeper, ctx := testkeeper.BcnaKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - params := types.DefaultParams() - keeper.SetParams(ctx, params) - - response, err := keeper.Params(wctx, &types.QueryParamsRequest{}) - require.NoError(t, err) - require.Equal(t, &types.QueryParamsResponse{Params: params}, response) -} diff --git a/x/bcna/keeper/grpc_query_supplychain_test.go b/x/bcna/keeper/grpc_query_supplychain_test.go index d8aae55a..f4a8a8f0 100644 --- a/x/bcna/keeper/grpc_query_supplychain_test.go +++ b/x/bcna/keeper/grpc_query_supplychain_test.go @@ -11,7 +11,6 @@ import ( "google.golang.org/grpc/status" keepertest "github.com/BitCannaGlobal/bcna/testutil/keeper" - "github.com/BitCannaGlobal/bcna/testutil/nullify" "github.com/BitCannaGlobal/bcna/x/bcna/types" ) @@ -51,10 +50,7 @@ func TestSupplychainQuerySingle(t *testing.T) { require.ErrorIs(t, err, tc.err) } else { require.NoError(t, err) - require.Equal(t, - nullify.Fill(tc.response), - nullify.Fill(response), - ) + require.Equal(t, tc.response, response) } }) } @@ -81,10 +77,7 @@ func TestSupplychainQueryPaginated(t *testing.T) { resp, err := keeper.SupplychainAll(wctx, request(nil, uint64(i), uint64(step), false)) require.NoError(t, err) require.LessOrEqual(t, len(resp.Supplychain), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.Supplychain), - ) + require.Subset(t, msgs, resp.Supplychain) } }) t.Run("ByKey", func(t *testing.T) { @@ -94,10 +87,7 @@ func TestSupplychainQueryPaginated(t *testing.T) { resp, err := keeper.SupplychainAll(wctx, request(next, 0, uint64(step), false)) require.NoError(t, err) require.LessOrEqual(t, len(resp.Supplychain), step) - require.Subset(t, - nullify.Fill(msgs), - nullify.Fill(resp.Supplychain), - ) + require.Subset(t, msgs, resp.Supplychain) next = resp.Pagination.NextKey } }) @@ -105,10 +95,6 @@ func TestSupplychainQueryPaginated(t *testing.T) { resp, err := keeper.SupplychainAll(wctx, request(nil, 0, 0, true)) require.NoError(t, err) require.Equal(t, len(msgs), int(resp.Pagination.Total)) - require.ElementsMatch(t, - nullify.Fill(msgs), - nullify.Fill(resp.Supplychain), - ) }) t.Run("InvalidRequest", func(t *testing.T) { _, err := keeper.SupplychainAll(wctx, nil) diff --git a/x/bcna/keeper/keeper.go b/x/bcna/keeper/keeper.go index 726a23d8..19a6d0c1 100644 --- a/x/bcna/keeper/keeper.go +++ b/x/bcna/keeper/keeper.go @@ -8,15 +8,13 @@ import ( "github.com/BitCannaGlobal/bcna/x/bcna/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) type ( Keeper struct { - cdc codec.BinaryCodec - storeKey sdk.StoreKey - memKey sdk.StoreKey - paramstore paramtypes.Subspace + cdc codec.BinaryCodec + storeKey sdk.StoreKey + memKey sdk.StoreKey } ) @@ -24,20 +22,12 @@ func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey sdk.StoreKey, - ps paramtypes.Subspace, ) *Keeper { - // set KeyTable if it has not already been set - if !ps.HasKeyTable() { - ps = ps.WithKeyTable(types.ParamKeyTable()) - } - return &Keeper{ - - cdc: cdc, - storeKey: storeKey, - memKey: memKey, - paramstore: ps, + cdc: cdc, + storeKey: storeKey, + memKey: memKey, } } diff --git a/x/bcna/keeper/params.go b/x/bcna/keeper/params.go deleted file mode 100644 index d32cac3e..00000000 --- a/x/bcna/keeper/params.go +++ /dev/null @@ -1,16 +0,0 @@ -package keeper - -import ( - "github.com/BitCannaGlobal/bcna/x/bcna/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// GetParams get all parameters as types.Params -func (k Keeper) GetParams(ctx sdk.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) -} diff --git a/x/bcna/keeper/params_test.go b/x/bcna/keeper/params_test.go deleted file mode 100644 index 7fb0a257..00000000 --- a/x/bcna/keeper/params_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package keeper_test - -import ( - "testing" - - testkeeper "github.com/BitCannaGlobal/bcna/testutil/keeper" - "github.com/BitCannaGlobal/bcna/x/bcna/types" - "github.com/stretchr/testify/require" -) - -func TestGetParams(t *testing.T) { - k, ctx := testkeeper.BcnaKeeper(t) - params := types.DefaultParams() - - k.SetParams(ctx, params) - - require.EqualValues(t, params, k.GetParams(ctx)) -} diff --git a/x/bcna/keeper/supplychain_test.go b/x/bcna/keeper/supplychain_test.go index 7cd68c52..9fb00498 100644 --- a/x/bcna/keeper/supplychain_test.go +++ b/x/bcna/keeper/supplychain_test.go @@ -4,7 +4,6 @@ import ( "testing" keepertest "github.com/BitCannaGlobal/bcna/testutil/keeper" - "github.com/BitCannaGlobal/bcna/testutil/nullify" "github.com/BitCannaGlobal/bcna/x/bcna/keeper" "github.com/BitCannaGlobal/bcna/x/bcna/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -25,10 +24,7 @@ func TestSupplychainGet(t *testing.T) { for _, item := range items { got, found := keeper.GetSupplychain(ctx, item.Id) require.True(t, found) - require.Equal(t, - nullify.Fill(&item), - nullify.Fill(&got), - ) + require.Equal(t, item, got) } } @@ -45,10 +41,7 @@ func TestSupplychainRemove(t *testing.T) { func TestSupplychainGetAll(t *testing.T) { keeper, ctx := keepertest.BcnaKeeper(t) items := createNSupplychain(keeper, ctx, 10) - require.ElementsMatch(t, - nullify.Fill(items), - nullify.Fill(keeper.GetAllSupplychain(ctx)), - ) + require.ElementsMatch(t, items, keeper.GetAllSupplychain(ctx)) } func TestSupplychainCount(t *testing.T) { diff --git a/x/bcna/module.go b/x/bcna/module.go index ca71f87c..4ebedfe4 100644 --- a/x/bcna/module.go +++ b/x/bcna/module.go @@ -98,22 +98,13 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command { type AppModule struct { AppModuleBasic - keeper keeper.Keeper - accountKeeper types.AccountKeeper - bankKeeper types.BankKeeper + keeper keeper.Keeper } -func NewAppModule( - cdc codec.Codec, - keeper keeper.Keeper, - accountKeeper types.AccountKeeper, - bankKeeper types.BankKeeper, -) AppModule { +func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule { return AppModule{ AppModuleBasic: NewAppModuleBasic(cdc), keeper: keeper, - accountKeeper: accountKeeper, - bankKeeper: bankKeeper, } } diff --git a/x/bcna/module_simulation.go b/x/bcna/module_simulation.go deleted file mode 100644 index f4fb6840..00000000 --- a/x/bcna/module_simulation.go +++ /dev/null @@ -1,175 +0,0 @@ -package bcna - -import ( - "math/rand" - - "github.com/BitCannaGlobal/bcna/testutil/sample" - bcnasimulation "github.com/BitCannaGlobal/bcna/x/bcna/simulation" - "github.com/BitCannaGlobal/bcna/x/bcna/types" - "github.com/cosmos/cosmos-sdk/baseapp" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" -) - -// avoid unused import issue -var ( - _ = sample.AccAddress - _ = bcnasimulation.FindAccount - _ = simappparams.StakePerAccount - _ = simulation.MsgEntryKind - _ = baseapp.Paramspace -) - -const ( - opWeightMsgCreateBitcannaid = "op_weight_msg_create_chain" - // TODO: Determine the simulation weight value - defaultWeightMsgCreateBitcannaid int = 100 - - opWeightMsgUpdateBitcannaid = "op_weight_msg_create_chain" - // TODO: Determine the simulation weight value - defaultWeightMsgUpdateBitcannaid int = 100 - - opWeightMsgDeleteBitcannaid = "op_weight_msg_create_chain" - // TODO: Determine the simulation weight value - defaultWeightMsgDeleteBitcannaid int = 100 - - opWeightMsgCreateSupplychain = "op_weight_msg_create_chain" - // TODO: Determine the simulation weight value - defaultWeightMsgCreateSupplychain int = 100 - - opWeightMsgUpdateSupplychain = "op_weight_msg_create_chain" - // TODO: Determine the simulation weight value - defaultWeightMsgUpdateSupplychain int = 100 - - opWeightMsgDeleteSupplychain = "op_weight_msg_create_chain" - // TODO: Determine the simulation weight value - defaultWeightMsgDeleteSupplychain int = 100 - - // this line is used by starport scaffolding # simapp/module/const -) - -// GenerateGenesisState creates a randomized GenState of the module -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - accs := make([]string, len(simState.Accounts)) - for i, acc := range simState.Accounts { - accs[i] = acc.Address.String() - } - bcnaGenesis := types.GenesisState{ - BitcannaidList: []types.Bitcannaid{ - { - Id: 0, - Creator: sample.AccAddress(), - }, - { - Id: 1, - Creator: sample.AccAddress(), - }, - }, - BitcannaidCount: 2, - SupplychainList: []types.Supplychain{ - { - Id: 0, - Creator: sample.AccAddress(), - }, - { - Id: 1, - Creator: sample.AccAddress(), - }, - }, - SupplychainCount: 2, - // this line is used by starport scaffolding # simapp/module/genesisState - } - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&bcnaGenesis) -} - -// ProposalContents doesn't return any content functions for governance proposals -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - -// RandomizedParams creates randomized param changes for the simulator -func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { - - return []simtypes.ParamChange{} -} - -// RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - -// WeightedOperations returns the all the gov module operations with their respective weights. -func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { - operations := make([]simtypes.WeightedOperation, 0) - - var weightMsgCreateBitcannaid int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgCreateBitcannaid, &weightMsgCreateBitcannaid, nil, - func(_ *rand.Rand) { - weightMsgCreateBitcannaid = defaultWeightMsgCreateBitcannaid - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgCreateBitcannaid, - bcnasimulation.SimulateMsgCreateBitcannaid(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgUpdateBitcannaid int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUpdateBitcannaid, &weightMsgUpdateBitcannaid, nil, - func(_ *rand.Rand) { - weightMsgUpdateBitcannaid = defaultWeightMsgUpdateBitcannaid - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgUpdateBitcannaid, - bcnasimulation.SimulateMsgUpdateBitcannaid(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgDeleteBitcannaid int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgDeleteBitcannaid, &weightMsgDeleteBitcannaid, nil, - func(_ *rand.Rand) { - weightMsgDeleteBitcannaid = defaultWeightMsgDeleteBitcannaid - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgDeleteBitcannaid, - bcnasimulation.SimulateMsgDeleteBitcannaid(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgCreateSupplychain int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgCreateSupplychain, &weightMsgCreateSupplychain, nil, - func(_ *rand.Rand) { - weightMsgCreateSupplychain = defaultWeightMsgCreateSupplychain - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgCreateSupplychain, - bcnasimulation.SimulateMsgCreateSupplychain(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgUpdateSupplychain int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUpdateSupplychain, &weightMsgUpdateSupplychain, nil, - func(_ *rand.Rand) { - weightMsgUpdateSupplychain = defaultWeightMsgUpdateSupplychain - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgUpdateSupplychain, - bcnasimulation.SimulateMsgUpdateSupplychain(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgDeleteSupplychain int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgDeleteSupplychain, &weightMsgDeleteSupplychain, nil, - func(_ *rand.Rand) { - weightMsgDeleteSupplychain = defaultWeightMsgDeleteSupplychain - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgDeleteSupplychain, - bcnasimulation.SimulateMsgDeleteSupplychain(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - // this line is used by starport scaffolding # simapp/module/operation - - return operations -} diff --git a/x/bcna/simulation/bitcannaid.go b/x/bcna/simulation/bitcannaid.go deleted file mode 100644 index 073f4fcf..00000000 --- a/x/bcna/simulation/bitcannaid.go +++ /dev/null @@ -1,134 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/BitCannaGlobal/bcna/x/bcna/keeper" - "github.com/BitCannaGlobal/bcna/x/bcna/types" - "github.com/cosmos/cosmos-sdk/baseapp" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" -) - -func SimulateMsgCreateBitcannaid( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - - msg := &types.MsgCreateBitcannaid{ - Creator: simAccount.Address.String(), - } - - txCtx := simulation.OperationInput{ - R: r, - App: app, - TxGen: simappparams.MakeTestEncodingConfig().TxConfig, - Cdc: nil, - Msg: msg, - MsgType: msg.Type(), - Context: ctx, - SimAccount: simAccount, - ModuleName: types.ModuleName, - CoinsSpentInMsg: sdk.NewCoins(), - AccountKeeper: ak, - Bankkeeper: bk, - } - return simulation.GenAndDeliverTxWithRandFees(txCtx) - } -} - -func SimulateMsgUpdateBitcannaid( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - var ( - simAccount = simtypes.Account{} - bitcannaid = types.Bitcannaid{} - msg = &types.MsgUpdateBitcannaid{} - allBitcannaid = k.GetAllBitcannaid(ctx) - found = false - ) - for _, obj := range allBitcannaid { - simAccount, found = FindAccount(accs, obj.Creator) - if found { - bitcannaid = obj - break - } - } - if !found { - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "bitcannaid creator not found"), nil, nil - } - msg.Creator = simAccount.Address.String() - msg.Id = bitcannaid.Id - - txCtx := simulation.OperationInput{ - R: r, - App: app, - TxGen: simappparams.MakeTestEncodingConfig().TxConfig, - Cdc: nil, - Msg: msg, - MsgType: msg.Type(), - Context: ctx, - SimAccount: simAccount, - ModuleName: types.ModuleName, - CoinsSpentInMsg: sdk.NewCoins(), - AccountKeeper: ak, - Bankkeeper: bk, - } - return simulation.GenAndDeliverTxWithRandFees(txCtx) - } -} - -func SimulateMsgDeleteBitcannaid( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - var ( - simAccount = simtypes.Account{} - bitcannaid = types.Bitcannaid{} - msg = &types.MsgUpdateBitcannaid{} - allBitcannaid = k.GetAllBitcannaid(ctx) - found = false - ) - for _, obj := range allBitcannaid { - simAccount, found = FindAccount(accs, obj.Creator) - if found { - bitcannaid = obj - break - } - } - if !found { - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "bitcannaid creator not found"), nil, nil - } - msg.Creator = simAccount.Address.String() - msg.Id = bitcannaid.Id - - txCtx := simulation.OperationInput{ - R: r, - App: app, - TxGen: simappparams.MakeTestEncodingConfig().TxConfig, - Cdc: nil, - Msg: msg, - MsgType: msg.Type(), - Context: ctx, - SimAccount: simAccount, - ModuleName: types.ModuleName, - CoinsSpentInMsg: sdk.NewCoins(), - AccountKeeper: ak, - Bankkeeper: bk, - } - return simulation.GenAndDeliverTxWithRandFees(txCtx) - } -} diff --git a/x/bcna/simulation/simap.go b/x/bcna/simulation/simap.go deleted file mode 100644 index 92c437c0..00000000 --- a/x/bcna/simulation/simap.go +++ /dev/null @@ -1,15 +0,0 @@ -package simulation - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" -) - -// FindAccount find a specific address from an account list -func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { - creator, err := sdk.AccAddressFromBech32(address) - if err != nil { - panic(err) - } - return simtypes.FindAccount(accs, creator) -} diff --git a/x/bcna/simulation/supplychain.go b/x/bcna/simulation/supplychain.go deleted file mode 100644 index 2d416456..00000000 --- a/x/bcna/simulation/supplychain.go +++ /dev/null @@ -1,134 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/BitCannaGlobal/bcna/x/bcna/keeper" - "github.com/BitCannaGlobal/bcna/x/bcna/types" - "github.com/cosmos/cosmos-sdk/baseapp" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" -) - -func SimulateMsgCreateSupplychain( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - - msg := &types.MsgCreateSupplychain{ - Creator: simAccount.Address.String(), - } - - txCtx := simulation.OperationInput{ - R: r, - App: app, - TxGen: simappparams.MakeTestEncodingConfig().TxConfig, - Cdc: nil, - Msg: msg, - MsgType: msg.Type(), - Context: ctx, - SimAccount: simAccount, - ModuleName: types.ModuleName, - CoinsSpentInMsg: sdk.NewCoins(), - AccountKeeper: ak, - Bankkeeper: bk, - } - return simulation.GenAndDeliverTxWithRandFees(txCtx) - } -} - -func SimulateMsgUpdateSupplychain( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - var ( - simAccount = simtypes.Account{} - supplychain = types.Supplychain{} - msg = &types.MsgUpdateSupplychain{} - allSupplychain = k.GetAllSupplychain(ctx) - found = false - ) - for _, obj := range allSupplychain { - simAccount, found = FindAccount(accs, obj.Creator) - if found { - supplychain = obj - break - } - } - if !found { - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "supplychain creator not found"), nil, nil - } - msg.Creator = simAccount.Address.String() - msg.Id = supplychain.Id - - txCtx := simulation.OperationInput{ - R: r, - App: app, - TxGen: simappparams.MakeTestEncodingConfig().TxConfig, - Cdc: nil, - Msg: msg, - MsgType: msg.Type(), - Context: ctx, - SimAccount: simAccount, - ModuleName: types.ModuleName, - CoinsSpentInMsg: sdk.NewCoins(), - AccountKeeper: ak, - Bankkeeper: bk, - } - return simulation.GenAndDeliverTxWithRandFees(txCtx) - } -} - -func SimulateMsgDeleteSupplychain( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - var ( - simAccount = simtypes.Account{} - supplychain = types.Supplychain{} - msg = &types.MsgUpdateSupplychain{} - allSupplychain = k.GetAllSupplychain(ctx) - found = false - ) - for _, obj := range allSupplychain { - simAccount, found = FindAccount(accs, obj.Creator) - if found { - supplychain = obj - break - } - } - if !found { - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "supplychain creator not found"), nil, nil - } - msg.Creator = simAccount.Address.String() - msg.Id = supplychain.Id - - txCtx := simulation.OperationInput{ - R: r, - App: app, - TxGen: simappparams.MakeTestEncodingConfig().TxConfig, - Cdc: nil, - Msg: msg, - MsgType: msg.Type(), - Context: ctx, - SimAccount: simAccount, - ModuleName: types.ModuleName, - CoinsSpentInMsg: sdk.NewCoins(), - AccountKeeper: ak, - Bankkeeper: bk, - } - return simulation.GenAndDeliverTxWithRandFees(txCtx) - } -} diff --git a/x/bcna/types/bitcannaid.pb.go b/x/bcna/types/bitcannaid.pb.go index a08784b0..69fa48ca 100644 --- a/x/bcna/types/bitcannaid.pb.go +++ b/x/bcna/types/bitcannaid.pb.go @@ -5,6 +5,7 @@ package types import ( fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" math "math" @@ -97,20 +98,20 @@ func init() { func init() { proto.RegisterFile("bcna/bitcannaid.proto", fileDescriptor_4b4053733ed2336d) } var fileDescriptor_4b4053733ed2336d = []byte{ - // 195 bytes of a gzipped FileDescriptorProto + // 208 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4d, 0x4a, 0xce, 0x4b, 0xd4, 0x4f, 0xca, 0x2c, 0x49, 0x4e, 0xcc, 0xcb, 0x4b, 0xcc, 0x4c, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x70, 0xca, 0x2c, 0x71, 0x06, 0x89, 0xb8, 0xe7, 0xe4, 0x27, 0x25, 0xe6, 0xe8, - 0x81, 0x54, 0x81, 0x09, 0xa5, 0x0c, 0x2e, 0x2e, 0x27, 0xb8, 0x6a, 0x21, 0x3e, 0x2e, 0xa6, 0xcc, - 0x14, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x96, 0x20, 0xa6, 0xcc, 0x14, 0x21, 0x31, 0x2e, 0x36, 0x90, - 0xaa, 0xcc, 0x14, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x28, 0x4f, 0x48, 0x82, 0x8b, 0x3d, - 0x31, 0x25, 0xa5, 0x28, 0xb5, 0xb8, 0x58, 0x82, 0x19, 0x2c, 0x01, 0xe3, 0x82, 0x64, 0x92, 0x8b, - 0x52, 0x13, 0x4b, 0xf2, 0x8b, 0x24, 0x58, 0x20, 0x32, 0x50, 0xae, 0x93, 0xeb, 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, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, - 0xe7, 0xe7, 0xea, 0xa3, 0x3a, 0x54, 0x1f, 0xec, 0x9d, 0x0a, 0x08, 0x55, 0x52, 0x59, 0x90, 0x5a, - 0x9c, 0xc4, 0x06, 0xf6, 0x91, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x37, 0xe8, 0x79, 0x27, 0xea, - 0x00, 0x00, 0x00, + 0x81, 0x54, 0x81, 0x09, 0x29, 0x91, 0xf4, 0xfc, 0xf4, 0x7c, 0xb0, 0x22, 0x7d, 0x10, 0x0b, 0xa2, + 0x5e, 0x29, 0x83, 0x8b, 0xcb, 0x09, 0x6e, 0x86, 0x10, 0x1f, 0x17, 0x53, 0x66, 0x8a, 0x04, 0xa3, + 0x02, 0xa3, 0x06, 0x4b, 0x10, 0x53, 0x66, 0x8a, 0x90, 0x18, 0x17, 0x1b, 0x48, 0x6f, 0x66, 0x8a, + 0x04, 0x93, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x94, 0x27, 0x24, 0xc1, 0xc5, 0x9e, 0x98, 0x92, 0x52, + 0x94, 0x5a, 0x5c, 0x2c, 0xc1, 0x0c, 0x96, 0x80, 0x71, 0x41, 0x32, 0xc9, 0x45, 0xa9, 0x89, 0x25, + 0xf9, 0x45, 0x12, 0x2c, 0x10, 0x19, 0x28, 0xd7, 0xc9, 0xf5, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, + 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, + 0x8f, 0xe5, 0x18, 0xa2, 0xb4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, + 0x51, 0x9d, 0xaf, 0x0f, 0xf6, 0x64, 0x05, 0x84, 0x2a, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, + 0xbb, 0xdb, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x58, 0x5d, 0x14, 0x30, 0x00, 0x01, 0x00, 0x00, } func (m *Bitcannaid) Marshal() (dAtA []byte, err error) { diff --git a/x/bcna/types/codec.go b/x/bcna/types/codec.go index 69b05f4d..86662e15 100644 --- a/x/bcna/types/codec.go +++ b/x/bcna/types/codec.go @@ -34,6 +34,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { } var ( - Amino = codec.NewLegacyAmino() + amino = codec.NewLegacyAmino() ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) ) diff --git a/x/bcna/types/expected_keepers.go b/x/bcna/types/expected_keepers.go index 6aa6e977..ab1254f4 100644 --- a/x/bcna/types/expected_keepers.go +++ b/x/bcna/types/expected_keepers.go @@ -1,18 +1 @@ package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" -) - -// AccountKeeper defines the expected account keeper used for simulations (noalias) -type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.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 - // Methods imported from bank should be defined here -} diff --git a/x/bcna/types/genesis.go b/x/bcna/types/genesis.go index b22555b2..485ea9f0 100644 --- a/x/bcna/types/genesis.go +++ b/x/bcna/types/genesis.go @@ -13,7 +13,6 @@ func DefaultGenesis() *GenesisState { BitcannaidList: []Bitcannaid{}, SupplychainList: []Supplychain{}, // this line is used by starport scaffolding # genesis/types/default - Params: DefaultParams(), } } @@ -46,5 +45,5 @@ func (gs GenesisState) Validate() error { } // this line is used by starport scaffolding # genesis/types/validate - return gs.Params.Validate() + return nil } diff --git a/x/bcna/types/genesis.pb.go b/x/bcna/types/genesis.pb.go index 44144d81..e93606e5 100644 --- a/x/bcna/types/genesis.pb.go +++ b/x/bcna/types/genesis.pb.go @@ -25,11 +25,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the bcna module's genesis state. type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - BitcannaidList []Bitcannaid `protobuf:"bytes,2,rep,name=bitcannaidList,proto3" json:"bitcannaidList"` - BitcannaidCount uint64 `protobuf:"varint,3,opt,name=bitcannaidCount,proto3" json:"bitcannaidCount,omitempty"` - SupplychainList []Supplychain `protobuf:"bytes,4,rep,name=supplychainList,proto3" json:"supplychainList"` - SupplychainCount uint64 `protobuf:"varint,5,opt,name=supplychainCount,proto3" json:"supplychainCount,omitempty"` + BitcannaidList []Bitcannaid `protobuf:"bytes,1,rep,name=bitcannaidList,proto3" json:"bitcannaidList"` + BitcannaidCount uint64 `protobuf:"varint,2,opt,name=bitcannaidCount,proto3" json:"bitcannaidCount,omitempty"` + SupplychainList []Supplychain `protobuf:"bytes,3,rep,name=supplychainList,proto3" json:"supplychainList"` + SupplychainCount uint64 `protobuf:"varint,4,opt,name=supplychainCount,proto3" json:"supplychainCount,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -65,13 +64,6 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - func (m *GenesisState) GetBitcannaidList() []Bitcannaid { if m != nil { return m.BitcannaidList @@ -107,27 +99,24 @@ func init() { func init() { proto.RegisterFile("bcna/genesis.proto", fileDescriptor_a0474e07bc9bd608) } var fileDescriptor_a0474e07bc9bd608 = []byte{ - // 305 bytes of a gzipped FileDescriptorProto + // 270 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4a, 0x4a, 0xce, 0x4b, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x70, 0xca, 0x2c, 0x71, 0x4e, 0xcc, 0xcb, 0x4b, 0x74, 0xcf, 0xc9, 0x4f, 0x4a, 0xcc, 0xd1, 0x03, - 0x29, 0x01, 0x13, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x45, 0xfa, 0x20, 0x16, 0x44, 0xbd, - 0x94, 0x20, 0xd8, 0x8c, 0x82, 0xc4, 0xa2, 0xc4, 0x5c, 0xa8, 0x11, 0x52, 0xa2, 0x60, 0xa1, 0xa4, - 0xcc, 0x92, 0x64, 0x90, 0x39, 0x99, 0x29, 0x50, 0x61, 0x31, 0xb0, 0x70, 0x71, 0x69, 0x41, 0x41, - 0x4e, 0x65, 0x72, 0x46, 0x62, 0x66, 0x1e, 0x44, 0x5c, 0xe9, 0x3c, 0x13, 0x17, 0x8f, 0x3b, 0xc4, - 0x0d, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x42, 0x76, 0x5c, 0x6c, 0x10, 0xf3, 0x24, 0x18, 0x15, 0x18, - 0x35, 0xb8, 0x8d, 0x14, 0xf4, 0x70, 0xb9, 0x49, 0x2f, 0x00, 0xac, 0xce, 0x89, 0xe5, 0xc4, 0x3d, - 0x79, 0x86, 0x20, 0xa8, 0x2e, 0xa1, 0x20, 0x2e, 0x3e, 0x84, 0xe5, 0x3e, 0x99, 0xc5, 0x25, 0x12, - 0x4c, 0x0a, 0xcc, 0x1a, 0xdc, 0x46, 0x2a, 0xb8, 0xcd, 0x71, 0x82, 0xab, 0x87, 0x9a, 0x85, 0x66, - 0x82, 0x90, 0x06, 0x17, 0x3f, 0x42, 0xc4, 0x39, 0xbf, 0x34, 0xaf, 0x44, 0x82, 0x59, 0x81, 0x51, - 0x83, 0x25, 0x08, 0x5d, 0x58, 0x28, 0x94, 0x8b, 0x1f, 0xc9, 0x8f, 0x60, 0xeb, 0x59, 0xc0, 0xd6, - 0xab, 0xe2, 0xb6, 0x3e, 0x18, 0xa1, 0x01, 0x6a, 0x3f, 0xba, 0x19, 0x42, 0x5a, 0x5c, 0x02, 0x48, - 0x42, 0x10, 0x17, 0xb0, 0x82, 0x5d, 0x80, 0x21, 0xee, 0xe4, 0x7a, 0xe2, 0x91, 0x1c, 0xe3, 0x85, - 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, - 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0xda, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, - 0xfa, 0xa8, 0xae, 0xd1, 0x07, 0xc7, 0x4e, 0x05, 0x84, 0x2a, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, - 0x03, 0xc7, 0x8f, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xb7, 0x66, 0x51, 0xec, 0x27, 0x02, 0x00, - 0x00, + 0x29, 0x01, 0x13, 0x52, 0xa2, 0x60, 0xd5, 0x49, 0x99, 0x25, 0xc9, 0x20, 0xe9, 0xcc, 0x14, 0x88, + 0x06, 0x29, 0x31, 0xb0, 0x70, 0x71, 0x69, 0x41, 0x41, 0x4e, 0x65, 0x72, 0x46, 0x62, 0x66, 0x1e, + 0x54, 0x5c, 0x24, 0x3d, 0x3f, 0x3d, 0x1f, 0xcc, 0xd4, 0x07, 0xb1, 0x20, 0xa2, 0x4a, 0xfd, 0x4c, + 0x5c, 0x3c, 0xee, 0x10, 0x0b, 0x83, 0x4b, 0x12, 0x4b, 0x52, 0x85, 0x82, 0xb8, 0xf8, 0x10, 0x46, + 0xfa, 0x64, 0x16, 0x97, 0x48, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x1b, 0xa9, 0xe8, 0xe1, 0x72, 0x08, + 0x48, 0x02, 0xaa, 0xde, 0x89, 0xe5, 0xc4, 0x3d, 0x79, 0x86, 0x20, 0x34, 0x13, 0x84, 0x34, 0xb8, + 0xf8, 0x11, 0x22, 0xce, 0xf9, 0xa5, 0x79, 0x25, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x2c, 0x41, 0xe8, + 0xc2, 0x42, 0xa1, 0x5c, 0xfc, 0x48, 0x2e, 0x07, 0x5b, 0xcf, 0x0c, 0xb6, 0x5e, 0x15, 0xb7, 0xf5, + 0xc1, 0x08, 0x0d, 0x50, 0xfb, 0xd1, 0xcd, 0x10, 0xd2, 0xe2, 0x12, 0x40, 0x12, 0x82, 0xb8, 0x80, + 0x05, 0xec, 0x02, 0x0c, 0x71, 0x27, 0xd7, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, + 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, + 0x88, 0xd2, 0x4e, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x47, 0x75, 0x8d, + 0x3e, 0x38, 0xcc, 0x2b, 0x20, 0x54, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x7c, 0x8d, + 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x28, 0x95, 0xb9, 0xbd, 0xd4, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -153,7 +142,7 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.SupplychainCount != 0 { i = encodeVarintGenesis(dAtA, i, uint64(m.SupplychainCount)) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x20 } if len(m.SupplychainList) > 0 { for iNdEx := len(m.SupplychainList) - 1; iNdEx >= 0; iNdEx-- { @@ -166,13 +155,13 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } } if m.BitcannaidCount != 0 { i = encodeVarintGenesis(dAtA, i, uint64(m.BitcannaidCount)) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x10 } if len(m.BitcannaidList) > 0 { for iNdEx := len(m.BitcannaidList) - 1; iNdEx >= 0; iNdEx-- { @@ -185,19 +174,9 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0xa } } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -218,8 +197,6 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) if len(m.BitcannaidList) > 0 { for _, e := range m.BitcannaidList { l = e.Size() @@ -277,39 +254,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field BitcannaidList", wireType) } @@ -343,7 +287,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: + case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field BitcannaidCount", wireType) } @@ -362,7 +306,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { break } } - case 4: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SupplychainList", wireType) } @@ -396,7 +340,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field SupplychainCount", wireType) } diff --git a/x/bcna/types/genesis_test.go b/x/bcna/types/genesis_test.go index c16b3f3c..3b52bf89 100644 --- a/x/bcna/types/genesis_test.go +++ b/x/bcna/types/genesis_test.go @@ -21,7 +21,6 @@ func TestGenesisState_Validate(t *testing.T) { { desc: "valid genesis state", genState: &types.GenesisState{ - BitcannaidList: []types.Bitcannaid{ { Id: 0, diff --git a/x/bcna/types/messages_bitcannaid.go b/x/bcna/types/messages_bitcannaid.go index 776c64a4..bb8b16ab 100644 --- a/x/bcna/types/messages_bitcannaid.go +++ b/x/bcna/types/messages_bitcannaid.go @@ -5,12 +5,6 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -const ( - TypeMsgCreateBitcannaid = "create_bitcannaid" - TypeMsgUpdateBitcannaid = "update_bitcannaid" - TypeMsgDeleteBitcannaid = "delete_bitcannaid" -) - var _ sdk.Msg = &MsgCreateBitcannaid{} func NewMsgCreateBitcannaid(creator string, bcnaid string, address string) *MsgCreateBitcannaid { @@ -26,7 +20,7 @@ func (msg *MsgCreateBitcannaid) Route() string { } func (msg *MsgCreateBitcannaid) Type() string { - return TypeMsgCreateBitcannaid + return "CreateBitcannaid" } func (msg *MsgCreateBitcannaid) GetSigners() []sdk.AccAddress { @@ -66,7 +60,7 @@ func (msg *MsgUpdateBitcannaid) Route() string { } func (msg *MsgUpdateBitcannaid) Type() string { - return TypeMsgUpdateBitcannaid + return "UpdateBitcannaid" } func (msg *MsgUpdateBitcannaid) GetSigners() []sdk.AccAddress { @@ -103,7 +97,7 @@ func (msg *MsgDeleteBitcannaid) Route() string { } func (msg *MsgDeleteBitcannaid) Type() string { - return TypeMsgDeleteBitcannaid + return "DeleteBitcannaid" } func (msg *MsgDeleteBitcannaid) GetSigners() []sdk.AccAddress { diff --git a/x/bcna/types/messages_supplychain.go b/x/bcna/types/messages_supplychain.go index 6bdee2f5..2719e85b 100644 --- a/x/bcna/types/messages_supplychain.go +++ b/x/bcna/types/messages_supplychain.go @@ -5,12 +5,6 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -const ( - TypeMsgCreateSupplychain = "create_supplychain" - TypeMsgUpdateSupplychain = "update_supplychain" - TypeMsgDeleteSupplychain = "delete_supplychain" -) - var _ sdk.Msg = &MsgCreateSupplychain{} func NewMsgCreateSupplychain(creator string, product string, info string, supplyinfo string) *MsgCreateSupplychain { @@ -27,7 +21,7 @@ func (msg *MsgCreateSupplychain) Route() string { } func (msg *MsgCreateSupplychain) Type() string { - return TypeMsgCreateSupplychain + return "CreateSupplychain" } func (msg *MsgCreateSupplychain) GetSigners() []sdk.AccAddress { @@ -68,7 +62,7 @@ func (msg *MsgUpdateSupplychain) Route() string { } func (msg *MsgUpdateSupplychain) Type() string { - return TypeMsgUpdateSupplychain + return "UpdateSupplychain" } func (msg *MsgUpdateSupplychain) GetSigners() []sdk.AccAddress { @@ -105,7 +99,7 @@ func (msg *MsgDeleteSupplychain) Route() string { } func (msg *MsgDeleteSupplychain) Type() string { - return TypeMsgDeleteSupplychain + return "DeleteSupplychain" } func (msg *MsgDeleteSupplychain) GetSigners() []sdk.AccAddress { diff --git a/x/bcna/types/params.go b/x/bcna/types/params.go deleted file mode 100644 index 357196ad..00000000 --- a/x/bcna/types/params.go +++ /dev/null @@ -1,39 +0,0 @@ -package types - -import ( - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "gopkg.in/yaml.v2" -) - -var _ paramtypes.ParamSet = (*Params)(nil) - -// ParamKeyTable the param key table for launch module -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// NewParams creates a new Params instance -func NewParams() Params { - return Params{} -} - -// DefaultParams returns a default set of parameters -func DefaultParams() Params { - return NewParams() -} - -// ParamSetPairs get the params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{} -} - -// Validate validates the set of params -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/bcna/types/params.pb.go b/x/bcna/types/params.pb.go deleted file mode 100644 index b127cc48..00000000 --- a/x/bcna/types/params.pb.go +++ /dev/null @@ -1,264 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: bcna/params.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Params defines the parameters for the module. -type Params struct { -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_33fe6ea42a5fee55, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Params)(nil), "BitCannaGlobal.bcna.bcna.Params") -} - -func init() { proto.RegisterFile("bcna/params.proto", fileDescriptor_33fe6ea42a5fee55) } - -var fileDescriptor_33fe6ea42a5fee55 = []byte{ - // 148 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4c, 0x4a, 0xce, 0x4b, - 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x70, - 0xca, 0x2c, 0x71, 0x4e, 0xcc, 0xcb, 0x4b, 0x74, 0xcf, 0xc9, 0x4f, 0x4a, 0xcc, 0xd1, 0x03, 0xa9, - 0x00, 0x13, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x45, 0xfa, 0x20, 0x16, 0x44, 0xbd, 0x12, - 0x1f, 0x17, 0x5b, 0x00, 0x58, 0xbf, 0x15, 0xcb, 0x8c, 0x05, 0xf2, 0x0c, 0x4e, 0xae, 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, 0x9d, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, - 0x97, 0x9c, 0x9f, 0xab, 0x8f, 0x6a, 0x89, 0x3e, 0xd8, 0x19, 0x15, 0x10, 0xaa, 0xa4, 0xb2, 0x20, - 0xb5, 0x38, 0x89, 0x0d, 0x6c, 0xba, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x5b, 0xdc, 0xcc, 0x8f, - 0xa2, 0x00, 0x00, 0x00, -} - -func (m *Params) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/bcna/types/query.pb.go b/x/bcna/types/query.pb.go index 46ce5c14..74baf9e3 100644 --- a/x/bcna/types/query.pb.go +++ b/x/bcna/types/query.pb.go @@ -30,89 +30,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_be73ff6631d32de0, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryParamsResponse is response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params holds all the parameters of this module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_be73ff6631d32de0, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - type QueryGetBitcannaidRequest struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } @@ -121,7 +38,7 @@ func (m *QueryGetBitcannaidRequest) Reset() { *m = QueryGetBitcannaidReq func (m *QueryGetBitcannaidRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetBitcannaidRequest) ProtoMessage() {} func (*QueryGetBitcannaidRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_be73ff6631d32de0, []int{2} + return fileDescriptor_be73ff6631d32de0, []int{0} } func (m *QueryGetBitcannaidRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -165,7 +82,7 @@ func (m *QueryGetBitcannaidResponse) Reset() { *m = QueryGetBitcannaidRe func (m *QueryGetBitcannaidResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetBitcannaidResponse) ProtoMessage() {} func (*QueryGetBitcannaidResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_be73ff6631d32de0, []int{3} + return fileDescriptor_be73ff6631d32de0, []int{1} } func (m *QueryGetBitcannaidResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -209,7 +126,7 @@ func (m *QueryAllBitcannaidRequest) Reset() { *m = QueryAllBitcannaidReq func (m *QueryAllBitcannaidRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllBitcannaidRequest) ProtoMessage() {} func (*QueryAllBitcannaidRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_be73ff6631d32de0, []int{4} + return fileDescriptor_be73ff6631d32de0, []int{2} } func (m *QueryAllBitcannaidRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -254,7 +171,7 @@ func (m *QueryAllBitcannaidResponse) Reset() { *m = QueryAllBitcannaidRe func (m *QueryAllBitcannaidResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllBitcannaidResponse) ProtoMessage() {} func (*QueryAllBitcannaidResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_be73ff6631d32de0, []int{5} + return fileDescriptor_be73ff6631d32de0, []int{3} } func (m *QueryAllBitcannaidResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -305,7 +222,7 @@ func (m *QueryGetSupplychainRequest) Reset() { *m = QueryGetSupplychainR func (m *QueryGetSupplychainRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetSupplychainRequest) ProtoMessage() {} func (*QueryGetSupplychainRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_be73ff6631d32de0, []int{6} + return fileDescriptor_be73ff6631d32de0, []int{4} } func (m *QueryGetSupplychainRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -349,7 +266,7 @@ func (m *QueryGetSupplychainResponse) Reset() { *m = QueryGetSupplychain func (m *QueryGetSupplychainResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetSupplychainResponse) ProtoMessage() {} func (*QueryGetSupplychainResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_be73ff6631d32de0, []int{7} + return fileDescriptor_be73ff6631d32de0, []int{5} } func (m *QueryGetSupplychainResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -393,7 +310,7 @@ func (m *QueryAllSupplychainRequest) Reset() { *m = QueryAllSupplychainR func (m *QueryAllSupplychainRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllSupplychainRequest) ProtoMessage() {} func (*QueryAllSupplychainRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_be73ff6631d32de0, []int{8} + return fileDescriptor_be73ff6631d32de0, []int{6} } func (m *QueryAllSupplychainRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -438,7 +355,7 @@ func (m *QueryAllSupplychainResponse) Reset() { *m = QueryAllSupplychain func (m *QueryAllSupplychainResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllSupplychainResponse) ProtoMessage() {} func (*QueryAllSupplychainResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_be73ff6631d32de0, []int{9} + return fileDescriptor_be73ff6631d32de0, []int{7} } func (m *QueryAllSupplychainResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -482,8 +399,6 @@ func (m *QueryAllSupplychainResponse) GetPagination() *query.PageResponse { } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "BitCannaGlobal.bcna.bcna.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "BitCannaGlobal.bcna.bcna.QueryParamsResponse") proto.RegisterType((*QueryGetBitcannaidRequest)(nil), "BitCannaGlobal.bcna.bcna.QueryGetBitcannaidRequest") proto.RegisterType((*QueryGetBitcannaidResponse)(nil), "BitCannaGlobal.bcna.bcna.QueryGetBitcannaidResponse") proto.RegisterType((*QueryAllBitcannaidRequest)(nil), "BitCannaGlobal.bcna.bcna.QueryAllBitcannaidRequest") @@ -497,46 +412,42 @@ func init() { func init() { proto.RegisterFile("bcna/query.proto", fileDescriptor_be73ff6631d32de0) } var fileDescriptor_be73ff6631d32de0 = []byte{ - // 622 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0xcf, 0x6b, 0x13, 0x41, - 0x14, 0xc7, 0x33, 0x69, 0xcd, 0x61, 0x8a, 0x45, 0xc7, 0x2a, 0x75, 0x95, 0xb5, 0x0c, 0xfd, 0x65, - 0x93, 0xee, 0x92, 0x54, 0xaf, 0x42, 0x23, 0x1a, 0x10, 0x84, 0x1a, 0xf1, 0xe2, 0x6d, 0x76, 0xb3, - 0x6c, 0x06, 0x36, 0x3b, 0xdb, 0xec, 0x44, 0x0c, 0xe2, 0xc5, 0x7f, 0x40, 0xc1, 0x7f, 0x42, 0x44, - 0x04, 0x0f, 0xfe, 0x0f, 0x3d, 0x56, 0xbc, 0x78, 0x12, 0x49, 0xfc, 0x43, 0x64, 0x67, 0x9e, 0xee, - 0xa6, 0xd9, 0x25, 0x69, 0xed, 0x25, 0x09, 0x2f, 0xef, 0xc7, 0xe7, 0xfb, 0xde, 0xcc, 0x1b, 0x7c, - 0xc9, 0x71, 0x43, 0x66, 0x1f, 0x0e, 0xbc, 0xfe, 0xd0, 0x8a, 0xfa, 0x42, 0x0a, 0xb2, 0xda, 0xe4, - 0xf2, 0x3e, 0x0b, 0x43, 0xd6, 0x0a, 0x84, 0xc3, 0x02, 0x2b, 0x71, 0x50, 0x1f, 0xc6, 0x8a, 0x2f, - 0x7c, 0xa1, 0x9c, 0xec, 0xe4, 0x97, 0xf6, 0x37, 0x6e, 0xfa, 0x42, 0xf8, 0x81, 0x67, 0xb3, 0x88, - 0xdb, 0x2c, 0x0c, 0x85, 0x64, 0x92, 0x8b, 0x30, 0x86, 0x7f, 0x77, 0x5c, 0x11, 0xf7, 0x44, 0x6c, - 0x3b, 0x2c, 0xf6, 0x74, 0x19, 0xfb, 0x45, 0xdd, 0xf1, 0x24, 0xab, 0xdb, 0x11, 0xf3, 0x79, 0xa8, - 0x9c, 0xc1, 0xf7, 0xb2, 0x62, 0x89, 0x58, 0x9f, 0xf5, 0xfe, 0x86, 0x5f, 0x55, 0x26, 0x87, 0x4b, - 0x37, 0x21, 0xe2, 0x1d, 0x30, 0x5f, 0x53, 0xe6, 0x78, 0x10, 0x45, 0xc1, 0xd0, 0xed, 0x32, 0x0e, - 0x19, 0xe8, 0x0a, 0x26, 0x4f, 0x92, 0x1a, 0x07, 0x2a, 0x47, 0xdb, 0x3b, 0x1c, 0x78, 0xb1, 0xa4, - 0xcf, 0xf0, 0x95, 0x09, 0x6b, 0x1c, 0x89, 0x30, 0xf6, 0xc8, 0x3d, 0x5c, 0xd1, 0xb5, 0x56, 0xd1, - 0x1a, 0xda, 0x5e, 0x6a, 0xac, 0x59, 0x45, 0xca, 0x2d, 0x1d, 0xd9, 0x5c, 0x3c, 0xfa, 0x79, 0xab, - 0xd4, 0x86, 0x28, 0x5a, 0xc5, 0xd7, 0x55, 0xda, 0x96, 0x27, 0x9b, 0xff, 0x00, 0xa1, 0x26, 0x59, - 0xc6, 0x65, 0xde, 0x51, 0x89, 0x17, 0xdb, 0x65, 0xde, 0xa1, 0x5d, 0x6c, 0xe4, 0x39, 0x03, 0xca, - 0x23, 0x8c, 0x53, 0x2b, 0xe0, 0xac, 0x17, 0xe3, 0xa4, 0xbe, 0x80, 0x94, 0x89, 0xa6, 0x2e, 0x60, - 0xed, 0x07, 0xc1, 0x34, 0xd6, 0x43, 0x8c, 0xd3, 0xb6, 0x43, 0xa1, 0x4d, 0x4b, 0xcf, 0xc8, 0x4a, - 0x66, 0x64, 0xe9, 0xa3, 0x00, 0x33, 0xb2, 0x0e, 0x98, 0xef, 0x41, 0x6c, 0x3b, 0x13, 0x49, 0xbf, - 0x20, 0xd0, 0x73, 0xa2, 0x4a, 0x81, 0x9e, 0x85, 0xb3, 0xeb, 0x21, 0xad, 0x09, 0xe4, 0xb2, 0x42, - 0xde, 0x9a, 0x89, 0xac, 0x41, 0x26, 0x98, 0x6b, 0xe9, 0x08, 0x9e, 0xa6, 0x27, 0xa7, 0x68, 0x60, - 0x01, 0xbe, 0x91, 0xeb, 0x0d, 0x0a, 0x1f, 0xe3, 0xa5, 0x8c, 0x19, 0x3a, 0xb9, 0x51, 0x2c, 0x31, - 0xe3, 0x0c, 0x1a, 0xb3, 0xf1, 0xb4, 0x93, 0xb6, 0x33, 0x87, 0xed, 0xbc, 0xa6, 0xf6, 0x15, 0x81, - 0xa8, 0x93, 0x65, 0x8a, 0x44, 0x2d, 0xfc, 0x8f, 0xa8, 0x73, 0x9b, 0x5c, 0xe3, 0x5b, 0x05, 0x5f, - 0x50, 0xdc, 0xe4, 0x2d, 0xc2, 0x15, 0x7d, 0x19, 0x49, 0xad, 0x98, 0x6b, 0x7a, 0x07, 0x18, 0xbb, - 0x73, 0x7a, 0xeb, 0xea, 0x74, 0xfb, 0xcd, 0xf7, 0xdf, 0xef, 0xcb, 0x94, 0xac, 0xd9, 0x93, 0x61, - 0xb6, 0xde, 0x47, 0xe9, 0x9e, 0x22, 0x1f, 0x51, 0xf6, 0xac, 0x93, 0xbd, 0x19, 0x75, 0xf2, 0x96, - 0x85, 0x71, 0xe7, 0x74, 0x41, 0xc0, 0x58, 0x57, 0x8c, 0x55, 0x72, 0xbb, 0x98, 0x31, 0x5d, 0x9c, - 0xf6, 0x2b, 0xde, 0x79, 0x4d, 0x3e, 0x20, 0x7c, 0x31, 0xcd, 0xb4, 0x1f, 0x04, 0x33, 0x79, 0xf3, - 0xb6, 0xc8, 0x4c, 0xde, 0xdc, 0xa5, 0x40, 0x6b, 0x8a, 0x77, 0x93, 0xac, 0xcf, 0xc3, 0x4b, 0x3e, - 0xa3, 0x89, 0xc3, 0x48, 0xe6, 0xe8, 0xd1, 0xf4, 0xcd, 0x31, 0xee, 0x9e, 0x32, 0x0a, 0x50, 0x1b, - 0x0a, 0xb5, 0x46, 0x76, 0x8a, 0x51, 0x33, 0x8f, 0x8f, 0xee, 0xed, 0x27, 0x84, 0x97, 0x33, 0xb9, - 0x92, 0xe6, 0xce, 0xd1, 0xa7, 0x33, 0x30, 0xe7, 0x5f, 0x5e, 0xba, 0xab, 0x98, 0xb7, 0xc8, 0xc6, - 0x5c, 0xcc, 0xcd, 0x07, 0x47, 0x23, 0x13, 0x1d, 0x8f, 0x4c, 0xf4, 0x6b, 0x64, 0xa2, 0x77, 0x63, - 0xb3, 0x74, 0x3c, 0x36, 0x4b, 0x3f, 0xc6, 0x66, 0xe9, 0x79, 0xd5, 0xe7, 0xb2, 0x3b, 0x70, 0x2c, - 0x57, 0xf4, 0x72, 0x53, 0xbd, 0xd4, 0x5f, 0x72, 0x18, 0x79, 0xb1, 0x53, 0x51, 0x0f, 0xef, 0xde, - 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbc, 0xd6, 0x5e, 0xcd, 0x48, 0x08, 0x00, 0x00, + // 553 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0x4d, 0x6b, 0x13, 0x41, + 0x18, 0xc7, 0x33, 0x69, 0xeb, 0x61, 0x8a, 0x45, 0x06, 0x95, 0xba, 0xca, 0x2a, 0x4b, 0x5f, 0xb4, + 0x89, 0x3b, 0x24, 0xd5, 0x0f, 0xd0, 0x88, 0x06, 0x04, 0x41, 0xe3, 0xcd, 0xdb, 0xec, 0xee, 0xb0, + 0x19, 0x98, 0xee, 0x6c, 0x3b, 0x13, 0x31, 0x88, 0x17, 0x3f, 0x81, 0xe0, 0x97, 0x10, 0x11, 0xc1, + 0x83, 0x67, 0xaf, 0x3d, 0x16, 0xbc, 0x78, 0x12, 0x49, 0xfc, 0x20, 0xb2, 0x33, 0xa3, 0xbb, 0xdb, + 0xee, 0x92, 0xb4, 0xe6, 0x92, 0x2c, 0x0f, 0xcf, 0xcb, 0xef, 0xff, 0x7f, 0x76, 0x66, 0xe1, 0xa5, + 0x20, 0x4c, 0x08, 0x3e, 0x18, 0xd1, 0xc3, 0xb1, 0x9f, 0x1e, 0x0a, 0x25, 0xd0, 0x7a, 0x8f, 0xa9, + 0x07, 0x24, 0x49, 0x48, 0x9f, 0x8b, 0x80, 0x70, 0x3f, 0x4b, 0xd0, 0x3f, 0xce, 0x8d, 0x58, 0x88, + 0x98, 0x53, 0x4c, 0x52, 0x86, 0x49, 0x92, 0x08, 0x45, 0x14, 0x13, 0x89, 0x34, 0x75, 0xce, 0x4e, + 0x28, 0xe4, 0xbe, 0x90, 0x38, 0x20, 0x92, 0x9a, 0x86, 0xf8, 0x65, 0x27, 0xa0, 0x8a, 0x74, 0x70, + 0x4a, 0x62, 0x96, 0xe8, 0x64, 0x9b, 0x7b, 0x45, 0x4f, 0x0d, 0x98, 0x0a, 0xb3, 0x41, 0x2c, 0xb2, + 0xe1, 0xab, 0x3a, 0x2c, 0x47, 0x69, 0xca, 0xc7, 0xe1, 0x90, 0xb0, 0xbf, 0xe9, 0x97, 0x63, 0x11, + 0x0b, 0xfd, 0x88, 0xb3, 0x27, 0x13, 0xf5, 0x5a, 0xf0, 0xda, 0xb3, 0x6c, 0x4c, 0x9f, 0xaa, 0xde, + 0xbf, 0x4e, 0x03, 0x7a, 0x30, 0xa2, 0x52, 0xa1, 0x35, 0xd8, 0x64, 0xd1, 0x3a, 0xb8, 0x05, 0x6e, + 0x2f, 0x0f, 0x9a, 0x2c, 0xf2, 0x86, 0xd0, 0xa9, 0x4a, 0x96, 0xa9, 0x48, 0x24, 0x45, 0x8f, 0x21, + 0xcc, 0xa3, 0xba, 0x6a, 0xb5, 0xbb, 0xe1, 0xd7, 0x19, 0xe1, 0xe7, 0xb9, 0xbd, 0xe5, 0xa3, 0x9f, + 0x37, 0x1b, 0x83, 0x42, 0xb5, 0x17, 0x5a, 0xac, 0x3d, 0xce, 0x4f, 0x63, 0x3d, 0x82, 0x30, 0x37, + 0xc3, 0x0e, 0xda, 0xf2, 0x8d, 0x73, 0x7e, 0xe6, 0x9c, 0x6f, 0x56, 0x61, 0x9d, 0xf3, 0x9f, 0x92, + 0x98, 0xda, 0xda, 0x41, 0xa1, 0xd2, 0xfb, 0x02, 0xac, 0x9e, 0x13, 0x53, 0x6a, 0xf4, 0x2c, 0x9d, + 0x5f, 0x0f, 0xea, 0x97, 0x90, 0x9b, 0x1a, 0x79, 0x7b, 0x26, 0xb2, 0x01, 0x29, 0x31, 0xb7, 0xf3, + 0x15, 0x3c, 0xcf, 0x57, 0x5c, 0xb7, 0x30, 0x0e, 0xaf, 0x57, 0x66, 0x5b, 0x85, 0x4f, 0xe0, 0x6a, + 0x21, 0x6c, 0x9d, 0xdc, 0xac, 0x97, 0x58, 0x48, 0xb6, 0x1a, 0x8b, 0xf5, 0x5e, 0x94, 0xdb, 0x59, + 0xc1, 0xb6, 0xa8, 0xad, 0x7d, 0x05, 0x56, 0xd4, 0xc9, 0x31, 0x75, 0xa2, 0x96, 0xfe, 0x47, 0xd4, + 0xc2, 0x36, 0xd7, 0xfd, 0xb6, 0x02, 0x57, 0x34, 0x37, 0xfa, 0x08, 0x8a, 0x6f, 0x16, 0xda, 0xad, + 0x67, 0xab, 0x3d, 0x9a, 0xce, 0xbd, 0xb3, 0x15, 0x19, 0x1e, 0xaf, 0xf3, 0xf6, 0xfb, 0xef, 0xf7, + 0xcd, 0x16, 0xba, 0x83, 0xcb, 0xd5, 0xd8, 0x5c, 0x25, 0xe5, 0xfb, 0x04, 0xbf, 0x66, 0xd1, 0x1b, + 0xf4, 0x01, 0xc0, 0x8b, 0x79, 0xa7, 0x3d, 0xce, 0x67, 0xf2, 0x56, 0x9d, 0xd9, 0x99, 0xbc, 0x95, + 0x47, 0xd0, 0x6b, 0x6b, 0xde, 0x2d, 0xb4, 0x31, 0x0f, 0x2f, 0xfa, 0x0c, 0x4a, 0xab, 0x47, 0x73, + 0x78, 0x74, 0xfa, 0x3d, 0x75, 0xee, 0x9f, 0xb1, 0xca, 0xa2, 0x76, 0x35, 0x6a, 0x1b, 0xed, 0xd4, + 0xa3, 0x16, 0xee, 0x64, 0xe3, 0xed, 0x27, 0x00, 0xd7, 0x0a, 0xbd, 0x32, 0x73, 0xe7, 0xf0, 0xe9, + 0x1c, 0xcc, 0xd5, 0x47, 0xc5, 0xbb, 0xab, 0x99, 0xb7, 0xd1, 0xe6, 0x5c, 0xcc, 0xbd, 0x87, 0x47, + 0x13, 0x17, 0x1c, 0x4f, 0x5c, 0xf0, 0x6b, 0xe2, 0x82, 0x77, 0x53, 0xb7, 0x71, 0x3c, 0x75, 0x1b, + 0x3f, 0xa6, 0x6e, 0xe3, 0x45, 0x2b, 0x66, 0x6a, 0x38, 0x0a, 0xfc, 0x50, 0xec, 0x57, 0xb6, 0x7a, + 0x65, 0xfe, 0xd4, 0x38, 0xa5, 0x32, 0xb8, 0xa0, 0xbf, 0x3c, 0xbb, 0x7f, 0x02, 0x00, 0x00, 0xff, + 0xff, 0xf1, 0x63, 0x35, 0x8c, 0x36, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -551,8 +462,6 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { - // Parameters queries the parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Queries a bitcannaid by id. Bitcannaid(ctx context.Context, in *QueryGetBitcannaidRequest, opts ...grpc.CallOption) (*QueryGetBitcannaidResponse, error) // Queries a list of bitcannaid items. @@ -571,15 +480,6 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/BitCannaGlobal.bcna.bcna.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) Bitcannaid(ctx context.Context, in *QueryGetBitcannaidRequest, opts ...grpc.CallOption) (*QueryGetBitcannaidResponse, error) { out := new(QueryGetBitcannaidResponse) err := c.cc.Invoke(ctx, "/BitCannaGlobal.bcna.bcna.Query/Bitcannaid", in, out, opts...) @@ -618,8 +518,6 @@ func (c *queryClient) SupplychainAll(ctx context.Context, in *QueryAllSupplychai // QueryServer is the server API for Query service. type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // Queries a bitcannaid by id. Bitcannaid(context.Context, *QueryGetBitcannaidRequest) (*QueryGetBitcannaidResponse, error) // Queries a list of bitcannaid items. @@ -634,9 +532,6 @@ type QueryServer interface { 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) Bitcannaid(ctx context.Context, req *QueryGetBitcannaidRequest) (*QueryGetBitcannaidResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Bitcannaid not implemented") } @@ -654,24 +549,6 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/BitCannaGlobal.bcna.bcna.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_Bitcannaid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryGetBitcannaidRequest) if err := dec(in); err != nil { @@ -748,10 +625,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "BitCannaGlobal.bcna.bcna.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, { MethodName: "Bitcannaid", Handler: _Query_Bitcannaid_Handler, @@ -773,62 +646,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "bcna/query.proto", } -func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *QueryGetBitcannaidRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1130,26 +947,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 - } - var l int - _ = l - return n -} - -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - func (m *QueryGetBitcannaidRequest) Size() (n int) { if m == nil { return 0 @@ -1266,139 +1063,6 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *QueryGetBitcannaidRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/bcna/types/query.pb.gw.go b/x/bcna/types/query.pb.gw.go index 0ed4a917..fe1c205a 100644 --- a/x/bcna/types/query.pb.gw.go +++ b/x/bcna/types/query.pb.gw.go @@ -33,24 +33,6 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - func request_Query_Bitcannaid_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGetBitcannaidRequest var metadata runtime.ServerMetadata @@ -237,29 +219,6 @@ func local_request_Query_SupplychainAll_0(ctx context.Context, marshaler runtime // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_Bitcannaid_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -393,26 +352,6 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_Bitcannaid_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -497,8 +436,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"BitCannaGlobal", "bcna", "params"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_Bitcannaid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"BitCannaGlobal", "bcna", "bitcannaid", "id"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_BitcannaidAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"BitCannaGlobal", "bcna", "bitcannaid"}, "", runtime.AssumeColonVerbOpt(true))) @@ -509,8 +446,6 @@ var ( ) var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - forward_Query_Bitcannaid_0 = runtime.ForwardResponseMessage forward_Query_BitcannaidAll_0 = runtime.ForwardResponseMessage diff --git a/x/bcna/types/supplychain.pb.go b/x/bcna/types/supplychain.pb.go index 01a078f9..d6901401 100644 --- a/x/bcna/types/supplychain.pb.go +++ b/x/bcna/types/supplychain.pb.go @@ -5,6 +5,7 @@ package types import ( fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" math "math" @@ -105,21 +106,22 @@ func init() { func init() { proto.RegisterFile("bcna/supplychain.proto", fileDescriptor_b6988f475c438d71) } var fileDescriptor_b6988f475c438d71 = []byte{ - // 213 bytes of a gzipped FileDescriptorProto + // 226 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4b, 0x4a, 0xce, 0x4b, 0xd4, 0x2f, 0x2e, 0x2d, 0x28, 0xc8, 0xa9, 0x4c, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x70, 0xca, 0x2c, 0x71, 0x4e, 0xcc, 0xcb, 0x4b, 0x74, 0xcf, 0xc9, 0x4f, - 0x4a, 0xcc, 0xd1, 0x03, 0x29, 0x03, 0x13, 0x4a, 0xad, 0x8c, 0x5c, 0xdc, 0xc1, 0x08, 0xf5, 0x42, - 0x7c, 0x5c, 0x4c, 0x99, 0x29, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x2c, 0x41, 0x4c, 0x99, 0x29, 0x42, - 0x12, 0x5c, 0xec, 0x05, 0x45, 0xf9, 0x29, 0xa5, 0xc9, 0x25, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x9c, - 0x41, 0x30, 0xae, 0x90, 0x10, 0x17, 0x4b, 0x66, 0x5e, 0x5a, 0xbe, 0x04, 0x33, 0x58, 0x18, 0xcc, - 0x16, 0x92, 0xe3, 0xe2, 0x82, 0x58, 0x0e, 0x96, 0x61, 0x01, 0xcb, 0x20, 0x89, 0x80, 0x4c, 0x4b, - 0x2e, 0x4a, 0x4d, 0x2c, 0xc9, 0x2f, 0x92, 0x60, 0x85, 0x98, 0x06, 0xe5, 0x3a, 0xb9, 0x9e, 0x78, - 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, - 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x76, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, - 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xaa, 0x37, 0xf4, 0xc1, 0xbe, 0xad, 0x80, 0x50, 0x25, 0x95, 0x05, - 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xff, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xed, 0x20, 0xee, - 0xa2, 0x09, 0x01, 0x00, 0x00, + 0x4a, 0xcc, 0xd1, 0x03, 0x29, 0x03, 0x13, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x45, 0xfa, + 0x20, 0x16, 0x44, 0xbd, 0x52, 0x2b, 0x23, 0x17, 0x77, 0x30, 0xc2, 0x14, 0x21, 0x3e, 0x2e, 0xa6, + 0xcc, 0x14, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x96, 0x20, 0xa6, 0xcc, 0x14, 0x21, 0x09, 0x2e, 0xf6, + 0x82, 0xa2, 0xfc, 0x94, 0xd2, 0xe4, 0x12, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x18, 0x57, + 0x48, 0x88, 0x8b, 0x25, 0x33, 0x2f, 0x2d, 0x5f, 0x82, 0x19, 0x2c, 0x0c, 0x66, 0x0b, 0xc9, 0x71, + 0x71, 0x41, 0x9c, 0x04, 0x96, 0x61, 0x01, 0xcb, 0x20, 0x89, 0x80, 0x4c, 0x4b, 0x2e, 0x4a, 0x4d, + 0x2c, 0xc9, 0x2f, 0x92, 0x60, 0x85, 0x98, 0x06, 0xe5, 0x3a, 0xb9, 0x9e, 0x78, 0x24, 0xc7, 0x78, + 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, + 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x76, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, + 0xae, 0x3e, 0xaa, 0xe7, 0xf4, 0xc1, 0x61, 0x50, 0x01, 0xa1, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, + 0xd8, 0xc0, 0xbe, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x65, 0xc6, 0x79, 0x1f, 0x01, + 0x00, 0x00, } func (m *Supplychain) Marshal() (dAtA []byte, err error) {