-
Notifications
You must be signed in to change notification settings - Fork 289
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
[LIVE-8174] Feature - coin-xrp module #6822
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ 5 Ignored Deployments
|
New and removed dependencies detected. Learn more about Socket for GitHub βοΈ
|
463b5e4
to
08b0b9e
Compare
Desktop Bundle Checks
Mobile Bundle Checksβ Previous issues have all been fixed. |
08b0b9e
to
49707b2
Compare
b069291
to
90e3c97
Compare
b64e69e
to
67cd3d1
Compare
[Bot] Testing with 'Nitrogen' β 1 txs β 1 txs ($22.82) β² 5min 53s
β 1 mutation errors
Details of the 2 mutationsSpec XRP (4)
Portfolio ($22.82) β Details of the 1 currencies
Performance β² 5min 53sTime spent for each spec: (total across mutations)
|
67cd3d1
to
1b1f144
Compare
import { getServerInfos, parseAPIValue } from "./api"; | ||
import { NetworkInfo, Transaction } from "./types"; | ||
|
||
// FIXME this could be cleaner |
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.
Is this comment still relevant ?
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.
I have no idea, the work of this PR was just to modularize the existing code base and adding a few types, we would need to have a proper look at how the coin integration is done to understand what should/could be done better π€·ββοΈ
networkInfo = { | ||
family: "xrp", | ||
serverFee, | ||
baseReserve: new BigNumber(0), // NOT USED. will refactor later. |
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.
should we delete this property ?
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.
My understanding for now is that the whole networkInfo
is useless, but as I don't want to introduce any breaking change for the scope of this PR, I think we should keep it as is, and do some proper cleaning work as a separate PR
@@ -16,6 +16,7 @@ describe("getWalletAPITransactionSignFlowInfos", () => { | |||
|
|||
const expectedLiveTx: Partial<Transaction> = { | |||
...xrpPlatformTx, | |||
family: "xrp", |
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.
Maybe we should have somewhere in Live common an object
export const defaultXRPTransaction = {
family: "xrp"
}
And then do
const expectedLiveTx: Partial<Transaction> = {
...xrpPlatformTx,
...defaultXRPTransaction,
}
That way we can easily extends the default values everywhere its needed
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.
Don't think it's necessary for now, as this is just a compatibilty layer while we wait for the wallet-api to stop using the "ripple" family string and rather use the xrp
one. As soon as it's done, we can remove that
@@ -1,6 +1,5 @@ | |||
import type { CryptoCurrency } from "@ledgerhq/types-cryptoassets"; | |||
import Transport from "@ledgerhq/hw-transport"; | |||
import ripple from "./ripple"; | |||
import tron from "./tron"; | |||
// TODO deprecate this approach |
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.
Just out of curiosity do we have a better approach in mind already ?
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.
Tbh I discovered that file while doing the migration, and I have no idea why it's here and what's the reason to have it. My guess is that it's just a forgotten tech debt of us trying to have a "generated" like file to have a single entrypoint for all "signTransaction", but that's not the idea anymore, so it's most probably useless now and the last coin-integration (tron) using it should be removed as well. But that's not the scope of this PR π
1b1f144
to
f882655
Compare
[Bot] Testing with 'Nitrogen' β 2 txs ($22.29) β² 71.2s
Details of the 2 mutationsSpec XRP (4)
Portfolio ($22.29) β Details of the 1 currencies
Performance β² 71.2sTime spent for each spec: (total across mutations)
|
[Bot] Testing with 'Phosphore' β 2 txs ($31.40) β² 76.9s
Details of the 2 mutationsSpec XRP (5)
Portfolio ($31.40) β Details of the 1 currencies
Performance β² 76.9sTime spent for each spec: (total across mutations)
|
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.
Thanks for splitting the code into different files :)
Some questions, but no hard blocker.
libs/ledger-live-common/src/families/xrp/bridge.integration.test.ts
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,11 @@ | |||
/* istanbul ignore file: untested because empty */ |
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.
Why didn't you keep the content of the old cli-transaction
file?
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.
It's just me doing a bad copy/paste of the EVM coin-module... (And I'm wondering now why this one is empty...) π€¦ββοΈ
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.
Added the file back with some modifications for typing and removal of the lodash dep π
2c154e4
to
dedd719
Compare
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.
π
dedd719
to
0bd2889
Compare
[Bot] Testing with 'Nitrogen' β 2 txs ($22.31) β² 71.5s
Details of the 2 mutationsSpec XRP (4)
Portfolio ($22.31) β Details of the 1 currencies
Performance β² 71.5sTime spent for each spec: (total across mutations)
|
[Bot] Testing with 'Phosphore' β 1 txs β 1 txs ($31.38) β² 5min 58s
β 1 mutation errors
Details of the 2 mutationsSpec XRP (5)
Portfolio ($31.38) β Details of the 1 currencies
Performance β² 5min 58sTime spent for each spec: (total across mutations)
|
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.
ok for live-hub scope (which is just the env lib)
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.
LGTM for my part I just wonder if this change is really necessary
|
||
const CAN_EDIT_FEES = true; | ||
|
||
const areFeesProvided = (tx: PlatformTransaction): boolean => !!tx.fee; | ||
|
||
const convertToLiveTransaction = (tx: PlatformTransaction): Partial<Transaction> => { | ||
return tx; | ||
return { ...tx, family: "xrp" }; |
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.
Not sure why we need to add family
here as I would expect it to already be in the tx
I suppose it's for making sure you always have the correct one
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.
@Justkant This change is only here because I'm renaming the "ripple" family into "xrp" family, and since I can't control the Wallet API in the same PR as this change, I need to have a compatibility layer for now ensuring that a tx with a "ripple" family from the Wallet API would still work correctly once reaching the live.
Next step is to ask your team to rename the family to xrp as well and to remove this compatibility thingy π
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.
Ok got it makes sense, thx for the details
d55dea2
0bd2889
to
d55dea2
Compare
d55dea2
to
9ddfbe1
Compare
β Checklist
npx changeset
was attached.π Description
Creation of the
coin-xrp
module, with support for better spendable balance (monitoring base reserve & trustlines), better typing, signer injection & removal of unmaintained libs likeripple-bs58check
β Context
π§ Checklist for the PR Reviewers