Type Alias cfg_mocks::pools::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_pool_exists(f: impl Fn(T::PoolId) -> bool + 'static)

source

pub fn mock_tranche_exists( f: impl Fn(T::PoolId, T::TrancheId) -> bool + 'static )

source

pub fn mock_account_for(f: impl Fn(T::PoolId) -> T::AccountId + 'static)

source

pub fn mock_currency_for( f: impl Fn(T::PoolId) -> Option<T::CurrencyId> + 'static )

source

pub fn mock_withdraw( f: impl Fn(T::PoolId, T::AccountId, T::Balance) -> DispatchResult + 'static )

source

pub fn mock_deposit( f: impl Fn(T::PoolId, T::AccountId, T::Balance) -> DispatchResult + 'static )

source

pub fn mock_info( f: impl Fn((T::PoolId, T::TrancheId)) -> Result<InvestmentInfo<T::AccountId, T::CurrencyId, (T::PoolId, T::TrancheId)>, DispatchError> + 'static )

source

pub fn mock_balance( f: impl Fn((T::PoolId, T::TrancheId), &T::AccountId) -> T::Balance + 'static )

source

pub fn mock_transfer( f: impl Fn((T::PoolId, T::TrancheId), &T::AccountId, &T::AccountId, T::Balance) -> DispatchResult + 'static )

source

pub fn mock_get_price( f: impl Fn(T::PoolId, T::TrancheId) -> Option<(T::BalanceRatio, Seconds)> + 'static )

source

pub fn mock_InvestmentAccountant_deposit( f: impl Fn(&T::AccountId, (T::PoolId, T::TrancheId), T::Balance) -> DispatchResult + 'static )

source

pub fn mock_InvestmentAccountant_withdraw( f: impl Fn(&T::AccountId, (T::PoolId, T::TrancheId), T::Balance) -> DispatchResult + 'static )

Trait Implementations

source§

impl<T: Config> TrancheTokenPrice<<T as Config>::AccountId, <T as Config>::CurrencyId> for Pallet<T>

§

type BalanceRatio = <T as Config>::BalanceRatio

§

type Moment = u64

§

type PoolId = <T as Config>::PoolId

§

type TrancheId = <T as Config>::TrancheId

source§

fn get_price( a: T::PoolId, b: T::TrancheId ) -> Option<(T::BalanceRatio, Seconds)>

source§

impl<T: Config> PoolInspect<<T as Config>::AccountId, <T as Config>::CurrencyId> for Pallet<T>

§

type Moment = u64

§

type PoolId = <T as Config>::PoolId

§

type TrancheId = <T as Config>::TrancheId

source§

fn pool_exists(a: T::PoolId) -> bool

Check if the pool exists
source§

fn tranche_exists(a: T::PoolId, b: T::TrancheId) -> bool

Check if the tranche exists for the given pool
source§

fn account_for(a: T::PoolId) -> T::AccountId

Get the account used for the given pool_id.
source§

fn currency_for(a: T::PoolId) -> Option<T::CurrencyId>

Get the currency used for the given pool_id.
source§

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

source§

fn integrity_test()

See [Hooks::integrity_test].
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> 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> 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: Config> StorageInfoTrait for Pallet<T>

source§

fn storage_info() -> Vec<StorageInfo>

source§

impl<T> Eq for Pallet<T>

source§

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

source§

fn on_runtime_upgrade() -> Weight

See [Hooks::on_runtime_upgrade].
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> PoolReserve<<T as Config>::AccountId, <T as Config>::CurrencyId> for Pallet<T>

§

type Balance = <T as Config>::Balance

source§

fn withdraw(a: T::PoolId, b: T::AccountId, c: T::Balance) -> DispatchResult

Withdraw amount from the reserve to the to account.
source§

fn deposit(a: T::PoolId, b: T::AccountId, c: T::Balance) -> DispatchResult

Deposit amount from the from account into the reserve.
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> OnGenesis for Pallet<T>

source§

fn on_genesis()

Something that should happen at genesis.
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> Debug for Pallet<T>

source§

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

Formats the value using the given formatter. Read more
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> InvestmentAccountant<<T as Config>::AccountId> for Pallet<T>

§

type Amount = <T as Config>::Balance

§

type Error = DispatchError

§

type InvestmentId = (<T as Config>::PoolId, <T as Config>::TrancheId)

§

type InvestmentInfo = InvestmentInfo<<T as Config>::AccountId, <T as Config>::CurrencyId, <Pallet<T> as InvestmentAccountant<<T as Config>::AccountId>>::InvestmentId>

source§

fn info(a: Self::InvestmentId) -> Result<Self::InvestmentInfo, DispatchError>

Information about an asset. Must allow to derive owner, payment and denomination currency
source§

fn balance(a: Self::InvestmentId, b: &T::AccountId) -> Self::Amount

Return the balance of a given user for the given investmnet
source§

fn transfer( a: Self::InvestmentId, b: &T::AccountId, c: &T::AccountId, d: Self::Amount ) -> DispatchResult

Transfer a given investment from source, to destination
source§

fn deposit( a: &T::AccountId, b: Self::InvestmentId, c: Self::Amount ) -> DispatchResult

Increases the existence of
source§

fn withdraw( a: &T::AccountId, b: Self::InvestmentId, c: Self::Amount ) -> DispatchResult

Reduce the existence of an asset
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> Callable<T> for Pallet<T>

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> 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> 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> 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