Skip to content

Commit 6c10711

Browse files
committed
Merge remote-tracking branch 'origin/hotfix/vune/disable-tx-fees-in-alpha' into devnet-ready
2 parents 2db51ce + 29c31cb commit 6c10711

File tree

2 files changed

+31
-16
lines changed

2 files changed

+31
-16
lines changed

pallets/transaction-fee/src/lib.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ where
308308

309309
fn withdraw_fee(
310310
who: &AccountIdOf<T>,
311-
call: &CallOf<T>,
311+
_call: &CallOf<T>,
312312
_dispatch_info: &DispatchInfoOf<CallOf<T>>,
313313
fee: Self::Balance,
314314
_tip: Self::Balance,
@@ -327,20 +327,20 @@ where
327327
) {
328328
Ok(imbalance) => Ok(Some(WithdrawnFee::Tao(imbalance))),
329329
Err(_) => {
330-
let alpha_vec = Self::fees_in_alpha::<T>(who, call);
331-
if !alpha_vec.is_empty() {
332-
let fee_u64: u64 = fee.into();
333-
OU::withdraw_in_alpha(who, &alpha_vec, fee_u64);
334-
return Ok(Some(WithdrawnFee::Alpha));
335-
}
330+
// let alpha_vec = Self::fees_in_alpha::<T>(who, call);
331+
// if !alpha_vec.is_empty() {
332+
// let fee_u64: u64 = fee.into();
333+
// OU::withdraw_in_alpha(who, &alpha_vec, fee_u64);
334+
// return Ok(Some(WithdrawnFee::Alpha));
335+
// }
336336
Err(InvalidTransaction::Payment.into())
337337
}
338338
}
339339
}
340340

