aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-utils/test
diff options
context:
space:
mode:
Diffstat (limited to 'packages/order-utils/test')
-rw-r--r--packages/order-utils/test/order_state_utils_test.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/packages/order-utils/test/order_state_utils_test.ts b/packages/order-utils/test/order_state_utils_test.ts
index 91ef23b69..ea88027ae 100644
--- a/packages/order-utils/test/order_state_utils_test.ts
+++ b/packages/order-utils/test/order_state_utils_test.ts
@@ -120,5 +120,25 @@ describe('OrderStateUtils', () => {
const orderState = await orderStateUtils.getOpenOrderStateAsync(signedOrder);
expect(orderState.isValid).to.eq(false);
});
+ it('should include the transactionHash in orderState if supplied in method invocation', async () => {
+ const makerAssetAmount = new BigNumber(10);
+ const takerAssetAmount = new BigNumber(10000000000000000);
+ const takerBalance = takerAssetAmount;
+ const orderFilledAmount = new BigNumber(0);
+ const mockBalanceFetcher = buildMockBalanceFetcher(takerBalance);
+ const mockOrderFilledFetcher = buildMockOrderFilledFetcher(orderFilledAmount);
+ const [signedOrder] = testOrderFactory.generateTestSignedOrders(
+ {
+ makerAssetAmount,
+ takerAssetAmount,
+ },
+ 1,
+ );
+
+ const orderStateUtils = new OrderStateUtils(mockBalanceFetcher, mockOrderFilledFetcher);
+ const transactionHash = '0xdeadbeef';
+ const orderState = await orderStateUtils.getOpenOrderStateAsync(signedOrder, transactionHash);
+ expect(orderState.transactionHash).to.eq(transactionHash);
+ });
});
});