diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-10-25 07:24:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-25 07:24:29 +0800 |
commit | f7688ac3cf8939057013667f544d57dcb73937a5 (patch) | |
tree | 6fd725ffd0ea856c4205472557e33aa012b3b16e /test/unit/idStore-test.js | |
parent | eba37e773df54276e84d27c02a370719f670cc8b (diff) | |
parent | 3af3565000e4952d95c50c1c25a9367ba8caec90 (diff) | |
download | tangerine-wallet-browser-f7688ac3cf8939057013667f544d57dcb73937a5.tar tangerine-wallet-browser-f7688ac3cf8939057013667f544d57dcb73937a5.tar.gz tangerine-wallet-browser-f7688ac3cf8939057013667f544d57dcb73937a5.tar.bz2 tangerine-wallet-browser-f7688ac3cf8939057013667f544d57dcb73937a5.tar.lz tangerine-wallet-browser-f7688ac3cf8939057013667f544d57dcb73937a5.tar.xz tangerine-wallet-browser-f7688ac3cf8939057013667f544d57dcb73937a5.tar.zst tangerine-wallet-browser-f7688ac3cf8939057013667f544d57dcb73937a5.zip |
Merge pull request #745 from MetaMask/i743-FixDelegateCallFlag
Reproduced issue 743 in test case
Diffstat (limited to 'test/unit/idStore-test.js')
-rw-r--r-- | test/unit/idStore-test.js | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/test/unit/idStore-test.js b/test/unit/idStore-test.js index 0a57d2121..da465f511 100644 --- a/test/unit/idStore-test.js +++ b/test/unit/idStore-test.js @@ -1,9 +1,10 @@ -var assert = require('assert') -var IdentityStore = require('../../app/scripts/lib/idStore') -var configManagerGen = require('../lib/mock-config-manager') +const async = require('async') +const assert = require('assert') const ethUtil = require('ethereumjs-util') const BN = ethUtil.BN -const async = require('async') +const configManagerGen = require('../lib/mock-config-manager') +const delegateCallCode = require('../lib/example-code.json').delegateCallCode +const IdentityStore = require('../../app/scripts/lib/idStore') describe('IdentityStore', function() { @@ -156,4 +157,16 @@ describe('IdentityStore', function() { assert.ok(bnResult.gt(gas), 'added more gas as buffer.') assert.equal(result.indexOf('0x'), 0, 'include hex prefix') }) + + describe('#checkForDelegateCall', function() { + const idStore = new IdentityStore({ + configManager: configManagerGen(), + ethStore: { + addAccount(acct) { accounts.push(ethUtil.addHexPrefix(acct)) }, + }, + }) + + var result = idStore.checkForDelegateCall(delegateCallCode) + assert.equal(result, true, 'no delegate call in provided code') + }) }) |