Skip to content

Commit

Permalink
Style fix for cargo fmt check
Browse files Browse the repository at this point in the history
  • Loading branch information
staffik committed Nov 1, 2023
1 parent 428f655 commit d0a8e78
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions core/primitives-core/src/runtime/fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,6 @@ pub fn transfer_exec_fee(
receiver_account_type: AccountType,
) -> Gas {
let transfer_fee = cfg.fee(ActionCosts::transfer).exec_fee();
let create_account_fee = cfg.fee(ActionCosts::create_account).exec_fee();
let add_access_key_fee = cfg.fee(ActionCosts::add_full_access_key).exec_fee();

match (implicit_account_creation_allowed, receiver_account_type) {
// Regular transfer to a named account.
(_, AccountType::NamedAccount) => transfer_fee,
Expand All @@ -223,7 +220,11 @@ pub fn transfer_exec_fee(
// Currently, no account is created on transfer to ETH-implicit account, just a regular transfer.
(true, AccountType::EthImplicitAccount) => transfer_fee,
// Extra fees for the CreateAccount and AddFullAccessKey.
(true, AccountType::NearImplicitAccount) => transfer_fee + create_account_fee + add_access_key_fee,
(true, AccountType::NearImplicitAccount) => {
transfer_fee
+ cfg.fee(ActionCosts::create_account).exec_fee()
+ cfg.fee(ActionCosts::add_full_access_key).exec_fee()
}
}
}

Expand All @@ -234,9 +235,7 @@ pub fn transfer_send_fee(
receiver_account_type: AccountType,
) -> Gas {
let transfer_fee = cfg.fee(ActionCosts::transfer).send_fee(sender_is_receiver);
let create_account_fee = cfg.fee(ActionCosts::create_account).send_fee(sender_is_receiver);
let add_access_key_fee = cfg.fee(ActionCosts::add_full_access_key).send_fee(sender_is_receiver);


match (implicit_account_creation_allowed, receiver_account_type) {
// Regular transfer to a named account.
(_, AccountType::NamedAccount) => transfer_fee,
Expand All @@ -245,6 +244,10 @@ pub fn transfer_send_fee(
// Currently, no account is created on transfer to ETH-implicit account, just a regular transfer.
(true, AccountType::EthImplicitAccount) => transfer_fee,
// Extra fees for the CreateAccount and AddFullAccessKey.
(true, AccountType::NearImplicitAccount) => transfer_fee + create_account_fee + add_access_key_fee,
(true, AccountType::NearImplicitAccount) => {
transfer_fee
+ cfg.fee(ActionCosts::create_account).send_fee(sender_is_receiver)
+ cfg.fee(ActionCosts::add_full_access_key).send_fee(sender_is_receiver)
}
}
}

0 comments on commit d0a8e78

Please sign in to comment.