Fix cli_tests, add --keyring-backend flag to wasmd

This commit is contained in:
Ethan Frey
2020-01-23 19:59:13 +01:00
parent 85d7677eaf
commit d505266f8f
7 changed files with 19 additions and 26 deletions

View File

@@ -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.