Skip to content

Commit

Permalink
Merge 7613dd4 into ed2f45e
Browse files Browse the repository at this point in the history
  • Loading branch information
josipbagaric committed Dec 21, 2018
2 parents ed2f45e + 7613dd4 commit 93e8db2
Show file tree
Hide file tree
Showing 10 changed files with 1,026 additions and 1,047 deletions.
2,028 changes: 1,015 additions & 1,013 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"homepage": "https://github.com/ethereum-alarm-clock/timenode-core#readme",
"dependencies": {
"bignumber.js": "5.0.0",
"@ethereum-alarm-clock/lib": "0.0.46",
"@ethereum-alarm-clock/lib": "0.1.0",
"ethereumjs-tx": "1.3.7",
"ethereumjs-wallet": "0.6.2",
"lokijs": "1.5.5",
Expand Down
4 changes: 2 additions & 2 deletions src/Actions/Helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const abortReasonToExecuteStatus = new Map<AbortReason, TxSendStatus>([
[AbortReason.Unknown, TxSendStatus.ABORTED_UNKNOWN]
]);

function isExecuted(receipt: TransactionReceipt) : boolean {
function isExecuted(receipt: TransactionReceipt): boolean {
return Boolean(receipt) && receipt.logs[0].topics.indexOf(EXECUTED_EVENT) > -1;
}

function isAborted(receipt: TransactionReceipt) : boolean {
function isAborted(receipt: TransactionReceipt): boolean {
return Boolean(receipt) && receipt.logs[0].topics.indexOf(ABORTED_EVENT) > -1;
}

Expand Down
6 changes: 1 addition & 5 deletions src/Config/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,7 @@ export default class Config implements IConfigParams {
this.pending = new Pending(this.gasPriceUtil, this.txPool);

if (params.walletStores && params.walletStores.length && params.walletStores.length > 0) {
this.wallet = new Wallet(
this.util,
new AccountState(),
this.logger
);
this.wallet = new Wallet(this.util, new AccountState(), this.logger);

params.walletStores = params.walletStores.map((store: object | string) => {
if (typeof store === 'object') {
Expand Down
9 changes: 3 additions & 6 deletions src/Wallet/Wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class Wallet {
};
}

let sentTransaction : PromiEvent<TransactionReceipt>;
let sentTransaction: PromiEvent<TransactionReceipt>;
let receipt: TransactionReceipt;

try {
Expand All @@ -196,13 +196,10 @@ export class Wallet {
}

try {
const hash : string = (await sentTransaction).transactionHash;
const hash: string = (await sentTransaction).transactionHash;
this.logger.debug(`Awaiting for confirmation for tx ${hash} from ${from}`, opts.to);

receipt = await this.util.waitForConfirmations(
sentTransaction,
this.CONFIRMATION_BLOCKS
);
receipt = await this.util.waitForConfirmations(sentTransaction, this.CONFIRMATION_BLOCKS);
this.accountState.set(from, opts.to, opts.operation, TransactionState.CONFIRMED);

this.logger.debug(`Transaction ${hash} from ${from} confirmed`, opts.to);
Expand Down
13 changes: 0 additions & 13 deletions test/helpers/calcEndowment.ts

This file was deleted.

1 change: 0 additions & 1 deletion test/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ export { mockTxRequest, mockTxStatus } from './MockTxRequest';
export { mockConfig, PRIVATE_KEY } from './mockConfig';
export { createWallet, createWalletKeystore } from './createWallet';
export { providerUrl } from './network';
export { calcEndowment } from './calcEndowment';
4 changes: 2 additions & 2 deletions test/unit/UnitTestTxPoolProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('TxPoolProcessor Unit Tests', () => {
const tx = { to: address, gasPrice };
const { processor, pool } = setup(tx);

const filterTx : IFilterTx = {
const filterTx: IFilterTx = {
address,
blockNumber: 1,
data: '',
Expand Down Expand Up @@ -58,7 +58,7 @@ describe('TxPoolProcessor Unit Tests', () => {
const tx = { to: address, gasPrice };
const { processor, pool } = setup(tx);

const filterTx : IFilterTx = {
const filterTx: IFilterTx = {
address,
data: '',
transactionIndex: 0,
Expand Down
4 changes: 1 addition & 3 deletions test/unit/UnitTestWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ let wallet: Wallet;
let myAccount: string;
let opts: ITransactionOptions;

const createTestWallet = (
accountState = new AccountState()
) => {
const createTestWallet = (accountState = new AccountState()) => {
return new Wallet(config.util, accountState);
};

Expand Down
2 changes: 1 addition & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"no-var-requires": false,
"comment-format": false,
"ordered-imports": false,
"await-promise": [true, "Bluebird", "Transition"],
"await-promise": [true, "Transition"],
"no-unsafe-finally": true,
"no-return-await": true
},
Expand Down

0 comments on commit 93e8db2

Please sign in to comment.