Skip to content

Commit

Permalink
Iden3SparseMerkleTreeProofType
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-basiuk committed Nov 20, 2023
1 parent 0e13eb3 commit 95d2706
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions credentialAtomicQueryV3.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
type ProofType string

const (
BJJSignatureProofType ProofType = "BJJSignature2021"
Iden3SparseMerkleProofType ProofType = "Iden3SparseMerkleProof"
BJJSignatureProofType ProofType = "BJJSignature2021"
Iden3SparseMerkleTreeProofType ProofType = "Iden3SparseMerkleTreeProof"
)

// AtomicQueryV3Inputs ZK private inputs for credentialAtomicQuerySig.circom
Expand Down Expand Up @@ -144,7 +144,7 @@ func (a AtomicQueryV3Inputs) Validate() error {
if a.Claim.SignatureProof.Signature == nil {
return errors.New(ErrorEmptyClaimSignature)
}
case Iden3SparseMerkleProofType:
case Iden3SparseMerkleTreeProofType:
if a.Claim.IncProof == nil {
return errors.New(ErrorEmptyMTPProof)
}
Expand Down Expand Up @@ -244,7 +244,7 @@ func (a AtomicQueryV3Inputs) InputsMarshal() ([]byte, error) {
s.IssuerAuthState = a.Claim.SignatureProof.IssuerAuthIncProof.TreeState.State

a.fillMTPProofsWithZero(&s)
case Iden3SparseMerkleProofType:
case Iden3SparseMerkleTreeProofType:
s.ProofType = "2"

if a.Claim.IncProof == nil {
Expand Down
4 changes: 2 additions & 2 deletions credentialAtomicQueryV3OnChain.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (a AtomicQueryV3OnChainInputs) Validate() error {
if a.Claim.SignatureProof.Signature == nil {
return errors.New(ErrorEmptyClaimSignature)
}
case Iden3SparseMerkleProofType:
case Iden3SparseMerkleTreeProofType:
if a.Claim.IncProof == nil {
return errors.New(ErrorEmptyMTPProof)
}
Expand Down Expand Up @@ -317,7 +317,7 @@ func (a AtomicQueryV3OnChainInputs) InputsMarshal() ([]byte, error) {
s.IssuerAuthState = a.Claim.SignatureProof.IssuerAuthIncProof.TreeState.State

a.fillMTPProofsWithZero(&s)
case Iden3SparseMerkleProofType:
case Iden3SparseMerkleTreeProofType:
s.ProofType = "2"

if a.Claim.IncProof == nil {
Expand Down
2 changes: 1 addition & 1 deletion credentialAtomicQueryV3OnChain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func TestAttrQueryV3OnChain_MTPPart_PrepareInputs(t *testing.T) {
SlotIndex: 2,
},
CurrentTimeStamp: timestamp,
ProofType: Iden3SparseMerkleProofType,
ProofType: Iden3SparseMerkleTreeProofType,
AuthClaim: user.AuthClaim,
AuthClaimIncMtp: authClaimIncMTP,
AuthClaimNonRevMtp: authClaimNonRevMTP,
Expand Down
2 changes: 1 addition & 1 deletion credentialAtomicQueryV3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func TestAttrQueryV3_MTPPart_PrepareInputs(t *testing.T) {
SlotIndex: 2,
},
CurrentTimeStamp: timestamp,
ProofType: Iden3SparseMerkleProofType,
ProofType: Iden3SparseMerkleTreeProofType,
LinkNonce: big.NewInt(0),
VerifierID: it.IDFromStr(
t, "21929109382993718606847853573861987353620810345503358891473103689157378049"),
Expand Down

0 comments on commit 95d2706

Please sign in to comment.