-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from osmosis-labs/alpo/limit-placement
[Orderbook]: Limit order placement logic
- Loading branch information
Showing
8 changed files
with
394 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,30 @@ | ||
use cosmwasm_std::StdError; | ||
use cosmwasm_std::{CoinsError, StdError, Uint128}; | ||
use cw_utils::PaymentError; | ||
use thiserror::Error; | ||
|
||
#[derive(Error, Debug)] | ||
#[derive(Error, Debug, PartialEq)] | ||
pub enum ContractError { | ||
#[error("{0}")] | ||
Std(#[from] StdError), | ||
|
||
#[error("Unauthorized")] | ||
Unauthorized {}, | ||
|
||
#[error("Invalid tick ID: {tick_id:?}")] | ||
InvalidTickId { tick_id: i64 }, | ||
|
||
#[error("Invalid quantity: {quantity:?}")] | ||
InvalidQuantity { quantity: Uint128 }, | ||
|
||
#[error("Insufficient funds. Sent: {sent:?}, Required: {required:?}")] | ||
InsufficientFunds { sent: Uint128, required: Uint128 }, | ||
|
||
#[error("Invalid book ID: {book_id:?}")] | ||
InvalidBookId { book_id: u64 }, | ||
|
||
#[error(transparent)] | ||
Coins(#[from] CoinsError), | ||
|
||
#[error(transparent)] | ||
PaymentError(#[from] PaymentError), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod test_order; | ||
pub mod test_orderbook; | ||
pub mod test_state; |
Oops, something went wrong.