cosmos-sdk/simapp/app.go

290 lines
10 KiB
Go
Raw Normal View History

package simapp
2018-04-06 22:12:00 -07:00
import (
2018-10-22 11:59:00 -07:00
"io"
"os"
abci "github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"
2018-04-06 22:12:00 -07:00
bam "github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
2018-04-06 22:12:00 -07:00
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/version"
2018-04-06 22:12:00 -07:00
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/bank"
Merge PR #3656: Broken-Invar Tx - aka. Crisis module * beginning thinking on issue * ... * working * working * working fee pool distribution * spek outline * spec update * gas refund calculations * simulation saved to ~/.gaiad/simulations/ * lean simulation output int * cleanup bank simulation messages * operation messges int * lint * move simulation to its own module * move simulation log code to log.go * logger overhaul int * distribution comments * fix compiling * cleanup modifications to x/distribution/keeper/allocation.go int int int * gov bug * result.IsOK() minimization * importExport typo bug * pending * address @alexanderbez comments * simple @cwgoes comments addressed * event logging unified approach * distr module name constant * implementing * compiles * gaia integration * proper constant fee removal * crisis genesis * go.sum update * ... * debugging * fix sum errors * missing err checks * working implementing CLI * remove query command * crisis expected keepers in other modules * crisis testing infrastructure * working * tests complete * modify handler to still panic if not enough pool coins, docs working * spec tags * docs complete * CL * assert invariants on a blockly basis gaiad functionality * gaiad CL * transaction details in runtime invariance panic * Apply suggestions from code review Co-Authored-By: rigelrozanski <rigel.rozanski@gmail.com> * sender tags * @mossid suggestions int * @cwgoes comments final * Apply suggestions from code review Co-Authored-By: rigelrozanski <rigel.rozanski@gmail.com> * bug seems fixed (#3998) * delete unused line in zero height export bug
2019-03-28 16:27:47 -07:00
"github.com/cosmos/cosmos-sdk/x/crisis"
2018-09-17 20:02:15 -07:00
distr "github.com/cosmos/cosmos-sdk/x/distribution"
2019-06-28 13:11:27 -07:00
"github.com/cosmos/cosmos-sdk/x/genaccounts"
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
"github.com/cosmos/cosmos-sdk/x/genutil"
2018-06-21 17:19:14 -07:00
"github.com/cosmos/cosmos-sdk/x/gov"
2018-10-19 11:36:00 -07:00
"github.com/cosmos/cosmos-sdk/x/mint"
Merge #4209: NFT Module * in sync with @okwme/cosmos-nft * remove tmp tx * structuring and minor changes * supply and client files * adding cli client * complete cli/tx and rest.go * cleanup and restructuring * restructure rest folder * minor updates on clients * update querier * encoding for clients and other changes * genesis, invariants, and keeper updates * update types * make golangcibot happy * renamed and removed bank keeper * remove handlers for editmetadata, mint, burn, buy * nft interface * minor cleanup * sort collections and nfts * balance and find * nft query and tx * touch ups * uint in place of int Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * little fixes: - fix error to err to avoid collision - error handling Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * module generalization changes * fixes * query with data * minor updates and TODOs * fix CLI tx * golang bot fixes * handlers and txs done * update module generalization * Added very basic tests which for some reason do not work * fix test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fixed test, now we should fix implementation, seems to fail Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix test, create new struct instead of changing the old one Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix handler with new logic Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * let's make it compile Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * single failing test example, need to be fixed and extended Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * single failing test example, need to be fixed and extended Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reverting work, still problems unmarshalling inside iterator from test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Setter in nft.go should return NFT instead of BaseNFT Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * remove TODOS Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comment out broken tests, we want at least a green mark here Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * little fixes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * hopefully no conflict * minor changes for tests * change nft id to string, refactors * messy pause * Changes Balances to OWners add all necessary functions, updated Keeper with UpdateNFT as as well as MintNFT and made sure they all update Owners * pause dev to merge sdk master * go.mod changes * getting closer still need module.go * builds!!! * fix lint begin handler tests * stableish * re-order nft attributes, add back mint and burn msgs and handlers * add errors to minting the same NFT and burning an NFT that doesnt exist * first querier test * add simulations for nft msgs * handler tests check tags now (fixed a bug!) * update simulation * generic handler * need to check if it compiles on another machine * fix weird interface error * add back cli * wtfff * codec error fixed, logs removed. still returning empty arrays of IDs * Take empty input as yes answer Closes: #4564 * Add pending log entry * merged in master * marshall errors * build commands * working!!! * linting errors * remove unused func * pause * fix burn error * fix burn error * tests for querier * typo * tests for NFT types * module spec standard * tests for Collection and Collections types * merge w Fede * tests for Owner Type * added genesis tests and beefed up keeper, querier, handler & types tests * linting errors deadcode * DONT COVER test_common.go * add msg type tests * Update x/nft/internal/keeper/key.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/nft/genesis.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/nft/client/cli/query.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Apply suggestions from code review * typo * cleanup events * split events * more cleanup * remove restrictions from default handlers * not sure where these go mod changes came from * sim generated changes * make format * add mint and burn sims * move NFT interface to nft/exported * make format * NFT spec * Updates * more updates * update specs readme * fix sims * rest additions * rest additions * fix invariant * minimal nft without name, description or image * sim * fix sim * fix sim * fix Update methods * nothing * simplify update and remove Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * remove test on memory location Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * TEST to get logs, need to be removed Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix simulator editMetadata Msg type * owner not found start with empty collection Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * artifacts on errors in case of failure, else, no artifacts Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add more invariant checks to handler_tests * never forget to overwrite * merge and update spec * colins feedback * code coverage test * code coverage test * code coverage test * spelling * clean up client * testing code coverage * testing code coverage * testing code coverage * testing code coverage * testing code coverage * Update docs/spec/nft/README.md Co-Authored-By: frog power 4000 <rigel.rozanski@gmail.com> * Apply suggestions from code review Co-Authored-By: frog power 4000 <rigel.rozanski@gmail.com> * minor changes * integration tests and fixes * minor golangCI fixes * Update simapp/app.go Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>
2019-08-26 09:54:45 -07:00
"github.com/cosmos/cosmos-sdk/x/nft"
"github.com/cosmos/cosmos-sdk/x/params"
paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
2018-05-23 13:25:56 -07:00
"github.com/cosmos/cosmos-sdk/x/slashing"
2019-01-11 12:08:01 -08:00
"github.com/cosmos/cosmos-sdk/x/staking"
2019-06-28 13:11:27 -07:00
"github.com/cosmos/cosmos-sdk/x/supply"
2018-04-06 22:12:00 -07:00
)
const appName = "SimApp"
2018-04-06 22:12:00 -07:00
2018-04-25 21:27:40 -07:00
var (
// default home directories for the application CLI
DefaultCLIHome = os.ExpandEnv("$HOME/.simapp")
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
// default home directories for the application daemon
DefaultNodeHome = os.ExpandEnv("$HOME/.simapp")
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
// The module BasicManager is in charge of setting up basic,
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
// non-dependant module elements, such as codec registration
// and genesis verification.
ModuleBasics = module.NewBasicManager(
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
genaccounts.AppModuleBasic{},
genutil.AppModuleBasic{},
auth.AppModuleBasic{},
bank.AppModuleBasic{},
staking.AppModuleBasic{},
mint.AppModuleBasic{},
distr.AppModuleBasic{},
gov.NewAppModuleBasic(paramsclient.ProposalHandler, distr.ProposalHandler),
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
params.AppModuleBasic{},
crisis.AppModuleBasic{},
slashing.AppModuleBasic{},
Merge #4209: NFT Module * in sync with @okwme/cosmos-nft * remove tmp tx * structuring and minor changes * supply and client files * adding cli client * complete cli/tx and rest.go * cleanup and restructuring * restructure rest folder * minor updates on clients * update querier * encoding for clients and other changes * genesis, invariants, and keeper updates * update types * make golangcibot happy * renamed and removed bank keeper * remove handlers for editmetadata, mint, burn, buy * nft interface * minor cleanup * sort collections and nfts * balance and find * nft query and tx * touch ups * uint in place of int Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * little fixes: - fix error to err to avoid collision - error handling Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * module generalization changes * fixes * query with data * minor updates and TODOs * fix CLI tx * golang bot fixes * handlers and txs done * update module generalization * Added very basic tests which for some reason do not work * fix test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fixed test, now we should fix implementation, seems to fail Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix test, create new struct instead of changing the old one Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix handler with new logic Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * let's make it compile Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * single failing test example, need to be fixed and extended Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * single failing test example, need to be fixed and extended Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reverting work, still problems unmarshalling inside iterator from test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Setter in nft.go should return NFT instead of BaseNFT Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * remove TODOS Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comment out broken tests, we want at least a green mark here Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * little fixes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * hopefully no conflict * minor changes for tests * change nft id to string, refactors * messy pause * Changes Balances to OWners add all necessary functions, updated Keeper with UpdateNFT as as well as MintNFT and made sure they all update Owners * pause dev to merge sdk master * go.mod changes * getting closer still need module.go * builds!!! * fix lint begin handler tests * stableish * re-order nft attributes, add back mint and burn msgs and handlers * add errors to minting the same NFT and burning an NFT that doesnt exist * first querier test * add simulations for nft msgs * handler tests check tags now (fixed a bug!) * update simulation * generic handler * need to check if it compiles on another machine * fix weird interface error * add back cli * wtfff * codec error fixed, logs removed. still returning empty arrays of IDs * Take empty input as yes answer Closes: #4564 * Add pending log entry * merged in master * marshall errors * build commands * working!!! * linting errors * remove unused func * pause * fix burn error * fix burn error * tests for querier * typo * tests for NFT types * module spec standard * tests for Collection and Collections types * merge w Fede * tests for Owner Type * added genesis tests and beefed up keeper, querier, handler & types tests * linting errors deadcode * DONT COVER test_common.go * add msg type tests * Update x/nft/internal/keeper/key.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/nft/genesis.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/nft/client/cli/query.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Apply suggestions from code review * typo * cleanup events * split events * more cleanup * remove restrictions from default handlers * not sure where these go mod changes came from * sim generated changes * make format * add mint and burn sims * move NFT interface to nft/exported * make format * NFT spec * Updates * more updates * update specs readme * fix sims * rest additions * rest additions * fix invariant * minimal nft without name, description or image * sim * fix sim * fix sim * fix Update methods * nothing * simplify update and remove Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * remove test on memory location Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * TEST to get logs, need to be removed Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix simulator editMetadata Msg type * owner not found start with empty collection Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * artifacts on errors in case of failure, else, no artifacts Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add more invariant checks to handler_tests * never forget to overwrite * merge and update spec * colins feedback * code coverage test * code coverage test * code coverage test * spelling * clean up client * testing code coverage * testing code coverage * testing code coverage * testing code coverage * testing code coverage * Update docs/spec/nft/README.md Co-Authored-By: frog power 4000 <rigel.rozanski@gmail.com> * Apply suggestions from code review Co-Authored-By: frog power 4000 <rigel.rozanski@gmail.com> * minor changes * integration tests and fixes * minor golangCI fixes * Update simapp/app.go Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>
2019-08-26 09:54:45 -07:00
nft.AppModuleBasic{},
2019-06-28 13:11:27 -07:00
supply.AppModuleBasic{},
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
)
// module account permissions
maccPerms = map[string][]string{
auth.FeeCollectorName: nil,
distr.ModuleName: nil,
mint.ModuleName: {supply.Minter},
staking.BondedPoolName: {supply.Burner, supply.Staking},
staking.NotBondedPoolName: {supply.Burner, supply.Staking},
gov.ModuleName: {supply.Burner},
}
)
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
// custom tx codec
func MakeCodec() *codec.Codec {
var cdc = codec.New()
ModuleBasics.RegisterCodec(cdc)
sdk.RegisterCodec(cdc)
codec.RegisterCrypto(cdc)
return cdc
}
// SimApp 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 SimApp struct {
2018-04-06 22:12:00 -07:00
*bam.BaseApp
cdc *codec.Codec
2018-04-06 22:12:00 -07:00
invCheckPeriod uint
Merge PR #3656: Broken-Invar Tx - aka. Crisis module * beginning thinking on issue * ... * working * working * working fee pool distribution * spek outline * spec update * gas refund calculations * simulation saved to ~/.gaiad/simulations/ * lean simulation output int * cleanup bank simulation messages * operation messges int * lint * move simulation to its own module * move simulation log code to log.go * logger overhaul int * distribution comments * fix compiling * cleanup modifications to x/distribution/keeper/allocation.go int int int * gov bug * result.IsOK() minimization * importExport typo bug * pending * address @alexanderbez comments * simple @cwgoes comments addressed * event logging unified approach * distr module name constant * implementing * compiles * gaia integration * proper constant fee removal * crisis genesis * go.sum update * ... * debugging * fix sum errors * missing err checks * working implementing CLI * remove query command * crisis expected keepers in other modules * crisis testing infrastructure * working * tests complete * modify handler to still panic if not enough pool coins, docs working * spec tags * docs complete * CL * assert invariants on a blockly basis gaiad functionality * gaiad CL * transaction details in runtime invariance panic * Apply suggestions from code review Co-Authored-By: rigelrozanski <rigel.rozanski@gmail.com> * sender tags * @mossid suggestions int * @cwgoes comments final * Apply suggestions from code review Co-Authored-By: rigelrozanski <rigel.rozanski@gmail.com> * bug seems fixed (#3998) * delete unused line in zero height export bug
2019-03-28 16:27:47 -07:00
2018-04-06 22:12:00 -07:00
// keys to access the substores
keys map[string]*sdk.KVStoreKey
tkeys map[string]*sdk.TransientStoreKey
2018-04-06 22:12:00 -07:00
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
// keepers
AccountKeeper auth.AccountKeeper
BankKeeper bank.Keeper
SupplyKeeper supply.Keeper
StakingKeeper staking.Keeper
SlashingKeeper slashing.Keeper
MintKeeper mint.Keeper
DistrKeeper distr.Keeper
GovKeeper gov.Keeper
CrisisKeeper crisis.Keeper
ParamsKeeper params.Keeper
Merge #4209: NFT Module * in sync with @okwme/cosmos-nft * remove tmp tx * structuring and minor changes * supply and client files * adding cli client * complete cli/tx and rest.go * cleanup and restructuring * restructure rest folder * minor updates on clients * update querier * encoding for clients and other changes * genesis, invariants, and keeper updates * update types * make golangcibot happy * renamed and removed bank keeper * remove handlers for editmetadata, mint, burn, buy * nft interface * minor cleanup * sort collections and nfts * balance and find * nft query and tx * touch ups * uint in place of int Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * little fixes: - fix error to err to avoid collision - error handling Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * module generalization changes * fixes * query with data * minor updates and TODOs * fix CLI tx * golang bot fixes * handlers and txs done * update module generalization * Added very basic tests which for some reason do not work * fix test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fixed test, now we should fix implementation, seems to fail Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix test, create new struct instead of changing the old one Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix handler with new logic Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * let's make it compile Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * single failing test example, need to be fixed and extended Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * single failing test example, need to be fixed and extended Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reverting work, still problems unmarshalling inside iterator from test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Setter in nft.go should return NFT instead of BaseNFT Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * remove TODOS Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comment out broken tests, we want at least a green mark here Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * little fixes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * hopefully no conflict * minor changes for tests * change nft id to string, refactors * messy pause * Changes Balances to OWners add all necessary functions, updated Keeper with UpdateNFT as as well as MintNFT and made sure they all update Owners * pause dev to merge sdk master * go.mod changes * getting closer still need module.go * builds!!! * fix lint begin handler tests * stableish * re-order nft attributes, add back mint and burn msgs and handlers * add errors to minting the same NFT and burning an NFT that doesnt exist * first querier test * add simulations for nft msgs * handler tests check tags now (fixed a bug!) * update simulation * generic handler * need to check if it compiles on another machine * fix weird interface error * add back cli * wtfff * codec error fixed, logs removed. still returning empty arrays of IDs * Take empty input as yes answer Closes: #4564 * Add pending log entry * merged in master * marshall errors * build commands * working!!! * linting errors * remove unused func * pause * fix burn error * fix burn error * tests for querier * typo * tests for NFT types * module spec standard * tests for Collection and Collections types * merge w Fede * tests for Owner Type * added genesis tests and beefed up keeper, querier, handler & types tests * linting errors deadcode * DONT COVER test_common.go * add msg type tests * Update x/nft/internal/keeper/key.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/nft/genesis.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/nft/client/cli/query.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Apply suggestions from code review * typo * cleanup events * split events * more cleanup * remove restrictions from default handlers * not sure where these go mod changes came from * sim generated changes * make format * add mint and burn sims * move NFT interface to nft/exported * make format * NFT spec * Updates * more updates * update specs readme * fix sims * rest additions * rest additions * fix invariant * minimal nft without name, description or image * sim * fix sim * fix sim * fix Update methods * nothing * simplify update and remove Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * remove test on memory location Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * TEST to get logs, need to be removed Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix simulator editMetadata Msg type * owner not found start with empty collection Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * artifacts on errors in case of failure, else, no artifacts Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add more invariant checks to handler_tests * never forget to overwrite * merge and update spec * colins feedback * code coverage test * code coverage test * code coverage test * spelling * clean up client * testing code coverage * testing code coverage * testing code coverage * testing code coverage * testing code coverage * Update docs/spec/nft/README.md Co-Authored-By: frog power 4000 <rigel.rozanski@gmail.com> * Apply suggestions from code review Co-Authored-By: frog power 4000 <rigel.rozanski@gmail.com> * minor changes * integration tests and fixes * minor golangCI fixes * Update simapp/app.go Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>
2019-08-26 09:54:45 -07:00
NFTKeeper nft.Keeper
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
// the module manager
mm *module.Manager
// simulation manager
sm *module.SimulationManager
2018-04-06 22:12:00 -07:00
}
// NewSimApp returns a reference to an initialized SimApp.
func NewSimApp(
logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool,
invCheckPeriod uint, baseAppOptions ...func(*bam.BaseApp),
) *SimApp {
Merge PR #3656: Broken-Invar Tx - aka. Crisis module * beginning thinking on issue * ... * working * working * working fee pool distribution * spek outline * spec update * gas refund calculations * simulation saved to ~/.gaiad/simulations/ * lean simulation output int * cleanup bank simulation messages * operation messges int * lint * move simulation to its own module * move simulation log code to log.go * logger overhaul int * distribution comments * fix compiling * cleanup modifications to x/distribution/keeper/allocation.go int int int * gov bug * result.IsOK() minimization * importExport typo bug * pending * address @alexanderbez comments * simple @cwgoes comments addressed * event logging unified approach * distr module name constant * implementing * compiles * gaia integration * proper constant fee removal * crisis genesis * go.sum update * ... * debugging * fix sum errors * missing err checks * working implementing CLI * remove query command * crisis expected keepers in other modules * crisis testing infrastructure * working * tests complete * modify handler to still panic if not enough pool coins, docs working * spec tags * docs complete * CL * assert invariants on a blockly basis gaiad functionality * gaiad CL * transaction details in runtime invariance panic * Apply suggestions from code review Co-Authored-By: rigelrozanski <rigel.rozanski@gmail.com> * sender tags * @mossid suggestions int * @cwgoes comments final * Apply suggestions from code review Co-Authored-By: rigelrozanski <rigel.rozanski@gmail.com> * bug seems fixed (#3998) * delete unused line in zero height export bug
2019-03-28 16:27:47 -07:00
cdc := MakeCodec()
2018-07-18 16:24:16 -07:00
bApp := bam.NewBaseApp(appName, logger, db, auth.DefaultTxDecoder(cdc), baseAppOptions...)
bApp.SetCommitMultiStoreTracer(traceStore)
bApp.SetAppVersion(version.Version)
keys := sdk.NewKVStoreKeys(bam.MainStoreKey, auth.StoreKey, staking.StoreKey,
supply.StoreKey, mint.StoreKey, distr.StoreKey, slashing.StoreKey,
Merge #4209: NFT Module * in sync with @okwme/cosmos-nft * remove tmp tx * structuring and minor changes * supply and client files * adding cli client * complete cli/tx and rest.go * cleanup and restructuring * restructure rest folder * minor updates on clients * update querier * encoding for clients and other changes * genesis, invariants, and keeper updates * update types * make golangcibot happy * renamed and removed bank keeper * remove handlers for editmetadata, mint, burn, buy * nft interface * minor cleanup * sort collections and nfts * balance and find * nft query and tx * touch ups * uint in place of int Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * little fixes: - fix error to err to avoid collision - error handling Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * module generalization changes * fixes * query with data * minor updates and TODOs * fix CLI tx * golang bot fixes * handlers and txs done * update module generalization * Added very basic tests which for some reason do not work * fix test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fixed test, now we should fix implementation, seems to fail Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix test, create new struct instead of changing the old one Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix handler with new logic Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * let's make it compile Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * single failing test example, need to be fixed and extended Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * single failing test example, need to be fixed and extended Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reverting work, still problems unmarshalling inside iterator from test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Setter in nft.go should return NFT instead of BaseNFT Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * remove TODOS Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comment out broken tests, we want at least a green mark here Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * little fixes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * hopefully no conflict * minor changes for tests * change nft id to string, refactors * messy pause * Changes Balances to OWners add all necessary functions, updated Keeper with UpdateNFT as as well as MintNFT and made sure they all update Owners * pause dev to merge sdk master * go.mod changes * getting closer still need module.go * builds!!! * fix lint begin handler tests * stableish * re-order nft attributes, add back mint and burn msgs and handlers * add errors to minting the same NFT and burning an NFT that doesnt exist * first querier test * add simulations for nft msgs * handler tests check tags now (fixed a bug!) * update simulation * generic handler * need to check if it compiles on another machine * fix weird interface error * add back cli * wtfff * codec error fixed, logs removed. still returning empty arrays of IDs * Take empty input as yes answer Closes: #4564 * Add pending log entry * merged in master * marshall errors * build commands * working!!! * linting errors * remove unused func * pause * fix burn error * fix burn error * tests for querier * typo * tests for NFT types * module spec standard * tests for Collection and Collections types * merge w Fede * tests for Owner Type * added genesis tests and beefed up keeper, querier, handler & types tests * linting errors deadcode * DONT COVER test_common.go * add msg type tests * Update x/nft/internal/keeper/key.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/nft/genesis.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/nft/client/cli/query.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Apply suggestions from code review * typo * cleanup events * split events * more cleanup * remove restrictions from default handlers * not sure where these go mod changes came from * sim generated changes * make format * add mint and burn sims * move NFT interface to nft/exported * make format * NFT spec * Updates * more updates * update specs readme * fix sims * rest additions * rest additions * fix invariant * minimal nft without name, description or image * sim * fix sim * fix sim * fix Update methods * nothing * simplify update and remove Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * remove test on memory location Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * TEST to get logs, need to be removed Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix simulator editMetadata Msg type * owner not found start with empty collection Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * artifacts on errors in case of failure, else, no artifacts Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add more invariant checks to handler_tests * never forget to overwrite * merge and update spec * colins feedback * code coverage test * code coverage test * code coverage test * spelling * clean up client * testing code coverage * testing code coverage * testing code coverage * testing code coverage * testing code coverage * Update docs/spec/nft/README.md Co-Authored-By: frog power 4000 <rigel.rozanski@gmail.com> * Apply suggestions from code review Co-Authored-By: frog power 4000 <rigel.rozanski@gmail.com> * minor changes * integration tests and fixes * minor golangCI fixes * Update simapp/app.go Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>
2019-08-26 09:54:45 -07:00
gov.StoreKey, params.StoreKey, nft.StoreKey)
tkeys := sdk.NewTransientStoreKeys(staking.TStoreKey, params.TStoreKey)
app := &SimApp{
2019-06-28 13:11:27 -07:00
BaseApp: bApp,
cdc: cdc,
invCheckPeriod: invCheckPeriod,
keys: keys,
tkeys: tkeys,
2018-04-06 22:12:00 -07:00
}
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
// init params keeper and subspaces
app.ParamsKeeper = params.NewKeeper(app.cdc, keys[params.StoreKey], tkeys[params.TStoreKey], params.DefaultCodespace)
authSubspace := app.ParamsKeeper.Subspace(auth.DefaultParamspace)
bankSubspace := app.ParamsKeeper.Subspace(bank.DefaultParamspace)
stakingSubspace := app.ParamsKeeper.Subspace(staking.DefaultParamspace)
mintSubspace := app.ParamsKeeper.Subspace(mint.DefaultParamspace)
distrSubspace := app.ParamsKeeper.Subspace(distr.DefaultParamspace)
slashingSubspace := app.ParamsKeeper.Subspace(slashing.DefaultParamspace)
govSubspace := app.ParamsKeeper.Subspace(gov.DefaultParamspace).WithKeyTable(gov.ParamKeyTable())
crisisSubspace := app.ParamsKeeper.Subspace(crisis.DefaultParamspace)
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
// add keepers
app.AccountKeeper = auth.NewAccountKeeper(app.cdc, keys[auth.StoreKey], authSubspace, auth.ProtoBaseAccount)
app.BankKeeper = bank.NewBaseKeeper(app.AccountKeeper, bankSubspace, bank.DefaultCodespace, app.ModuleAccountAddrs())
app.SupplyKeeper = supply.NewKeeper(app.cdc, keys[supply.StoreKey], app.AccountKeeper, app.BankKeeper, maccPerms)
stakingKeeper := staking.NewKeeper(app.cdc, keys[staking.StoreKey], tkeys[staking.TStoreKey],
app.SupplyKeeper, stakingSubspace, staking.DefaultCodespace)
app.MintKeeper = mint.NewKeeper(app.cdc, keys[mint.StoreKey], mintSubspace, &stakingKeeper, app.SupplyKeeper, auth.FeeCollectorName)
app.DistrKeeper = distr.NewKeeper(app.cdc, keys[distr.StoreKey], distrSubspace, &stakingKeeper,
app.SupplyKeeper, distr.DefaultCodespace, auth.FeeCollectorName, app.ModuleAccountAddrs())
app.SlashingKeeper = slashing.NewKeeper(app.cdc, keys[slashing.StoreKey], &stakingKeeper,
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
slashingSubspace, slashing.DefaultCodespace)
app.CrisisKeeper = crisis.NewKeeper(crisisSubspace, invCheckPeriod, app.SupplyKeeper, auth.FeeCollectorName)
Merge #4209: NFT Module * in sync with @okwme/cosmos-nft * remove tmp tx * structuring and minor changes * supply and client files * adding cli client * complete cli/tx and rest.go * cleanup and restructuring * restructure rest folder * minor updates on clients * update querier * encoding for clients and other changes * genesis, invariants, and keeper updates * update types * make golangcibot happy * renamed and removed bank keeper * remove handlers for editmetadata, mint, burn, buy * nft interface * minor cleanup * sort collections and nfts * balance and find * nft query and tx * touch ups * uint in place of int Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * little fixes: - fix error to err to avoid collision - error handling Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * module generalization changes * fixes * query with data * minor updates and TODOs * fix CLI tx * golang bot fixes * handlers and txs done * update module generalization * Added very basic tests which for some reason do not work * fix test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fixed test, now we should fix implementation, seems to fail Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix test, create new struct instead of changing the old one Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix handler with new logic Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * let's make it compile Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * single failing test example, need to be fixed and extended Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * single failing test example, need to be fixed and extended Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reverting work, still problems unmarshalling inside iterator from test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Setter in nft.go should return NFT instead of BaseNFT Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * remove TODOS Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comment out broken tests, we want at least a green mark here Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * little fixes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * hopefully no conflict * minor changes for tests * change nft id to string, refactors * messy pause * Changes Balances to OWners add all necessary functions, updated Keeper with UpdateNFT as as well as MintNFT and made sure they all update Owners * pause dev to merge sdk master * go.mod changes * getting closer still need module.go * builds!!! * fix lint begin handler tests * stableish * re-order nft attributes, add back mint and burn msgs and handlers * add errors to minting the same NFT and burning an NFT that doesnt exist * first querier test * add simulations for nft msgs * handler tests check tags now (fixed a bug!) * update simulation * generic handler * need to check if it compiles on another machine * fix weird interface error * add back cli * wtfff * codec error fixed, logs removed. still returning empty arrays of IDs * Take empty input as yes answer Closes: #4564 * Add pending log entry * merged in master * marshall errors * build commands * working!!! * linting errors * remove unused func * pause * fix burn error * fix burn error * tests for querier * typo * tests for NFT types * module spec standard * tests for Collection and Collections types * merge w Fede * tests for Owner Type * added genesis tests and beefed up keeper, querier, handler & types tests * linting errors deadcode * DONT COVER test_common.go * add msg type tests * Update x/nft/internal/keeper/key.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/nft/genesis.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/nft/client/cli/query.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Apply suggestions from code review * typo * cleanup events * split events * more cleanup * remove restrictions from default handlers * not sure where these go mod changes came from * sim generated changes * make format * add mint and burn sims * move NFT interface to nft/exported * make format * NFT spec * Updates * more updates * update specs readme * fix sims * rest additions * rest additions * fix invariant * minimal nft without name, description or image * sim * fix sim * fix sim * fix Update methods * nothing * simplify update and remove Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * remove test on memory location Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * TEST to get logs, need to be removed Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix simulator editMetadata Msg type * owner not found start with empty collection Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * artifacts on errors in case of failure, else, no artifacts Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add more invariant checks to handler_tests * never forget to overwrite * merge and update spec * colins feedback * code coverage test * code coverage test * code coverage test * spelling * clean up client * testing code coverage * testing code coverage * testing code coverage * testing code coverage * testing code coverage * Update docs/spec/nft/README.md Co-Authored-By: frog power 4000 <rigel.rozanski@gmail.com> * Apply suggestions from code review Co-Authored-By: frog power 4000 <rigel.rozanski@gmail.com> * minor changes * integration tests and fixes * minor golangCI fixes * Update simapp/app.go Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>
2019-08-26 09:54:45 -07:00
app.NFTKeeper = nft.NewKeeper(app.cdc, keys[nft.StoreKey])
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
// register the proposal types
Merge PR #4206: Param Change Proposal * Add params error types * Update param module keeper to take a codespace * Update imports * Implement SetRaw and SetRawWithSubkey * Implement ParamChange and update aliases * Add types codec * Implement ParameterChangeProposal * Implement TestParameterChangeProposal * Fix linting errors * Update tags * Implement content * Updata params aliases * Finish params handler and proposal types * Move deposit and vote logic to types package * Move proposal type to types package * Move errors to types package * Update proposal * Move gov messages to types package * Minor updates to naming * Move keys to types package * Move codec to types package * Move proposal types to types package * Update aliases * Add governance alias types * Implement governance router * Update gov aliases * Update gov keeper * Update private functions needed for the keeper * Update godocs * Update the gov message handler * Update Gaia app * Make updates to auth * Update the message codec in the keeper * Update gov end blocker * Update types tests * Minor tweaks * Add legacy genesis logic * Update gov aliases * Move gov keys to types package * Revertt to using gov/types in params * Implement params handler test * Update governance tests * Fix endblocker tests * Fix governance querier tests * Add seal support to gov router * Update simulationCreateMsgSubmitProposal * Disable software upgrade proposals * Move params keys to types package * Implement param module proposal client logic * Update gov client logic * Update gaia app client hooks * Fix linting errors * Fix ValidateBasic * Remove legacy files * Update paramchange to use strings * Update paramchange cli cmd * Update ValidateBasic and errors * Use PostCommands when adding child cmds * Fix codec logic * Update params client and handler * Update IsValidProposalType * Update SubmitProposal to test exec * Implement TestGaiaCLISubmitParamChangeProposal * Implement TestSubmitParamChangeProposal * Update swagger.yaml * Update gaiacli.md * Update gov spec docs * Fix linting errors * Fix unit tests * Add pending log entries * Update docs * Update docs * Update client/lcd/swagger-ui/swagger.yaml Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> * Update docs/cosmos-hub/gaiacli.md Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> * Update cmd/gaia/cli_test/test_helpers.go Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> * Update client/lcd/test_helpers.go Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> * Update docs/cosmos-hub/gaiacli.md Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> * Update docs/cosmos-hub/gaiacli.md Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> * Update docs/cosmos-hub/gaiacli.md Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> * Update x/gov/types/proposal.go Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> * Update docs/cosmos-hub/gaiacli.md Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> * Update docs/cosmos-hub/gaiacli.md Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> * Address PR comments * Update docs/cosmos-hub/gaiacli.md Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> * Update gov docs to include quorum notes * Add logs to handleParameterChangeProposal * Update docs/spec/governance/02_state.md Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> * Support and use new StatusFailed when proposal passes but fails exec * Add docs/notes warning on param validity * Update docs * Update docs/spec/governance/02_state.md Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> * Update docs/spec/governance/02_state.md Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> * Minor doc update * Update x/gov/client/cli/tx.go Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> * Fix usage of fromAddr * Rige code style suggestion * Update x/params/types/proposal.go Co-Authored-By: alexanderbez <alexanderbez@users.noreply.github.com> * Fix CI lint errors * Update NewModuleClient godoc * Add godoc to rtr.Seal() call * Rename files * Rename NewProposalHandler
2019-04-30 09:31:38 -07:00
govRouter := gov.NewRouter()
govRouter.AddRoute(gov.RouterKey, gov.ProposalHandler).
AddRoute(params.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
AddRoute(distr.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper))
app.GovKeeper = gov.NewKeeper(app.cdc, keys[gov.StoreKey], govSubspace,
app.SupplyKeeper, &stakingKeeper, gov.DefaultCodespace, govRouter)
2018-04-18 09:36:55 -07:00
2018-09-18 14:54:28 -07:00
// register the staking hooks
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
app.StakingKeeper = *stakingKeeper.SetHooks(
staking.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()),
)
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
// NOTE: Any module instantiated in the module manager that is later modified
// must be passed by reference here.
app.mm = module.NewManager(
genaccounts.NewAppModule(app.AccountKeeper),
genutil.NewAppModule(app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx),
auth.NewAppModule(app.AccountKeeper),
bank.NewAppModule(app.BankKeeper, app.AccountKeeper),
crisis.NewAppModule(&app.CrisisKeeper),
supply.NewAppModule(app.SupplyKeeper, app.AccountKeeper),
distr.NewAppModule(app.DistrKeeper, app.SupplyKeeper),
gov.NewAppModule(app.GovKeeper, app.SupplyKeeper),
mint.NewAppModule(app.MintKeeper),
slashing.NewAppModule(app.SlashingKeeper, app.StakingKeeper),
staking.NewAppModule(app.StakingKeeper, app.AccountKeeper, app.SupplyKeeper),
Merge #4209: NFT Module * in sync with @okwme/cosmos-nft * remove tmp tx * structuring and minor changes * supply and client files * adding cli client * complete cli/tx and rest.go * cleanup and restructuring * restructure rest folder * minor updates on clients * update querier * encoding for clients and other changes * genesis, invariants, and keeper updates * update types * make golangcibot happy * renamed and removed bank keeper * remove handlers for editmetadata, mint, burn, buy * nft interface * minor cleanup * sort collections and nfts * balance and find * nft query and tx * touch ups * uint in place of int Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * little fixes: - fix error to err to avoid collision - error handling Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * module generalization changes * fixes * query with data * minor updates and TODOs * fix CLI tx * golang bot fixes * handlers and txs done * update module generalization * Added very basic tests which for some reason do not work * fix test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fixed test, now we should fix implementation, seems to fail Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix test, create new struct instead of changing the old one Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix handler with new logic Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * let's make it compile Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * single failing test example, need to be fixed and extended Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * single failing test example, need to be fixed and extended Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reverting work, still problems unmarshalling inside iterator from test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Setter in nft.go should return NFT instead of BaseNFT Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * remove TODOS Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comment out broken tests, we want at least a green mark here Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * little fixes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * hopefully no conflict * minor changes for tests * change nft id to string, refactors * messy pause * Changes Balances to OWners add all necessary functions, updated Keeper with UpdateNFT as as well as MintNFT and made sure they all update Owners * pause dev to merge sdk master * go.mod changes * getting closer still need module.go * builds!!! * fix lint begin handler tests * stableish * re-order nft attributes, add back mint and burn msgs and handlers * add errors to minting the same NFT and burning an NFT that doesnt exist * first querier test * add simulations for nft msgs * handler tests check tags now (fixed a bug!) * update simulation * generic handler * need to check if it compiles on another machine * fix weird interface error * add back cli * wtfff * codec error fixed, logs removed. still returning empty arrays of IDs * Take empty input as yes answer Closes: #4564 * Add pending log entry * merged in master * marshall errors * build commands * working!!! * linting errors * remove unused func * pause * fix burn error * fix burn error * tests for querier * typo * tests for NFT types * module spec standard * tests for Collection and Collections types * merge w Fede * tests for Owner Type * added genesis tests and beefed up keeper, querier, handler & types tests * linting errors deadcode * DONT COVER test_common.go * add msg type tests * Update x/nft/internal/keeper/key.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/nft/genesis.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/nft/client/cli/query.go Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Apply suggestions from code review * typo * cleanup events * split events * more cleanup * remove restrictions from default handlers * not sure where these go mod changes came from * sim generated changes * make format * add mint and burn sims * move NFT interface to nft/exported * make format * NFT spec * Updates * more updates * update specs readme * fix sims * rest additions * rest additions * fix invariant * minimal nft without name, description or image * sim * fix sim * fix sim * fix Update methods * nothing * simplify update and remove Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * remove test on memory location Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * TEST to get logs, need to be removed Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix simulator editMetadata Msg type * owner not found start with empty collection Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * artifacts on errors in case of failure, else, no artifacts Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add more invariant checks to handler_tests * never forget to overwrite * merge and update spec * colins feedback * code coverage test * code coverage test * code coverage test * spelling * clean up client * testing code coverage * testing code coverage * testing code coverage * testing code coverage * testing code coverage * Update docs/spec/nft/README.md Co-Authored-By: frog power 4000 <rigel.rozanski@gmail.com> * Apply suggestions from code review Co-Authored-By: frog power 4000 <rigel.rozanski@gmail.com> * minor changes * integration tests and fixes * minor golangCI fixes * Update simapp/app.go Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>
2019-08-26 09:54:45 -07:00
nft.NewAppModule(app.NFTKeeper),
)
2018-09-18 14:54:28 -07:00
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
// 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.
app.mm.SetOrderBeginBlockers(mint.ModuleName, distr.ModuleName, slashing.ModuleName)
app.mm.SetOrderEndBlockers(crisis.ModuleName, gov.ModuleName, staking.ModuleName)
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
// NOTE: The genutils moodule must occur after staking so that pools are
// properly initialized with tokens from genesis accounts.
app.mm.SetOrderInitGenesis(
genaccounts.ModuleName, distr.ModuleName, staking.ModuleName,
auth.ModuleName, bank.ModuleName, slashing.ModuleName, gov.ModuleName,
mint.ModuleName, supply.ModuleName, crisis.ModuleName, genutil.ModuleName,
)
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
app.mm.RegisterInvariants(&app.CrisisKeeper)
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
app.mm.RegisterRoutes(app.Router(), app.QueryRouter())
app.sm = module.NewSimulationManager(app.mm.Modules)
app.sm.RegisterStoreDecoders()
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
// initialize stores
app.MountKVStores(keys)
app.MountTransientStores(tkeys)
2018-08-04 22:56:48 -07:00
2018-04-06 22:12:00 -07:00
// initialize BaseApp
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
app.SetInitChainer(app.InitChainer)
app.SetBeginBlocker(app.BeginBlocker)
app.SetAnteHandler(auth.NewAnteHandler(app.AccountKeeper, app.SupplyKeeper, auth.DefaultSigVerificationGasConsumer))
2018-10-04 17:20:43 -07:00
app.SetEndBlocker(app.EndBlocker)
if loadLatest {
err := app.LoadLatestVersion(app.keys[bam.MainStoreKey])
if err != nil {
cmn.Exit(err.Error())
}
2018-04-06 22:12:00 -07:00
}
return app
}
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
// application updates every begin block
func (app *SimApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
return app.mm.BeginBlock(ctx, req)
}
// application updates every end block
func (app *SimApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock {
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
return app.mm.EndBlock(ctx, req)
}
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
// application update at chain initialization
func (app *SimApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
var genesisState GenesisState
Merge PR #4159: Module/Genesis Generalization * first commit * gaia cleanup * ... * staking multihooks * missing module function return args * bank module name constant * working, module interface for x/ * got this thing compiling * make test compiles and passes * remove expanded simulation invariants * genesis issue * continued * continued * register crisis routes thought mm * begin blocker to mm * end blocker to mm * empty routes not initialized * move gaia initChainer sanity check to baseapp * remove codecs from module manager * reorging genesis stuff * module manager passed by reference/bugfixes from working last commit int int * move invariant checks from gaia to crisis * typo * basic refactors cmd/gaia/init * working * MultiStakingHooks from types to x/staking/types int * default module manager order of operations from input modules * working * typo * add AppModuleBasic * moduleBasicManager / non-test code compiles * working attempting to get tests passing * make test passes * sim random genesis fix * export bug * ... * genutil module * genutil working * refactored - happy with non-testing code in cmd/ * ... * lint fixes * comment improvement * cli test fix * compile housing * working through compile errors * working gettin' compilin' * non-test code compiles * move testnet to its own module * reworking tests int * bez staging PR 1 comments * concise module function-of names * moved all tests from genesis_test.go to other genutil tests * genaccounts package, add genutil and genaccounts to app.go * docs for genutil genaccounts * genaccounts iterate fn * non-test code with genaccounts/ now compiles * working test compiling * debugging tests * resolved all make test compile errors * test debuggin * resolved all unit tests, introduced param module * cli-test compile fixes * staking initialization bug * code comment improvements, changelog entries * BasicGaiaApp -> ModuleBasics * highlevel explanation in types/module.go * @alexanderbez comment revisions * @fedekunze PR comments * @alexanderbez PR comments (x2) * @cwgoes comments (minor updates) * @fedekunze suggestions * panic on init with multiple validator updates from different modules * initchain panic makes validate genesis fail int * AppModuleGenesis seperation int * test * remove init panic logic in validate genesis replaced with TODO * set maxprocs to match system's GOMAXPROCS * Update circleci * Cap maxprocs in CI to 4 * @alexanderbez recent comments addressed * less blocks in twouble sims int * runsim error output flag * -e on import_export as well * error out int * Try to fix failures * runsim
2019-05-16 08:25:32 -07:00
app.cdc.MustUnmarshalJSON(req.AppStateBytes, &genesisState)
return app.mm.InitGenesis(ctx, genesisState)
2018-04-06 22:12:00 -07:00
}
2018-04-24 06:46:39 -07:00
2018-11-13 07:14:09 -08:00
// load a particular height
func (app *SimApp) LoadHeight(height int64) error {
return app.LoadVersion(height, app.keys[bam.MainStoreKey])
2018-11-13 07:14:09 -08:00
}
// ModuleAccountAddrs returns all the app's module account addresses.
func (app *SimApp) ModuleAccountAddrs() map[string]bool {
modAccAddrs := make(map[string]bool)
for acc := range maccPerms {
modAccAddrs[supply.NewModuleAddress(acc).String()] = true
}
return modAccAddrs
}
// Codec returns simapp's codec
func (app *SimApp) Codec() *codec.Codec {
return app.cdc
}
// GetKey returns the KVStoreKey for the provided store key
func (app *SimApp) GetKey(storeKey string) *sdk.KVStoreKey {
return app.keys[storeKey]
}
// GetTKey returns the TransientStoreKey for the provided store key
func (app *SimApp) GetTKey(storeKey string) *sdk.TransientStoreKey {
return app.tkeys[storeKey]
}
// 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
}