Add testcases

This commit is contained in:
Christopher Goes 2018-04-12 13:08:57 +02:00
parent e870163ec0
commit 7fafa9e021
No known key found for this signature in database
GPG Key ID: E828D98232D328D3
1 changed files with 16 additions and 0 deletions

View File

@ -71,3 +71,19 @@ func TestAccountMapperSealed(t *testing.T) {
mapperSealed := mapper.Seal()
assert.Panics(t, func() { mapperSealed.WireCodec() })
}
func TestAccountMapperFeePool(t *testing.T) {
ms, capKey := setupMultiStore()
cdc := wire.NewCodec()
ctx := sdk.NewContext(ms, abci.Header{}, false, nil)
mapper := NewAccountMapper(cdc, capKey, &BaseAccount{})
// default empty
pool := mapper.GetFeePool(ctx)
assert.Equal(t, pool, sdk.Coins{})
// get after set
mapper.SetFeePool(ctx, sdk.Coins{sdk.Coin{"doge", 1}})
pool = mapper.GetFeePool(ctx)
assert.Equal(t, pool, sdk.Coins{sdk.Coin{"doge", 1}})
}