aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/extensions/balance_threshold_filter.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/contracts/test/extensions/balance_threshold_filter.ts')
-rw-r--r--packages/contracts/test/extensions/balance_threshold_filter.ts44
1 files changed, 43 insertions, 1 deletions
diff --git a/packages/contracts/test/extensions/balance_threshold_filter.ts b/packages/contracts/test/extensions/balance_threshold_filter.ts
index 7ca8a8e98..0a03678b1 100644
--- a/packages/contracts/test/extensions/balance_threshold_filter.ts
+++ b/packages/contracts/test/extensions/balance_threshold_filter.ts
@@ -1225,7 +1225,7 @@ describe.only(ContractName.BalanceThresholdFilter, () => {
compliantSignedOrder = await orderFactory.newSignedOrderAsync();
compliantSignedOrder2 = await orderFactory2.newSignedOrderAsync();
});
- it.only('Should transfer correct amounts when both makers and taker meet the balance threshold', async () => {
+ it('Should transfer correct amounts when both makers and taker meet the balance threshold', async () => {
// Test values/results taken from Match Orders test:
// 'Should transfer correct amounts when right order is fully filled and values pass isRoundingErrorFloor but fail isRoundingErrorCeil'
// Create orders to match
@@ -1309,6 +1309,48 @@ describe.only(ContractName.BalanceThresholdFilter, () => {
erc20Balances[feeRecipientAddress][zrxToken.address].add(expectedTransferAmounts.feePaidByLeftMaker).add(expectedTransferAmounts.feePaidByRightMaker).add(expectedTransferAmounts.feePaidByTakerLeft).add(expectedTransferAmounts.feePaidByTakerRight),
);
});
+ it('should revert if left maker does not meet the balance threshold', async () => {
+ // Create signed order with non-compliant maker address
+ const signedOrderWithBadMakerAddress = await orderFactory.newSignedOrderAsync({
+ senderAddress: compliantForwarderInstance.address,
+ makerAddress: nonCompliantAddress
+ });
+ // Execute transaction
+ return expectTransactionFailedAsync(
+ balanceThresholdWrapper.matchOrdersAsync(
+ compliantSignedOrder,
+ signedOrderWithBadMakerAddress,
+ compliantTakerAddress,
+ ),
+ RevertReason.AtLeastOneAddressDoesNotMeetBalanceThreshold
+ );
+ });
+ it('should revert if right maker does not meet the balance threshold', async () => {
+ // Create signed order with non-compliant maker address
+ const signedOrderWithBadMakerAddress = await orderFactory.newSignedOrderAsync({
+ senderAddress: compliantForwarderInstance.address,
+ makerAddress: nonCompliantAddress
+ });
+ // Execute transaction
+ return expectTransactionFailedAsync(
+ balanceThresholdWrapper.matchOrdersAsync(
+ signedOrderWithBadMakerAddress,
+ compliantSignedOrder,
+ compliantTakerAddress,
+ ),
+ RevertReason.AtLeastOneAddressDoesNotMeetBalanceThreshold
+ );
+ });
+ it('should revert if taker does not meet the balance threshold', async () => {
+ return expectTransactionFailedAsync(
+ nonCompliantBalanceThresholdWrapper.matchOrdersAsync(
+ compliantSignedOrder,
+ compliantSignedOrder,
+ nonCompliantAddress,
+ ),
+ RevertReason.AtLeastOneAddressDoesNotMeetBalanceThreshold
+ );
+ });
});
describe('cancelOrder', () => {