forked from baron-chain/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenesis_test.go
37 lines (33 loc) · 986 Bytes
/
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
package gov_test
import (
"testing"
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/stretchr/testify/require"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
)
func TestImportExportQueues_ErrorUnconsistentState(t *testing.T) {
suite := createTestSuite(t)
app := suite.App
ctx := app.BaseApp.NewContext(false, cmtproto.Header{})
require.Panics(t, func() {
gov.InitGenesis(ctx, suite.AccountKeeper, suite.BankKeeper, suite.GovKeeper, &v1.GenesisState{
Deposits: v1.Deposits{
{
ProposalId: 1234,
Depositor: "me",
Amount: sdk.Coins{
sdk.NewCoin(
"stake",
sdk.NewInt(1234),
),
},
},
},
})
})
gov.InitGenesis(ctx, suite.AccountKeeper, suite.BankKeeper, suite.GovKeeper, v1.DefaultGenesisState())
genState := gov.ExportGenesis(ctx, suite.GovKeeper)
require.Equal(t, genState, v1.DefaultGenesisState())
}