[][src]Trait names::Trait

pub trait Trait: Trait {
    type Name: Clone + Debug + Default + Eq + FullCodec;
    type Value: Clone + Debug + Default + Eq + FullCodec;
    type Currency: Currency<Self::AccountId>;
    type Event: From<Event<Self>> + Into<Self::Event>;
    fn get_name_fee(
        op: &Operation<Self>
    ) -> Option<<Self::Currency as Currency<Self::AccountId>>::Balance>;
fn get_expiration(op: &Operation<Self>) -> Option<Self::BlockNumber>;
fn deposit_fee(
        value: <Self::Currency as Currency<Self::AccountId>>::NegativeImbalance
    ); }

The pallet's configuration trait.

Associated Types

type Name: Clone + Debug + Default + Eq + FullCodec

Type for names.

type Value: Clone + Debug + Default + Eq + FullCodec

Type for values associated to names.

type Currency: Currency<Self::AccountId>

Type for currency operations (in order to pay for names).

type Event: From<Event<Self>> + Into<Self::Event>

The overarching event type.

Loading content...

Required methods

fn get_name_fee(
    op: &Operation<Self>
) -> Option<<Self::Currency as Currency<Self::AccountId>>::Balance>

Computes and returns the currency fee the sender has to pay for a certain operation. If None is returned, it means that the operation is invalid (e.g. the name is too short).

fn get_expiration(op: &Operation<Self>) -> Option<Self::BlockNumber>

For a given name operation, computes the number of blocks before the name will expire again. If None is returned, then the name will never expire.

fn deposit_fee(
    value: <Self::Currency as Currency<Self::AccountId>>::NegativeImbalance
)

"Takes ownership" of the fee paid for a name operation. This function can just do nothing to effectively burn the fee, it may deposit it to a developer account, or it may give it out to miners.

Loading content...

Implementors

Loading content...