mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Coins pallet (#399)
* initial implementation * add function to get a balance of an account * add support for multiple coins * rename pallet to "coins-pallet" * replace balances, assets and tokens pallet with coins pallet in runtime * add total supply info * update client side for new Coins pallet * handle fees * bug fixes * Update FeeAccount test * Fmt * fix pr comments * remove extraneous Imbalance type * Minor tweaks --------- Co-authored-by: Luke Parker <lukeparker5132@gmail.com>
This commit is contained in:
@@ -16,7 +16,7 @@ use serai_client::{
|
||||
ValidatorSetsEvent,
|
||||
},
|
||||
in_instructions::InInstructionsEvent,
|
||||
coins::{primitives::OutInstructionWithBalance, TokensEvent},
|
||||
coins::CoinsEvent,
|
||||
};
|
||||
|
||||
use serai_db::DbTxn;
|
||||
@@ -209,12 +209,12 @@ async fn handle_batch_and_burns<D: Db, Pro: Processors>(
|
||||
}
|
||||
|
||||
for burn in serai.coins().burn_events().await? {
|
||||
if let TokensEvent::Burn { address: _, balance, instruction } = burn {
|
||||
let network = balance.coin.network();
|
||||
if let CoinsEvent::Burn { address: _, instruction } = burn {
|
||||
let network = instruction.balance.coin.network();
|
||||
network_had_event(&mut burns, &mut batches, network);
|
||||
|
||||
// network_had_event should register an entry in burns
|
||||
burns.get_mut(&network).unwrap().push(OutInstructionWithBalance { balance, instruction });
|
||||
burns.get_mut(&network).unwrap().push(instruction);
|
||||
} else {
|
||||
panic!("Burn event wasn't Burn: {burn:?}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user