Skip to content

Commit

Permalink
bot: Update sns_aggregator candid bindings (#5699)
Browse files Browse the repository at this point in the history
# Motivation
A newer release of the internet computer is available.
We would like to parse all the latest SNS data. To do so, we update the
candid interfaces for the SNS aggregator.
Even with no changes, just updating the reference is good practice.

# Changes
* Update the version of `IC_COMMIT_FOR_SNS_AGGREGATOR` specified in
`dfx.json`.
* Updated the `sns_aggregator` candid files to the versions in that
commit.
* Updated the Rust code derived from `.did` files in the aggregator.

# Tests
- [ ] Please check the API updates for any breaking changes that affect
our code.
  Breaking changes are:
    * New mandatory fields
    * Removing mandatory fields
    * Renaming fields
    * Changing the type of a field
    * Adding new variants

Co-authored-by: gix-bot <[email protected]>
  • Loading branch information
sa-github-api and gix-bot authored Oct 29, 2024
1 parent 82e31e6 commit e578229
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 11 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-10-17_03-07-scheduler-changes-guestos-revert/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-23_03-07-ubuntu20.04/rs/sns/governance/canister/governance.did>
type Account = record {
owner : opt principal;
subaccount : opt Subaccount;
Expand Down Expand Up @@ -292,6 +292,16 @@ type Governance = record {
neurons : vec record { text; Neuron };
genesis_timestamp_seconds : nat64;
target_version: opt Version;
timers : opt Timers;
};

type Timers = record {
last_reset_timestamp_seconds : opt nat64;
last_spawned_timestamp_seconds : opt nat64;
};

type GetTimersResponse = record {
timers : opt Timers;
};

type GovernanceCachedMetrics = record {
Expand Down Expand Up @@ -741,4 +751,6 @@ service : (Governance) -> {
list_proposals : (ListProposals) -> (ListProposalsResponse) query;
manage_neuron : (ManageNeuron) -> (ManageNeuronResponse);
set_mode : (SetMode) -> (record {});
reset_timers : (record {}) -> (record {});
get_timers : (record {}) -> (GetTimersResponse) query;
}
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-10-17_03-07-scheduler-changes-guestos-revert/rs/ledger_suite/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-23_03-07-ubuntu20.04/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-10-17_03-07-scheduler-changes-guestos-revert/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-23_03-07-ubuntu20.04/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-10-17_03-07-scheduler-changes-guestos-revert/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-23_03-07-ubuntu20.04/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-10-17_03-07-scheduler-changes-guestos-revert/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-23_03-07-ubuntu20.04/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 @@ -405,7 +405,7 @@
"CARGO_SORT_VERSION": "1.0.9",
"SNSDEMO_RELEASE": "release-2024-10-23",
"IC_COMMIT_FOR_PROPOSALS": "release-2024-10-23_03-07-ubuntu20.04",
"IC_COMMIT_FOR_SNS_AGGREGATOR": "release-2024-10-17_03-07-scheduler-changes-guestos-revert"
"IC_COMMIT_FOR_SNS_AGGREGATOR": "release-2024-10-23_03-07-ubuntu20.04"
},
"packtool": ""
}
Expand Down
24 changes: 23 additions & 1 deletion 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-10-17_03-07-scheduler-changes-guestos-revert/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-23_03-07-ubuntu20.04/rs/sns/governance/canister/governance.did>
#![allow(clippy::all)]
#![allow(unused_imports)]
#![allow(missing_docs)]
Expand All @@ -16,6 +16,11 @@ 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 Timers {
pub last_spawned_timestamp_seconds: Option<u64>,
pub last_reset_timestamp_seconds: Option<u64>,
}
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct Version {
pub archive_wasm_hash: serde_bytes::ByteBuf,
Expand Down Expand Up @@ -468,6 +473,7 @@ pub struct Neuron {
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct Governance {
pub root_canister_id: Option<Principal>,
pub timers: Option<Timers>,
pub cached_upgrade_steps: Option<CachedUpgradeSteps>,
pub id_to_nervous_system_functions: Vec<(u64, NervousSystemFunction)>,
pub metrics: Option<GovernanceCachedMetrics>,
Expand Down Expand Up @@ -633,6 +639,12 @@ pub struct GetSnsInitializationParametersResponse {
pub sns_initialization_parameters: String,
}
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct GetTimersArg {}
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct GetTimersResponse {
pub timers: Option<Timers>,
}
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct GetUpgradeJournalRequest {}
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct GetUpgradeJournalResponse {
Expand Down Expand Up @@ -740,6 +752,10 @@ pub struct ManageNeuronResponse {
pub command: Option<Command1>,
}
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct ResetTimersArg {}
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct ResetTimersRet {}
#[derive(Serialize, Clone, Debug, CandidType, Deserialize)]
pub struct SetMode {
pub mode: i32,
}
Expand Down Expand Up @@ -799,6 +815,9 @@ impl Service {
) -> CallResult<(GetSnsInitializationParametersResponse,)> {
ic_cdk::call(self.0, "get_sns_initialization_parameters", (arg0,)).await
}
pub async fn get_timers(&self, arg0: GetTimersArg) -> CallResult<(GetTimersResponse,)> {
ic_cdk::call(self.0, "get_timers", (arg0,)).await
}
pub async fn get_upgrade_journal(
&self,
arg0: GetUpgradeJournalRequest,
Expand All @@ -817,6 +836,9 @@ impl Service {
pub async fn manage_neuron(&self, arg0: ManageNeuron) -> CallResult<(ManageNeuronResponse,)> {
ic_cdk::call(self.0, "manage_neuron", (arg0,)).await
}
pub async fn reset_timers(&self, arg0: ResetTimersArg) -> CallResult<(ResetTimersRet,)> {
ic_cdk::call(self.0, "reset_timers", (arg0,)).await
}
pub async fn set_mode(&self, arg0: SetMode) -> CallResult<(SetModeRet,)> {
ic_cdk::call(self.0, "set_mode", (arg0,)).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-10-17_03-07-scheduler-changes-guestos-revert/rs/ledger_suite/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-23_03-07-ubuntu20.04/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-10-17_03-07-scheduler-changes-guestos-revert/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-23_03-07-ubuntu20.04/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-10-17_03-07-scheduler-changes-guestos-revert/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-23_03-07-ubuntu20.04/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-10-17_03-07-scheduler-changes-guestos-revert/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-23_03-07-ubuntu20.04/rs/nns/sns-wasm/canister/sns-wasm.did>
#![allow(clippy::all)]
#![allow(unused_imports)]
#![allow(missing_docs)]
Expand Down

0 comments on commit e578229

Please sign in to comment.