Skip to content

Commit

Permalink
chore: remove ActionCreationConfig et al. (#8397)
Browse files Browse the repository at this point in the history
`ActionCreationConfigView` is still around for the RPC format but inside the transaction runtime logic we now use
`RuntimeFeesConfig::action_fees` which stores these fees by parameter.

The same goes for `DataReceiptCreationConfig` and
`AccessKeyCreationConfig`.

These have been obsolete since #8100 I just forgot to delete them.
  • Loading branch information
jakmeier authored Jan 27, 2023
1 parent 194c7b8 commit 26a3d79
Showing 1 changed file with 0 additions and 64 deletions.
64 changes: 0 additions & 64 deletions core/primitives-core/src/runtime/fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,70 +60,6 @@ pub struct RuntimeFeesConfig {
pub pessimistic_gas_price_inflation_ratio: Rational32,
}

/// Describes the cost of creating a data receipt, `DataReceipt`.
#[derive(Debug, Serialize, Deserialize, Clone, Hash, PartialEq, Eq)]
pub struct DataReceiptCreationConfig {
/// Base cost of creating a data receipt.
/// Both `send` and `exec` costs are burned when a new receipt has input dependencies. The gas
/// is charged for each input dependency. The dependencies are specified when a receipt is
/// created using `promise_then` and `promise_batch_then`.
/// NOTE: Any receipt with output dependencies will produce data receipts. Even if it fails.
/// Even if the last action is not a function call (in case of success it will return empty
/// value).
pub base_cost: Fee,
/// Additional cost per byte sent.
/// Both `send` and `exec` costs are burned when a function call finishes execution and returns
/// `N` bytes of data to every output dependency. For each output dependency the cost is
/// `(send(sir) + exec()) * N`.
pub cost_per_byte: Fee,
}

/// Describes the cost of creating a specific action, `Action`. Includes all variants.
#[derive(Debug, Serialize, Deserialize, Clone, Hash, PartialEq, Eq)]
pub struct ActionCreationConfig {
/// Base cost of creating an account.
pub create_account_cost: Fee,

/// Base cost of deploying a contract.
pub deploy_contract_cost: Fee,
/// Cost per byte of deploying a contract.
pub deploy_contract_cost_per_byte: Fee,

/// Base cost of calling a function.
pub function_call_cost: Fee,
/// Cost per byte of method name and arguments of calling a function.
pub function_call_cost_per_byte: Fee,

/// Base cost of making a transfer.
pub transfer_cost: Fee,

/// Base cost of staking.
pub stake_cost: Fee,

/// Base cost of adding a key.
pub add_key_cost: AccessKeyCreationConfig,

/// Base cost of deleting a key.
pub delete_key_cost: Fee,

/// Base cost of deleting an account.
pub delete_account_cost: Fee,

/// Base cost of a delegate action
pub delegate_cost: Fee,
}

/// Describes the cost of creating an access key.
#[derive(Debug, Serialize, Deserialize, Clone, Hash, PartialEq, Eq)]
pub struct AccessKeyCreationConfig {
/// Base cost of creating a full access access-key.
pub full_access_cost: Fee,
/// Base cost of creating an access-key restricted to specific functions.
pub function_call_cost: Fee,
/// Cost per byte of method_names of creating a restricted access-key.
pub function_call_cost_per_byte: Fee,
}

/// Describes cost of storage per block
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
pub struct StorageUsageConfig {
Expand Down

0 comments on commit 26a3d79

Please sign in to comment.