Skip to content

Commit

Permalink
[PLAT-259] Upgrade EthereumTx version (#3606)
Browse files Browse the repository at this point in the history
* Upgrade EthereumTx version

* Fix lint
  • Loading branch information
raymondjacobson authored Aug 5, 2022
1 parent 907ffe9 commit 21fc91b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 31 deletions.
31 changes: 5 additions & 26 deletions identity-service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion identity-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"cors": "^2.8.4",
"death": "^1.1.0",
"eth-sig-util": "^2.2.0",
"ethereumjs-tx": "^1.3.7",
"ethereumjs-tx": "2.1.2",
"ethereumjs-util": "^6.2.1",
"ethereumjs-wallet": "^0.6.3",
"express": "^4.16.3",
Expand Down
4 changes: 2 additions & 2 deletions identity-service/src/relay/ethTxRelay.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const EthereumWallet = require('ethereumjs-wallet')
const EthereumTx = require('ethereumjs-tx')
const { Transaction } = require('ethereumjs-tx')
const axios = require('axios')
const config = require('../config')
const { ethWeb3 } = require('../web3')
Expand Down Expand Up @@ -128,7 +128,7 @@ const createAndSendEthTransaction = async (sender, receiverAddress, value, web3,
if (data) {
txParams = { ...txParams, data }
}
const tx = new EthereumTx(txParams)
const tx = new Transaction(txParams)
tx.sign(privateKeyBuffer)
const signedTx = '0x' + tx.serialize().toString('hex')
logger.info(`L1 txRelay - sending a transaction for sender ${sender.publicKey} to ${receiverAddress}, gasPrice ${parseInt(gasPrice, 16)}, gasLimit ${DEFAULT_GAS_LIMIT}, nonce ${nonce}`)
Expand Down
4 changes: 2 additions & 2 deletions identity-service/src/relay/txRelay.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const EthereumWallet = require('ethereumjs-wallet')
const EthereumTx = require('ethereumjs-tx')
const { Transaction } = require('ethereumjs-tx')

const models = require('../models')
const config = require('../config')
Expand Down Expand Up @@ -222,7 +222,7 @@ const createAndSendTransaction = async (sender, receiverAddress, value, web3, lo
txParams = { ...txParams, data }
}

const tx = new EthereumTx(txParams)
const tx = new Transaction(txParams)
tx.sign(privateKeyBuffer)
const signedTx = '0x' + tx.serialize().toString('hex')
console.log(`txRelay - sending a transaction for sender ${sender.publicKey} to ${receiverAddress}, gasPrice ${parseInt(gasPrice, 16)}, gasLimit ${DEFAULT_GAS_LIMIT}, nonce ${nonce}`)
Expand Down

0 comments on commit 21fc91b

Please sign in to comment.