mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-22 08:58:55 +00:00
Fix Trezor signing + stronger typing (#723)
This commit is contained in:
parent
42b16155c5
commit
18695d0936
@ -1,6 +1,6 @@
|
||||
import Ledger3 from 'vendor/ledger3';
|
||||
import LedgerEth from 'vendor/ledger-eth';
|
||||
import EthTx from 'ethereumjs-tx';
|
||||
import EthTx, { TxObj } from 'ethereumjs-tx';
|
||||
import { addHexPrefix, bufferToHex, toBuffer } from 'ethereumjs-util';
|
||||
import { DeterministicWallet } from './deterministic';
|
||||
import { getTransactionFields } from 'libs/transaction';
|
||||
@ -34,7 +34,7 @@ export class LedgerWallet extends DeterministicWallet implements IFullWallet {
|
||||
}
|
||||
const strTx = getTransactionFields(t);
|
||||
|
||||
const txToSerialize = {
|
||||
const txToSerialize: TxObj = {
|
||||
...strTx,
|
||||
v: addHexPrefix(result.v),
|
||||
r: addHexPrefix(result.r),
|
||||
|
@ -1,10 +1,9 @@
|
||||
import BN from 'bn.js';
|
||||
import EthTx from 'ethereumjs-tx';
|
||||
import EthTx, { TxObj } from 'ethereumjs-tx';
|
||||
import { addHexPrefix } from 'ethereumjs-util';
|
||||
import { stripHexPrefixAndLower, padLeftEven } from 'libs/values';
|
||||
import TrezorConnect from 'vendor/trezor-connect';
|
||||
import { DeterministicWallet } from './deterministic';
|
||||
|
||||
import { getTransactionFields } from 'libs/transaction';
|
||||
import mapValues from 'lodash/mapValues';
|
||||
|
||||
@ -35,8 +34,8 @@ export class TrezorWallet extends DeterministicWallet implements IFullWallet {
|
||||
|
||||
// TODO: Explain what's going on here? Add tests? Adapted from:
|
||||
// https://github.com/kvhnuke/etherwallet/blob/v3.10.2.6/app/scripts/uiFuncs.js#L24
|
||||
const txToSerialize = {
|
||||
...tx,
|
||||
const txToSerialize: TxObj = {
|
||||
...strTx,
|
||||
v: addHexPrefix(new BN(result.v).toString(16)),
|
||||
r: addHexPrefix(result.r),
|
||||
s: addHexPrefix(result.s)
|
||||
|
Loading…
x
Reference in New Issue
Block a user