Skip to content
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

Merged
merged 24 commits into from
Feb 27, 2024

Conversation

ilya-korotya
Copy link
Contributor

No description provided.

@@ -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,
Copy link
Contributor

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)
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
defer ethcli.Close()

Comment on lines 35 to 39
outBytes, err := json.Marshal(out)
require.NoError(t, err)
var actualOutCredential *verifiable.W3CCredential
err = json.Unmarshal(outBytes, &actualOutCredential)
require.NoError(t, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)

require.Equal(t, wantOutCredential, actualOutCredential)
}

removeIdFromEthBody := func(body []byte) []byte {
Copy link
Contributor

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?

@@ -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:
Copy link
Contributor

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

Base automatically changed from migrate_core_proof to main February 27, 2024 16:35
@olomix olomix merged commit bd36fc2 into main Feb 27, 2024
5 checks passed
@olomix olomix deleted the feature/support-go-onchain-adapter-library branch February 27, 2024 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants