Skip to content

Commit 064d475

Browse files
committed
fixup: Check for compatible min stake duration
1 parent 37713cf commit 064d475

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

tests/e2e/p/interchain_workflow.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ import (
99

1010
ginkgo "github.com/onsi/ginkgo/v2"
1111

12+
"github.com/spf13/cast"
13+
1214
"github.com/stretchr/testify/require"
1315

1416
"github.com/ava-labs/coreth/plugin/evm"
1517

1618
"github.com/ava-labs/avalanchego/api/info"
19+
"github.com/ava-labs/avalanchego/config"
1720
"github.com/ava-labs/avalanchego/ids"
1821
"github.com/ava-labs/avalanchego/tests/e2e"
1922
"github.com/ava-labs/avalanchego/tests/fixture/testnet"
@@ -37,6 +40,12 @@ var _ = e2e.DescribeXChain("[Interchain Workflow]", func() {
3740
)
3841

3942
ginkgo.It("should ensure that funds can be transferred from the P-Chain to the X-Chain and the C-Chain", func() {
43+
ginkgo.By("checking that the network has a compatible minimum stake duration", func() {
44+
network := e2e.Env.GetNetwork()
45+
minStakeDuration := cast.ToDuration(network.GetConfig().DefaultFlags[config.MinStakeDurationKey])
46+
require.Equal(testnet.DefaultMinStakeDuration, minStakeDuration)
47+
})
48+
4049
ginkgo.By("creating wallet with a funded key to send from and recipient key to deliver to")
4150
factory := secp256k1.Factory{}
4251
recipientKey, err := factory.NewPrivateKey()

tests/fixture/testnet/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ import (
3030
const (
3131
DefaultNodeCount = 5
3232
DefaultFundedKeyCount = 50
33+
34+
// A short min stake duration enables testing of staking logic.
35+
DefaultMinStakeDuration = time.Second
3336
)
3437

3538
var (

tests/fixture/testnet/local/config.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ func LocalFlags() testnet.FlagsMap {
3838
config.IndexEnabledKey: true,
3939
config.LogDisplayLevelKey: "INFO",
4040
config.LogLevelKey: "DEBUG",
41-
42-
// A short min stake duration enables testing of staking logic.
43-
config.MinStakeDurationKey: "1s",
41+
config.MinStakeDurationKey: testnet.DefaultMinStakeDuration,
4442
}
4543
}
4644

0 commit comments

Comments
 (0)