|
|
@ -63,7 +63,7 @@ module.exports = class txProviderUtils { |
|
|
|
const initialGasLimitBn = hexToBn(initialGasLimitHex) |
|
|
|
const initialGasLimitBn = hexToBn(initialGasLimitHex) |
|
|
|
const blockGasLimitBn = hexToBn(blockGasLimitHex) |
|
|
|
const blockGasLimitBn = hexToBn(blockGasLimitHex) |
|
|
|
const bufferedGasLimitBn = initialGasLimitBn.muln(1.5) |
|
|
|
const bufferedGasLimitBn = initialGasLimitBn.muln(1.5) |
|
|
|
|
|
|
|
|
|
|
|
// if initialGasLimit is above blockGasLimit, dont modify it
|
|
|
|
// if initialGasLimit is above blockGasLimit, dont modify it
|
|
|
|
if (initialGasLimitBn.gt(blockGasLimitBn)) return bnToHex(initialGasLimitBn) |
|
|
|
if (initialGasLimitBn.gt(blockGasLimitBn)) return bnToHex(initialGasLimitBn) |
|
|
|
// if bufferedGasLimit is below blockGasLimit, use bufferedGasLimit
|
|
|
|
// if bufferedGasLimit is below blockGasLimit, use bufferedGasLimit
|
|
|
@ -99,7 +99,7 @@ module.exports = class txProviderUtils { |
|
|
|
txParams.from = normalize(txParams.from) |
|
|
|
txParams.from = normalize(txParams.from) |
|
|
|
txParams.value = normalize(txParams.value) |
|
|
|
txParams.value = normalize(txParams.value) |
|
|
|
txParams.data = normalize(txParams.data) |
|
|
|
txParams.data = normalize(txParams.data) |
|
|
|
txParams.gasLimit = normalize(txParams.gasLimit || txParams.gas) |
|
|
|
txParams.gas = normalize(txParams.gas || txParams.gasLimit) |
|
|
|
txParams.nonce = normalize(txParams.nonce) |
|
|
|
txParams.nonce = normalize(txParams.nonce) |
|
|
|
// build ethTx
|
|
|
|
// build ethTx
|
|
|
|
log.info(`Prepared tx for signing: ${JSON.stringify(txParams)}`) |
|
|
|
log.info(`Prepared tx for signing: ${JSON.stringify(txParams)}`) |
|
|
@ -134,4 +134,4 @@ function bnToHex(inputBn) { |
|
|
|
|
|
|
|
|
|
|
|
function hexToBn(inputHex) { |
|
|
|
function hexToBn(inputHex) { |
|
|
|
return new BN(ethUtil.stripHexPrefix(inputHex), 16) |
|
|
|
return new BN(ethUtil.stripHexPrefix(inputHex), 16) |
|
|
|
} |
|
|
|
} |
|
|
|