diff options
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') + }) }) |