Skip to content

Commit

Permalink
Reexport ErrInvalidIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
poszu committed Dec 22, 2023
1 parent 11eb06b commit b96bdb6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile.Inc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ else
endif
endif

POSTRS_SETUP_REV = 0.7.0-rc1-distributed-verification
POSTRS_SETUP_REV = 0.7.0-rc2-distributed-verification
POSTRS_SETUP_ZIP = libpost-$(platform)-v$(POSTRS_SETUP_REV).zip
POSTRS_SETUP_URL_ZIP ?= https://github.com/spacemeshos/post-rs/releases/download/v$(POSTRS_SETUP_REV)/$(POSTRS_SETUP_ZIP)
ifeq ($(platform), windows)
Expand Down
2 changes: 1 addition & 1 deletion internal/postrs/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (v *Verifier) VerifyProof(proof *shared.Proof, metadata *shared.ProofMetada
return nil
case C.VerifyResult_InvalidIndex:
result := castBytes[C.VerifyResult_InvalidIndex_Body](result.anon0[:])
return ErrInvalidIndex{Index: int(result.index_id)}
return &ErrInvalidIndex{Index: int(result.index_id)}
case C.VerifyResult_InvalidArgument:
return fmt.Errorf("invalid argument")
default:
Expand Down
3 changes: 3 additions & 0 deletions verifying/verifying.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import (
"github.com/spacemeshos/post/shared"
)

// Reexport from internal pkg.
type ErrInvalidIndex = postrs.ErrInvalidIndex

// VerifyVRFNonce ensures the validity of a nonce for a given node.
// AtxId is the id of the ATX that was selected by the node for its commitment.
func VerifyVRFNonce(nonce *uint64, m *shared.VRFNonceMetadata, opts ...OptionFunc) error {
Expand Down

0 comments on commit b96bdb6

Please sign in to comment.