aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/2.0.0
diff options
context:
space:
mode:
authorRemco Bloemen <remco@wicked.ventures>2018-08-23 03:23:32 +0800
committerRemco Bloemen <remco@wicked.ventures>2018-08-25 05:09:51 +0800
commit3dad6ee55e9f51daa66cfe3c83dd17abc31f23f5 (patch)
tree0450ae8f09ce0eabdaa419dc54fe9d2b6067b853 /packages/contracts/src/2.0.0
parent5d70df771b151800b8a04b5569529843701c9fbd (diff)
downloaddexon-sol-tools-3dad6ee55e9f51daa66cfe3c83dd17abc31f23f5.tar
dexon-sol-tools-3dad6ee55e9f51daa66cfe3c83dd17abc31f23f5.tar.gz
dexon-sol-tools-3dad6ee55e9f51daa66cfe3c83dd17abc31f23f5.tar.bz2
dexon-sol-tools-3dad6ee55e9f51daa66cfe3c83dd17abc31f23f5.tar.lz
dexon-sol-tools-3dad6ee55e9f51daa66cfe3c83dd17abc31f23f5.tar.xz
dexon-sol-tools-3dad6ee55e9f51daa66cfe3c83dd17abc31f23f5.tar.zst
dexon-sol-tools-3dad6ee55e9f51daa66cfe3c83dd17abc31f23f5.zip
Add tests for getPartialAmountCeil
Diffstat (limited to 'packages/contracts/src/2.0.0')
-rw-r--r--packages/contracts/src/2.0.0/test/TestExchangeInternals/TestExchangeInternals.sol17
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/contracts/src/2.0.0/test/TestExchangeInternals/TestExchangeInternals.sol b/packages/contracts/src/2.0.0/test/TestExchangeInternals/TestExchangeInternals.sol
index d9cec9edc..239dd10a8 100644
--- a/packages/contracts/src/2.0.0/test/TestExchangeInternals/TestExchangeInternals.sol
+++ b/packages/contracts/src/2.0.0/test/TestExchangeInternals/TestExchangeInternals.sol
@@ -79,6 +79,23 @@ contract TestExchangeInternals is
return getPartialAmount(numerator, denominator, target);
}
+ /// @dev Calculates partial value given a numerator and denominator.
+ /// @param numerator Numerator.
+ /// @param denominator Denominator.
+ /// @param target Value to calculate partial of.
+ /// @return Partial value of target.
+ function publicGetPartialAmountCeil(
+ uint256 numerator,
+ uint256 denominator,
+ uint256 target
+ )
+ public
+ pure
+ returns (uint256 partialAmount)
+ {
+ return getPartialAmountCeil(numerator, denominator, target);
+ }
+
/// @dev Checks if rounding error > 0.1%.
/// @param numerator Numerator.
/// @param denominator Denominator.