parent
f279a8e61a
commit
13ebb0b455
@ -1,5 +1,5 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const ComposableObservableStore = require('../../app/scripts/lib/ComposableObservableStore') |
const ComposableObservableStore = require('../../../app/scripts/lib/ComposableObservableStore') |
||||||
const ObservableStore = require('obs-store') |
const ObservableStore = require('obs-store') |
||||||
|
|
||||||
describe('ComposableObservableStore', () => { |
describe('ComposableObservableStore', () => { |
@ -1,5 +1,6 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const accountImporter = require('../../app/scripts/account-import-strategies/index') |
const path = require('path') |
||||||
|
const accountImporter = require('../../../app/scripts/account-import-strategies/index') |
||||||
const ethUtil = require('ethereumjs-util') |
const ethUtil = require('ethereumjs-util') |
||||||
|
|
||||||
describe('Account Import Strategies', function () { |
describe('Account Import Strategies', function () { |
@ -0,0 +1,48 @@ |
|||||||
|
const assert = require('assert') |
||||||
|
const getBuyEthUrl = require('../../../app/scripts/lib/buy-eth-url') |
||||||
|
|
||||||
|
describe('', function () { |
||||||
|
const mainnet = { |
||||||
|
network: '1', |
||||||
|
amount: 5, |
||||||
|
address: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc', |
||||||
|
} |
||||||
|
const ropsten = { |
||||||
|
network: '3', |
||||||
|
} |
||||||
|
const rinkeby = { |
||||||
|
network: '4', |
||||||
|
} |
||||||
|
const kovan = { |
||||||
|
network: '42', |
||||||
|
} |
||||||
|
|
||||||
|
it('returns coinbase url with amount and address for network 1', function () { |
||||||
|
const coinbaseUrl = getBuyEthUrl(mainnet) |
||||||
|
const coinbase = coinbaseUrl.match(/(https:\/\/buy.coinbase.com)/) |
||||||
|
const amount = coinbaseUrl.match(/(amount)\D\d/) |
||||||
|
const address = coinbaseUrl.match(/(address)(.*)(?=&)/) |
||||||
|
|
||||||
|
assert.equal(coinbase[0], 'https://buy.coinbase.com') |
||||||
|
assert.equal(amount[0], 'amount=5') |
||||||
|
assert.equal(address[0], 'address=0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc') |
||||||
|
|
||||||
|
}) |
||||||
|
|
||||||
|
it('returns metamask ropsten faucet for network 3', function () { |
||||||
|
const ropstenUrl = getBuyEthUrl(ropsten) |
||||||
|
assert.equal(ropstenUrl, 'https://faucet.metamask.io/') |
||||||
|
}) |
||||||
|
|
||||||
|
it('returns rinkeby dapp for network 4', function () { |
||||||
|
const rinkebyUrl = getBuyEthUrl(rinkeby) |
||||||
|
assert.equal(rinkebyUrl, 'https://www.rinkeby.io/') |
||||||
|
}) |
||||||
|
|
||||||
|
it('returns kovan github test faucet for network 42', function () { |
||||||
|
const kovanUrl = getBuyEthUrl(kovan) |
||||||
|
assert.equal(kovanUrl, 'https://github.com/kovan-testnet/faucet') |
||||||
|
}) |
||||||
|
|
||||||
|
}) |
||||||
|
|
@ -1,5 +1,5 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const AddressBookController = require('../../app/scripts/controllers/address-book') |
const AddressBookController = require('../../../../app/scripts/controllers/address-book') |
||||||
|
|
||||||
const mockKeyringController = { |
const mockKeyringController = { |
||||||
memStore: { |
memStore: { |
@ -1,5 +1,5 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const BlacklistController = require('../../app/scripts/controllers/blacklist') |
const BlacklistController = require('../../../../app/scripts/controllers/blacklist') |
||||||
|
|
||||||
describe('blacklist controller', function () { |
describe('blacklist controller', function () { |
||||||
let blacklistController |
let blacklistController |
@ -1,6 +1,6 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const sinon = require('sinon') |
const sinon = require('sinon') |
||||||
const InfuraController = require('../../app/scripts/controllers/infura') |
const InfuraController = require('../../../../app/scripts/controllers/infura') |
||||||
|
|
||||||
describe('infura-controller', function () { |
describe('infura-controller', function () { |
||||||
let infuraController, sandbox, networkStatus |
let infuraController, sandbox, networkStatus |
@ -1,11 +1,11 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const nock = require('nock') |
const nock = require('nock') |
||||||
const NetworkController = require('../../app/scripts/controllers/network') |
const NetworkController = require('../../../../app/scripts/controllers/network') |
||||||
const { |
const { |
||||||
getNetworkDisplayName, |
getNetworkDisplayName, |
||||||
} = require('../../app/scripts/controllers/network/util') |
} = require('../../../../app/scripts/controllers/network/util') |
||||||
|
|
||||||
const { createTestProviderTools } = require('../stub/provider') |
const { createTestProviderTools } = require('../../../stub/provider') |
||||||
const providerResultStub = {} |
const providerResultStub = {} |
||||||
|
|
||||||
describe('# Network Controller', function () { |
describe('# Network Controller', function () { |
@ -1,6 +1,6 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const configManagerGen = require('../lib/mock-config-manager') |
const configManagerGen = require('../../../lib/mock-config-manager') |
||||||
const NoticeController = require('../../app/scripts/notice-controller') |
const NoticeController = require('../../../../app/scripts/notice-controller') |
||||||
|
|
||||||
describe('notice-controller', function () { |
describe('notice-controller', function () { |
||||||
var noticeController |
var noticeController |
@ -1,5 +1,5 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const PreferencesController = require('../../app/scripts/controllers/preferences') |
const PreferencesController = require('../../../../app/scripts/controllers/preferences') |
||||||
|
|
||||||
describe('preferences controller', function () { |
describe('preferences controller', function () { |
||||||
let preferencesController |
let preferencesController |
@ -1,6 +1,6 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const sinon = require('sinon') |
const sinon = require('sinon') |
||||||
const TokenRatesController = require('../../app/scripts/controllers/token-rates') |
const TokenRatesController = require('../../../../app/scripts/controllers/token-rates') |
||||||
const ObservableStore = require('obs-store') |
const ObservableStore = require('obs-store') |
||||||
|
|
||||||
describe('TokenRatesController', () => { |
describe('TokenRatesController', () => { |
@ -1,6 +1,6 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const NonceTracker = require('../../app/scripts/controllers/transactions/nonce-tracker') |
const NonceTracker = require('../../../../../app/scripts/controllers/transactions/nonce-tracker') |
||||||
const MockTxGen = require('../lib/mock-tx-gen') |
const MockTxGen = require('../../../../lib/mock-tx-gen') |
||||||
let providerResultStub = {} |
let providerResultStub = {} |
||||||
|
|
||||||
describe('Nonce Tracker', function () { |
describe('Nonce Tracker', function () { |
@ -1,5 +1,5 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const txHelper = require('../../ui/lib/tx-helper') |
const txHelper = require('../../../../../ui/lib/tx-helper') |
||||||
|
|
||||||
describe('txHelper', function () { |
describe('txHelper', function () { |
||||||
it('always shows the oldest tx first', function () { |
it('always shows the oldest tx first', function () { |
@ -1,6 +1,6 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const txStateHistoryHelper = require('../../app/scripts/controllers/transactions/lib/tx-state-history-helper') |
const txStateHistoryHelper = require('../../../../../app/scripts/controllers/transactions/lib/tx-state-history-helper') |
||||||
const testVault = require('../data/v17-long-history.json') |
const testVault = require('../../../../data/v17-long-history.json') |
||||||
|
|
||||||
describe ('Transaction state history helper', function () { |
describe ('Transaction state history helper', function () { |
||||||
|
|
@ -1,8 +1,8 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const clone = require('clone') |
const clone = require('clone') |
||||||
const ObservableStore = require('obs-store') |
const ObservableStore = require('obs-store') |
||||||
const TxStateManager = require('../../app/scripts/controllers/transactions/tx-state-manager') |
const TxStateManager = require('../../../../../app/scripts/controllers/transactions/tx-state-manager') |
||||||
const txStateHistoryHelper = require('../../app/scripts/controllers/transactions/lib/tx-state-history-helper') |
const txStateHistoryHelper = require('../../../../../app/scripts/controllers/transactions/lib/tx-state-history-helper') |
||||||
const noop = () => true |
const noop = () => true |
||||||
|
|
||||||
describe('TransactionStateManager', function () { |
describe('TransactionStateManager', function () { |
@ -1,5 +1,5 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const txUtils = require('../../app/scripts/controllers/transactions/lib/util') |
const txUtils = require('../../../../../app/scripts/controllers/transactions/lib/util') |
||||||
|
|
||||||
|
|
||||||
describe('txUtils', function () { |
describe('txUtils', function () { |
@ -1,6 +1,6 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
|
|
||||||
const EdgeEncryptor = require('../../app/scripts/edge-encryptor') |
const EdgeEncryptor = require('../../../app/scripts/edge-encryptor') |
||||||
|
|
||||||
var password = 'passw0rd1' |
var password = 'passw0rd1' |
||||||
var data = 'some random data' |
var data = 'some random data' |
@ -1,5 +1,5 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const MessageManager = require('../../app/scripts/lib/message-manager') |
const MessageManager = require('../../../app/scripts/lib/message-manager') |
||||||
|
|
||||||
describe('Message Manager', function () { |
describe('Message Manager', function () { |
||||||
let messageManager |
let messageManager |
@ -1,5 +1,5 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const nodeify = require('../../app/scripts/lib/nodeify') |
const nodeify = require('../../../app/scripts/lib/nodeify') |
||||||
|
|
||||||
describe('nodeify', function () { |
describe('nodeify', function () { |
||||||
var obj = { |
var obj = { |
@ -1,6 +1,6 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const PendingBalanceCalculator = require('../../app/scripts/lib/pending-balance-calculator') |
const PendingBalanceCalculator = require('../../../app/scripts/lib/pending-balance-calculator') |
||||||
const MockTxGen = require('../lib/mock-tx-gen') |
const MockTxGen = require('../../lib/mock-tx-gen') |
||||||
const BN = require('ethereumjs-util').BN |
const BN = require('ethereumjs-util').BN |
||||||
let providerResultStub = {} |
let providerResultStub = {} |
||||||
|
|
@ -1,6 +1,6 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
|
|
||||||
const PersonalMessageManager = require('../../app/scripts/lib/personal-message-manager') |
const PersonalMessageManager = require('../../../app/scripts/lib/personal-message-manager') |
||||||
|
|
||||||
describe('Personal Message Manager', function () { |
describe('Personal Message Manager', function () { |
||||||
let messageManager |
let messageManager |
@ -1,9 +1,9 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const clone = require('clone') |
const clone = require('clone') |
||||||
const KeyringController = require('eth-keyring-controller') |
const KeyringController = require('eth-keyring-controller') |
||||||
const firstTimeState = require('../../app/scripts/first-time-state') |
const firstTimeState = require('../../../app/scripts/first-time-state') |
||||||
const seedPhraseVerifier = require('../../app/scripts/lib/seed-phrase-verifier') |
const seedPhraseVerifier = require('../../../app/scripts/lib/seed-phrase-verifier') |
||||||
const mockEncryptor = require('../lib/mock-encryptor') |
const mockEncryptor = require('../../lib/mock-encryptor') |
||||||
|
|
||||||
describe('SeedPhraseVerifier', function () { |
describe('SeedPhraseVerifier', function () { |
||||||
|
|
@ -1,5 +1,5 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const { sufficientBalance } = require('../../app/scripts/lib/util') |
const { sufficientBalance } = require('../../../app/scripts/lib/util') |
||||||
|
|
||||||
|
|
||||||
describe('SufficientBalance', function () { |
describe('SufficientBalance', function () { |
@ -1,22 +1,22 @@ |
|||||||
const assert = require('assert') |
const assert = require('assert') |
||||||
const path = require('path') |
const path = require('path') |
||||||
|
|
||||||
const wallet1 = require(path.join('..', 'lib', 'migrations', '001.json')) |
const wallet1 = require(path.join('..', '..', 'lib', 'migrations', '001.json')) |
||||||
const vault4 = require(path.join('..', 'lib', 'migrations', '004.json')) |
const vault4 = require(path.join('..', '..', 'lib', 'migrations', '004.json')) |
||||||
let vault5, vault6, vault7, vault8, vault9 // vault10, vault11
|
let vault5, vault6, vault7, vault8, vault9 // vault10, vault11
|
||||||
|
|
||||||
const migration2 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '002')) |
const migration2 = require(path.join('..', '..', '..', 'app', 'scripts', 'migrations', '002')) |
||||||
const migration3 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '003')) |
const migration3 = require(path.join('..', '..', '..', 'app', 'scripts', 'migrations', '003')) |
||||||
const migration4 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '004')) |
const migration4 = require(path.join('..', '..', '..', 'app', 'scripts', 'migrations', '004')) |
||||||
const migration5 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '005')) |
const migration5 = require(path.join('..', '..', '..', 'app', 'scripts', 'migrations', '005')) |
||||||
const migration6 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '006')) |
const migration6 = require(path.join('..', '..', '..', 'app', 'scripts', 'migrations', '006')) |
||||||
const migration7 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '007')) |
const migration7 = require(path.join('..', '..', '..', 'app', 'scripts', 'migrations', '007')) |
||||||
const migration8 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '008')) |
const migration8 = require(path.join('..', '..', '..', 'app', 'scripts', 'migrations', '008')) |
||||||
const migration9 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '009')) |
const migration9 = require(path.join('..', '..', '..', 'app', 'scripts', 'migrations', '009')) |
||||||
const migration10 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '010')) |
const migration10 = require(path.join('..', '..', '..', 'app', 'scripts', 'migrations', '010')) |
||||||
const migration11 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '011')) |
const migration11 = require(path.join('..', '..', '..', 'app', 'scripts', 'migrations', '011')) |
||||||
const migration12 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '012')) |
const migration12 = require(path.join('..', '..', '..', 'app', 'scripts', 'migrations', '012')) |
||||||
const migration13 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '013')) |
const migration13 = require(path.join('..', '..', '..', 'app', 'scripts', 'migrations', '013')) |
||||||
|
|
||||||
|
|
||||||
const oldTestRpc = 'https://rawtestrpc.metamask.io/' |
const oldTestRpc = 'https://rawtestrpc.metamask.io/' |
Loading…
Reference in new issue