Skip to main content

CheckableState

Trait CheckableState 

Source
pub trait CheckableState {
    // Required methods
    fn limit_kind(&self, sell_token: &Bytes, buy_token: &Bytes) -> LimitKind;
    fn check_valid(&self) -> Result<(), String>;

    // Provided method
    fn amounts(&self, _sell_token: &Bytes, _buy_token: &Bytes) -> Vec<BigUint> { ... }
}
Expand description

What the checks ask of a state they hold, decoded or generated.

Required Methods§

Source

fn limit_kind(&self, sell_token: &Bytes, buy_token: &Bytes) -> LimitKind

The kind of bound get_limits(sell_token, buy_token) reports in this state.

Source

fn check_valid(&self) -> Result<(), String>

Whether the state is one the venue can hold on chain, with what is wrong when it is not.

Provided Methods§

Source

fn amounts(&self, _sell_token: &Bytes, _buy_token: &Bytes) -> Vec<BigUint>

Amounts to quote get_amount_out(_, sell_token, buy_token) at in this state besides the ones every state is quoted at: where its own behaviour changes, such as the smallest input that buys any output. None by default.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§