aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2018-07-06 16:26:59 +0800
committerJacob Evans <jacob@dekz.net>2018-07-06 16:26:59 +0800
commitbc52303402e6ee1b3ab9d948d909d1d10ebf26e4 (patch)
tree24edd7fb5183980e70b7eff0a2d0ad1ce63a5981 /packages/contracts/test
parent2da705e81c727cd99421fa6234736cebe5029fbb (diff)
downloaddexon-0x-contracts-bc52303402e6ee1b3ab9d948d909d1d10ebf26e4.tar
dexon-0x-contracts-bc52303402e6ee1b3ab9d948d909d1d10ebf26e4.tar.gz
dexon-0x-contracts-bc52303402e6ee1b3ab9d948d909d1d10ebf26e4.tar.bz2
dexon-0x-contracts-bc52303402e6ee1b3ab9d948d909d1d10ebf26e4.tar.lz
dexon-0x-contracts-bc52303402e6ee1b3ab9d948d909d1d10ebf26e4.tar.xz
dexon-0x-contracts-bc52303402e6ee1b3ab9d948d909d1d10ebf26e4.tar.zst
dexon-0x-contracts-bc52303402e6ee1b3ab9d948d909d1d10ebf26e4.zip
Types: Move Forwarder Revert Reason into types package
Diffstat (limited to 'packages/contracts/test')
-rw-r--r--packages/contracts/test/forwarder/forwarder.ts19
1 files changed, 6 insertions, 13 deletions
diff --git a/packages/contracts/test/forwarder/forwarder.ts b/packages/contracts/test/forwarder/forwarder.ts
index d10ae3d12..33fd6e27d 100644
--- a/packages/contracts/test/forwarder/forwarder.ts
+++ b/packages/contracts/test/forwarder/forwarder.ts
@@ -31,13 +31,6 @@ const DECIMALS_DEFAULT = 18;
// Set a gasPrice so when checking balance of msg.sender we can accurately calculate gasPrice*gasUsed
const DEFAULT_GAS_PRICE = new BigNumber(1);
-enum ForwarderRevertReason {
- UnacceptableThreshold = 'UNACCEPTABLE_THRESHOLD',
- FeeProportionTooLarge = 'FEE_PROPORTION_TOO_LARGE',
- ValueGreaterThanZero = 'VALUE_GREATER_THAN_ZERO',
- InvalidMsgValue = 'INVALID_MSG_VALUE',
-}
-
describe(ContractName.Forwarder, () => {
let makerAddress: string;
let owner: string;
@@ -278,7 +271,7 @@ describe(ContractName.Forwarder, () => {
value: fillAmount,
from: takerAddress,
}),
- ForwarderRevertReason.UnacceptableThreshold as any,
+ RevertReason.UnacceptableThreshold,
);
});
it('should fail if fee abstraction amount is too high', async () => {
@@ -362,7 +355,7 @@ describe(ContractName.Forwarder, () => {
{ from: takerAddress, value: fillAmount, gasPrice: DEFAULT_GAS_PRICE },
{ feeProportion, feeRecipient: feeRecipientAddress },
),
- ForwarderRevertReason.FeeProportionTooLarge as any,
+ RevertReason.FeeProportionTooLarge,
);
const afterEthBalance = await web3Wrapper.getBalanceInWeiAsync(feeRecipientAddress);
expect(afterEthBalance).to.be.bignumber.equal(initEthBalance);
@@ -474,7 +467,7 @@ describe(ContractName.Forwarder, () => {
from: takerAddress,
value: fillAmountWei,
}),
- ForwarderRevertReason.UnacceptableThreshold as any,
+ RevertReason.UnacceptableThreshold,
);
});
it('throws if fees are higher than 5% when buying erc20', async () => {
@@ -495,7 +488,7 @@ describe(ContractName.Forwarder, () => {
from: takerAddress,
value: fillAmountWei,
}),
- ForwarderRevertReason.UnacceptableThreshold as any,
+ RevertReason.UnacceptableThreshold as any,
);
});
it('throws if makerAssetAmount is 0', async () => {
@@ -511,7 +504,7 @@ describe(ContractName.Forwarder, () => {
from: takerAddress,
value: fillAmountWei,
}),
- ForwarderRevertReason.ValueGreaterThanZero as any,
+ RevertReason.ValueGreaterThanZero as any,
);
});
it('throws if the amount of ETH sent in is less than the takerAssetFilledAmount', async () => {
@@ -545,7 +538,7 @@ describe(ContractName.Forwarder, () => {
constants.NULL_ADDRESS,
{ value: fillAmount, from: takerAddress },
),
- ForwarderRevertReason.InvalidMsgValue as any,
+ RevertReason.InvalidMsgValue,
);
});
});