Fixed a bug in the nth root that affects speed of computation. Also started playing with retaining decimal places of root computation

This commit is contained in:
Greg Hysen
2019-06-05 23:57:48 -07:00
parent 8dd74bcf82
commit 202dcfb4c5
3 changed files with 50 additions and 14 deletions

View File

@@ -330,6 +330,7 @@ export class StakingWrapper {
return balance;
}
public async nthRoot(value: BigNumber, n: BigNumber): Promise<BigNumber> {
//const txReceipt = await this.getLibMathTestContract().nthRoot.await(value, n);
const output = await this.getLibMathTestContract().nthRoot.callAsync(value, n);
return output;
}
@@ -365,6 +366,15 @@ export class StakingWrapper {
totalStake: BigNumber,
alphaDenominator: BigNumber
) {
const txReceipt = await this.getLibMathTestContract().cobbDouglasSimplifiedInverse.awaitTransactionSuccessAsync(
totalRewards,
ownerFees,
totalFees,
ownerStake,
totalStake,
alphaDenominator
);
console.log(`Gas Used: ${txReceipt.gasUsed}`);
const output = await this.getLibMathTestContract().cobbDouglasSimplified.callAsync(
totalRewards,
ownerFees,