|
|
|
@ -137,7 +137,12 @@ module.exports = class TransactionManager extends EventEmitter { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// formats txParams so the keyringController can sign it
|
|
|
|
|
formatTxForSigining (txParams, cb) { |
|
|
|
|
formatTxForSigning (txParams, cb) { |
|
|
|
|
this.getNetwork((err, networkId) => { |
|
|
|
|
if (err) { |
|
|
|
|
return cb(err) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var address = txParams.from |
|
|
|
|
var metaTx = this.getTx(txParams.metamaskId) |
|
|
|
|
var gasMultiplier = metaTx.gasMultiplier |
|
|
|
@ -152,10 +157,13 @@ module.exports = class TransactionManager extends EventEmitter { |
|
|
|
|
txParams.data = normalize(txParams.data) |
|
|
|
|
txParams.gasLimit = normalize(txParams.gasLimit || txParams.gas) |
|
|
|
|
txParams.nonce = normalize(txParams.nonce) |
|
|
|
|
txParams.chainId = parseInt(networkId) |
|
|
|
|
|
|
|
|
|
const ethTx = new Transaction(txParams) |
|
|
|
|
|
|
|
|
|
// listener is assigned in metamaskController
|
|
|
|
|
this.emit(`${txParams.metamaskId}:formatted`, ethTx, address, txParams.metamaskId, cb) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// receives a signed tx object and updates the tx hash
|
|
|
|
|