Skip to content

Commit

Permalink
fix comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
colindickson committed Sep 3, 2024
1 parent d6a54f3 commit 9eb4f4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions codec/consolereader.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ func (ctx *parseCtx) readBlock(line string) (*pbnear.Block, error) {
if block.Header.PrevHeight != parentHeight {
return nil, fmt.Errorf("invalid block: prev height mismatch, got %d, expected %d", block.Header.PrevHeight, parentHeight)
}
if block.Header.PrevHash.AsString() != base58.Encode(parentHash) {
if block.Header.PrevHash.AsBase58String() != base58.Encode(parentHash) {
return nil, fmt.Errorf("invalid block: prev hash mismatch, got %s, expected %s", block.Header.PrevHash.AsBase58String(), base58.Encode(parentHash))
}
if block.Header.LastFinalBlock.AsString() != hex.EncodeToString(libHash) {
if block.Header.LastFinalBlock.AsBase58String() != hex.EncodeToString(libHash) {
return nil, fmt.Errorf("invalid block: lib hash mismatch, got %s, expected %s", block.Header.LastFinalBlock.AsBase58String(), hex.EncodeToString(libHash))
}

Expand Down

0 comments on commit 9eb4f4f

Please sign in to comment.