aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/app/controllers/transactions/tx-controller-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/app/controllers/transactions/tx-controller-test.js')
-rw-r--r--test/unit/app/controllers/transactions/tx-controller-test.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/app/controllers/transactions/tx-controller-test.js b/test/unit/app/controllers/transactions/tx-controller-test.js
index 559c4011b..f94b0cc44 100644
--- a/test/unit/app/controllers/transactions/tx-controller-test.js
+++ b/test/unit/app/controllers/transactions/tx-controller-test.js
@@ -188,6 +188,23 @@ describe('Transaction Controller', function () {
.catch(done)
})
+ it('should fail if recipient is public', function (done) {
+ txController.networkStore = new ObservableStore(1)
+ txController.addUnapprovedTransaction({ from: '0x1678a085c290ebd122dc42cba69373b5953b831d', to: '0x0d1d4e623D10F9FBA5Db95830F7d3839406C6AF2' })
+ .catch((err) => {
+ if (err.message === 'Recipient is a public account') done()
+ else done(err)
+ })
+ })
+
+ it('should not fail if recipient is public but not on mainnet', function (done) {
+ txController.once('newUnapprovedTx', (txMetaFromEmit) => {
+ assert(txMetaFromEmit, 'txMeta is falsey')
+ done()
+ })
+ txController.addUnapprovedTransaction({ from: '0x1678a085c290ebd122dc42cba69373b5953b831d', to: '0x0d1d4e623D10F9FBA5Db95830F7d3839406C6AF2' })
+ .catch(done)
+ })
})
describe('#addTxGasDefaults', function () {