Skip to content

Commit

Permalink
fix more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Elsasser committed Sep 28, 2018
1 parent f4ee832 commit aec2d53
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 73 deletions.
13 changes: 7 additions & 6 deletions contracts/MarketTradingHub.sol
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,17 @@ contract MarketTradingHub {
) external returns (int filledQty)
{
MarketContract marketContract = MarketContract(orderAddresses[0]);
require(!marketContract.isSettled()); // no trading past settlement
require(orderQty != 0 && qtyToFill != 0 && orderQty.isSameSign(qtyToFill)); // no zero trades, sings match
require(MKT_TOKEN.isUserEnabledForContract(this, msg.sender));
require(!marketContract.isSettled(), "Contract has already settled"); // no trading past settlement
require(orderQty != 0 && qtyToFill != 0 && orderQty.isSameSign(qtyToFill), "qty Error"); // no zero trades, sings match
require(MKT_TOKEN.isUserEnabledForContract(this, msg.sender), "taker not enabled");
OrderLib.Order memory order = OrderLib.createOrder(orderAddresses, unsignedOrderValues, orderQty);
require(MKT_TOKEN.isUserEnabledForContract(this, order.maker));
require(MKT_TOKEN.isUserEnabledForContract(this, order.maker), "maker not enabled");

// taker can be anyone, or specifically the caller!
require(order.taker == address(0) || order.taker == msg.sender);
require(order.taker == address(0) || order.taker == msg.sender, "invalid taker");
// do not allow self trade
require(order.maker != address(0) && order.maker != msg.sender);
require(order.maker != address(0) && order.maker != msg.sender, "invalid wash trade");

require(
OrderLib.isValidSignature(
order.maker,
Expand Down

0 comments on commit aec2d53

Please sign in to comment.