Skip to content

[$40 BOUNTY] [Go] Add order book cancellation depth tests #2

Description

@jackjin1997

Bounty: $40 (LT)

Area: market/orderbook/orderbook.go

Current state: The order book supports adding and cancelling orders, but focused tests are needed around depth updates after cancellation, closed-book behavior, and snapshot immutability.

What is needed: Add Go tests for order cancellation and snapshot/depth behavior in the order book package.

Acceptance criteria:

  • Cover cancelling a bid removes the matching bid level and deletes the order id.
  • Cover cancelling an ask removes the matching ask level.
  • Cover cancelling an unknown order returns ErrOrderNotFound.
  • Cover closed books rejecting add/cancel operations with ErrBookClosed.
  • Cover snapshots returning copies so callers cannot mutate internal bid/ask slices.

Required validation:

  • Run go test ./market/orderbook or the closest package-level Go test command available in this repo.
  • Run python3 build.py.
  • Include the generated diagnostic/build-*.logd artifact from diagnostic/; include the matching diagnostic/build-*.json if present.
  • Use .github/pull_request_template.md for the submission.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bountyBounty issuegood first issueGood for first-time contributorshelp wantedOpen for external contributionlanguage:goGo language task

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions