-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE][LIVE-10220] make Qtum work with old and new nano app interf…
…aces (#5675) * make qtum work with old and new nano app interfaces update isPathNormal to allow qtum coin type (88) * misc: code improvement - use switch instead of if else cascade - use semver for nano apps versions related tests * add changeset * add tests for isPathNormal * improve documentation and readability of isPathNormal function * update Qtum version using new btc implem to 3.0.0 * add regression tests regarding semver use
- Loading branch information
Showing
5 changed files
with
154 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@ledgerhq/hw-app-btc": minor | ||
--- | ||
|
||
make Qtum work with old and new nano app interfaces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
libs/ledgerjs/packages/hw-app-btc/tests/newops/isPathNormal.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { isPathNormal } from "../../src/BtcNew"; | ||
|
||
describe("isPathNormal", () => { | ||
describe("should return true for normal and supported paths", () => { | ||
test.each([ | ||
"44'/0'/0'", | ||
"44'/0'/0'/0/0", | ||
"84'/0'/0'", | ||
"84'/0'/0'/0/0", | ||
"86'/0'/0'", | ||
"86'/0'/0'/0/0", | ||
"49'/0'/0'", | ||
"49'/0'/0'/0/0", | ||
"48'/1'/99'/7'", | ||
"86'/1'/99'/0", | ||
"48'/0'/99'/7'/1/17", | ||
])("%s", path => { | ||
expect(isPathNormal(path)).toEqual(true); | ||
}); | ||
}); | ||
|
||
describe("should return false for non-normal or non supported paths", () => { | ||
test.each(["48'/0'/99'", "48'/0'/99'/7'/1/17/2", "199'/0'/1'/0/88", "86'/1'/99'/2"])( | ||
"%s", | ||
path => { | ||
expect(isPathNormal(path)).toEqual(false); | ||
}, | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import semver from "semver"; | ||
|
||
/** | ||
* To detect any semver regression that could impact the behavior of the package | ||
* implementation when working with versions having prefix. | ||
* One might say this is not necessary since it should already be covered by the | ||
* semver package own testsuite, but better be safe than sorry. | ||
* | ||
* Following this comment: | ||
* Are you 100% sure this does the same as the current implem? | ||
* Just being paranoid, because app versions can be different from a clean | ||
* major.minor.patch | ||
* e.g they can have -rc0 -next0 or such additional stuff at the end, | ||
* and it happened in the past that semver doesn't behave as we think it does. | ||
* cf. https://github.com/LedgerHQ/ledger-live/pull/5675/files#r1417174514 | ||
*/ | ||
|
||
describe("semver", () => { | ||
describe("should be able to properly compare version with prefix", () => { | ||
it("2.0.0-rc0 should be lower than 2.1.0", () => { | ||
const version = "2.0.0-rc1"; | ||
expect(semver.lt(version, "2.1.0")); | ||
}); | ||
it("2.0.0-next0 should be lower than 2.1.0", () => { | ||
const version = "2.0.0-next0"; | ||
expect(semver.lt(version, "2.1.0")); | ||
}); | ||
it("2.1.0-rc0 should be greater than 2.1.0", () => { | ||
const version = "2.1.0-rc0"; | ||
expect(semver.gt(version, "2.1.0")); | ||
}); | ||
it("2.1.0-next0 should be greater than 2.1.0", () => { | ||
const version = "2.1.0-next0"; | ||
expect(semver.gt(version, "2.1.0")); | ||
}); | ||
}); | ||
}); |
5fdd5f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
web-tools – ./apps/web-tools
ledger-live.vercel.app
web-tools-ledgerhq.vercel.app
ledger-live-tools.vercel.app
web-tools-git-develop-ledgerhq.vercel.app
live.ledger.tools
5fdd5f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Bot] Daily non-reg on develop with 'Nitrogen' ✅ 157 txs ❌ 31 txs 💰 3 miss funds ($2,025.06) ⏲ 37min 54s
8 critical spec errors
Spec Bitcoin Testnet failed!
Spec persistence failed!
Spec Solana failed!
Spec Ethereum Ropsten failed!
Spec Arbitrum Goerli failed!
Spec Kava EVM failed!
Spec Evmos EVM failed!
Spec Klaytn failed!
❌ 31 mutation errors
Please increase the account target to at least 6 accounts
Please increase the account target to at least 6 accounts
Please increase the account target to at least 6 accounts
Please increase the account target to at least 6 accounts
Please increase the account target to at least 6 accounts
Please increase the account target to at least 8 accounts
Portfolio ($2,025.06) – Details of the 68 currencies
qrzkxyvzwsghcztzg70ahd2rsfs9ranlevhtt2r68s
AVW7tDTLxYvQ5TUXohVC6PVV2sanQd3Tnr
XvD8ibKX2zTqk1HDW2MbxzvqCaAw6eLog9
dgb1qx6sswjfmgsae65ljugnn290dt208anqgn8j2f0
DMV37hhBLbJMqBFTz9TYDbz6EVwFgHbniX
RUjAgsqzt5kjkMBtWjRozbiRdJ68GNQcDW
ltc1qkk5yfet4w4hfs7z2alk0ukg79h9g32tx748eua
PDL68AQbE6frs9vUvhrvYzSAFuP6fK76HL
DQsqAp6UJPsYS6jd8hihn5a7EoADDRPUaA
32MNHKXVgcskZpXye3qtf8MvfohymcffvE
EN7mqKBrj86et83araQSxA1y1xbkb51h9k
t1PTFWCH6VeoizKvkTTEUPqv9LuGcDpPbZA
znXMQsv3o6tSugC5xomYxiE4NJdk217GgdW
02026B93627Ed2F76551E7CeF0466468B12db8Fab806266107b69947D9c95CEd9E7c
0x246FFDB387F1F8c48072E1C13443540017bC71b7
osmo1rs97j43nfyvc689y5rjvnnhrq3tes6ghn8m44l
desmos1rs97j43nfyvc689y5rjvnnhrq3tes6gh0y9454
dydx1rs97j43nfyvc689y5rjvnnhrq3tes6ghj9xpr6
umee1rs97j43nfyvc689y5rjvnnhrq3tes6ghf2468l
quick1rs97j43nfyvc689y5rjvnnhrq3tes6ghscch6l
onomy1rs97j43nfyvc689y5rjvnnhrq3tes6ghpaunjg
sei1rs97j43nfyvc689y5rjvnnhrq3tes6ghksen9v
stars1rs97j43nfyvc689y5rjvnnhrq3tes6gh0qlcgu
core1rs97j43nfyvc689y5rjvnnhrq3tes6ghgjs7yk
inj1vzjwweta3hegt99vfgrvmcq7rr5532yjsgxd4a
cro14zpaxs3msrdnx5ch3m3y3yue0wwwevrf2hmwra
erd18n5sk95fq9dtgdsa9m9q5ddp66ch9cq5lpjflwn5j9z8x2e9h0qqrvk5qp
0.0.3663977
f2ed4c9253d3aca7d679bfa9f528d13e85c7f522b8857e094c850a157b750209
0573d7a9c745fa9fe224b080832aa93d740760b94f192c9c141c709945e9aaaf
r9etPtq3oboweMPju5gdYufmvwhH2euz8z
SP2J4VHFRAT94KY6NFT6129HBA382S6R98W9ABFG2
GDJPZPOWITPCBX3TIHB6N7E4WCHS6JBZKSNWGU34QYCJXKWBTUZY5RYC
tz1aDK1uFAmnUXZ7KJPEmcCEFeYHiVZ56zVF
0xc4B17901FECf86932c3bb296BB00E7c6816Fd416
0xc4B17901FECf86932c3bb296BB00E7c6816Fd416
TM4WJOS4MZ2TD775W7GSXZMBUF74YT6SKSBXCZY3N7OUIAPXE54MZ5FCD4
0x7584df0780C5eB83b26aE55abBc265014f8bf897
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x48ec5fC762B9300e3B5e04E8ca634165240A1B15
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0xe404f128644459C5A0F6FAc6824AdA8F94798c8f
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
Performance ⏲ 37min 54s
Time spent for each spec: (total across mutations)