Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
rianhughes committed Oct 18, 2024
1 parent 11b3c3b commit 9fe5df3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,15 @@ func (b *Blockchain) validateCommitments(shadowBlock *core.Block, shadowStateUpd
if err != nil {
return fmt.Errorf("failed to compute the shadow commitments %s", err)
}
blockVer, err := core.ParseBlockVersion(shadowBlock.ProtocolVersion)
if err != nil {
return err
}
if blockVer.LessThan(semver.MustParse("0.13.2")) {
// receipt commitment isn't needed for pre 0.13.2 blocks. see post07Hash().
shadowCommitments.ReceiptCommitment = nil
}

if !shadowCommitments.TransactionCommitment.Equal(sequenceCommitments.TransactionCommitment) {
return fmt.Errorf("transaction commitment mismatch: shadow commitment %v, sequence commitment %v",
shadowCommitments.TransactionCommitment, sequenceCommitments.TransactionCommitment)
Expand Down

0 comments on commit 9fe5df3

Please sign in to comment.