/// Validate the given supply on initialization. This is useful for curves
/// that allow zero supply on one or both sides, since the standard constant
/// product curve must have a non-zero supply on both sides.
Validate the given supply on initialization. This is useful for curves
that allow zero supply on one or both sides, since the standard constant
product curve must have a non-zero supply on both sides.
Validate the given supply on initialization . This is useful for curves that allow zero supply on one or both sides since the standard constant product curve must have a non - zero supply on both sides .
fn validate_supply(&self, token_a_amount: u64, token_b_amount: u64) -> Result<(), SwapError> {
        if token_a_amount == 0 {
            return Err(SwapError::EmptySupply);
        }
        if token_b_amount == 0 {
            return Err(SwapError::EmptySupply);
        }
        Ok(())
    }
fn validate_supply ( & self , token_a_amount : u64 , token_b_amount : u64 ) -> Result < ( ) , SwapError > { if token_a_amount == 0 { return Err ( SwapError :: EmptySupply ) ; } if token_b_amount == 0 { return Err ( SwapError :: EmptySupply ) ; } Ok ( ( ) ) }
Validate the given supply on initialization.
Validate the given supply on initialization .
&self
token_a_amount
u64
token_b_amount
u64