mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 04:39:24 +00:00
Have the coins pallet emit events via serai_core_pallet
`serai_core_pallet` solely defines an accumulator for the events. We use the traditional `frame_system::Events` to store them for now and enable retrieval.
This commit is contained in:
@@ -44,6 +44,15 @@ pub enum Event {
|
||||
/// The coins minted.
|
||||
coins: Balance,
|
||||
},
|
||||
/// The specified coins were transferred.
|
||||
Transfer {
|
||||
/// The address transferred from.
|
||||
from: SeraiAddress,
|
||||
/// The address transferred to.
|
||||
to: SeraiAddress,
|
||||
/// The coins transferred.
|
||||
coins: Balance,
|
||||
},
|
||||
/// The specified coins were burnt.
|
||||
Burn {
|
||||
/// The address burnt from.
|
||||
@@ -58,13 +67,4 @@ pub enum Event {
|
||||
/// The `OutInstruction` specified, and the coins burnt.
|
||||
instruction: OutInstructionWithBalance,
|
||||
},
|
||||
/// The specified coins were transferred.
|
||||
Transfer {
|
||||
/// The address transferred from.
|
||||
from: SeraiAddress,
|
||||
/// The address transferred to.
|
||||
to: SeraiAddress,
|
||||
/// The coins transferred.
|
||||
coins: Balance,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -96,3 +96,44 @@ pub enum Event {
|
||||
/// The event for `InInstruction`s.
|
||||
InInstructions(in_instructions::Event) = 7,
|
||||
}
|
||||
|
||||
impl From<system::Event> for Event {
|
||||
fn from(event: system::Event) -> Self {
|
||||
Self::System(event)
|
||||
}
|
||||
}
|
||||
impl From<coins::Event> for Event {
|
||||
fn from(event: coins::Event) -> Self {
|
||||
Self::Coins(event)
|
||||
}
|
||||
}
|
||||
impl From<validator_sets::Event> for Event {
|
||||
fn from(event: validator_sets::Event) -> Self {
|
||||
Self::ValidatorSets(event)
|
||||
}
|
||||
}
|
||||
impl From<signals::Event> for Event {
|
||||
fn from(event: signals::Event) -> Self {
|
||||
Self::Signals(event)
|
||||
}
|
||||
}
|
||||
impl From<dex::Event> for Event {
|
||||
fn from(event: dex::Event) -> Self {
|
||||
Self::Dex(event)
|
||||
}
|
||||
}
|
||||
impl From<genesis_liquidity::Event> for Event {
|
||||
fn from(event: genesis_liquidity::Event) -> Self {
|
||||
Self::GenesisLiquidity(event)
|
||||
}
|
||||
}
|
||||
impl From<economic_security::Event> for Event {
|
||||
fn from(event: economic_security::Event) -> Self {
|
||||
Self::EconomicSecurity(event)
|
||||
}
|
||||
}
|
||||
impl From<in_instructions::Event> for Event {
|
||||
fn from(event: in_instructions::Event) -> Self {
|
||||
Self::InInstructions(event)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user