Type Alias cfg_mocks::token_swaps::pallet::Module
source · pub type Module<T> = Pallet<T>;
👎Deprecated: use
Pallet
insteadExpand 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>
impl<T: Config> Pallet<T>
pub fn mock_place_order( f: impl Fn(T::AccountId, T::CurrencyId, T::CurrencyId, T::BalanceOut, OrderRatio<T::Ratio>) -> Result<T::OrderId, DispatchError> + 'static )
pub fn mock_update_order( f: impl Fn(T::OrderId, T::BalanceOut, OrderRatio<T::Ratio>) -> DispatchResult + 'static )
pub fn mock_cancel_order(f: impl Fn(T::OrderId) -> DispatchResult + 'static)
pub fn mock_is_active(f: impl Fn(T::OrderId) -> bool + 'static)
pub fn mock_get_order_details( f: impl Fn(T::OrderId) -> Option<OrderInfo<T::BalanceOut, T::CurrencyId, T::Ratio>> + 'static )
pub fn mock_convert_by_market( f: impl Fn(T::CurrencyId, T::CurrencyId, T::BalanceOut) -> Result<T::BalanceIn, DispatchError> + 'static )
pub fn mock_market_ratio( f: impl Fn(T::CurrencyId, T::CurrencyId) -> Result<T::Ratio, DispatchError> + 'static )
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>
impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> PalletInfoAccess for Pallet<T>
impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
fn module_name() -> &'static str
Name of the Rust module containing the pallet.
source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
Version of the crate containing the pallet.
source§impl<T: Config> IntegrityTest for Pallet<T>
impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
fn integrity_test()
See [
Hooks::integrity_test
].source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
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
fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [
Hooks::on_initialize
].source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
See [
Hooks::on_runtime_upgrade
].impl<T> Eq for Pallet<T>
source§impl<T: Config> OnGenesis for Pallet<T>
impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
fn on_genesis()
Something that should happen at genesis.
source§impl<T: Config> WhitelistedStorageKeys for Pallet<T>
impl<T: Config> WhitelistedStorageKeys for Pallet<T>
source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
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>
impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.
source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.
source§impl<T: Config> TokenSwaps<<T as Config>::AccountId> for Pallet<T>
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>
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
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
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>>
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>
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>
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
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>
impl<T> PartialEq for Pallet<T>
source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
§fn on_initialize(_n: BlockNumber) -> Weight
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)
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
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
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)
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()
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>
impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
fn on_finalize(n: BlockNumberFor<T>)
See [
Hooks::on_finalize
].source§impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>
impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>
source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
Something that should happen before runtime migrations are executed.