Zilliqa / marketplace-contracts

GNU General Public License v3.0
2 stars 4 forks source link

Wrong exception error for fulfill buy order #16

Closed bb111189 closed 2 years ago

bb111189 commented 2 years ago

Wrong SellOrderNotFoundError exception throw

  | False => 
    (* Side: Buy *)
    (* - Sellers can fulfill buy orders. *)
    seller = _sender;
    maybe_buy_order <- buy_orders[token_address][token_id][payment_token_address][sale_price];

    match maybe_buy_order with
    | None => 
      error = SellOrderNotFoundError;
      Throw error
    | Some (Order buyer expiration_bnum) =>  
      RequireNotExpired expiration_bnum;

      HandleFulfillOrder token_address token_id payment_token_address sale_price buyer seller side buyer;

      (* Remove all sell orders *)
      delete sell_orders[token_address][token_id];

      (* - When a buy order is fulfilled, the buy order is removed. *)
      (* Remove the buy order *)
      delete buy_orders[token_address][token_id][payment_token_address][sale_price]
    end
ghost commented 2 years ago

nice catch!