Skip to content

Commit

Permalink
fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AdoAdoAdo committed May 15, 2024
1 parent 6430307 commit b9c087e
Showing 1 changed file with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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")
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit b9c087e

Please sign in to comment.