diff --git a/pkg/services/blockchain/eth/resolver.go b/pkg/services/blockchain/eth/resolver.go index 6b32909..59c7260 100644 --- a/pkg/services/blockchain/eth/resolver.go +++ b/pkg/services/blockchain/eth/resolver.go @@ -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) diff --git a/pkg/services/blockchain/eth/resolver_test.go b/pkg/services/blockchain/eth/resolver_test.go index 46d239f..f90f143 100644 --- a/pkg/services/blockchain/eth/resolver_test.go +++ b/pkg/services/blockchain/eth/resolver_test.go @@ -252,7 +252,7 @@ func TestResolveSignature_Success(t *testing.T) { ReplacedByRoot: big.NewInt(0), ReplacedAtTimestamp: big.NewInt(0), }, - Signature: "0x4640cdda90e9340e4283e5e5d622137ee624142a53a66b98552eae931dab8eb41f25b4c9eae4771be41e7e1dcac364fc2b98cc6adf02586b158c24c3ca36f8af1c", + Signature: "0xc3dd18cd87c75fe225a569473f822daf66eed38f6e81dfc6766f4c35f1610ad96c546812eb416cd29f30098e5e9e38db78c4887db517f0569762e9f62227154d1b", }, }, { @@ -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 } diff --git a/pkg/services/did.go b/pkg/services/did.go index 74f2d21..c65a01f 100644 --- a/pkg/services/did.go +++ b/pkg/services/did.go @@ -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)