Skip to content

Commit

Permalink
use utils constants for set position (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-korotya authored May 23, 2023
1 parent f93681e commit 119230f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions json/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ func (s Parser) ParseClaim(ctx context.Context, credential verifiable.W3CCredent
opts = &processor.CoreClaimOptions{
RevNonce: 0,
Version: 0,
SubjectPosition: "index",
MerklizedRootPosition: "none",
SubjectPosition: utils.SubjectPositionIndex,
MerklizedRootPosition: utils.MerklizedRootPositionNone,
Updatable: false,
}
}
Expand Down
7 changes: 4 additions & 3 deletions json/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
core "github.com/iden3/go-iden3-core"
"github.com/iden3/go-schema-processor/merklize"
"github.com/iden3/go-schema-processor/processor"
"github.com/iden3/go-schema-processor/utils"
"github.com/iden3/go-schema-processor/verifiable"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -56,7 +57,7 @@ func TestParser_ParseClaimWithDataSlots(t *testing.T) {
opts := processor.CoreClaimOptions{
RevNonce: 127366661,
Version: 0,
SubjectPosition: "index",
SubjectPosition: utils.SubjectPositionIndex,
MerklizedRootPosition: "",
Updatable: true,
}
Expand Down Expand Up @@ -105,8 +106,8 @@ func TestParser_ParseClaimWithMerklizedRoot(t *testing.T) {
opts := processor.CoreClaimOptions{
RevNonce: 127366661,
Version: 0,
SubjectPosition: "index",
MerklizedRootPosition: "index",
SubjectPosition: utils.SubjectPositionIndex,
MerklizedRootPosition: utils.MerklizedRootPositionIndex,
Updatable: true,
}
claim, err := parser.ParseClaim(context.Background(), credential, credentialType, schemaBytes, &opts)
Expand Down

0 comments on commit 119230f

Please sign in to comment.