Skip to content

Commit

Permalink
fix issue ethereum address
Browse files Browse the repository at this point in the history
  • Loading branch information
daveroga committed Jul 19, 2024
1 parent 156795f commit 3782f58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
11 changes: 1 addition & 10 deletions pkg/services/blockchain/eth/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,7 @@ func (r *Resolver) Resolve(
}

signature := ""
if r.walletKey != "" {
if opts.VerifyingContractChainId == nil {
return services.IdentityState{}, errors.New("error verifying contract chainId is not set")
}
if opts.VerifyingContractAddress == "" {
return services.IdentityState{}, errors.New("error verifying contract address is not set")
}
if r.walletKey != "" && opts.VerifyingContractChainId != nil && opts.VerifyingContractAddress != "" {
verifyingContract := services.VerifyingContract{
ChainId: *opts.VerifyingContractChainId,
Address: opts.VerifyingContractAddress,
Expand All @@ -237,9 +231,6 @@ func (r *Resolver) Resolve(

identityState.Signature = signature

// verified, _ := r.VerifyIdentityState(identityState, did)
// log.Println("VERIFIED:", verified)

return identityState, err
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/services/did.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (d *DidDocumentServices) GetDidDocument(ctx context.Context, did string, op
blockchain = userDID.IDStrings[0]
network = userDID.IDStrings[1]
} else {
userID, err := core.IDFromDID(*userDID)
userID, err = core.IDFromDID(*userDID)
errResolution, err = expectedError(err)
if err != nil {
return errResolution, err
Expand Down Expand Up @@ -110,7 +110,7 @@ func (d *DidDocumentServices) GetDidDocument(ctx context.Context, did string, op

chainIDStateAddress := resolver.BlockchainID()

if err == nil {
if err == nil && userDID.IDStrings[2] != "000000000000000000000000000000000000000000" {
addressString := fmt.Sprintf("%x", addr)
blockchainAccountID := fmt.Sprintf("eip155:%s:0x%s", strings.Split(chainIDStateAddress, ":")[0], addressString)
didResolution.DidDocument.VerificationMethod = append(
Expand Down

0 comments on commit 3782f58

Please sign in to comment.