working
This commit is contained in:
parent
890fadc8c3
commit
34ff225c31
@ -51,6 +51,11 @@ func (tapp *TestApp) RunBeginBlock() {
|
||||
return
|
||||
}
|
||||
|
||||
// kill resources used by basecapp
|
||||
func (tapp *TestApp) Close() {
|
||||
tapp.db.Close()
|
||||
}
|
||||
|
||||
func (tapp *TestApp) ensureBeginBlock() {
|
||||
if tapp.header == nil {
|
||||
panic("TestApp.header was nil, call TestApp.RunBeginBlock()")
|
||||
|
||||
@ -18,6 +18,7 @@ import (
|
||||
func TestSendMsg(t *testing.T) {
|
||||
tba := newTestBasecoinApp()
|
||||
tba.RunBeginBlock()
|
||||
defer tba.Close()
|
||||
|
||||
// Construct a SendMsg.
|
||||
var msg = bank.SendMsg{
|
||||
@ -43,8 +44,12 @@ func TestSendMsg(t *testing.T) {
|
||||
// Run a Deliver on SendMsg.
|
||||
res = tba.RunDeliverMsg(msg)
|
||||
assert.Equal(t, sdk.CodeUnrecognizedAddress, res.Code, res.Log)
|
||||
}
|
||||
|
||||
// TODO seperate this test, need a closer on db? keep getting resource unavailable
|
||||
func TestGenesis(t *testing.T) {
|
||||
tba := newTestBasecoinApp()
|
||||
tba.RunBeginBlock()
|
||||
defer tba.Close()
|
||||
|
||||
// construct some genesis bytes to reflect basecoin/types/AppAccount
|
||||
pk := crypto.GenPrivKeyEd25519().PubKey()
|
||||
|
||||
@ -4,6 +4,7 @@ import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||
crypto "github.com/tendermint/go-crypto"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
)
|
||||
|
||||
var _ sdk.Account = (*AppAccount)(nil)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user