forked from paritytech/substrate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/refactor fee (paritytech#162)
* Move xexecutive from xrml path to runtime path * Move fee from xrml path to runtime * Add CheckFee trait * run ok * Format * Support runtime module test
- Loading branch information
Showing
12 changed files
with
69 additions
and
173 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2018 Chainpool | ||
|
||
use balances::Call as BalancesCall; | ||
use Call; | ||
|
||
pub trait CheckFee { | ||
fn check_fee(&self) -> Option<u64>; | ||
} | ||
|
||
impl CheckFee for Call { | ||
fn check_fee(&self) -> Option<u64> { | ||
// ret fee_power, total_fee = base_fee * fee_power + byte_fee * bytes | ||
match self { | ||
Call::Balances(call) => match call { | ||
BalancesCall::transfer(_, _) => Some(1), | ||
_ => None, | ||
}, | ||
_ => None, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.