mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 12:49:23 +00:00
Tidy the DEX pallet
This commit is contained in:
@@ -4,7 +4,7 @@ version = "0.1.0"
|
||||
description = "Coins pallet for Serai"
|
||||
license = "AGPL-3.0-only"
|
||||
repository = "https://github.com/serai-dex/serai/tree/develop/substrate/coins"
|
||||
authors = ["Akil Demir <akildemir72@gmail.com>"]
|
||||
authors = ["Luke Parker <lukeparker5132@gmail.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.85"
|
||||
|
||||
|
||||
@@ -227,6 +227,13 @@ mod pallet {
|
||||
Self::emit_event(Event::Transfer { from: from.into(), to: to.into(), coins });
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Burn `coins` from `from`.
|
||||
pub fn burn_fn(from: Public, coins: Balance) -> Result<(), Error<T, I>> {
|
||||
Self::burn_internal(from, coins)?;
|
||||
Self::emit_event(Event::Burn { from: from.into(), coins });
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::call]
|
||||
@@ -245,8 +252,7 @@ mod pallet {
|
||||
#[pallet::weight((0, DispatchClass::Normal))] // TODO
|
||||
pub fn burn(origin: OriginFor<T>, coins: Balance) -> DispatchResult {
|
||||
let from = ensure_signed(origin)?;
|
||||
Self::burn_internal(from, coins)?;
|
||||
Self::emit_event(Event::Burn { from: from.into(), coins });
|
||||
Self::burn_fn(from, coins)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Test environment for Coins pallet.
|
||||
//! Test environment for the Coins pallet.
|
||||
|
||||
use borsh::BorshDeserialize;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user