From abbaf8732c7980990f41db702548bbafd4d1e36e Mon Sep 17 00:00:00 2001 From: kylezs Date: Fri, 1 Mar 2024 22:54:09 +1100 Subject: [PATCH] chore: add asset to withdrawal event (#4590) --- api/lib/src/lib.rs | 1 + state-chain/pallets/cf-swapping/src/lib.rs | 2 ++ state-chain/pallets/cf-swapping/src/tests.rs | 1 + 3 files changed, 4 insertions(+) diff --git a/api/lib/src/lib.rs b/api/lib/src/lib.rs index 4421800690..145f56da6e 100644 --- a/api/lib/src/lib.rs +++ b/api/lib/src/lib.rs @@ -406,6 +406,7 @@ pub trait BrokerApi: SignedExtrinsicApi { egress_fee, destination_address, egress_id, + .. }, )) = events.iter().find(|event| { matches!( diff --git a/state-chain/pallets/cf-swapping/src/lib.rs b/state-chain/pallets/cf-swapping/src/lib.rs index cf955b003d..20fcfeb5ee 100644 --- a/state-chain/pallets/cf-swapping/src/lib.rs +++ b/state-chain/pallets/cf-swapping/src/lib.rs @@ -348,6 +348,7 @@ pub mod pallet { /// A broker fee withdrawal has been requested. WithdrawalRequested { egress_id: EgressId, + egress_asset: Asset, egress_amount: AssetAmount, egress_fee: AssetAmount, destination_address: EncodedAddress, @@ -551,6 +552,7 @@ pub mod pallet { Self::deposit_event(Event::::WithdrawalRequested { egress_amount, + egress_asset: asset, egress_fee: fee_withheld, destination_address, egress_id, diff --git a/state-chain/pallets/cf-swapping/src/tests.rs b/state-chain/pallets/cf-swapping/src/tests.rs index 569d5750a1..7de9c43f21 100644 --- a/state-chain/pallets/cf-swapping/src/tests.rs +++ b/state-chain/pallets/cf-swapping/src/tests.rs @@ -335,6 +335,7 @@ fn withdraw_broker_fees() { assert_eq!(egresses.pop().expect("must exist").amount(), 200); System::assert_last_event(RuntimeEvent::Swapping(Event::::WithdrawalRequested { egress_id: (ForeignChain::Ethereum, 1), + egress_asset: Asset::Eth, egress_amount: 200, destination_address: EncodedAddress::Eth(Default::default()), egress_fee: 0,