aboutsummaryrefslogtreecommitdiffstats
path: root/test/lib
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-05-25 14:19:39 +0800
committerkumavis <aaron@kumavis.me>2018-05-25 14:19:39 +0800
commitda5be0812aed74548f1107a9f1ce3a2abc479076 (patch)
tree60286dede9a751a5bcbc986479f958e25b7a5b59 /test/lib
parent0b45810d4cdb6f5cfcf875b916b7dc52c4c6ef51 (diff)
downloadtangerine-wallet-browser-da5be0812aed74548f1107a9f1ce3a2abc479076.tar
tangerine-wallet-browser-da5be0812aed74548f1107a9f1ce3a2abc479076.tar.gz
tangerine-wallet-browser-da5be0812aed74548f1107a9f1ce3a2abc479076.tar.bz2
tangerine-wallet-browser-da5be0812aed74548f1107a9f1ce3a2abc479076.tar.lz
tangerine-wallet-browser-da5be0812aed74548f1107a9f1ce3a2abc479076.tar.xz
tangerine-wallet-browser-da5be0812aed74548f1107a9f1ce3a2abc479076.tar.zst
tangerine-wallet-browser-da5be0812aed74548f1107a9f1ce3a2abc479076.zip
test - unit - metamask-controller - fix many bugs in tests
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/createTxMeta.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/lib/createTxMeta.js b/test/lib/createTxMeta.js
new file mode 100644
index 000000000..246ea58a5
--- /dev/null
+++ b/test/lib/createTxMeta.js
@@ -0,0 +1,16 @@
+const txStateHistoryHelper = require('../../app/scripts/controllers/transactions/lib/tx-state-history-helper')
+
+module.exports = createTxMeta
+
+function createTxMeta(partialMeta) {
+ const txMeta = Object.assign({
+ status: 'unapproved',
+ txParams: {},
+ }, partialMeta)
+ // initialize history
+ txMeta.history = []
+ // capture initial snapshot of txMeta for history
+ const snapshot = txStateHistoryHelper.snapshotFromTxMeta(txMeta)
+ txMeta.history.push(snapshot)
+ return txMeta
+}