99 "time"
1010
1111 "github.com/0xPolygon/polygon-edge/bls"
12+ "github.com/0xPolygon/polygon-edge/chain"
1213 "github.com/0xPolygon/polygon-edge/consensus"
1314 "github.com/0xPolygon/polygon-edge/consensus/polybft/bitmap"
1415 "github.com/0xPolygon/polygon-edge/consensus/polybft/contractsapi"
@@ -590,6 +591,7 @@ func TestFSM_VerifyStateTransactions_MiddleOfEpochWithoutTransaction(t *testing.
590591 fsm := & fsm {
591592 commitEpochInput : createTestCommitEpochInput (t , 0 , allAccounts , 10 ),
592593 parent : & types.Header {},
594+ forks : & chain.Forks {},
593595 }
594596 err := fsm .VerifyStateTransactions ([]* types.Transaction {})
595597 assert .NoError (t , err )
@@ -604,6 +606,8 @@ func TestFSM_VerifyStateTransactions_EndOfEpochWithoutTransaction(t *testing.T)
604606 fsm := & fsm {
605607 isEndOfEpoch : true ,
606608 commitEpochInput : createTestCommitEpochInput (t , 0 , allAccounts , 10 ),
609+ forks : & chain.Forks {},
610+ parent : & types.Header {},
607611 }
608612 assert .EqualError (t , fsm .VerifyStateTransactions ([]* types.Transaction {}),
609613 "commit epoch transaction is not found in the epoch ending block" )
@@ -857,6 +861,7 @@ func TestFSM_VerifyStateTransactions_EndOfEpochMissingFundRewardWalletTx(t *test
857861 commitEpochInput : createTestCommitEpochInput (t , 0 , allAccounts , 10 ),
858862 rewardWalletFundAmount : common .GetTwoThirdOfMaxUint256 (),
859863 logger : hclog .NewNullLogger (),
864+ forks : & chain.Forks {},
860865 }
861866
862867 // create commit epoch transaction in order to add it to the transactions list
@@ -899,6 +904,7 @@ func TestFSM_VerifyStateTransactions_EndOfEpochWithoutFundRewardWalletTx(t *test
899904 ),
900905 distributeDAOIncentiveInput : createTestDistributeDAOIncentiveInput (t ),
901906 logger : hclog .NewNullLogger (),
907+ forks : & chain.Forks {},
902908 }
903909
904910 // create commit epoch transaction in order to add it to the transactions list
@@ -1008,6 +1014,7 @@ func TestFSM_VerifyStateTransactions_EndOfEpochMissingDistributeVaultFundsTx(t *
10081014 ),
10091015 distributeDAOIncentiveInput : createTestDistributeDAOIncentiveInput (t ),
10101016 logger : hclog .NewNullLogger (),
1017+ forks : & chain.Forks {},
10111018 }
10121019
10131020 // create commit epoch transaction in order to add it to the transactions list
@@ -1202,6 +1209,7 @@ func TestFSM_VerifyStateTransactions_StateTransactionPass(t *testing.T) {
12021209 ),
12031210 distributeDAOIncentiveInput : createTestDistributeDAOIncentiveInput (t ),
12041211 logger : hclog .NewNullLogger (),
1212+ forks : & chain.Forks {},
12051213 }
12061214
12071215 // create commit epoch transaction in order to add it to the transactions list
@@ -1251,6 +1259,7 @@ func TestFSM_VerifyStateTransaction_StartOfEpochInvalidSyncValidatorsDataTxIndex
12511259 syncValidatorsDataInput : createTestSyncValidatorsDataInput (t , allAccounts ),
12521260 newValidatorsDelta : newValidatorDelta ,
12531261 logger : hclog .NewNullLogger (),
1262+ forks : & chain.Forks {},
12541263 }
12551264
12561265 // create sync validators data transaction to add it in the list of state transactions to verify
@@ -1303,6 +1312,7 @@ func TestFSM_VerifyStateTransaction_StartOfEpochInvalidSyncValidatorsDataTxErr(t
13031312 syncValidatorsDataInput : createTestSyncValidatorsDataInput (t , allAccounts ),
13041313 newValidatorsDelta : newValidatorDelta ,
13051314 logger : hclog .NewNullLogger (),
1315+ forks : & chain.Forks {},
13061316 }
13071317
13081318 syncValidatorsDataInputEncoded , err := fsm .syncValidatorsDataInput .EncodeAbi ()
@@ -1349,6 +1359,7 @@ func TestFSM_VerifyStateTransaction_StartOfEpochSingleSyncValidatorsDataTxRequir
13491359 syncValidatorsDataInput : createTestSyncValidatorsDataInput (t , allAccounts ),
13501360 newValidatorsDelta : newValidatorDelta ,
13511361 logger : hclog .NewNullLogger (),
1362+ forks : & chain.Forks {},
13521363 }
13531364
13541365 // create sync validators data transaction to add it in the list of state transactions to verify
@@ -1383,6 +1394,7 @@ func TestFSM_VerifyStateTransaction_StartOfEpochUnexpectedSyncValidatorsDataTxEr
13831394 validators : validatorSet ,
13841395 syncValidatorsDataInput : createTestSyncValidatorsDataInput (t , allAccounts ),
13851396 logger : hclog .NewNullLogger (),
1397+ forks : & chain.Forks {},
13861398 }
13871399
13881400 // create sync validators data transaction to add it in the list of state transactions to verify
@@ -1452,6 +1464,7 @@ func TestFSM_VerifyStateTransaction_StartOfEpochMissingSyncValidatorsDataTx(t *t
14521464 syncValidatorsDataInput : createTestSyncValidatorsDataInput (t , validators ),
14531465 newValidatorsDelta : newDelta ,
14541466 logger : hclog .NewNullLogger (),
1467+ forks : & chain.Forks {},
14551468 }
14561469
14571470 assert .ErrorContains (
@@ -1483,6 +1496,7 @@ func TestFSM_VerifyStateTransaction_SyncValidatorsData(t *testing.T) {
14831496 syncValidatorsDataInput : createTestSyncValidatorsDataInput (t , allAccounts ),
14841497 newValidatorsDelta : newValidatorDelta ,
14851498 logger : hclog .NewNullLogger (),
1499+ forks : & chain.Forks {},
14861500 }
14871501
14881502 // create sync validators data transaction to add it in the list of state transactions to verify
@@ -1791,6 +1805,7 @@ func TestFSM_Validate_ExitEventRootNotExpected(t *testing.T) {
17911805 exitEventRootHash : types .BytesToHash (
17921806 []byte {0 , 1 , 2 , 3 , 4 },
17931807 ), // expect this to be in proposal extra
1808+ forks : & chain.Forks {},
17941809 }
17951810
17961811 err = fsm .Validate (proposal )
@@ -1928,6 +1943,7 @@ func TestFSM_Validate_EpochEndingBlock_MismatchInDeltas(t *testing.T) {
19281943 polybftBackend : polybftBackendMock ,
19291944 newValidatorsDelta : newValidatorDelta ,
19301945 config : & PolyBFTConfig {BlockTimeDrift : 1 },
1946+ forks : & chain.Forks {},
19311947 }
19321948
19331949 err = fsm .Validate (proposal )
@@ -2027,6 +2043,7 @@ func TestFSM_Validate_EpochEndingBlock_UpdatingValidatorSetInNonEpochEndingBlock
20272043 logger : hclog .NewNullLogger (),
20282044 polybftBackend : polybftBackendMock ,
20292045 config : & PolyBFTConfig {BlockTimeDrift : 1 },
2046+ forks : & chain.Forks {},
20302047 }
20312048
20322049 err = fsm .Validate (proposal )
@@ -2485,11 +2502,11 @@ func TestFSM_DecodeCommitEpochStateTx(t *testing.T) {
24852502// func TestFSM_VerifyStateTransaction_ValidBothTypesOfStateTransactions(t *testing.T) {
24862503// t.Parallel()
24872504
2488- // var (
2489- // commitments [2]*PendingCommitment
2490- // stateSyncs [2][]*contractsapi.StateSyncedEvent
2491- // signedCommitments [2]*CommitmentMessageSigned
2492- // )
2505+ // var (
2506+ // commitments [2]*PendingCommitment
2507+ // stateSyncs [2][]*contractsapi.StateSyncedEvent
2508+ // signedCommitments [2]*CommitmentMessageSigned
2509+ // )
24932510
24942511// validators := validator.NewTestValidatorsWithAliases(t, []string{"A", "B", "C", "D", "E"})
24952512// commitments[0], signedCommitments[0], stateSyncs[0] = buildCommitmentAndStateSyncs(t, 10, uint64(3), 2)
0 commit comments