-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support go-onchain-credential-adapter #57
Conversation
…om go-iden3-core library.
…esolverRegistry instead of custom code
…, but that accepts configuration and registers custom DID methods.
@@ -861,6 +861,56 @@ func PLGNCacheCredentials(in *C.char, cfg *C.char, status **C.PLGNStatus) bool { | |||
return true | |||
} | |||
|
|||
//export PLGNW3CCredentialFromOnchainHex | |||
func PLGNW3CCredentialFromOnchainHex(jsonResponse **C.char, in *C.char, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a documentation to this function?
return nil, | ||
fmt.Errorf("failed to connect to ethereum: %w", err) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defer ethcli.Close() | |
onchain_adapter_test.go
Outdated
outBytes, err := json.Marshal(out) | ||
require.NoError(t, err) | ||
var actualOutCredential *verifiable.W3CCredential | ||
err = json.Unmarshal(outBytes, &actualOutCredential) | ||
require.NoError(t, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outBytes, err := json.Marshal(out) | |
require.NoError(t, err) | |
var actualOutCredential *verifiable.W3CCredential | |
err = json.Unmarshal(outBytes, &actualOutCredential) | |
require.NoError(t, err) | |
var actualOutCredential *verifiable.W3CCredential | |
err = remarshalObj(&actualOutCredential, out) | |
require.NoError(t, err) |
onchain_adapter_test.go
Outdated
require.Equal(t, wantOutCredential, actualOutCredential) | ||
} | ||
|
||
removeIdFromEthBody := func(body []byte) []byte { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same function as in TestPrepareInputs. Maybe it would be better to move it to an outer scope and use the same function in both places?
cmd/polygonid/polygonid.go
Outdated
@@ -861,6 +861,16 @@ func PLGNCacheCredentials(in *C.char, cfg *C.char, status **C.PLGNStatus) bool { | |||
return true | |||
} | |||
|
|||
// PLGNW3CCredentialFromOnchainHex returns a verifiable credential from an onchain data hex string. | |||
// | |||
// Sample configuration: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's an input, not a configuration
No description provided.