Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Batch Order Matching #1900

Conversation

jalextowle
Copy link
Contributor

@jalextowle jalextowle commented Jun 26, 2019

Description

This PR partially address ZEIP 41.

image

Batch Order Matching

These changes add a batchMatchOrders function, which allows several orders to be matched in a single transaction. This implementation can easily be modified to also meet the requirements for batchMatchOrdersWithMaximalFill as soon as ZEIP 40 is implemented.

Simulating Batch Order Matching

A batchMatchOrdersAndAssertEffectsAsync function was added to facilitate testing the new batchMatchOrders function, and in the process I was able to refactor some of the match_order_tester.ts file to be more general.

Testing instructions

yarn build:contracts && yarn test:contracts && yarn lint:contracts

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • Prefix PR title with [WIP] if necessary.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • Add new entries to the relevant CHANGELOG.jsons.

@jalextowle jalextowle changed the base branch from development to 3.0 June 26, 2019 17:03
@jalextowle jalextowle force-pushed the feature/contracts/3.0/batch-match-orders branch from 36fed4d to 4c21215 Compare June 27, 2019 07:35
@jalextowle jalextowle changed the title [WIP] Batch Order Matching Batch Order Matching Jun 27, 2019
@jalextowle jalextowle changed the title Batch Order Matching [WIP] Batch Order Matching Jun 27, 2019
@jalextowle jalextowle changed the title [WIP] Batch Order Matching Batch Order Matching Jun 27, 2019
@jalextowle jalextowle force-pushed the feature/contracts/3.0/batch-match-orders branch from 9be6e56 to c0196d8 Compare June 27, 2019 21:24
@jalextowle
Copy link
Contributor Author

Due to the fact that ZEIP 40 addresses several of the issues in this ZEIP, more tests for batchMatchOrders will be added in that PR.

@jalextowle jalextowle force-pushed the feature/contracts/3.0/batch-match-orders branch 3 times, most recently from 4a24d52 to e24c55d Compare July 1, 2019 22:41
@jalextowle jalextowle mentioned this pull request Jul 1, 2019
4 tasks
@jalextowle jalextowle force-pushed the feature/contracts/3.0/batch-match-orders branch 3 times, most recently from f484c88 to 5735e29 Compare July 2, 2019 00:06
@jalextowle jalextowle force-pushed the feature/contracts/3.0/batch-match-orders branch 2 times, most recently from 3abb6cc to cff710c Compare July 2, 2019 04:46
@jalextowle jalextowle force-pushed the feature/contracts/3.0/batch-match-orders branch from cff710c to bbd5b86 Compare July 2, 2019 04:57
contracts/exchange/contracts/src/MixinMatchOrders.sol Outdated Show resolved Hide resolved
contracts/exchange/test/match_orders.ts Outdated Show resolved Hide resolved
contracts/exchange/test/match_orders.ts Outdated Show resolved Hide resolved
contracts/exchange/test/match_orders.ts Show resolved Hide resolved
contracts/exchange/test/match_orders.ts Show resolved Hide resolved
contracts/exchange/contracts/src/MixinMatchOrders.sol Outdated Show resolved Hide resolved
const _initialTokenBalances = initialTokenBalances
? initialTokenBalances
: await this._initialTokenBalancesPromise;
// Execute `batchMatchOrders()`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right before this, can we do an exchangeWrapper.getBatchMatchOrdersResultsAsync() and assert the results against the simulation? I don't see where we are checking the return value of batchMatchOrders() anywhere.

Would also be nice to have this done for the regular matchOrders() tests, as well.

);
}
}
// TODO(jalextowle): Implement the same as the above for ERC1155
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any matchOrders coverage for 1155s? Let's add an asana task for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check and get back to you.

jalextowle added a commit to jalextowle/0x-monorepo that referenced this pull request Jul 2, 2019
jalextowle added a commit to jalextowle/0x-monorepo that referenced this pull request Jul 3, 2019
@jalextowle jalextowle closed this Jul 3, 2019
jalextowle added a commit to jalextowle/0x-monorepo that referenced this pull request Jul 3, 2019
jalextowle added a commit to jalextowle/0x-monorepo that referenced this pull request Jul 17, 2019
abandeali1 pushed a commit that referenced this pull request Jul 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants