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

util/signature: add WalletConnect API support #386

Merged
merged 1 commit into from
Jun 21, 2022

Conversation

fyrchik
Copy link
Contributor

@fyrchik fyrchik commented Mar 15, 2022

Signed-off-by: Evgenii Stratonikov evgeniy@nspcc.ru

@codecov
Copy link

codecov bot commented Mar 15, 2022

Codecov Report

Merging #386 (1ac5359) into master (c82dcf7) will decrease coverage by 0.29%.
The diff coverage is 71.60%.

❗ Current head 1ac5359 differs from pull request most recent head c07b3dd. Consider uploading reports for the commit c07b3dd to get more accurate results

@@            Coverage Diff             @@
##           master     #386      +/-   ##
==========================================
- Coverage   63.65%   63.36%   -0.30%     
==========================================
  Files          71       74       +3     
  Lines        9017     9163     +146     
==========================================
+ Hits         5740     5806      +66     
- Misses       2590     2663      +73     
- Partials      687      694       +7     
Impacted Files Coverage Δ
refs/types.go 47.25% <ø> (ø)
util/signature/walletconnect/sign.go 71.21% <71.21%> (ø)
util/signature/options.go 46.51% <73.33%> (ø)
object/convert.go 73.59% <0.00%> (-2.16%) ⬇️
object/marshal.go 71.61% <0.00%> (ø)
util/signature/data.go 67.56% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 79902c1...c07b3dd. Read the comment docs.

msg := []byte("NEO")
result, err := SignMessage(p1, msg)
require.NoError(t, err)
//require.Equal(t, elliptic.MarshalCompressed(elliptic.P256(), p1.PublicKey.X, p1.PublicKey.Y), result.PublicKey)
Copy link
Member

Choose a reason for hiding this comment

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

debug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

alexvanin
alexvanin previously approved these changes Jun 20, 2022
Copy link
Contributor

@alexvanin alexvanin left a comment

Choose a reason for hiding this comment

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

go.mod changes look a bit strange, though

@carpawell
Copy link
Member

A binary in the PR. Was it planned?

Comment on lines 39 to 40
// Verify verifies message using WalletConnect API. The returned signature
// contains RFC6979 signature and 16-byte salt.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Verify verifies message using WalletConnect API. The returned signature
// contains RFC6979 signature and 16-byte salt.
// Verify verifies message using WalletConnect API.

copypaste?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is nice to have some info about the signature format.

Copy link
Member

Choose a reason for hiding this comment

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

yes, that is good but what about "...returned..."? func does not return any signature

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

To avoid introducing new dependency (neo-go), crypto routines are used
as in other code.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
@fyrchik fyrchik merged commit dd233c3 into nspcc-dev:master Jun 21, 2022
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