forked from lesnikutsa/babylon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenesis_test.go
40 lines (31 loc) · 1.15 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
package btccheckpoint_test
import (
"testing"
"github.com/babylonchain/babylon/x/btccheckpoint"
"github.com/stretchr/testify/require"
simapp "github.com/babylonchain/babylon/app"
"github.com/babylonchain/babylon/x/btccheckpoint/types"
)
func TestExportGenesis(t *testing.T) {
app := simapp.Setup(t, false)
ctx := app.BaseApp.NewContext(false)
if err := app.BtcCheckpointKeeper.SetParams(ctx, types.DefaultParams()); err != nil {
panic(err)
}
genesisState := btccheckpoint.ExportGenesis(ctx, app.BtcCheckpointKeeper)
require.Equal(t, genesisState.Params, types.DefaultParams())
}
func TestInitGenesis(t *testing.T) {
app := simapp.Setup(t, false)
ctx := app.BaseApp.NewContext(false)
genesisState := types.GenesisState{
Params: types.Params{
BtcConfirmationDepth: 888,
CheckpointFinalizationTimeout: 999,
CheckpointTag: types.DefaultCheckpointTag,
},
}
btccheckpoint.InitGenesis(ctx, app.BtcCheckpointKeeper, genesisState)
require.Equal(t, app.BtcCheckpointKeeper.GetParams(ctx).BtcConfirmationDepth, uint64(888))
require.Equal(t, app.BtcCheckpointKeeper.GetParams(ctx).CheckpointFinalizationTimeout, uint64(999))
}