|
|
|
@ -270,26 +270,28 @@ describe('Transaction Controller', function () { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('does not overwrite set values', function (done) { |
|
|
|
|
this.timeout(15000) |
|
|
|
|
const wrongValue = '0x05' |
|
|
|
|
|
|
|
|
|
txController.addTx(txMeta) |
|
|
|
|
|
|
|
|
|
const estimateStub = sinon.stub(txController.txProviderUtils.query, 'estimateGas') |
|
|
|
|
.callsArgWith(1, null, wrongValue) |
|
|
|
|
.callsArgWithAsync(1, null, wrongValue) |
|
|
|
|
|
|
|
|
|
const priceStub = sinon.stub(txController.txProviderUtils.query, 'gasPrice') |
|
|
|
|
.callsArgWith(0, null, wrongValue) |
|
|
|
|
.callsArgWithAsync(0, null, wrongValue) |
|
|
|
|
|
|
|
|
|
const nonceStub = sinon.stub(txController.txProviderUtils.query, 'getTransactionCount') |
|
|
|
|
.callsArgWith(2, null, wrongValue) |
|
|
|
|
.callsArgWithAsync(2, null, wrongValue) |
|
|
|
|
|
|
|
|
|
const signStub = sinon.stub(txController, 'signTransaction') |
|
|
|
|
.callsArgWith(1, null, noop) |
|
|
|
|
.callsArgWithAsync(1, null, noop) |
|
|
|
|
|
|
|
|
|
const pubStub = sinon.stub(txController.txProviderUtils, 'publishTransaction') |
|
|
|
|
.callsArgWith(1, null, originalValue) |
|
|
|
|
.callsArgWithAsync(1, null, originalValue) |
|
|
|
|
console.log('HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') |
|
|
|
|
|
|
|
|
|
txController.approveTransaction(txMeta.id, (err) => { |
|
|
|
|
txController.approveTransaction(txMeta.id).then((err) => { |
|
|
|
|
assert.ifError(err, 'should not error') |
|
|
|
|
|
|
|
|
|
const result = txController.getTx(txMeta.id) |
|
|
|
@ -305,7 +307,6 @@ describe('Transaction Controller', function () { |
|
|
|
|
signStub.restore() |
|
|
|
|
nonceStub.restore() |
|
|
|
|
pubStub.restore() |
|
|
|
|
|
|
|
|
|
done() |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|