Skip to content

Commit

Permalink
Small styling fixes (#55)
Browse files Browse the repository at this point in the history
* Small styling fixes

* Move impl of FixedGasPrice to the same block as the defintion
  • Loading branch information
sorpaas authored Jun 29, 2020
1 parent 8ee30fb commit dd7a211
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ pub type Hash = sp_core::H256;
/// Digest item type.
pub type DigestItem = generic::DigestItem<Hash>;

// EVM structs
pub struct FixedGasPrice;
/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know
/// the specifics of the runtime. They can then be made to be agnostic over specific formats
/// of data like extrinsics, allowing for them to continue syncing the network through upgrades
Expand Down Expand Up @@ -266,7 +264,6 @@ impl balances::Trait for Runtime {

parameter_types! {
pub const TransactionByteFee: Balance = 1;
pub const EVMModuleId: ModuleId = ModuleId(*b"py/evmpa");
}

impl transaction_payment::Trait for Runtime {
Expand All @@ -282,22 +279,27 @@ impl sudo::Trait for Runtime {
type Call = Call;
}

/// Fixed gas price of `1`.
pub struct FixedGasPrice;

impl FeeCalculator for FixedGasPrice {
fn min_gas_price() -> U256 {
// Gas price is always one token per gas.
1.into()
}
}

parameter_types! {
pub const EVMModuleId: ModuleId = ModuleId(*b"py/evmpa");
}

impl evm::Trait for Runtime {
type ModuleId = EVMModuleId;
type FeeCalculator = FixedGasPrice;
type ConvertAccountId = HashTruncateConvertAccountId<BlakeTwo256>;
type Currency = Balances;
type Event = Event;
type Precompiles = (); // We can use () here because paint_evm provides an
// `impl Precompiles for ()``
// block that always returns none (line 75)
type Precompiles = ();
}

impl ethereum::Trait for Runtime {
Expand Down

0 comments on commit dd7a211

Please sign in to comment.