Skip to content

Commit d06242a

Browse files
committed
fix build
1 parent 41b821d commit d06242a

1 file changed

Lines changed: 31 additions & 28 deletions

File tree

e2e-tests/src/test/fee.rs

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
// use aleph_client::{
2-
// api::transaction_payment::events::TransactionFeePaid,
3-
// pallets::{balances::BalanceUserApi, fee::TransactionPaymentApi, system::SystemSudoApi},
4-
// utility::BlocksApi,
5-
// AccountId, RootConnection, SignedConnection, TxStatus,
6-
// };
7-
// use log::info;
8-
// use primitives::Balance;
1+
use aleph_client::{
2+
api::transaction_payment::events::TransactionFeePaid,
3+
pallets::{balances::BalanceUserApi, fee::TransactionPaymentApi},
4+
utility::BlocksApi,
5+
AccountId, SignedConnection, TxStatus,
6+
};
7+
use log::info;
8+
use primitives::Balance;
9+
10+
// use aleph_client::{RootConnection, pallets::system::SystemSudoApi};
911
// use sp_runtime::{FixedPointNumber, FixedU128};
1012

1113
// use crate::{config::setup_test, transfer::setup_for_transfer};
1214

15+
// This test is disabled, as for now we no longer have access to fill_block runtime call
1316
// #[tokio::test]
1417
// pub async fn fee_calculation() -> anyhow::Result<()> {
1518
// let config = setup_test();
@@ -99,27 +102,27 @@
99102
// }
100103
// }
101104

102-
// pub async fn current_fees(
103-
// connection: &SignedConnection,
104-
// to: AccountId,
105-
// tip: Option<Balance>,
106-
// transfer_value: Balance,
107-
// ) -> (Balance, u128) {
108-
// let actual_multiplier = connection.get_next_fee_multiplier(None).await;
109-
110-
// let tx_info = match tip {
111-
// None => connection.transfer(to, transfer_value, TxStatus::Finalized),
112-
// Some(tip) => connection.transfer_with_tip(to, transfer_value, tip, TxStatus::Finalized),
113-
// }
114-
// .await
115-
// .unwrap();
105+
pub async fn current_fees(
106+
connection: &SignedConnection,
107+
to: AccountId,
108+
tip: Option<Balance>,
109+
transfer_value: Balance,
110+
) -> (Balance, u128) {
111+
let actual_multiplier = connection.get_next_fee_multiplier(None).await;
116112

117-
// let events = connection.get_tx_events(tx_info).await.unwrap();
118-
// let event = events.find_first::<TransactionFeePaid>().unwrap().unwrap();
113+
let tx_info = match tip {
114+
None => connection.transfer(to, transfer_value, TxStatus::Finalized),
115+
Some(tip) => connection.transfer_with_tip(to, transfer_value, tip, TxStatus::Finalized),
116+
}
117+
.await
118+
.unwrap();
119119

120-
// let fee = event.actual_fee;
120+
let events = connection.get_tx_events(tx_info).await.unwrap();
121+
let event = events.find_first::<TransactionFeePaid>().unwrap().unwrap();
121122

122-
// info!("fee payed: {}", fee);
123+
let fee = event.actual_fee;
123124

124-
// (fee, actual_multiplier)
125-
// }
125+
info!("fee payed: {}", fee);
126+
127+
(fee, actual_multiplier)
128+
}

0 commit comments

Comments
 (0)