forked from maticnetwork/heimdall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenesis_test.go
54 lines (40 loc) · 1.12 KB
/
genesis_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package bank_test
import (
"testing"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/maticnetwork/heimdall/app"
"github.com/maticnetwork/heimdall/bank"
)
//
// Test suite
//
// GenesisTestSuite integrate test suite context object
type GenesisTestSuite struct {
suite.Suite
app *app.HeimdallApp
ctx sdk.Context
}
func (suite *GenesisTestSuite) SetupTest() {
suite.app, suite.ctx = createTestApp(false)
}
func TestGenesisTestSuite(t *testing.T) {
t.Parallel()
suite.Run(t, new(GenesisTestSuite))
}
//
// Tests
//
func (suite *GenesisTestSuite) TestInitGenesis() {
t, happ, ctx := suite.T(), suite.app, suite.ctx
require.Equal(t, true, happ.BankKeeper.GetSendEnabled(ctx))
}
func (suite *GenesisTestSuite) TestExportGenesis() {
t, happ, ctx := suite.T(), suite.app, suite.ctx
genesisState := bank.ExportGenesis(ctx, happ.BankKeeper)
require.Equal(t, true, genesisState.SendEnabled)
happ.BankKeeper.SetSendEnabled(ctx, false)
genesisState = bank.ExportGenesis(ctx, happ.BankKeeper)
require.Equal(t, false, genesisState.SendEnabled)
}