Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[matcher.test.ts] Testing "Cancelling a market order" should not be a test as by definition you are buying into the slippage #51

Open
xucito opened this issue Jan 24, 2020 · 0 comments

Comments

@xucito
Copy link

xucito commented Jan 24, 2020

Cancelling a market order should not be a test as by definition you are buying into the slippage.

Only way to make this test pass is by configuring matcher to break the market (No seller side)

 it('should submit and cancel market order', async () => {
    const oParams = {
      orderType: 'buy' as 'buy',
      matcherPublicKey: MATCHER_PUBLIC_KEY,
      price: 10000000000000,
      amount: 1000,
      matcherFee: 8000000,
      priceAsset: null,
      amountAsset: assetId
    }

    const ord = order(oParams, MASTER_SEED)
    const submitResp = await submitOrder(ord, {market: true, matcherUrl: MATCHER_URL})
    expect(submitResp.status).toEqual('OrderAccepted')

    const co = cancelOrder({ orderId: ord.id }, MASTER_SEED)
    const cancelResp = await cancelSubmittedOrder(co, ord.assetPair.amountAsset, ord.assetPair.priceAsset, MATCHER_URL)
    expect(cancelResp.status).toEqual('OrderCanceled')
  }, TIMEOUT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant