Skip to content

Commit

Permalink
types: Fully test (SpendPolicy).Verify
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechampine committed Nov 26, 2024
1 parent 788be94 commit bf93a07
Show file tree
Hide file tree
Showing 2 changed files with 185 additions and 126 deletions.
4 changes: 2 additions & 2 deletions types/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ func (p SpendPolicy) Verify(height uint64, medianTimestamp time.Time, sigHash Ha
if height >= uint64(p) {
return nil
}
return fmt.Errorf("height not above %v", uint64(p))
return fmt.Errorf("height (%v) not above %v", height, uint64(p))
case PolicyTypeAfter:
if medianTimestamp.After(time.Time(p)) {
return nil
}
return fmt.Errorf("median timestamp not after %v", time.Time(p))
return fmt.Errorf("median timestamp (%v) not after %v", medianTimestamp, time.Time(p))
case PolicyTypePublicKey:
if sig, ok := nextSig(); ok && PublicKey(p).VerifyHash(sigHash, sig) {
return nil
Expand Down
Loading

0 comments on commit bf93a07

Please sign in to comment.