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

multi: Add ledger ui. #3874

Merged
merged 1 commit into from
Sep 25, 2023
Merged

Conversation

JoeGruffins
Copy link
Member

@JoeGruffins JoeGruffins commented May 16, 2023

depends on #3869
part of #3865

Note to reviewers. This currently only works on testnet with the ledger decred testnet app. This is different from the normal mainnet app. You must download it from ledger live after turning on "experimental" features there. The ledger must also be unlocked and that app open.

@JoeGruffins JoeGruffins force-pushed the hookupledgeractions branch 3 times, most recently from 7693520 to 01b175c Compare May 16, 2023 10:16
Copy link
Member

@amass01 amass01 left a comment

Choose a reason for hiding this comment

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

found some minors


const LedgerLoaderBarContainer = ({ loaderBar }) => {
const { ledgerDevice, deviceLabel } = useLedgerLoaderBarContainer();
return ledgerDevice ? (
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
return ledgerDevice ? (
return ledgerDevice && (

Copy link
Member Author

Choose a reason for hiding this comment

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

changed

Copy link
Member Author

Choose a reason for hiding this comment

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

Is it right to change this? Looks like it does the other thing if no label.

Comment on lines 133 to 141
if (isLedger && !ledgerDevice) {
ledgerAlertNoConnectedDevice();
return;
}
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
if (isLedger && !ledgerDevice) {
ledgerAlertNoConnectedDevice();
return;
}
if (isLedger && !ledgerDevice) {
return ledgerAlertNoConnectedDevice();
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed but does this return value do anything?

Comment on lines 96 to 98
if (isLedger) {
ledgerEnable();
} else {
ledgerDisable();
}
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
if (isLedger) {
ledgerEnable();
} else {
ledgerDisable();
}
if (isLedger) {
return ledgerEnable();
}
return ledgerDisable();

Copy link
Member Author

Choose a reason for hiding this comment

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

Is the return value used for something?

@amass01
Copy link
Member

amass01 commented May 19, 2023

also, seems like this doesn't include create/restore ledger wallet pages ? 🤔

@JoeGruffins
Copy link
Member Author

also, seems like this doesn't include create/restore ledger wallet pages ?

Maybe missed those. will add

Working well now. The transport was real finnicky to make work... One weird thing I have seen when sending a transaction is one time the fee showed up as output#1 on the trezor. Not sure what that was about have not been able to reproduce yet.

@JoeGruffins JoeGruffins force-pushed the hookupledgeractions branch 3 times, most recently from e00d9bc to 317fa79 Compare June 6, 2023 06:46
Comment on lines -52 to -61
const walletName = selectors.getWalletName(getState());

if (walletName) {
const config = wallet.getWalletCfg(
selectors.isTestNet(getState()),
walletName
);
config.set(cfgConstants.TREZOR, true);
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Alright to just set this when the wallet is created? If it trezor/ledger it will always be so. There's no reason to set it over and over.

@JoeGruffins
Copy link
Member Author

JoeGruffins commented Jun 6, 2023

./node_modules/prettier/bin-prettier.js --list-different app/**/*.{js,jsx,css,json} test/**/*.js or yarn prettify:diff doesn't show anything locally for me. What do I need to change.

I guess app/**/*.{js,jsx,css,json} doesn't expand deep enough for me.

@JoeGruffins JoeGruffins force-pushed the hookupledgeractions branch 2 times, most recently from a56a1ff to a02e434 Compare June 6, 2023 07:22
@JoeGruffins JoeGruffins marked this pull request as ready for review June 6, 2023 07:37
@JoeGruffins
Copy link
Member Author

JoeGruffins commented Jul 3, 2023

Not sure what this new test error is about...

The package "@ledgerhq/devices/hid-framing" isn't registered with npm. Maybe I need to use a lower version of the transport after all...

@JoeGruffins
Copy link
Member Author

downgrading the version LedgerHQ/ledger-live#763

@JoeGruffins
Copy link
Member Author

Copy link
Member

@amass01 amass01 left a comment

Choose a reason for hiding this comment

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

why not using new ledger icon also here ?

image

@amass01
Copy link
Member

amass01 commented Sep 12, 2023

got this with unlocked and connected ledger 🤔

image

@amass01
Copy link
Member

amass01 commented Sep 12, 2023

crash when having decdrediton running on different network than ledger app, i expect it to show the error
in the toast

image

@JoeGruffins
Copy link
Member Author

crash when having decdrediton running on different network than ledger app, i expect it to show the error in the toast
image

Absolutely. @matheusd is this maybe what you are hitting? Working on errors here now.

@JoeGruffins
Copy link
Member Author

got this with unlocked and connected ledger 🤔
image

Did this resolve itself? Was the testnet app open?

@JoeGruffins
Copy link
Member Author

JoeGruffins commented Sep 15, 2023

why not using new ledger icon also here ?
image

Having trouble making this work. Any tips?

edit: Working now... I made and am importing from decred/pi-ui#480

image
image

@JoeGruffins JoeGruffins force-pushed the hookupledgeractions branch 2 times, most recently from f35831e to ee14239 Compare September 15, 2023 09:39
@JoeGruffins
Copy link
Member Author

Showing an error for the incorrect networks now and pulling in my repo for the svg, that will change https://github.com/decred/decrediton/compare/f35831e7156bec176eb11ec93cb3232075c465a5..ee142398f37f27ffd0d6d391fcf6c9995540f929

@JoeGruffins JoeGruffins force-pushed the hookupledgeractions branch 2 times, most recently from cd28163 to 9f8be31 Compare September 19, 2023 04:21
@JoeGruffins
Copy link
Member Author

Using a newer svg. Not sure if all these changes to yarn.lock were necessary. https://github.com/decred/decrediton/compare/cd28163e854ee3762135ce1bb437c6bdf38b118a..9f8be316eb90cc719ce5de97de1ab86becb83416

@JoeGruffins
Copy link
Member Author

Copy trezor elements and apply to ledger where possible.
@JoeGruffins
Copy link
Member Author

@alexlyp alexlyp merged commit 2df568a into decred:master Sep 25, 2023
1 check passed
alexlyp pushed a commit that referenced this pull request Sep 26, 2023
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.

None yet

4 participants