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

Rahul/validate correct public address on import #4950

Merged
merged 1 commit into from
May 8, 2024

Conversation

patnir
Copy link
Contributor

@patnir patnir commented May 7, 2024

Summary

Validates public address is accurate for corresponding keys on import

Adds a public to the rust node js bindings that returns a public address from an IVK.

Testing Plan

Manual testing + unit tests

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and label it with breaking-change-rpc or breaking-change-sdk.

[ ] Yes

@patnir patnir requested a review from a team as a code owner May 7, 2024 22:11
Copy link
Member

@dguenther dguenther left a comment

Choose a reason for hiding this comment

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

Left one suggestion but otherwise seems like a worthwhile improvement to me!


if (isValidIVKAndPublicAddressPair(toImport.incomingViewKey, toImport.publicAddress)) {
throw new Error(
`Public address ${toImport.publicAddress} does not match public address generated from incoming view key ${toImport.incomingViewKey}`,
Copy link
Member

Choose a reason for hiding this comment

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

It might be nice to also log the address generated from the incoming view key -- might give someone a clue as to why they don't match.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Adds a public to the rust node js bindings that returns a public address from an IVK.
@patnir patnir force-pushed the rahul/validate-correct-public-address-on-import branch from 8f7731a to dff9c04 Compare May 7, 2024 23:00
@patnir patnir merged commit 4ef3e46 into staging May 8, 2024
13 checks passed
@patnir patnir deleted the rahul/validate-correct-public-address-on-import branch May 8, 2024 20:00
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.

2 participants