Skip to content

Commit

Permalink
fix churn
Browse files Browse the repository at this point in the history
  • Loading branch information
iansuvak committed Sep 17, 2024
1 parent 38aa2a2 commit 2fd7783
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions tests/flows/staking/erc20_delegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func ERC20Delegation(network interfaces.LocalNetwork) {
stakingManagerAddress,
network,
signatureAggregator,
utils.DefaultMinStakeAmount*10,
)

//
Expand Down
1 change: 1 addition & 0 deletions tests/flows/staking/erc20_token_staking.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func ERC20TokenStakingManager(network interfaces.LocalNetwork) {
stakingManagerAddress,
network,
signatureAggregator,
utils.DefaultMinStakeAmount*10,
)

//
Expand Down
1 change: 1 addition & 0 deletions tests/flows/staking/native_delegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func NativeDelegation(network interfaces.LocalNetwork) {
stakingManagerAddress,
network,
signatureAggregator,
utils.DefaultMinStakeAmount*10,
)

//
Expand Down
1 change: 1 addition & 0 deletions tests/flows/staking/native_token_staking.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) {
stakingManagerContractAddress,
network,
signatureAggregator,
utils.DefaultMinStakeAmount*10,
)

//
Expand Down
10 changes: 7 additions & 3 deletions tests/utils/staking.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ func InitializeNativeTokenValidatorSet(
validatorManagerAddress common.Address,
network interfaces.LocalNetwork,
signatureAggregator *aggregator.SignatureAggregator,
initialValidatorWeight uint64,
) ids.ID {
convertSubnetTxId := ids.GenerateTestID()
blsPublicKey := [bls.PublicKeyLen]byte{}
Expand All @@ -239,7 +240,7 @@ func InitializeNativeTokenValidatorSet(
InitialValidators: []nativetokenstakingmanager.InitialValidator{
{
NodeID: ids.GenerateTestID(),
Weight: 1,
Weight: initialValidatorWeight,
BlsPublicKey: blsPublicKey[:],
},
},
Expand Down Expand Up @@ -268,6 +269,7 @@ func InitializeNativeTokenValidatorSet(
)
Expect(err).Should(BeNil())
Expect(initialValidatorCreatedEvent.NodeID).Should(Equal(subnetConversionData.InitialValidators[0].NodeID))
Expect(initialValidatorCreatedEvent.Weight).Should(Equal(new(big.Int).SetUint64(initialValidatorWeight)))

expectedValidationID := CalculateSubnetConversionValidationId(convertSubnetTxId, 0)
emittedValidationID := ids.ID(initialValidatorCreatedEvent.ValidationID)
Expand All @@ -285,6 +287,7 @@ func InitializeERC20TokenValidatorSet(
validatorManagerAddress common.Address,
network interfaces.LocalNetwork,
signatureAggregator *aggregator.SignatureAggregator,
initialValidatorWeight uint64,
) ids.ID {
convertSubnetTxId := ids.GenerateTestID()
blsPublicKey := [bls.PublicKeyLen]byte{}
Expand All @@ -295,7 +298,7 @@ func InitializeERC20TokenValidatorSet(
InitialValidators: []erc20tokenstakingmanager.InitialValidator{
{
NodeID: ids.GenerateTestID(),
Weight: 1,
Weight: initialValidatorWeight,
BlsPublicKey: blsPublicKey[:],
},
},
Expand Down Expand Up @@ -324,6 +327,7 @@ func InitializeERC20TokenValidatorSet(
)
Expect(err).Should(BeNil())
Expect(initialValidatorCreatedEvent.NodeID).Should(Equal(subnetConversionData.InitialValidators[0].NodeID))
Expect(initialValidatorCreatedEvent.Weight).Should(Equal(new(big.Int).SetUint64(initialValidatorWeight)))

expectedValidationID := CalculateSubnetConversionValidationId(convertSubnetTxId, 0)
emittedValidationID := ids.ID(initialValidatorCreatedEvent.ValidationID)
Expand Down Expand Up @@ -382,7 +386,7 @@ func InitializePoAValidatorSet(
)
Expect(err).Should(BeNil())
Expect(initialValidatorCreatedEvent.NodeID).Should(Equal(subnetConversionData.InitialValidators[0].NodeID))
Expect(initialValidatorCreatedEvent.Weight).Should(Equal(initialValidatorWeight))
Expect(initialValidatorCreatedEvent.Weight).Should(Equal(new(big.Int).SetUint64(initialValidatorWeight)))

expectedValidationID := CalculateSubnetConversionValidationId(convertSubnetTxId, 0)
emittedValidationID := ids.ID(initialValidatorCreatedEvent.ValidationID)
Expand Down

0 comments on commit 2fd7783

Please sign in to comment.