From b9c087e984f393dfefcc6881b805f94b20f76962 Mon Sep 17 00:00:00 2001 From: Adrian Dobrita Date: Wed, 15 May 2024 14:41:24 +0300 Subject: [PATCH] fix integration tests --- .../stakingProvider/delegation_test.go | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/integrationTests/chainSimulator/staking/stakingProvider/delegation_test.go b/integrationTests/chainSimulator/staking/stakingProvider/delegation_test.go index ad238766068..3ee5971a502 100644 --- a/integrationTests/chainSimulator/staking/stakingProvider/delegation_test.go +++ b/integrationTests/chainSimulator/staking/stakingProvider/delegation_test.go @@ -15,6 +15,10 @@ import ( "github.com/multiversx/mx-chain-crypto-go/signing" "github.com/multiversx/mx-chain-crypto-go/signing/mcl" mclsig "github.com/multiversx/mx-chain-crypto-go/signing/mcl/singlesig" + logger "github.com/multiversx/mx-chain-logger-go" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/multiversx/mx-chain-go/common" "github.com/multiversx/mx-chain-go/config" chainSimulatorIntegrationTests "github.com/multiversx/mx-chain-go/integrationTests/chainSimulator" @@ -25,9 +29,6 @@ import ( chainSimulatorProcess "github.com/multiversx/mx-chain-go/node/chainSimulator/process" "github.com/multiversx/mx-chain-go/process" "github.com/multiversx/mx-chain-go/vm" - logger "github.com/multiversx/mx-chain-logger-go" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) var log = logger.GetOrCreate("stakingProvider") @@ -399,11 +400,25 @@ func testBLSKeyIsInAuction( currentEpoch := metachainNode.GetCoreComponents().EnableEpochsHandler().GetCurrentEpoch() if metachainNode.GetCoreComponents().EnableEpochsHandler().GetActivationEpoch(common.StakingV4Step2Flag) == currentEpoch { // starting from phase 2, we have the shuffled out nodes from the previous epoch in the action list - actionListSize += 8 + // if there is no lowWaitingList condition + shuffledToAuctionValPubKeys, err := metachainNode.GetProcessComponents().NodesCoordinator().GetShuffledOutToAuctionValidatorsPublicKeys(currentEpoch) + require.Nil(t, err) + + if len(shuffledToAuctionValPubKeys) > 0 { + // there are 2 nodes per shard shuffled out so 2 * 4 = 8 + actionListSize += 8 + } } if metachainNode.GetCoreComponents().EnableEpochsHandler().GetActivationEpoch(common.StakingV4Step3Flag) <= currentEpoch { // starting from phase 3, we have the shuffled out nodes from the previous epoch in the action list - actionListSize += 4 + // if there is no lowWaitingList condition + shuffledToAuctionValPubKeys, err := metachainNode.GetProcessComponents().NodesCoordinator().GetShuffledOutToAuctionValidatorsPublicKeys(currentEpoch) + require.Nil(t, err) + + if len(shuffledToAuctionValPubKeys) > 0 { + // there are 2 nodes per shard shuffled out so 2 * 4 = 8 + actionListSize += 8 + } } require.Equal(t, actionListSize, len(auctionList))