forked from bianjieai/nft-transfer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchain_test.go
38 lines (28 loc) · 1.18 KB
/
chain_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
package ibctesting_test
import (
"testing"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/stretchr/testify/require"
ibctesting "github.com/cosmos/ibc-go/v5/testing"
)
func TestChangeValSet(t *testing.T) {
coord := ibctesting.NewCoordinator(t, 2)
chainA := coord.GetChain(ibctesting.GetChainID(1))
chainB := coord.GetChain(ibctesting.GetChainID(2))
path := ibctesting.NewPath(chainA, chainB)
coord.Setup(path)
amount, ok := sdk.NewIntFromString("10000000000000000000")
require.True(t, ok)
amount2, ok := sdk.NewIntFromString("30000000000000000000")
require.True(t, ok)
val := chainA.GetSimApp().StakingKeeper.GetValidators(chainA.GetContext(), 4)
chainA.GetSimApp().StakingKeeper.Delegate(chainA.GetContext(), chainA.SenderAccounts[1].SenderAccount.GetAddress(),
amount, types.Unbonded, val[1], true)
chainA.GetSimApp().StakingKeeper.Delegate(chainA.GetContext(), chainA.SenderAccounts[3].SenderAccount.GetAddress(),
amount2, types.Unbonded, val[3], true)
coord.CommitBlock(chainA)
// verify that update clients works even after validator update goes into effect
path.EndpointB.UpdateClient()
path.EndpointB.UpdateClient()
}