Type Alias cfg_mocks::token_swaps::pallet::Module

source ·
pub type Module<T> = Pallet<T>;
👎Deprecated: use Pallet instead
Expand description

Type alias to Pallet, to be used by construct_runtime.

Generated by pallet attribute macro.

Aliased Type§

struct Module<T>(/* private fields */);

Implementations

source§

impl<T: Config> Pallet<T>

source

pub fn mock_place_order( f: impl Fn(T::AccountId, T::CurrencyId, T::CurrencyId, T::BalanceOut, OrderRatio<T::Ratio>) -> Result<T::OrderId, DispatchError> + 'static )

source

pub fn mock_update_order( f: impl Fn(T::OrderId, T::BalanceOut, OrderRatio<T::Ratio>) -> DispatchResult + 'static )

source

pub fn mock_cancel_order(f: impl Fn(T::OrderId) -> DispatchResult + 'static)

source

pub fn mock_is_active(f: impl Fn(T::OrderId) -> bool + 'static)

source

pub fn mock_get_order_details( f: impl Fn(T::OrderId) -> Option<OrderInfo<T::BalanceOut, T::CurrencyId, T::Ratio>> + 'static )

source

pub fn mock_convert_by_market( f: impl Fn(T::CurrencyId, T::CurrencyId, T::BalanceOut) -> Result<T::BalanceIn, DispatchError> + 'static )

source

pub fn mock_market_ratio( f: impl Fn(T::CurrencyId, T::CurrencyId) -> Result<T::Ratio, DispatchError> + 'static )

source

pub fn mock_fill_order( f: impl Fn(T::AccountId, T::OrderId, T::BalanceOut) -> DispatchResult + 'static )

Trait Implementations

source§

impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

source§

fn on_idle(n: BlockNumberFor<T>, remaining_weight: Weight) -> Weight

See [Hooks::on_idle].
source§

impl<T: Config> StorageInfoTrait for Pallet<T>

source§

fn storage_info() -> Vec<StorageInfo>

source§

impl<T: Config> PalletInfoAccess for Pallet<T>

source§

fn index() -> usize

Index of the pallet as configured in the runtime.
source§

fn name() -> &'static str

Name of the pallet as configured in the runtime.
source§

fn name_hash() -> [u8; 16]

Two128 hash of name.
source§

fn module_name() -> &'static str

Name of the Rust module containing the pallet.
source§

fn crate_version() -> CrateVersion

Version of the crate containing the pallet.
source§

impl<T: Config> IntegrityTest for Pallet<T>

source§

fn integrity_test()

See [Hooks::integrity_test].
source§

impl<T: Config> PalletsInfoAccess for Pallet<T>

source§

fn count() -> usize

The number of pallets’ information that this type represents. Read more
source§

fn infos() -> Vec<PalletInfoData>

All of the pallets’ information that this type represents.
source§

impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

source§

fn on_initialize(n: BlockNumberFor<T>) -> Weight

See [Hooks::on_initialize].
source§

impl<T: Config> OnRuntimeUpgrade for Pallet<T>

source§

fn on_runtime_upgrade() -> Weight

See [Hooks::on_runtime_upgrade].
source§

impl<T> Eq for Pallet<T>

source§

impl<T: Config> OnGenesis for Pallet<T>

source§

fn on_genesis()

Something that should happen at genesis.
source§

impl<T: Config> WhitelistedStorageKeys for Pallet<T>

source§

fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>

Returns a Vec<TrackedStorageKey> indicating the storage keys that should be whitelisted during benchmarking. This means that those keys will be excluded from the benchmarking performance calculation.
source§

impl<T: Config> GetStorageVersion for Pallet<T>

§

type CurrentStorageVersion = NoStorageVersionSet

This will be filled out by the pallet macro. Read more
source§

fn current_storage_version() -> Self::CurrentStorageVersion

Returns the current storage version as supported by the pallet.
source§

fn on_chain_storage_version() -> StorageVersion

Returns the on-chain storage version of the pallet as stored in the storage.
source§

impl<T> Clone for Pallet<T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Config> Callable<T> for Pallet<T>

source§

impl<T: Config> TokenSwaps<<T as Config>::AccountId> for Pallet<T>

§

type BalanceIn = <T as Config>::BalanceIn

§

type BalanceOut = <T as Config>::BalanceOut

§

type CurrencyId = <T as Config>::CurrencyId

§

type OrderId = <T as Config>::OrderId

§

type Ratio = <T as Config>::Ratio

source§

fn place_order( a: T::AccountId, b: Self::CurrencyId, c: Self::CurrencyId, d: Self::BalanceOut, e: OrderRatio<Self::Ratio> ) -> Result<Self::OrderId, DispatchError>

Swap tokens selling amount_out of currency_out and buying currency_in given an order ratio.
source§

fn update_order( a: Self::OrderId, b: Self::BalanceOut, c: OrderRatio<Self::Ratio> ) -> DispatchResult

Update an existing active order.
source§

fn cancel_order(a: Self::OrderId) -> DispatchResult

Cancel an already active order.
source§

fn get_order_details( a: Self::OrderId ) -> Option<OrderInfo<Self::BalanceOut, Self::CurrencyId, Self::Ratio>>

Retrieve the details of the order if it exists.
source§

fn convert_by_market( a: Self::CurrencyId, b: Self::CurrencyId, c: Self::BalanceOut ) -> Result<Self::BalanceIn, DispatchError>

Makes a conversion between 2 currencies using the market ratio between them.
source§

fn market_ratio( a: Self::CurrencyId, b: Self::CurrencyId ) -> Result<Self::Ratio, DispatchError>

Returns the conversion ratio to convert currency out into currency in,
source§

fn fill_order( a: T::AccountId, b: Self::OrderId, c: Self::BalanceOut ) -> DispatchResult

Fill an existing order up to the provided amount. Read more
source§

impl<T> PartialEq for Pallet<T>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

§

fn on_initialize(_n: BlockNumber) -> Weight

Block initialization hook. This is called at the very beginning of block execution. Read more
§

fn on_finalize(_n: BlockNumber)

Block finalization hook. This is called at the very end of block execution. Read more
§

fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight

Hook to consume a block’s idle time. This will run when the block is being finalized (before [Hooks::on_finalize]). Read more
§

fn on_runtime_upgrade() -> Weight

Hook executed when a code change (aka. a “runtime upgrade”) is detected by FRAME. Read more
§

fn offchain_worker(_n: BlockNumber)

Implementing this function on a pallet allows you to perform long-running tasks that are dispatched as separate threads, and entirely independent of the main wasm runtime. Read more
§

fn integrity_test()

Check the integrity of this pallet’s configuration. Read more
source§

impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

source§

fn on_finalize(n: BlockNumberFor<T>)

See [Hooks::on_finalize].
source§

impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>

source§

fn before_all_runtime_migrations() -> Weight

Something that should happen before runtime migrations are executed.
source§

impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

source§

fn offchain_worker(n: BlockNumberFor<T>)

This function is being called after every block import (when fully synced). Read more
source§

impl<T> Debug for Pallet<T>

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more