diff --git a/examples/n2c-miniprotocols/src/main.rs b/examples/n2c-miniprotocols/src/main.rs index de784c37..1c0bf26d 100644 --- a/examples/n2c-miniprotocols/src/main.rs +++ b/examples/n2c-miniprotocols/src/main.rs @@ -83,8 +83,8 @@ async fn do_localstate_query(client: &mut NodeClient) { async fn do_chainsync(client: &mut NodeClient) { let known_points = vec![Point::Specific( - 43847831u64, - hex::decode("15b9eeee849dd6386d3770b0745e0450190f7560e5159b1b3ab13b14b2684a45").unwrap(), + 77110778u64, + hex::decode("18e6eeaa592c42113280ba47a0829355e6bed1c9ce67cce4be502d6031d0679a").unwrap(), )]; let (point, _) = client diff --git a/pallas-network/src/miniprotocols/localstate/queries_v16/mod.rs b/pallas-network/src/miniprotocols/localstate/queries_v16/mod.rs index 5e4e8646..deee48b6 100644 --- a/pallas-network/src/miniprotocols/localstate/queries_v16/mod.rs +++ b/pallas-network/src/miniprotocols/localstate/queries_v16/mod.rs @@ -111,6 +111,7 @@ pub type PositiveInterval = RationalNumber; pub type ProtocolVersionMajor = u64; pub type ProtocolVersionMinor = u64; +pub type ProtocolVersion = (ProtocolVersionMajor, ProtocolVersionMinor); pub type CostModel = Vec; @@ -169,26 +170,24 @@ pub struct ProtocolParam { #[n(11)] pub treasury_growth_rate: Option, #[n(12)] - pub protocol_version_major: Option, + pub protocol_version: Option, #[n(13)] - pub protocol_version_minor: Option, - #[n(14)] pub min_pool_cost: Option, - #[n(15)] + #[n(14)] pub ada_per_utxo_byte: Option, - #[n(16)] + #[n(15)] pub cost_models_for_script_languages: Option, - #[n(17)] + #[n(16)] pub execution_costs: Option, - #[n(18)] + #[n(17)] pub max_tx_ex_units: Option, - #[n(19)] + #[n(18)] pub max_block_ex_units: Option, - #[n(20)] + #[n(19)] pub max_value_size: Option, - #[n(21)] + #[n(20)] pub collateral_percentage: Option, - #[n(22)] + #[n(21)] pub max_collateral_inputs: Option, } @@ -201,19 +200,21 @@ pub struct StakeDistribution { #[derive(Debug, Encode, Decode, PartialEq, Clone)] pub struct Pool { #[n(0)] - pub stakes: Fraction, + pub stakes: RationalNumber, #[n(1)] pub hashes: Bytes, } +/// Type used at [GenesisConfig], which is a fraction that is CBOR-encoded +/// as an untagged array. #[derive(Debug, Encode, Decode, PartialEq, Clone)] pub struct Fraction { #[n(0)] pub num: u64, #[n(1)] - pub dem: u64, + pub den: u64, } pub type Addr = Bytes; @@ -316,7 +317,7 @@ pub struct Stakes { } #[derive(Debug, Encode, Decode, PartialEq)] -pub struct Genesis { +pub struct GenesisConfig { #[n(0)] pub system_start: SystemStart, @@ -469,7 +470,7 @@ pub async fn get_cbor( pub async fn get_genesis_config( client: &mut Client, era: u16, -) -> Result, ClientError> { +) -> Result, ClientError> { let query = BlockQuery::GetGenesisConfig; let query = LedgerQuery::BlockQuery(era, query); let query = Request::LedgerQuery(query);