From 28de71fc061a2b1d1f3950f0c5bc86dbf783e101 Mon Sep 17 00:00:00 2001 From: muXxer Date: Thu, 9 May 2024 01:19:32 +0200 Subject: [PATCH] Fix special parameters in docker tests --- .../tests/committeerotation_test.go | 14 +++++++++++-- .../tests/dockertestframework/options.go | 1 - tools/docker-network/tests/rewards_test.go | 21 ++++++++++++++++--- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/tools/docker-network/tests/committeerotation_test.go b/tools/docker-network/tests/committeerotation_test.go index 2c362fb97..ca1b9c84c 100644 --- a/tools/docker-network/tests/committeerotation_test.go +++ b/tools/docker-network/tests/committeerotation_test.go @@ -193,7 +193,12 @@ func Test_NoCandidacyPayload(t *testing.T) { // 3. Check if the account became a staker. func Test_Staking(t *testing.T) { d := dockertestframework.NewDockerTestFramework(t, - dockertestframework.WithProtocolParametersOptions(dockertestframework.ShortSlotsAndEpochsProtocolParametersOptions...), + dockertestframework.WithProtocolParametersOptions( + append( + dockertestframework.ShortSlotsAndEpochsProtocolParametersOptions, + iotago.WithTargetCommitteeSize(3), + )..., + ), ) defer d.Stop() @@ -237,7 +242,12 @@ func Test_Staking(t *testing.T) { // 4. Delegate requested faucet funds to V3, V3 should replace V1 as a committee member. (V3 > V2 > V4 > V1) func Test_Delegation(t *testing.T) { d := dockertestframework.NewDockerTestFramework(t, - dockertestframework.WithProtocolParametersOptions(dockertestframework.ShortSlotsAndEpochsProtocolParametersOptions...), + dockertestframework.WithProtocolParametersOptions( + append( + dockertestframework.ShortSlotsAndEpochsProtocolParametersOptions, + iotago.WithTargetCommitteeSize(3), + )..., + ), ) defer d.Stop() diff --git a/tools/docker-network/tests/dockertestframework/options.go b/tools/docker-network/tests/dockertestframework/options.go index 5e051ecb3..7163122b2 100644 --- a/tools/docker-network/tests/dockertestframework/options.go +++ b/tools/docker-network/tests/dockertestframework/options.go @@ -23,7 +23,6 @@ var ShortSlotsAndEpochsProtocolParametersOptions = []options.Option[iotago.V3Pro iotago.WithLivenessOptions(5, 5, 2, 4, 5), iotago.WithCongestionControlOptions(1, 1, 1, 200_000_000, 125_000_000, 50_000_000, 1000, 100), iotago.WithRewardsOptions(8, 10, 2, 384), - iotago.WithStakingOptions(2, 5, 5), iotago.WithTargetCommitteeSize(4), } diff --git a/tools/docker-network/tests/rewards_test.go b/tools/docker-network/tests/rewards_test.go index da5f47e01..a13c15163 100644 --- a/tools/docker-network/tests/rewards_test.go +++ b/tools/docker-network/tests/rewards_test.go @@ -23,7 +23,12 @@ import ( // 4. Claim rewards and check if the mana increased as expected, the account that issued less validation blocks should have less mana. func Test_ValidatorRewards(t *testing.T) { d := dockertestframework.NewDockerTestFramework(t, - dockertestframework.WithProtocolParametersOptions(dockertestframework.ShortSlotsAndEpochsProtocolParametersOptions...), + dockertestframework.WithProtocolParametersOptions( + append( + dockertestframework.ShortSlotsAndEpochsProtocolParametersOptions, + iotago.WithStakingOptions(2, 10, 10), + )..., + ), ) defer d.Stop() @@ -137,7 +142,12 @@ func Test_ValidatorRewards(t *testing.T) { // 3. Claim rewards and check if the mana increased as expected. func Test_DelegatorRewards(t *testing.T) { d := dockertestframework.NewDockerTestFramework(t, - dockertestframework.WithProtocolParametersOptions(dockertestframework.ShortSlotsAndEpochsProtocolParametersOptions...), + dockertestframework.WithProtocolParametersOptions( + append( + dockertestframework.ShortSlotsAndEpochsProtocolParametersOptions, + iotago.WithStakingOptions(3, 10, 10), + )..., + ), ) defer d.Stop() @@ -192,7 +202,12 @@ func Test_DelegatorRewards(t *testing.T) { // 3. Claim rewards and check to destroy the delegation output. func Test_DelayedClaimingRewards(t *testing.T) { d := dockertestframework.NewDockerTestFramework(t, - dockertestframework.WithProtocolParametersOptions(dockertestframework.ShortSlotsAndEpochsProtocolParametersOptions...), + dockertestframework.WithProtocolParametersOptions( + append( + dockertestframework.ShortSlotsAndEpochsProtocolParametersOptions, + iotago.WithStakingOptions(3, 10, 10), + )..., + ), ) defer d.Stop()