Skip to content

Commit

Permalink
fix: returned supported struct type and added a condition to attempt …
Browse files Browse the repository at this point in the history
…confirmBlock when node just started voting
  • Loading branch information
Yashk767 committed Oct 9, 2024
1 parent 02de3ff commit 4ed9a06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func (*UtilsStruct) HandleBlock(client *ethclient.Client, account types.Account,
blockConfirmed = epoch
break
}
if lastVerification == epoch && blockConfirmed < epoch {
if (lastVerification == epoch || lastVerification == 0) && blockConfirmed < epoch {
txn, err := cmdUtils.ClaimBlockReward(types.TransactionOptions{
Client: client,
ChainId: core.ChainId,
Expand Down
7 changes: 6 additions & 1 deletion utils/struct-utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,12 @@ func (b BlockManagerStruct) GetConfirmedBlocks(client *ethclient.Client, epoch u
if returnedError != nil {
return coretypes.ConfirmedBlock{}, returnedError
}
return returnedValues[0].Interface().(coretypes.ConfirmedBlock), nil
return returnedValues[0].Interface().(struct {
Valid bool
ProposerId uint32
Iteration *big.Int
BiggestStake *big.Int
}), nil
}

func (s StakeManagerStruct) GetStakerId(client *ethclient.Client, address common.Address) (uint32, error) {
Expand Down

0 comments on commit 4ed9a06

Please sign in to comment.