-
Notifications
You must be signed in to change notification settings - Fork 16
/
mockConfig.ts
44 lines (39 loc) · 1.22 KB
/
mockConfig.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import * as loki from 'lokijs';
import { Config } from '../../src/index';
import MockLogger from './MockLogger';
// import { createWalletKeystore } from './createWallet';
import { providerUrl } from './network';
import BigNumber from 'bignumber.js';
const PRIVATE_KEY = 'fdf2e15fd858d9d81e31baa1fe76de9c7d49af0018a1322aa2b9e493b02afa26';
const mockConfig = (preConfig?: any) => {
const client = preConfig && preConfig.client ? preConfig.client : 'unknown';
const filename = 'wallet.txt';
const password = 'password123';
const wallet = [PRIVATE_KEY]; //createWalletKeystore(web3, 1, filename, password);
const config = new Config({
autostart: true,
claiming: true,
disableDetection: true,
economicStrategy: {
maxDeposit: new BigNumber(0),
minBalance: new BigNumber(0),
minProfitability: new BigNumber(0),
maxGasSubsidy: 100
},
logger: new MockLogger(),
ms: 4000,
password,
providerUrl,
scanSpread: 0,
statsDb: new loki('stats.db', {
autoload: true,
autosave: true,
autosaveInterval: 4000
}),
walletStores: wallet,
walletStoresAsPrivateKeys: true
});
config.client = client;
return config;
};
export { mockConfig, PRIVATE_KEY };