feat: add support for Conway config and params traverse (#521)
Co-authored-by: Clark Alesna <clark_alesna@hotmail.com> Co-authored-by: johnquinnvictaboada <quinnvictaboada@gmail.com>
This commit is contained in:
parent
ae71a53707
commit
19b0ac3072
10 changed files with 800 additions and 19 deletions
|
|
@ -408,7 +408,8 @@ fn compute_script_hash(script: &NativeScript) -> PolicyId {
|
|||
pallas_crypto::hash::Hasher::<224>::hash(&payload)
|
||||
}
|
||||
|
||||
// Checks all certificates in order, and counts the relevant ones for computing deposits.
|
||||
// Checks all certificates in order, and counts the relevant ones for computing
|
||||
// deposits.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn check_certificates(
|
||||
cert_opt: &Option<Vec<Certificate>>,
|
||||
|
|
@ -585,13 +586,13 @@ fn check_pool_retirement(
|
|||
pool_hash: &PoolKeyhash,
|
||||
repoch: &Epoch,
|
||||
cepoch: &Epoch,
|
||||
emax: &u32,
|
||||
emax: &Epoch,
|
||||
ps: &mut PState,
|
||||
) -> ValidationResult {
|
||||
if !ps.pool_params.contains_key(pool_hash) {
|
||||
return Err(ShelleyMA(PoolNotRegistered));
|
||||
}
|
||||
if (*cepoch < *repoch) & (*repoch <= *cepoch + *emax as u64) {
|
||||
if (*cepoch < *repoch) & (*repoch <= *cepoch + *emax) {
|
||||
ps.retiring.insert(*pool_hash, *repoch);
|
||||
Ok(())
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use pallas_primitives::{
|
|||
Coin, CostMdls, ExUnitPrices, ExUnits, Nonce, ProtocolVersion, RationalNumber, UnitInterval,
|
||||
},
|
||||
babbage::CostMdls as BabbageCostMdls,
|
||||
conway::CostMdls as ConwayCostMdls,
|
||||
conway::{CostMdls as ConwayCostMdls, Epoch},
|
||||
};
|
||||
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
|
|
@ -81,7 +81,7 @@ pub struct ShelleyProtParams {
|
|||
pub min_pool_cost: Coin,
|
||||
pub expansion_rate: UnitInterval,
|
||||
pub treasury_growth_rate: UnitInterval,
|
||||
pub maximum_epoch: u32,
|
||||
pub maximum_epoch: Epoch,
|
||||
pub pool_pledge_influence: RationalNumber,
|
||||
pub decentralization_constant: UnitInterval,
|
||||
pub extra_entropy: Nonce,
|
||||
|
|
@ -109,7 +109,7 @@ pub struct AlonzoProtParams {
|
|||
pub max_collateral_inputs: u32,
|
||||
pub expansion_rate: UnitInterval,
|
||||
pub treasury_growth_rate: UnitInterval,
|
||||
pub maximum_epoch: u32,
|
||||
pub maximum_epoch: Epoch,
|
||||
pub pool_pledge_influence: RationalNumber,
|
||||
pub decentralization_constant: UnitInterval,
|
||||
pub extra_entropy: Nonce,
|
||||
|
|
@ -137,7 +137,7 @@ pub struct BabbageProtParams {
|
|||
pub max_collateral_inputs: u32,
|
||||
pub expansion_rate: UnitInterval,
|
||||
pub treasury_growth_rate: UnitInterval,
|
||||
pub maximum_epoch: u32,
|
||||
pub maximum_epoch: Epoch,
|
||||
pub pool_pledge_influence: RationalNumber,
|
||||
pub decentralization_constant: UnitInterval,
|
||||
pub extra_entropy: Nonce,
|
||||
|
|
@ -165,16 +165,16 @@ pub struct ConwayProtParams {
|
|||
pub max_collateral_inputs: u32,
|
||||
pub expansion_rate: UnitInterval,
|
||||
pub treasury_growth_rate: UnitInterval,
|
||||
pub maximum_epoch: u32,
|
||||
pub maximum_epoch: Epoch,
|
||||
pub pool_pledge_influence: RationalNumber,
|
||||
pub pool_voting_thresholds: pallas_primitives::conway::PoolVotingThresholds,
|
||||
pub drep_voting_thresholds: pallas_primitives::conway::DRepVotingThresholds,
|
||||
pub min_committee_size: u64,
|
||||
pub committee_term_limit: u32,
|
||||
pub governance_action_validity_period: u32,
|
||||
pub committee_term_limit: Epoch,
|
||||
pub governance_action_validity_period: Epoch,
|
||||
pub governance_action_deposit: Coin,
|
||||
pub drep_deposit: Coin,
|
||||
pub drep_inactivity_period: u32,
|
||||
pub drep_inactivity_period: Epoch,
|
||||
pub minfee_refscript_cost_per_byte: UnitInterval,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue