aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-utils/src/utils.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-06-28 17:04:16 +0800
committerGitHub <noreply@github.com>2018-06-28 17:04:16 +0800
commit988a3347582cd812aadeaa0cdaef67389c8d833d (patch)
treeb3067914037f0423480be297c860b4c3adaf2e3a /packages/order-utils/src/utils.ts
parent57d5fbfbd8d15d96061687e5badcecec4ffdd713 (diff)
parent4fe626904337290774e39f3aba143fa776785269 (diff)
downloaddexon-sol-tools-988a3347582cd812aadeaa0cdaef67389c8d833d.tar
dexon-sol-tools-988a3347582cd812aadeaa0cdaef67389c8d833d.tar.gz
dexon-sol-tools-988a3347582cd812aadeaa0cdaef67389c8d833d.tar.bz2
dexon-sol-tools-988a3347582cd812aadeaa0cdaef67389c8d833d.tar.lz
dexon-sol-tools-988a3347582cd812aadeaa0cdaef67389c8d833d.tar.xz
dexon-sol-tools-988a3347582cd812aadeaa0cdaef67389c8d833d.tar.zst
dexon-sol-tools-988a3347582cd812aadeaa0cdaef67389c8d833d.zip
Merge pull request #707 from 0xProject/feature/combinatorial-testing
OrderFill Declarative Testing & Combinatorial Tests [Merge after #760]
Diffstat (limited to 'packages/order-utils/src/utils.ts')
-rw-r--r--packages/order-utils/src/utils.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/order-utils/src/utils.ts b/packages/order-utils/src/utils.ts
index 6149316f6..7aaaf0609 100644
--- a/packages/order-utils/src/utils.ts
+++ b/packages/order-utils/src/utils.ts
@@ -12,4 +12,11 @@ export const utils = {
const milisecondsInSecond = 1000;
return new BigNumber(Date.now() / milisecondsInSecond).round();
},
+ getPartialAmount(numerator: BigNumber, denominator: BigNumber, target: BigNumber): BigNumber {
+ const fillMakerTokenAmount = numerator
+ .mul(target)
+ .div(denominator)
+ .round(0);
+ return fillMakerTokenAmount;
+ },
};