From 75fe1a93746c8657e4d9d6bec2f98e2a3a684461 Mon Sep 17 00:00:00 2001 From: Hakim <59644786+haammar-ledger@users.noreply.github.com> Date: Tue, 5 Apr 2022 15:01:48 +0200 Subject: [PATCH] Family/crypto org (#1852) * LIVE-1743 Fix crypto.com address derivation path (#1836) * trigger bot * Tentative to fix crypto.com use of address Co-authored-by: Thomas Nguy <81727899+thomas-nguy@users.noreply.github.com> --- src/families/crypto_org/js-buildTransaction.ts | 2 +- src/families/crypto_org/js-signOperation.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/families/crypto_org/js-buildTransaction.ts b/src/families/crypto_org/js-buildTransaction.ts index 1fcc4d6fc1..cb69fec44b 100644 --- a/src/families/crypto_org/js-buildTransaction.ts +++ b/src/families/crypto_org/js-buildTransaction.ts @@ -32,7 +32,7 @@ export const buildTransaction = async ( publicKey: string ) => { const croSdk = getCroSdk(a.currency.id); - const address = a.freshAddresses[0].address; + const address = a.freshAddress; const { accountNumber, sequence } = await getAccountParams( address, a.currency.id diff --git a/src/families/crypto_org/js-signOperation.ts b/src/families/crypto_org/js-signOperation.ts index d0287b3d0f..c1ce20be1d 100644 --- a/src/families/crypto_org/js-signOperation.ts +++ b/src/families/crypto_org/js-signOperation.ts @@ -117,10 +117,9 @@ const signOperation = ({ // Get the public key const hwApp = new CryptoOrgApp(transport); - const address = account.freshAddresses[0]; const cointype = isTestNet(account.currency.id) ? "tcro" : "cro"; const { publicKey } = await hwApp.getAddress( - address.derivationPath, + account.freshAddressPath, cointype, false ); @@ -131,7 +130,7 @@ const signOperation = ({ ); // Sign by device const { signature } = await hwApp.sign( - address.derivationPath, + account.freshAddressPath, unsigned.toSignDocument(0).toUint8Array() );