diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-11-18 06:27:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-18 06:27:34 +0800 |
commit | 6400eb8453c173e04e59d7990bd2c79afb3493be (patch) | |
tree | ecb311d43d0f77d5f5f0e82a0014a09c6381f0ef /test/lib/mock-simple-keychain.js | |
parent | 115fdc36fefd33e4bf4a9e551dd6267d3d75f2c5 (diff) | |
parent | 4352c7031afb6f9a175b29d0addeb7ea48345676 (diff) | |
download | tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.gz tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.bz2 tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.lz tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.xz tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.zst tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.zip |
Merge pull request #816 from MetaMask/i328-MultiVault
Multi vault to Dev Branch
Diffstat (limited to 'test/lib/mock-simple-keychain.js')
-rw-r--r-- | test/lib/mock-simple-keychain.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/lib/mock-simple-keychain.js b/test/lib/mock-simple-keychain.js new file mode 100644 index 000000000..615b3e537 --- /dev/null +++ b/test/lib/mock-simple-keychain.js @@ -0,0 +1,38 @@ +var fakeWallet = { + privKey: '0x123456788890abcdef', + address: '0xfedcba0987654321', +} +const type = 'Simple Key Pair' + +module.exports = class MockSimpleKeychain { + + static type() { return type } + + constructor(opts) { + this.type = type + this.opts = opts || {} + this.wallets = [] + } + + serialize() { + return [ fakeWallet.privKey ] + } + + deserialize(data) { + if (!Array.isArray(data)) { + throw new Error('Simple keychain deserialize requires a privKey array.') + } + this.wallets = [ fakeWallet ] + } + + addAccounts(n = 1) { + for(var i = 0; i < n; i++) { + this.wallets.push(fakeWallet) + } + } + + getAccounts() { + return this.wallets.map(w => w.address) + } + +} |