@@ -1320,9 +1320,13 @@ func (s *state) syncGenesis(genesisBlk block.Block, genesis *genesis.Genesis) er
1320
1320
1321
1321
// Persist primary network validator set at genesis
1322
1322
for _ , vdrTx := range genesis .Validators {
1323
- validatorTx , ok := vdrTx .Unsigned .(txs.ValidatorTx )
1323
+ // We expect genesis validator txs to be either AddValidatorTx or
1324
+ // AddPermissionlessValidatorTx.
1325
+ //
1326
+ // TODO: Enforce stricter type check
1327
+ validatorTx , ok := vdrTx .Unsigned .(txs.ScheduledStaker )
1324
1328
if ! ok {
1325
- return fmt .Errorf ("expected tx type txs.ValidatorTx but got %T" , vdrTx .Unsigned )
1329
+ return fmt .Errorf ("expected a scheduled staker but got %T" , vdrTx .Unsigned )
1326
1330
}
1327
1331
1328
1332
stakeAmount := validatorTx .Weight ()
@@ -1451,7 +1455,7 @@ func (s *state) loadCurrentValidators() error {
1451
1455
return fmt .Errorf ("failed loading validator transaction txID %s, %w" , txID , err )
1452
1456
}
1453
1457
1454
- stakerTx , ok := tx .Unsigned .(txs.Staker )
1458
+ stakerTx , ok := tx .Unsigned .(txs.ScheduledStaker )
1455
1459
if ! ok {
1456
1460
return fmt .Errorf ("expected tx type txs.Staker but got %T" , tx .Unsigned )
1457
1461
}
@@ -1492,7 +1496,7 @@ func (s *state) loadCurrentValidators() error {
1492
1496
return err
1493
1497
}
1494
1498
1495
- stakerTx , ok := tx .Unsigned .(txs.Staker )
1499
+ stakerTx , ok := tx .Unsigned .(txs.ScheduledStaker )
1496
1500
if ! ok {
1497
1501
return fmt .Errorf ("expected tx type txs.Staker but got %T" , tx .Unsigned )
1498
1502
}
@@ -1539,7 +1543,7 @@ func (s *state) loadCurrentValidators() error {
1539
1543
return err
1540
1544
}
1541
1545
1542
- stakerTx , ok := tx .Unsigned .(txs.Staker )
1546
+ stakerTx , ok := tx .Unsigned .(txs.ScheduledStaker )
1543
1547
if ! ok {
1544
1548
return fmt .Errorf ("expected tx type txs.Staker but got %T" , tx .Unsigned )
1545
1549
}
@@ -1596,7 +1600,7 @@ func (s *state) loadPendingValidators() error {
1596
1600
return err
1597
1601
}
1598
1602
1599
- stakerTx , ok := tx .Unsigned .(txs.Staker )
1603
+ stakerTx , ok := tx .Unsigned .(txs.ScheduledStaker )
1600
1604
if ! ok {
1601
1605
return fmt .Errorf ("expected tx type txs.Staker but got %T" , tx .Unsigned )
1602
1606
}
@@ -1631,7 +1635,7 @@ func (s *state) loadPendingValidators() error {
1631
1635
return err
1632
1636
}
1633
1637
1634
- stakerTx , ok := tx .Unsigned .(txs.Staker )
1638
+ stakerTx , ok := tx .Unsigned .(txs.ScheduledStaker )
1635
1639
if ! ok {
1636
1640
return fmt .Errorf ("expected tx type txs.Staker but got %T" , tx .Unsigned )
1637
1641
}
0 commit comments