Skip to content

Commit

Permalink
bot: Update sns_aggregator candid bindings (#5397)
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 <gix-bot@users.noreply.github.com>
  • Loading branch information
sa-github-api and gix-bot committed Sep 3, 2024
1 parent b59f527 commit c041085
Show file tree
Hide file tree
Showing 11 changed files with 670 additions and 132 deletions.
321 changes: 271 additions & 50 deletions declarations/used_by_sns_aggregator/sns_governance/sns_governance.did

Large diffs are not rendered by default.

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-08-21_15-36-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-08-29_01-30-base/rs/rosetta-api/icrc1/ledger/ledger.did>
type BlockIndex = nat;
type Subaccount = blob;
// Number of nanoseconds since the UNIX epoch in UTC timezone.
Expand Down
73 changes: 61 additions & 12 deletions declarations/used_by_sns_aggregator/sns_root/sns_root.did
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
//! Candid for canister `sns_root` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-08-21_15-36-canister-snapshots/rs/sns/root/canister/root.did>
type CanisterCallError = record { code : opt int32; description : text };
type CanisterIdRecord = record { canister_id : principal };
type CanisterInstallMode = variant { reinstall; upgrade; install };
//! Candid for canister `sns_root` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2024-08-29_01-30-base/rs/sns/root/canister/root.did>
type CanisterCallError = record {
code : opt int32;
description : text;
};

type CanisterIdRecord = record {
canister_id : principal;
};

type CanisterInstallMode = variant {
reinstall;
upgrade;
install;
};

type CanisterStatusResult = record {
status : CanisterStatusType;
memory_size : nat;
Expand All @@ -11,6 +23,7 @@ type CanisterStatusResult = record {
module_hash : opt blob;
reserved_cycles : opt nat;
};

type CanisterStatusResultV2 = record {
status : CanisterStatusType;
memory_size : nat;
Expand All @@ -19,11 +32,18 @@ type CanisterStatusResultV2 = record {
idle_cycles_burned_per_day : nat;
module_hash : opt blob;
};
type CanisterStatusType = variant { stopped; stopping; running };

type CanisterStatusType = variant {
stopped;
stopping;
running;
};

type CanisterSummary = record {
status : opt CanisterStatusResultV2;
canister_id : opt principal;
};

type ChangeCanisterRequest = record {
arg : blob;
wasm_module : blob;
Expand All @@ -33,6 +53,7 @@ type ChangeCanisterRequest = record {
memory_allocation : opt nat;
compute_allocation : opt nat;
};

type DefiniteCanisterSettings = record {
freezing_threshold : opt nat;
controllers : vec principal;
Expand All @@ -42,17 +63,24 @@ type DefiniteCanisterSettings = record {
memory_allocation : opt nat;
compute_allocation : opt nat;
};

type DefiniteCanisterSettingsArgs = record {
freezing_threshold : nat;
controllers : vec principal;
wasm_memory_limit : opt nat;
memory_allocation : nat;
compute_allocation : nat;
};

type FailedUpdate = record {
err : opt CanisterCallError;
dapp_canister_id : opt principal;
};
type GetSnsCanistersSummaryRequest = record { update_canister_list : opt bool };

type GetSnsCanistersSummaryRequest = record {
update_canister_list : opt bool;
};

type GetSnsCanistersSummaryResponse = record {
root : opt CanisterSummary;
swap : opt CanisterSummary;
Expand All @@ -62,6 +90,7 @@ type GetSnsCanistersSummaryResponse = record {
dapps : vec CanisterSummary;
archives : vec CanisterSummary;
};

type ListSnsCanistersResponse = record {
root : opt principal;
swap : opt principal;
Expand All @@ -71,7 +100,12 @@ type ListSnsCanistersResponse = record {
dapps : vec principal;
archives : vec principal;
};
type LogVisibility = variant { controllers; public };

type LogVisibility = variant {
controllers;
public;
};

type ManageDappCanisterSettingsRequest = record {
freezing_threshold : opt nat64;
canister_ids : vec principal;
Expand All @@ -81,14 +115,28 @@ type ManageDappCanisterSettingsRequest = record {
memory_allocation : opt nat64;
compute_allocation : opt nat64;
};
type ManageDappCanisterSettingsResponse = record { failure_reason : opt text };
type RegisterDappCanisterRequest = record { canister_id : opt principal };
type RegisterDappCanistersRequest = record { canister_ids : vec principal };

type ManageDappCanisterSettingsResponse = record {
failure_reason : opt text;
};

type RegisterDappCanisterRequest = record {
canister_id : opt principal;
};

type RegisterDappCanistersRequest = record {
canister_ids : vec principal;
};

type SetDappControllersRequest = record {
canister_ids : opt RegisterDappCanistersRequest;
controller_principal_ids : vec principal;
};
type SetDappControllersResponse = record { failed_updates : vec FailedUpdate };

type SetDappControllersResponse = record {
failed_updates : vec FailedUpdate;
};

type SnsRootCanister = record {
dapp_canister_ids : vec principal;
testflight : bool;
Expand All @@ -99,6 +147,7 @@ type SnsRootCanister = record {
swap_canister_id : opt principal;
ledger_canister_id : opt principal;
};

service : (SnsRootCanister) -> {
canister_status : (CanisterIdRecord) -> (CanisterStatusResult);
change_canister : (ChangeCanisterRequest) -> ();
Expand All @@ -115,4 +164,4 @@ service : (SnsRootCanister) -> {
set_dapp_controllers : (SetDappControllersRequest) -> (
SetDappControllersResponse,
);
}
}
Loading

0 comments on commit c041085

Please sign in to comment.