aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/utils
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-04-27 00:29:05 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-04-27 02:11:54 +0800
commit599d34f1c08c3b41817c8cfe3f4e1b847cda072b (patch)
tree6c3299c43de6c5036f6e0d20ab6c15ff14988333 /packages/contracts/src/utils
parent31411dd11be29d5dcca646737e6ca08840e2d510 (diff)
downloaddexon-0x-contracts-599d34f1c08c3b41817c8cfe3f4e1b847cda072b.tar.gz
dexon-0x-contracts-599d34f1c08c3b41817c8cfe3f4e1b847cda072b.tar.zst
dexon-0x-contracts-599d34f1c08c3b41817c8cfe3f4e1b847cda072b.zip
Make all lib functions internal, add contracts for testing
Diffstat (limited to 'packages/contracts/src/utils')
-rw-r--r--packages/contracts/src/utils/exchange_wrapper.ts31
-rw-r--r--packages/contracts/src/utils/types.ts2
2 files changed, 2 insertions, 31 deletions
diff --git a/packages/contracts/src/utils/exchange_wrapper.ts b/packages/contracts/src/utils/exchange_wrapper.ts
index 000905854..27fdd698f 100644
--- a/packages/contracts/src/utils/exchange_wrapper.ts
+++ b/packages/contracts/src/utils/exchange_wrapper.ts
@@ -221,37 +221,6 @@ export class ExchangeWrapper {
const tx = await this._getTxWithDecodedExchangeLogsAsync(txHash);
return tx;
}
- public async getOrderHashAsync(signedOrder: SignedOrder): Promise<string> {
- const order = orderUtils.getOrderStruct(signedOrder);
- const orderHash = await this._exchange.getOrderHash.callAsync(order);
- return orderHash;
- }
- public async isValidSignatureAsync(signedOrder: SignedOrder): Promise<boolean> {
- const isValidSignature = await this._exchange.isValidSignature.callAsync(
- orderUtils.getOrderHashHex(signedOrder),
- signedOrder.makerAddress,
- signedOrder.signature,
- );
- return isValidSignature;
- }
- public async isRoundingErrorAsync(
- numerator: BigNumber,
- denominator: BigNumber,
- target: BigNumber,
- ): Promise<boolean> {
- const isRoundingError = await this._exchange.isRoundingError.callAsync(numerator, denominator, target);
- return isRoundingError;
- }
- public async getPartialAmountAsync(
- numerator: BigNumber,
- denominator: BigNumber,
- target: BigNumber,
- ): Promise<BigNumber> {
- const partialAmount = new BigNumber(
- await this._exchange.getPartialAmount.callAsync(numerator, denominator, target),
- );
- return partialAmount;
- }
public async getTakerAssetFilledAmountAsync(orderHashHex: string): Promise<BigNumber> {
const filledAmount = new BigNumber(await this._exchange.filled.callAsync(orderHashHex));
return filledAmount;
diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts
index 934dc52fa..6f9aeda94 100644
--- a/packages/contracts/src/utils/types.ts
+++ b/packages/contracts/src/utils/types.ts
@@ -94,6 +94,8 @@ export enum ContractName {
EtherDelta = 'EtherDelta',
Arbitrage = 'Arbitrage',
TestAssetProxyDispatcher = 'TestAssetProxyDispatcher',
+ TestLibs = 'TestLibs',
+ TestSignatureValidator = 'TestSignatureValidator',
ERC20Proxy = 'ERC20Proxy',
ERC721Proxy = 'ERC721Proxy',
DummyERC721Token = 'DummyERC721Token',