Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
adonesky1 committed Oct 4, 2023
1 parent 7c75942 commit e70ae00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/ledger-keyring.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Common, Chain, Hardfork } from '@ethereumjs/common';
import { TransactionFactory } from '@ethereumjs/tx';
import sigUtil from 'eth-sig-util';
import EthereumTx from 'ethereumjs-tx';
import * as ethUtil from 'ethereumjs-util';
import * as ethUtil from '@ethereumjs/util';

Check failure on line 5 in src/ledger-keyring.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (14.x)

`@ethereumjs/util` import should occur before import of `eth-sig-util`

Check failure on line 5 in src/ledger-keyring.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (16.x)

`@ethereumjs/util` import should occur before import of `eth-sig-util`

Check failure on line 5 in src/ledger-keyring.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (19.x)

`@ethereumjs/util` import should occur before import of `eth-sig-util`
import {RLP} from '@ethereumjs/rlp'

Check failure on line 6 in src/ledger-keyring.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (14.x)

`@ethereumjs/rlp` import should occur before import of `@ethereumjs/tx`

Check failure on line 6 in src/ledger-keyring.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (14.x)

Replace `RLP}·from·'@ethereumjs/rlp'` with `·RLP·}·from·'@ethereumjs/rlp';`

Check failure on line 6 in src/ledger-keyring.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (16.x)

`@ethereumjs/rlp` import should occur before import of `@ethereumjs/tx`

Check failure on line 6 in src/ledger-keyring.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (16.x)

Replace `RLP}·from·'@ethereumjs/rlp'` with `·RLP·}·from·'@ethereumjs/rlp';`

Check failure on line 6 in src/ledger-keyring.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (19.x)

`@ethereumjs/rlp` import should occur before import of `@ethereumjs/tx`

Check failure on line 6 in src/ledger-keyring.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (19.x)

Replace `RLP}·from·'@ethereumjs/rlp'` with `·RLP·}·from·'@ethereumjs/rlp';`
import HDKey from 'hdkey';

import { LedgerBridge } from './ledger-bridge';
Expand Down Expand Up @@ -536,9 +537,9 @@ describe('LedgerKeyring', function () {
.mockImplementation(async (params) => {
expect(params).toStrictEqual({
hdPath: "m/44'/60'/0'/0",
tx: ethUtil.rlp
tx: RLP

Check failure on line 540 in src/ledger-keyring.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (14.x)

Replace `⏎················.encode(newFakeTx.getMessageToSign(false))⏎················` with `.encode(newFakeTx.getMessageToSign(false))`

Check failure on line 540 in src/ledger-keyring.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (16.x)

Replace `⏎················.encode(newFakeTx.getMessageToSign(false))⏎················` with `.encode(newFakeTx.getMessageToSign(false))`

Check failure on line 540 in src/ledger-keyring.test.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (19.x)

Replace `⏎················.encode(newFakeTx.getMessageToSign(false))⏎················` with `.encode(newFakeTx.getMessageToSign(false))`
.encode(newFakeTx.getMessageToSign(false))
.toString('hex'),
.toString(),
});
return expectedRSV;
});
Expand Down
5 changes: 3 additions & 2 deletions src/ledger-keyring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { TransactionFactory, TxData, TypedTransaction } from '@ethereumjs/tx';
import { Buffer } from 'buffer';
import * as sigUtil from 'eth-sig-util';
import type OldEthJsTransaction from 'ethereumjs-tx';
import * as ethUtil from 'ethereumjs-util';
import * as ethUtil from '@ethereumjs/util';

Check failure on line 6 in src/ledger-keyring.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (14.x)

`@ethereumjs/util` import should occur before import of `buffer`

Check failure on line 6 in src/ledger-keyring.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (16.x)

`@ethereumjs/util` import should occur before import of `buffer`

Check failure on line 6 in src/ledger-keyring.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (19.x)

`@ethereumjs/util` import should occur before import of `buffer`
import { RLP } from '@ethereumjs/rlp';

Check failure on line 7 in src/ledger-keyring.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (14.x)

`@ethereumjs/rlp` import should occur before import of `@ethereumjs/tx`

Check failure on line 7 in src/ledger-keyring.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (16.x)

`@ethereumjs/rlp` import should occur before import of `@ethereumjs/tx`

Check failure on line 7 in src/ledger-keyring.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (19.x)

`@ethereumjs/rlp` import should occur before import of `@ethereumjs/tx`
// eslint-disable-next-line import/no-nodejs-modules
import { EventEmitter } from 'events';
import HDKey from 'hdkey';
Expand Down Expand Up @@ -333,7 +334,7 @@ export class LedgerKeyring extends EventEmitter {

rawTxHex = Buffer.isBuffer(messageToSign)
? messageToSign.toString('hex')
: ethUtil.rlp.encode(messageToSign).toString('hex');
: RLP.encode(messageToSign).toString();

return this.#signTransaction(address, rawTxHex, (payload) => {
// Because tx will be immutable, first get a plain javascript object that
Expand Down

0 comments on commit e70ae00

Please sign in to comment.