Skip to content

Commit

Permalink
poa->pos testing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iansuvak committed Sep 17, 2024
1 parent f1dcd6b commit 7e6cbd5
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 16 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/staking/ValidatorManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ abstract contract ValidatorManager is Initializable, ContextUpgradeable, IValida
ValidatorManagerStorage storage $ = _getValidatorManagerStorage();
(WarpMessage memory warpMessage, bool valid) =
WARP_MESSENGER.getVerifiedWarpMessage(messageIndex);
require(valid, "ValidatorManager: Invalid warp message");
require(valid, "ValidatorManager: invalid warp message");
require(
warpMessage.sourceChainID == $._pChainBlockchainID,
"ValidatorManager: invalid source chain ID"
Expand Down
13 changes: 2 additions & 11 deletions tests/flows/staking/poa_to_pos.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func PoAMigrationToPoS(network interfaces.LocalNetwork) {
proxyAddress,
network,
signatureAggregator,
20,
utils.DefaultMinStakeAmount*10,
)

// Register a validator
Expand Down Expand Up @@ -197,16 +197,7 @@ func PoAMigrationToPoS(network interfaces.LocalNetwork) {
stakeAmount,
)

// Attempt to delist previous PoA validator with wrong owner and check that it fails
_, err = posValidatorManager.InitializeEndValidation(
opts,
poaValidationID,
false,
0,
)
Expect(err).ShouldNot(BeNil())

// Delist the previous PoA validator properly
// Delist the previous PoA validator
utils.InitializeAndCompleteEndNativeValidation(
network,
signatureAggregator,
Expand Down
1 change: 0 additions & 1 deletion tests/utils/staking.go
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,6 @@ func PackInitialValidator(iv interface{}) ([]byte, error) {
weight := v.FieldByName("Weight").Interface().(uint64)
blsPublicKey := v.FieldByName("BlsPublicKey").Interface().([]byte)

// Placeholder: Replace this with the actual packing logic
b := make([]byte, initialValidatorPackedLen)
copy(b[0:32], nodeID[:])
binary.BigEndian.PutUint64(b[32:40], weight)
Expand Down

0 comments on commit 7e6cbd5

Please sign in to comment.