Skip to content

Commit

Permalink
Update candid and rust
Browse files Browse the repository at this point in the history
  • Loading branch information
dskloetd committed Oct 15, 2024
1 parent c799d6d commit 9afc3e2
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Candid for canister `sns_governance` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-09-26_01-31-no-canister-snapshots/rs/sns/governance/canister/governance.did>
//! Candid for canister `sns_governance` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-10-11_14-35-overload/rs/sns/governance/canister/governance.did>
type Account = record {
owner : opt principal;
subaccount : opt Subaccount;
Expand Down Expand Up @@ -265,6 +265,12 @@ type GetSnsInitializationParametersResponse = record {
sns_initialization_parameters : text;
};

type CachedUpgradeSteps = record {
upgrade_steps : opt Versions;
requested_timestamp_seconds : opt nat64;
response_timestamp_seconds : opt nat64;
};

type Governance = record {
root_canister_id : opt principal;
id_to_nervous_system_functions : vec record { nat64; NervousSystemFunction };
Expand All @@ -274,6 +280,7 @@ type Governance = record {
parameters : opt NervousSystemParameters;
is_finalizing_disburse_maturity : opt bool;
deployed_version : opt Version;
cached_upgrade_steps : opt CachedUpgradeSteps;
sns_initialization_parameters : text;
latest_reward_event : opt RewardEvent;
pending_version : opt UpgradeInProgress;
Expand All @@ -284,7 +291,6 @@ type Governance = record {
sns_metadata : opt ManageSnsMetadata;
neurons : vec record { text; Neuron };
genesis_timestamp_seconds : nat64;
migrated_root_wasm_memory_limit : opt bool;
};

type GovernanceCachedMetrics = record {
Expand Down Expand Up @@ -689,6 +695,8 @@ type Version = record {
index_wasm_hash : blob;
};

type Versions = record { versions : vec Version };

type VotingRewardsParameters = record {
final_reward_rate_basis_points : opt nat64;
initial_reward_rate_basis_points : opt nat64;
Expand All @@ -700,6 +708,13 @@ type WaitForQuietState = record {
current_deadline_timestamp_seconds : nat64;
};

type GetUpgradeJournalRequest = record {};

type GetUpgradeJournalResponse = record {
upgrade_steps : opt Versions;
response_timestamp_seconds : opt nat64;
};

service : (Governance) -> {
claim_swap_neurons : (ClaimSwapNeuronsRequest) -> (ClaimSwapNeuronsResponse);
fail_stuck_upgrade_in_progress : (record {}) -> (record {});
Expand All @@ -716,6 +731,7 @@ service : (Governance) -> {
get_sns_initialization_parameters : (record {}) -> (
GetSnsInitializationParametersResponse,
) query;
get_upgrade_journal : (GetUpgradeJournalRequest) -> (GetUpgradeJournalResponse) query;
list_nervous_system_functions : () -> (
ListNervousSystemFunctionsResponse,
) query;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Candid for canister `sns_ledger` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-09-26_01-31-no-canister-snapshots/rs/rosetta-api/icrc1/ledger/ledger.did>
//! Candid for canister `sns_ledger` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-10-11_14-35-overload/rs/ledger_suite/icrc1/ledger/ledger.did>
type BlockIndex = nat;
type Subaccount = blob;
// Number of nanoseconds since the UNIX epoch in UTC timezone.
Expand Down
2 changes: 1 addition & 1 deletion declarations/used_by_sns_aggregator/sns_root/sns_root.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Candid for canister `sns_root` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-09-26_01-31-no-canister-snapshots/rs/sns/root/canister/root.did>
//! Candid for canister `sns_root` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-10-11_14-35-overload/rs/sns/root/canister/root.did>
type CanisterCallError = record {
code : opt int32;
description : text;
Expand Down
2 changes: 1 addition & 1 deletion declarations/used_by_sns_aggregator/sns_swap/sns_swap.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Candid for canister `sns_swap` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-09-26_01-31-no-canister-snapshots/rs/sns/swap/canister/swap.did>
//! Candid for canister `sns_swap` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-10-11_14-35-overload/rs/sns/swap/canister/swap.did>
type BuyerState = record {
icp : opt TransferableAmount;
has_created_neuron_recipes : opt bool;
Expand Down
2 changes: 1 addition & 1 deletion declarations/used_by_sns_aggregator/sns_wasm/sns_wasm.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Candid for canister `sns_wasm` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-09-26_01-31-no-canister-snapshots/rs/nns/sns-wasm/canister/sns-wasm.did>
//! Candid for canister `sns_wasm` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-10-11_14-35-overload/rs/nns/sns-wasm/canister/sns-wasm.did>
type AddWasmRequest = record {
hash : blob;
wasm : opt SnsWasm;
Expand Down
2 changes: 1 addition & 1 deletion dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@
"CARGO_SORT_VERSION": "1.0.9",
"SNSDEMO_RELEASE": "release-2024-10-09",
"IC_COMMIT_FOR_PROPOSALS": "release-2024-09-26_01-31-no-canister-snapshots",
"IC_COMMIT_FOR_SNS_AGGREGATOR": "release-2024-09-26_01-31-no-canister-snapshots"
"IC_COMMIT_FOR_SNS_AGGREGATOR": "release-2024-10-11_14-35-overload"
},
"packtool": ""
}
Expand Down
45 changes: 34 additions & 11 deletions rs/sns_aggregator/src/types/ic_sns_governance.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Rust code created from candid by: `scripts/did2rs.sh --canister sns_governance --out ic_sns_governance.rs --header did2rs.header --traits Serialize\,\ Clone\,\ Debug`
//! Candid for canister `sns_governance` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-09-26_01-31-no-canister-snapshots/rs/sns/governance/canister/governance.did>
//! Candid for canister `sns_governance` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-10-11_14-35-overload/rs/sns/governance/canister/governance.did>
#![allow(clippy::all)]
#![allow(unused_imports)]
#![allow(missing_docs)]
Expand All @@ -16,6 +16,25 @@ use ic_cdk::api::call::CallResult;
// use candid::{self, CandidType, Deserialize, Principal};
// use ic_cdk::api::call::CallResult as Result;

#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct Version {
pub archive_wasm_hash: serde_bytes::ByteBuf,
pub root_wasm_hash: serde_bytes::ByteBuf,
pub swap_wasm_hash: serde_bytes::ByteBuf,
pub ledger_wasm_hash: serde_bytes::ByteBuf,
pub governance_wasm_hash: serde_bytes::ByteBuf,
pub index_wasm_hash: serde_bytes::ByteBuf,
}
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct Versions {
pub versions: Vec<Version>,
}
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct CachedUpgradeSteps {
pub upgrade_steps: Option<Versions>,
pub response_timestamp_seconds: Option<u64>,
pub requested_timestamp_seconds: Option<u64>,
}
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct GenericNervousSystemFunction {
pub validator_canister_id: Option<Principal>,
Expand Down Expand Up @@ -105,15 +124,6 @@ pub struct NervousSystemParameters {
pub max_number_of_principals_per_neuron: Option<u64>,
}
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct Version {
pub archive_wasm_hash: serde_bytes::ByteBuf,
pub root_wasm_hash: serde_bytes::ByteBuf,
pub swap_wasm_hash: serde_bytes::ByteBuf,
pub ledger_wasm_hash: serde_bytes::ByteBuf,
pub governance_wasm_hash: serde_bytes::ByteBuf,
pub index_wasm_hash: serde_bytes::ByteBuf,
}
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct ProposalId {
pub id: u64,
}
Expand Down Expand Up @@ -458,6 +468,7 @@ pub struct Neuron {
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct Governance {
pub root_canister_id: Option<Principal>,
pub cached_upgrade_steps: Option<CachedUpgradeSteps>,
pub id_to_nervous_system_functions: Vec<(u64, NervousSystemFunction)>,
pub metrics: Option<GovernanceCachedMetrics>,
pub maturity_modulation: Option<MaturityModulation>,
Expand All @@ -473,7 +484,6 @@ pub struct Governance {
pub proposals: Vec<(u64, ProposalData)>,
pub in_flight_commands: Vec<(String, NeuronInFlightCommand)>,
pub sns_metadata: Option<ManageSnsMetadata>,
pub migrated_root_wasm_memory_limit: Option<bool>,
pub neurons: Vec<(String, Neuron)>,
pub genesis_timestamp_seconds: u64,
}
Expand Down Expand Up @@ -621,6 +631,13 @@ pub struct GetSnsInitializationParametersArg {}
pub struct GetSnsInitializationParametersResponse {
pub sns_initialization_parameters: String,
}
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct GetUpgradeJournalRequest {}
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct GetUpgradeJournalResponse {
pub upgrade_steps: Option<Versions>,
pub response_timestamp_seconds: Option<u64>,
}
#[derive(Serialize, Clone, Debug, CandidType, Deserialize, Default)]
pub struct ListNervousSystemFunctionsResponse {
pub reserved_ids: Vec<u64>,
Expand Down Expand Up @@ -780,6 +797,12 @@ impl Service {
) -> CallResult<(GetSnsInitializationParametersResponse,)> {
ic_cdk::call(self.0, "get_sns_initialization_parameters", (arg0,)).await
}
pub async fn get_upgrade_journal(
&self,
arg0: GetUpgradeJournalRequest,
) -> CallResult<(GetUpgradeJournalResponse,)> {
ic_cdk::call(self.0, "get_upgrade_journal", (arg0,)).await
}
pub async fn list_nervous_system_functions(&self) -> CallResult<(ListNervousSystemFunctionsResponse,)> {
ic_cdk::call(self.0, "list_nervous_system_functions", ()).await
}
Expand Down
2 changes: 1 addition & 1 deletion rs/sns_aggregator/src/types/ic_sns_ledger.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Rust code created from candid by: `scripts/did2rs.sh --canister sns_ledger --out ic_sns_ledger.rs --header did2rs.header --traits Serialize\,\ Clone\,\ Debug`
//! Candid for canister `sns_ledger` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-09-26_01-31-no-canister-snapshots/rs/rosetta-api/icrc1/ledger/ledger.did>
//! Candid for canister `sns_ledger` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-10-11_14-35-overload/rs/ledger_suite/icrc1/ledger/ledger.did>
#![allow(clippy::all)]
#![allow(unused_imports)]
#![allow(missing_docs)]
Expand Down
2 changes: 1 addition & 1 deletion rs/sns_aggregator/src/types/ic_sns_root.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Rust code created from candid by: `scripts/did2rs.sh --canister sns_root --out ic_sns_root.rs --header did2rs.header --traits Serialize\,\ Clone\,\ Debug`
//! Candid for canister `sns_root` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-09-26_01-31-no-canister-snapshots/rs/sns/root/canister/root.did>
//! Candid for canister `sns_root` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-10-11_14-35-overload/rs/sns/root/canister/root.did>
#![allow(clippy::all)]
#![allow(unused_imports)]
#![allow(missing_docs)]
Expand Down
2 changes: 1 addition & 1 deletion rs/sns_aggregator/src/types/ic_sns_swap.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Rust code created from candid by: `scripts/did2rs.sh --canister sns_swap --out ic_sns_swap.rs --header did2rs.header --traits Serialize\,\ Clone\,\ Debug`
//! Candid for canister `sns_swap` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-09-26_01-31-no-canister-snapshots/rs/sns/swap/canister/swap.did>
//! Candid for canister `sns_swap` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-10-11_14-35-overload/rs/sns/swap/canister/swap.did>
#![allow(clippy::all)]
#![allow(unused_imports)]
#![allow(missing_docs)]
Expand Down
2 changes: 1 addition & 1 deletion rs/sns_aggregator/src/types/ic_sns_wasm.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Rust code created from candid by: `scripts/did2rs.sh --canister sns_wasm --out ic_sns_wasm.rs --header did2rs.header --traits Serialize\,\ Clone\,\ Debug`
//! Candid for canister `sns_wasm` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-09-26_01-31-no-canister-snapshots/rs/nns/sns-wasm/canister/sns-wasm.did>
//! Candid for canister `sns_wasm` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-10-11_14-35-overload/rs/nns/sns-wasm/canister/sns-wasm.did>
#![allow(clippy::all)]
#![allow(unused_imports)]
#![allow(missing_docs)]
Expand Down

0 comments on commit 9afc3e2

Please sign in to comment.