Skip to content

Commit

Permalink
corrected test defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
EdHastingsCasperAssociation committed Dec 20, 2024
1 parent 263a450 commit fe68133
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion types/src/chainspec/vm_config/handle_payment_costs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub const DEFAULT_SET_REFUND_PURSE_COST: u32 = 10_000;
/// Default cost of the `get_refund_purse` `handle_payment` entry point.
pub const DEFAULT_GET_REFUND_PURSE_COST: u32 = 10_000;
/// Default cost of the `finalize_payment` `handle_payment` entry point.
pub const DEFAULT_FINALIZE_PAYMENT_COST: u32 = 10_000;
pub const DEFAULT_FINALIZE_PAYMENT_COST: u32 = 2_500_000_000;

/// Description of the costs of calling `handle_payment` entrypoints.
#[derive(Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Debug)]
Expand Down
4 changes: 2 additions & 2 deletions types/src/chainspec/vm_config/mint_costs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::bytesrepr::{self, FromBytes, ToBytes};
/// Default cost of the `mint` mint entry point.
pub const DEFAULT_MINT_COST: u32 = 2_500_000_000;
/// Default cost of the `reduce_total_supply` mint entry point.
pub const DEFAULT_REDUCE_TOTAL_SUPPLY_COST: u32 = 10_000;
pub const DEFAULT_REDUCE_TOTAL_SUPPLY_COST: u32 = 2_500_000_000;
/// Default cost of the `burn` mint entry point.
pub const DEFAULT_BURN_COST: u32 = 10_000;
/// Default cost of the `create` mint entry point.
Expand All @@ -23,7 +23,7 @@ pub const DEFAULT_BALANCE_COST: u32 = 10_000;
/// Default cost of the `transfer` mint entry point.
pub const DEFAULT_TRANSFER_COST: u32 = 100_000_000;
/// Default cost of the `read_base_round_reward` mint entry point.
pub const DEFAULT_READ_BASE_ROUND_REWARD_COST: u32 = 10_000;
pub const DEFAULT_READ_BASE_ROUND_REWARD_COST: u32 = 2_500_000_000;
/// Default cost of the `mint_into_existing_purse` mint entry point.
pub const DEFAULT_MINT_INTO_EXISTING_PURSE_COST: u32 = 2_500_000_000;

Expand Down
18 changes: 17 additions & 1 deletion types/src/chainspec/vm_config/system_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ use crate::{
chainspec::vm_config::{AuctionCosts, HandlePaymentCosts, MintCosts, StandardPaymentCosts},
};

/// Default cost for calls not a non-existent entrypoint.
pub const DEFAULT_NO_SUCH_ENTRYPOINT_COST: u64 = 2_500_000_000;

/// Definition of costs in the system.
///
/// This structure contains the costs of all the system contract's entry points and, additionally,
/// it defines a wasmless mint cost.
#[derive(Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Debug, Default)]
#[derive(Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Debug)]
#[cfg_attr(feature = "datasize", derive(DataSize))]
#[serde(deny_unknown_fields)]
pub struct SystemConfig {
Expand All @@ -38,6 +41,19 @@ pub struct SystemConfig {
standard_payment_costs: StandardPaymentCosts,
}

impl Default for SystemConfig {
/// Implements Default for SystemConfig.
fn default() -> Self {
Self {
no_such_entrypoint: DEFAULT_NO_SUCH_ENTRYPOINT_COST,
auction_costs: Default::default(),
handle_payment_costs: Default::default(),
mint_costs: Default::default(),
standard_payment_costs: Default::default(),
}
}
}

impl SystemConfig {
/// Creates new system config instance.
pub fn new(
Expand Down

0 comments on commit fe68133

Please sign in to comment.