341341
fn can_withdraw_fee(
342342
who: &AccountIdOf<T>,
343-
call: &CallOf<T>,
343+
_call: &CallOf<T>,
344344
_dispatch_info: &DispatchInfoOf<CallOf<T>>,
345345
fee: Self::Balance,
346346
_tip: Self::Balance,
@@ -353,14 +353,14 @@ where
353353
match F::can_withdraw(who, fee) {
354354
WithdrawConsequence::Success => Ok(()),
355355
_ => {
356-
// Fallback to fees in Alpha if possible
357-
let alpha_vec = Self::fees_in_alpha::<T>(who, call);
358-
if !alpha_vec.is_empty() {
359-
let fee_u64: u64 = fee.into();
360-
if OU::can_withdraw_in_alpha(who, &alpha_vec, fee_u64) {
361-
return Ok(());
362-
}
363-
}
356+
// // Fallback to fees in Alpha if possible
357+
// let alpha_vec = Self::fees_in_alpha::<T>(who, call);
358+
// if !alpha_vec.is_empty() {
359+
// let fee_u64: u64 = fee.into();
360+
// if OU::can_withdraw_in_alpha(who, &alpha_vec, fee_u64) {
361+
// return Ok(());
362+
// }
363+
// }
364364
Err(InvalidTransaction::Payment.into())
365365
}
366366
}

pallets/transaction-fee/src/tests/mod.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ fn test_remove_stake_fees_tao() {
7474

7575
// cargo test --package subtensor-transaction-fee --lib -- tests::test_remove_stake_fees_alpha --exact --show-output
7676
#[test]
77+
#[ignore]
7778
fn test_remove_stake_fees_alpha() {
7879
new_test_ext().execute_with(|| {
7980
let stake_amount = TAO;
@@ -142,6 +143,7 @@ fn test_remove_stake_fees_alpha() {
142143
//
143144
// cargo test --package subtensor-transaction-fee --lib -- tests::test_remove_stake_root --exact --show-output
144145
#[test]
146+
#[ignore]
145147
fn test_remove_stake_root() {
146148
new_test_ext().execute_with(|| {
147149
let stake_amount = TAO;
@@ -200,6 +202,7 @@ fn test_remove_stake_root() {
200202
//
201203
// cargo test --package subtensor-transaction-fee --lib -- tests::test_remove_stake_completely_root --exact --show-output
202204
#[test]
205+
#[ignore]
203206
fn test_remove_stake_completely_root() {
204207
new_test_ext().execute_with(|| {
205208
let stake_amount = TAO;
@@ -251,6 +254,7 @@ fn test_remove_stake_completely_root() {
251254

252255
// cargo test --package subtensor-transaction-fee --lib -- tests::test_remove_stake_completely_fees_alpha --exact --show-output
253256
#[test]
257+
#[ignore]
254258
fn test_remove_stake_completely_fees_alpha() {
255259
new_test_ext().execute_with(|| {
256260
let stake_amount = TAO;
@@ -381,6 +385,7 @@ fn test_remove_stake_not_enough_balance_for_fees() {
381385
//
382386
// cargo test --package subtensor-transaction-fee --lib -- tests::test_remove_stake_edge_alpha --exact --show-output
383387
#[test]
388+
#[ignore]
384389
fn test_remove_stake_edge_alpha() {
385390
new_test_ext().execute_with(|| {
386391
let stake_amount = TAO;
@@ -519,6 +524,7 @@ fn test_remove_stake_failing_transaction_tao_fees() {
519524
//
520525
// cargo test --package subtensor-transaction-fee --lib -- tests::test_remove_stake_failing_transaction_alpha_fees --exact --show-output
521526
#[test]
527+
#[ignore]
522528
fn test_remove_stake_failing_transaction_alpha_fees() {
523529
new_test_ext().execute_with(|| {
524530
let stake_amount = TAO;
@@ -584,6 +590,7 @@ fn test_remove_stake_failing_transaction_alpha_fees() {
584590

585591
// cargo test --package subtensor-transaction-fee --lib -- tests::test_remove_stake_limit_fees_alpha --exact --show-output
586592
#[test]
593+
#[ignore]
587594
fn test_remove_stake_limit_fees_alpha() {
588595
new_test_ext().execute_with(|| {
589596
let stake_amount = TAO;
@@ -651,6 +658,7 @@ fn test_remove_stake_limit_fees_alpha() {
651658

652659
// cargo test --package subtensor-transaction-fee --lib -- tests::test_unstake_all_fees_alpha --exact --show-output
653660
#[test]
661+
#[ignore]
654662
fn test_unstake_all_fees_alpha() {
655663
new_test_ext().execute_with(|| {
656664
let stake_amount = TAO;
@@ -723,6 +731,7 @@ fn test_unstake_all_fees_alpha() {
723731

724732
// cargo test --package subtensor-transaction-fee --lib -- tests::test_unstake_all_alpha_fees_alpha --exact --show-output
725733
#[test]
734+
#[ignore]
726735
fn test_unstake_all_alpha_fees_alpha() {
727736
new_test_ext().execute_with(|| {
728737
let stake_amount = TAO;
@@ -790,6 +799,7 @@ fn test_unstake_all_alpha_fees_alpha() {
790799

791800
// cargo test --package subtensor-transaction-fee --lib -- tests::test_move_stake_fees_alpha --exact --show-output
792801
#[test]
802+
#[ignore]
793803
fn test_move_stake_fees_alpha() {
794804
new_test_ext().execute_with(|| {
795805
let stake_amount = TAO;
@@ -861,6 +871,7 @@ fn test_move_stake_fees_alpha() {
861871

862872
// cargo test --package subtensor-transaction-fee --lib -- tests::test_transfer_stake_fees_alpha --exact --show-output
863873
#[test]
874+
#[ignore]
864875
fn test_transfer_stake_fees_alpha() {
865876
new_test_ext().execute_with(|| {
866877
let destination_coldkey = U256::from(100000);
@@ -933,6 +944,7 @@ fn test_transfer_stake_fees_alpha() {
933944

934945
// cargo test --package subtensor-transaction-fee --lib -- tests::test_swap_stake_fees_alpha --exact --show-output
935946
#[test]
947+
#[ignore]
936948
fn test_swap_stake_fees_alpha() {
937949
new_test_ext().execute_with(|| {
938950
let stake_amount = TAO;
@@ -1003,6 +1015,7 @@ fn test_swap_stake_fees_alpha() {
10031015

10041016
// cargo test --package subtensor-transaction-fee --lib -- tests::test_swap_stake_limit_fees_alpha --exact --show-output
10051017
#[test]
1018+
#[ignore]
10061019
fn test_swap_stake_limit_fees_alpha() {
10071020
new_test_ext().execute_with(|| {
10081021
let stake_amount = TAO;
@@ -1075,6 +1088,7 @@ fn test_swap_stake_limit_fees_alpha() {
10751088

10761089
// cargo test --package subtensor-transaction-fee --lib -- tests::test_burn_alpha_fees_alpha --exact --show-output
10771090
#[test]
1091+
#[ignore]
10781092
fn test_burn_alpha_fees_alpha() {
10791093
new_test_ext().execute_with(|| {
10801094
let stake_amount = TAO;
@@ -1136,6 +1150,7 @@ fn test_burn_alpha_fees_alpha() {
11361150

11371151
// cargo test --package subtensor-transaction-fee --lib -- tests::test_recycle_alpha_fees_alpha --exact --show-output
11381152
#[test]
1153+
#[ignore]
11391154
fn test_recycle_alpha_fees_alpha() {
11401155
new_test_ext().execute_with(|| {
11411156
let stake_amount = TAO;

0 commit comments

Comments
 (0)