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

Update zondax ironfish to 0.5.1 #5449

Merged
merged 3 commits into from
Oct 2, 2024
Merged

Conversation

patnir
Copy link
Contributor

@patnir patnir commented Sep 27, 2024

Summary

We previously had to have two versions of this SDK available because the newer one did not work with single signer.

Zondax fixed the bugs and now we don't need to manage two separate dependencies now.

Created a base ledger class for the common functionality.

Testing Plan

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

We previously had to have two versions of this SDK available because the newer one did not work with single signer.

Zondax fixed the bugs and now we don't need to manage two separate dependencies now.

Created a base ledger class for the common functionality.
@patnir patnir force-pushed the rahul/update-zondax-js-to-5-1 branch from a67544c to a250002 Compare September 27, 2024 17:34
@patnir patnir changed the title implementation complete Update zondax ironfish to 0.5.1 Sep 27, 2024
@patnir patnir marked this pull request as ready for review September 27, 2024 18:34
@patnir patnir requested a review from a team as a code owner September 27, 2024 18:34
Copy link
Contributor

@hughy hughy left a comment

Choose a reason for hiding this comment

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

tested single signer, dkg, and multisig signing

ResponseIdentity,
ResponseProofGenKey as ResponseProofGenKeyDkg,
ResponseViewKey as ResponseViewKeyDkg,
} from '@zondax/ledger-ironfish-dkg'
import { ResponseError } from '@zondax/ledger-js'
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a bug because we're importing from a library that we don't have a dependency on. We shouldn't import from dependencies of our dependencies. We need to include this in our package.json.

@@ -68,9 +68,7 @@
"@oclif/plugin-warn-if-update-available": "3.1.8",
"@types/keccak": "3.0.4",
"@types/tar": "6.1.1",
"@zondax/ledger-ironfish": "0.1.2",
"@zondax/ledger-ironfish-dkg": "npm:@zondax/ledger-ironfish@0.4.0",
"@zondax/ledger-js": "^1.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Bring this back

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I asked Zondax if they will the response error type. I feel like we shouldn't include ledger-js since it is an inner dependency. We only had this because we were managing two versions of ledger-ironfish which relied on different versions of this sub dependency

Copy link
Contributor

Choose a reason for hiding this comment

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

We added this dependency because we needed access to ResponseError. Managing two versions of @zondax/ledger-ironfish caused problems with resolving to the right version, but we needed our own dependency for ResponseError

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that's fine, but you cannot use an import without referencing it in your package because if the library you depend on stops including it your code will stop compiling. You are making the code base depend on that library by importing it, therefore you need to add it to the package to indicate the dependency.

Copy link
Contributor

@mat-if mat-if Oct 2, 2024

Choose a reason for hiding this comment

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

A good way to see this in action is to comment out import { ResponseError } from '@zondax/ledger-js' in ledger.ts, then press CMD + . in VSCode to trigger the autofix. Without this being in the package.json, it will not attempt to auto-import anything. If this is in the package.json, it correctly suggests to add the import.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mat-if tried this, it is not in this package.json . They haven't exposed it in "@zondax/ledger-ironfish". I asked zondax to do it, and they said they should release it today

@patnir
Copy link
Contributor Author

patnir commented Oct 2, 2024

Going to merge this now and made a note to import ResponseError from the top level dependency once zondax makes the change. Context: https://iflabs.slack.com/archives/C06FQDY6CNT/p1727824902604019

@patnir patnir merged commit 7134289 into staging Oct 2, 2024
9 checks passed
@patnir patnir deleted the rahul/update-zondax-js-to-5-1 branch October 2, 2024 20:28
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.

4 participants