Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/dependencies #198

Merged
merged 22 commits into from Jul 31, 2019
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Running pretiter

  • Loading branch information
Freydal committed Jul 30, 2019
commit a90680020c5867f5be3fb0fc4ba278239197d8f8
@@ -77,11 +77,7 @@ export class KosuToken {
throw new Error("Invalid network for KosuToken");
}

this.contract = new KosuTokenContract(
this.address,
this.web3Wrapper.getProvider(),
{ from: coinbase },
);
this.contract = new KosuTokenContract(this.address, this.web3Wrapper.getProvider(), { from: coinbase });
}
return this.contract;
}
@@ -188,7 +184,9 @@ export class KosuToken {
*/
public async bondTokens(value: BigNumber, minPayout: BigNumber): Promise<TransactionReceiptWithDecodedLogs> {
const contract = await this.getContract();
return contract.bondTokens.awaitTransactionSuccessAsync(new BigNumber(minPayout.toString()), { value: new BigNumber(value.toString()) });
return contract.bondTokens.awaitTransactionSuccessAsync(new BigNumber(minPayout.toString()), {
value: new BigNumber(value.toString()),
});
}

/**
@@ -211,7 +209,12 @@ export class KosuToken {
public async pay(value: BigNumber): Promise<TransactionReceiptWithDecodedLogs> {
const contract = await this.getContract();
return this.web3Wrapper
.sendTransactionAsync({ from: await this.web3.eth.getCoinbase(), to: contract.address, value: new BigNumber(value.toString()), gas: 70000 })
.sendTransactionAsync({
from: await this.web3.eth.getCoinbase(),
to: contract.address,
value: new BigNumber(value.toString()),
gas: 70000,
})
.then(async txHash => this.web3Wrapper.awaitTransactionSuccessAsync(txHash));
}
}
@@ -149,7 +149,12 @@ export class PosterRegistry {
public async pay(value: BigNumber): Promise<TransactionReceiptWithDecodedLogs> {
const contract = await this.getContract();
return this.web3Wrapper
.sendTransactionAsync({ from: await this.web3.eth.getCoinbase(), to: contract.address, value: new BigNumber(value.toString()), gas: 220000 })
.sendTransactionAsync({
from: await this.web3.eth.getCoinbase(),
to: contract.address,
value: new BigNumber(value.toString()),
gas: 220000,
})
.then(async txHash => this.web3Wrapper.awaitTransactionSuccessAsync(txHash));
}
}
@@ -221,7 +221,12 @@ export class Treasury {
public async pay(value: BigNumber): Promise<TransactionReceiptWithDecodedLogs> {
const contract = await this.getContract();
return this.web3Wrapper
.sendTransactionAsync({ from: await this.web3.eth.getCoinbase(), to: contract.address, value: new BigNumber(value.toString()), gas: 120000 })
.sendTransactionAsync({
from: await this.web3.eth.getCoinbase(),
to: contract.address,
value: new BigNumber(value.toString()),
gas: 120000,
})
.then(async txHash => this.web3Wrapper.awaitTransactionSuccessAsync(txHash));
}
}
@@ -229,7 +229,12 @@ export class ValidatorRegistry {
throw new Error(`Reward rate: ${_rewardRate.toString()} exceeds maxmimum of ${maxRewardRate.toString()}`);
}

return contract.registerListing.awaitTransactionSuccessAsync(_pubKey, new BigNumber(_tokensToStake.toString()), new BigNumber(_rewardRate.toString()), _details);
return contract.registerListing.awaitTransactionSuccessAsync(
_pubKey,
new BigNumber(_tokensToStake.toString()),
new BigNumber(_rewardRate.toString()),
_details,
);
}

/**
@@ -79,7 +79,11 @@ export class Voting {

// tslint:disable-next-line: no-console
console.log(`Committing vote ${_vote} with ${_tokensToCommit} DIGM tokens`);
return contract.commitVote.awaitTransactionSuccessAsync(new BigNumber(_pollId.toString()), _vote, new BigNumber(_tokensToCommit.toString()));
return contract.commitVote.awaitTransactionSuccessAsync(
new BigNumber(_pollId.toString()),
_vote,
new BigNumber(_tokensToCommit.toString()),
);
}

/**
@@ -95,7 +99,11 @@ export class Voting {
_voteSalt: BigNumber,
): Promise<TransactionReceiptWithDecodedLogs> {
const contract = await this.getContract();
return contract.revealVote.awaitTransactionSuccessAsync(new BigNumber(_pollId.toString()), new BigNumber(_voteOption.toString()), new BigNumber(_voteSalt.toString()));
return contract.revealVote.awaitTransactionSuccessAsync(
new BigNumber(_pollId.toString()),
new BigNumber(_voteOption.toString()),
new BigNumber(_voteSalt.toString()),
);
}

/**
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.