Skip to content

Commit

Permalink
chore: add asset to withdrawal event (#4590)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylezs authored Mar 1, 2024
1 parent 022015b commit abbaf87
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ pub trait BrokerApi: SignedExtrinsicApi {
egress_fee,
destination_address,
egress_id,
..
},
)) = events.iter().find(|event| {
matches!(
Expand Down
2 changes: 2 additions & 0 deletions state-chain/pallets/cf-swapping/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -551,6 +552,7 @@ pub mod pallet {

Self::deposit_event(Event::<T>::WithdrawalRequested {
egress_amount,
egress_asset: asset,
egress_fee: fee_withheld,
destination_address,
egress_id,
Expand Down
1 change: 1 addition & 0 deletions state-chain/pallets/cf-swapping/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ fn withdraw_broker_fees() {
assert_eq!(egresses.pop().expect("must exist").amount(), 200);
System::assert_last_event(RuntimeEvent::Swapping(Event::<Test>::WithdrawalRequested {
egress_id: (ForeignChain::Ethereum, 1),
egress_asset: Asset::Eth,
egress_amount: 200,
destination_address: EncodedAddress::Eth(Default::default()),
egress_fee: 0,
Expand Down

0 comments on commit abbaf87

Please sign in to comment.