diff --git a/app/integration/common_test.go b/app/integration/common_test.go index f3739bdd..4fdc522a 100644 --- a/app/integration/common_test.go +++ b/app/integration/common_test.go @@ -31,7 +31,7 @@ const ( // Setup initializes a new wasmd.WasmApp. A Nop logger is set in WasmApp. func Setup(isCheckTx bool) *wasmd.WasmApp { db := dbm.NewMemDB() - app := wasmd.NewWasmApp(log.NewNopLogger(), db, nil, true, 0) + app := wasmd.NewWasmApp(log.NewNopLogger(), db, nil, true, 0, nil) // app := wasmd.NewWasmApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, 0) if !isCheckTx { // init chain must be called to stop deliverState from being nil @@ -57,7 +57,7 @@ func Setup(isCheckTx bool) *wasmd.WasmApp { // genesis accounts. func SetupWithGenesisAccounts(genAccs []authexported.GenesisAccount) *wasmd.WasmApp { db := dbm.NewMemDB() - app := wasmd.NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0) + app := wasmd.NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0, nil) // app := wasmd.NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, 0) // initialize the chain with the passed in genesis accounts @@ -94,8 +94,7 @@ func SetupWithGenesisAccounts(genAccs []authexported.GenesisAccount) *wasmd.Wasm func SignAndDeliver( t *testing.T, app *wasmd.WasmApp, msgs []sdk.Msg, accNums, seq []uint64, expPass bool, priv ...crypto.PrivKey, -) sdk.Result { - // ) (sdk.GasInfo, *sdk.Result, error) { +) (sdk.GasInfo, *sdk.Result, error) { tx := GenTx( msgs, @@ -110,26 +109,19 @@ func SignAndDeliver( // Simulate a sending a transaction and committing a block app.BeginBlock(abci.RequestBeginBlock{Header: abci.Header{Height: app.LastBlockHeight() + 1, ChainID: SimAppChainID}}) - res := app.Deliver(tx) + gasInfo, res, err := app.Deliver(tx) if expPass { - require.True(t, res.IsOK(), res) + require.NoError(t, err) + require.NotNil(t, res) } else { - require.False(t, res.IsOK(), res) + require.Error(t, err) + require.Nil(t, res) } - // gInfo, res, err := app.Deliver(tx) - // if expPass { - // require.NoError(t, err) - // require.NotNil(t, res) - // } else { - // require.Error(t, err) - // require.Nil(t, res) - // } - app.EndBlock(abci.RequestEndBlock{}) app.Commit() - return res + return gasInfo, res, err } // GenTx generates a signed mock transaction. diff --git a/app/integration/integration_test.go b/app/integration/integration_test.go index ae2e34b1..64314f88 100644 --- a/app/integration/integration_test.go +++ b/app/integration/integration_test.go @@ -49,9 +49,11 @@ func TestSendWithApp(t *testing.T) { _ = sign(t, wasm, msg, &keys[0], true) } -func sign(t *testing.T, wasm *app.WasmApp, msg sdk.Msg, signer *signer, expectPass bool) sdk.Result { - res := SignAndDeliver(t, wasm, []sdk.Msg{msg}, []uint64{signer.acctNum}, []uint64{signer.seq}, expectPass, signer.priv) - signer.seq++ +func sign(t *testing.T, wasm *app.WasmApp, msg sdk.Msg, signer *signer, expectPass bool) *sdk.Result { + _, res, _ := SignAndDeliver(t, wasm, []sdk.Msg{msg}, []uint64{signer.acctNum}, []uint64{signer.seq}, expectPass, signer.priv) + if expectPass { + signer.seq++ + } return res } diff --git a/app/sim_bench_test.go b/app/sim_bench_test.go index bbe1eb3a..c7a88761 100644 --- a/app/sim_bench_test.go +++ b/app/sim_bench_test.go @@ -27,7 +27,7 @@ func BenchmarkFullAppSimulation(b *testing.B) { } }() - app := NewGaiaApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, interBlockCacheOpt()) + app := NewWasmApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, interBlockCacheOpt()) // run randomized simulation _, simParams, simErr := simulation.SimulateFromSeed( @@ -66,7 +66,7 @@ func BenchmarkInvariants(b *testing.B) { } }() - app := NewGaiaApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, interBlockCacheOpt()) + app := NewWasmApp(logger, db, nil, true, simapp.FlagPeriodValue, map[int64]bool{}, interBlockCacheOpt()) // run randomized simulation _, simParams, simErr := simulation.SimulateFromSeed( diff --git a/cli_test/cli_test.go b/cli_test/cli_test.go index 33c68178..0fdb46b5 100644 --- a/cli_test/cli_test.go +++ b/cli_test/cli_test.go @@ -13,17 +13,14 @@ import ( "strings" "testing" - "github.com/cosmos/gaia/app" "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/crypto/ed25519" tmtypes "github.com/tendermint/tendermint/types" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/stretchr/testify/require" "github.com/cosmwasm/wasmd/app" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/tests" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" diff --git a/cmd/wasmd/genaccounts.go b/cmd/wasmd/genaccounts.go index c1bafb65..0d912791 100644 --- a/cmd/wasmd/genaccounts.go +++ b/cmd/wasmd/genaccounts.go @@ -143,6 +143,7 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa } cmd.Flags().String(cli.HomeFlag, defaultNodeHome, "node's home directory") + cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)") cmd.Flags().String(flagClientHome, defaultClientHome, "client's home directory") cmd.Flags().String(flagVestingAmt, "", "amount of coins for vesting accounts") cmd.Flags().Uint64(flagVestingStart, 0, "schedule start time (unix epoch) for vesting accounts") diff --git a/cmd/wasmd/testnet.go b/cmd/wasmd/testnet.go index 968d887e..a4295c82 100644 --- a/cmd/wasmd/testnet.go +++ b/cmd/wasmd/testnet.go @@ -93,6 +93,7 @@ Example: cmd.Flags().String( server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake)") + cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)") return cmd } diff --git a/lcd_test/helpers.go b/lcd_test/helpers.go index 79128757..e80347c0 100644 --- a/lcd_test/helpers.go +++ b/lcd_test/helpers.go @@ -73,7 +73,7 @@ func InitializeLCD(nValidators int, initAddrs []sdk.AccAddress, minting bool, po logger = log.NewFilter(logger, log.AllowError()) db := dbm.NewMemDB() - gapp := app.NewWasmApp(logger, db, nil, true, 0, baseapp.SetPruning(store.PruneNothing)) + gapp := app.NewWasmApp(logger, db, nil, true, 0, nil, baseapp.SetPruning(store.PruneNothing)) cdc = app.MakeCodec() genDoc, valConsPubKeys, valOperAddrs, privVal, err := defaultGenesis(config, nValidators, initAddrs, minting)