Skip to content

Commit

Permalink
fix global state message with gist param
Browse files Browse the repository at this point in the history
  • Loading branch information
daveroga committed Aug 20, 2024
1 parent 510a477 commit b8b234d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/services/blockchain/eth/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func (r *Resolver) Resolve(
signature := ""
if r.walletKey != "" && opts.Signature != "" {
primaryType := services.IdentityStateType
if stateInfo == nil {
if opts.GistRoot != nil {
primaryType = services.GlobalStateType
}
signature, err = r.signTypedData(primaryType, did, identityState)
Expand Down
4 changes: 2 additions & 2 deletions pkg/services/blockchain/eth/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func TestResolveSignature_Success(t *testing.T) {
ReplacedByRoot: big.NewInt(0),
ReplacedAtTimestamp: big.NewInt(0),
},
Signature: "0x4640cdda90e9340e4283e5e5d622137ee624142a53a66b98552eae931dab8eb41f25b4c9eae4771be41e7e1dcac364fc2b98cc6adf02586b158c24c3ca36f8af1c",
Signature: "0xc3dd18cd87c75fe225a569473f822daf66eed38f6e81dfc6766f4c35f1610ad96c546812eb416cd29f30098e5e9e38db78c4887db517f0569762e9f62227154d1b",
},
},
{
Expand Down Expand Up @@ -337,7 +337,7 @@ func TestResolveSignature_Success(t *testing.T) {
require.Equal(t, tt.expectedIdentityState, identityState)

primaryType := services.IdentityStateType
if tt.expectedIdentityState.StateInfo == nil {
if tt.opts.GistRoot != nil {
primaryType = services.GlobalStateType
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/services/did.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (d *DidDocumentServices) GetDidDocument(ctx context.Context, did string, op

if err == nil && opts.Signature != "" {
primaryType := IdentityStateType
if identityState.StateInfo == nil {
if opts.GistRoot != nil {
primaryType = GlobalStateType
}
eip712TypedData, err := resolver.TypedData(primaryType, *userDID, identityState, walletAddress)
Expand Down

0 comments on commit b8b234d

Please sign in to comment.