Skip to content

Commit

Permalink
Bump ethereumjs/** versions (#153)
Browse files Browse the repository at this point in the history
Co-authored-by: legobt <[email protected]>
  • Loading branch information
adonesky1 and legobeat authored Oct 10, 2023
1 parent 2c6ac51 commit 30ddc3a
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 124 deletions.
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ module.exports = {
global: {
branches: 65.42,
functions: 88.57,
lines: 81.57,
statements: 81.49,
lines: 81.63,
statements: 81.55,
},
},

Expand Down
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@ethereumjs/rlp": "^4.0.0",
"@ethereumjs/tx": "^4.1.1",
"@ethereumjs/util": "^8.0.0",
"@metamask/utils": "^5.0.0",
"eth-sig-util": "^2.0.0",
"ethereumjs-util": "^7.0.9",
"hdkey": "0.8.0"
},
"devDependencies": {
Expand Down Expand Up @@ -90,11 +91,8 @@
"lavamoat": {
"allowScripts": {
"@lavamoat/preinstall-always-fail": false,
"eth-sig-util>ethereumjs-abi>ethereumjs-util>keccak": false,
"eth-sig-util>ethereumjs-util>keccak": false,
"ethereumjs-tx>ethereumjs-util>keccak": false,
"ethereumjs-util>ethereum-cryptography>keccak": false,
"ethereumjs-util>ethereum-cryptography>secp256k1": false,
"eth-sig-util>ethereumjs-util>ethereum-cryptography>keccak": false,
"eth-sig-util>ethereumjs-util>ethereum-cryptography>secp256k1": false,
"hdkey>secp256k1": false
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/ledger-keyring.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Common, Chain, Hardfork } from '@ethereumjs/common';
import { RLP } from '@ethereumjs/rlp';
import { TransactionFactory } from '@ethereumjs/tx';
import * as ethUtil from '@ethereumjs/util';
import sigUtil from 'eth-sig-util';
import EthereumTx from 'ethereumjs-tx';
import * as ethUtil from 'ethereumjs-util';
import HDKey from 'hdkey';

import { LedgerBridge } from './ledger-bridge';
Expand Down Expand Up @@ -536,9 +537,7 @@ describe('LedgerKeyring', function () {
.mockImplementation(async (params) => {
expect(params).toStrictEqual({
hdPath: "m/44'/60'/0'/0",
tx: ethUtil.rlp
.encode(newFakeTx.getMessageToSign(false))
.toString('hex'),
tx: RLP.encode(newFakeTx.getMessageToSign(false)).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
@@ -1,9 +1,10 @@
import { RLP } from '@ethereumjs/rlp';
import { TransactionFactory, TxData, TypedTransaction } from '@ethereumjs/tx';
import * as ethUtil from '@ethereumjs/util';
// eslint-disable-next-line import/no-nodejs-modules
import { Buffer } from 'buffer';
import * as sigUtil from 'eth-sig-util';
import type OldEthJsTransaction from 'ethereumjs-tx';
import * as ethUtil from 'ethereumjs-util';
// 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
Loading

0 comments on commit 30ddc3a

Please sign in to comment.