Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
josipbagaric committed Aug 17, 2018
1 parent 6cfa3f0 commit e107d70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Config/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ export default class Config implements IConfigParams {
throw new Error('Please set the providerUrl in the config object.');
}

this.economicStrategy = params.economicStrategy || Config.DEFAULT_ECONOMIC_STRATEGY;
this.economicStrategy = params.economicStrategy || {
maxDeposit: Config.DEFAULT_ECONOMIC_STRATEGY.maxDeposit,
minBalance: Config.DEFAULT_ECONOMIC_STRATEGY.minBalance,
minProfitability: Config.DEFAULT_ECONOMIC_STRATEGY.minProfitability,
maxGasSubsidy: Config.DEFAULT_ECONOMIC_STRATEGY.maxGasSubsidy
};

this.autostart = params.autostart !== undefined ? params.autostart : true;
this.claiming = params.claiming || false;
Expand Down
2 changes: 1 addition & 1 deletion test/unit/UnitTestEconomicStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Economic Strategy Tests', () => {
});

it('returns DEPOSIT_TOO_HIGH if transaction exceeds maxDeposit', async () => {
config.economicStrategy.maxDeposit = new BigNumber(2);
config.economicStrategy.maxDeposit = new BigNumber(1);
const nextAccount = config.wallet.nextAccount.getAddressString();
const shouldClaimStatus = await shouldClaimTx(txTimestamp, config, nextAccount);
assert.equal(shouldClaimStatus, EconomicStrategyStatus.DEPOSIT_TOO_HIGH);
Expand Down

0 comments on commit e107d70

Please sign in to comment.