From 7fafa9e021a7d8e5267315de9ebea37dcc23041f Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Thu, 12 Apr 2018 13:08:57 +0200 Subject: [PATCH] Add testcases --- x/auth/mapper_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/x/auth/mapper_test.go b/x/auth/mapper_test.go index 030207db2..e59139841 100644 --- a/x/auth/mapper_test.go +++ b/x/auth/mapper_test.go @@ -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}}) +}