1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

tests - tx-manager - fix assert and clean formatting

This commit is contained in:
kumavis 2017-03-30 16:06:27 -07:00
parent 1dce352523
commit 12918e1894
2 changed files with 2 additions and 10 deletions

View File

@ -56,7 +56,7 @@
"eth-query": "^1.0.3",
"eth-sig-util": "^1.1.1",
"eth-simple-keyring": "^1.1.1",
"ethereumjs-tx": "^1.0.0",
"ethereumjs-tx": "^1.2.5",
"ethereumjs-util": "ethereumjs/ethereumjs-util#ac5d0908536b447083ea422b435da27f26615de9",
"ethereumjs-wallet": "^0.6.0",
"ethjs-ens": "^1.0.2",

View File

@ -1,5 +1,4 @@
// const assert = require('assert')
const assert = require('chai').assert
const assert = require('assert')
const extend = require('xtend')
const EventEmitter = require('events')
const ethUtil = require('ethereumjs-util')
@ -22,7 +21,6 @@ describe('Transaction Manager', function() {
blockTracker: new EventEmitter(),
signTransaction: (ethTx) => new Promise((resolve) => {
ethTx.sign(privKey)
const result = ethTx.serialize()
resolve()
})
})
@ -229,21 +227,15 @@ describe('Transaction Manager', function() {
})
})
describe('#sign replay-protected tx', function() {
it('prepares a tx with the chainId set', function() {
txManager.addTx({ id: '1', status: 'unapproved', metamaskNetworkId: currentNetworkId, txParams: {} }, noop)
txManager.signTransaction('1', (err, rawTx) => {
if (err) return assert.fail('it should not fail')
const ethTx = new EthTx(ethUtil.toBuffer(rawTx))
console.log('------------------------------------------')
console.log('ethTx.getChainId(), currentNetworkId')
console.log(ethTx.getChainId(), currentNetworkId)
assert.equal(ethTx.getChainId(), currentNetworkId)
})
})
})
})