Skip to content

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

@xucito

Description

@xucito

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions