Skip to content

Commit

Permalink
Upgrade nns governance did (#389)
Browse files Browse the repository at this point in the history
# Motivation

Update `nns/governance.did`.

# Changes

- extend `SwapParameters` with missing fields that needs to be displayed
for 1-proposal.
- update `deploy_new_sns` related types
- add `includeAllManageNeuronProposals` param

# Tests

Unit tests work.

---------

Co-authored-by: Formatting Committer <nobody@example.com>
  • Loading branch information
mstrasinskis and Formatting Committer authored Aug 2, 2023
1 parent affe5ea commit 0697cdc
Show file tree
Hide file tree
Showing 11 changed files with 290 additions and 2 deletions.
19 changes: 19 additions & 0 deletions packages/nns/candid/governance.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,24 @@ export const idlFactory = ({ IDL }) => {
'dissolve_delay_interval' : IDL.Opt(Duration),
'count' : IDL.Opt(IDL.Nat64),
});
const GlobalTimeOfDay = IDL.Record({
'seconds_after_utc_midnight' : IDL.Opt(IDL.Nat64),
});
const Countries = IDL.Record({ 'iso_codes' : IDL.Vec(IDL.Text) });
const SwapParameters = IDL.Record({
'minimum_participants' : IDL.Opt(IDL.Nat64),
'duration' : IDL.Opt(Duration),
'neuron_basket_construction_parameters' : IDL.Opt(
NeuronBasketConstructionParameters
),
'confirmation_text' : IDL.Opt(IDL.Text),
'maximum_participant_icp' : IDL.Opt(Tokens),
'neurons_fund_investment' : IDL.Opt(Tokens),
'minimum_icp' : IDL.Opt(Tokens),
'minimum_participant_icp' : IDL.Opt(Tokens),
'start_time' : IDL.Opt(GlobalTimeOfDay),
'maximum_icp' : IDL.Opt(Tokens),
'restricted_countries' : IDL.Opt(Countries),
});
const SwapDistribution = IDL.Record({ 'total' : IDL.Opt(Tokens) });
const NeuronDistribution = IDL.Record({
Expand Down Expand Up @@ -532,6 +541,7 @@ export const idlFactory = ({ IDL }) => {
'before_proposal' : IDL.Opt(NeuronId),
'limit' : IDL.Nat32,
'exclude_topic' : IDL.Vec(IDL.Int32),
'include_all_manage_neuron_proposals' : IDL.Opt(IDL.Bool),
'include_status' : IDL.Vec(IDL.Int32),
});
const ListProposalInfoResponse = IDL.Record({
Expand Down Expand Up @@ -905,15 +915,24 @@ export const init = ({ IDL }) => {
'dissolve_delay_interval' : IDL.Opt(Duration),
'count' : IDL.Opt(IDL.Nat64),
});
const GlobalTimeOfDay = IDL.Record({
'seconds_after_utc_midnight' : IDL.Opt(IDL.Nat64),
});
const Countries = IDL.Record({ 'iso_codes' : IDL.Vec(IDL.Text) });
const SwapParameters = IDL.Record({
'minimum_participants' : IDL.Opt(IDL.Nat64),
'duration' : IDL.Opt(Duration),
'neuron_basket_construction_parameters' : IDL.Opt(
NeuronBasketConstructionParameters
),
'confirmation_text' : IDL.Opt(IDL.Text),
'maximum_participant_icp' : IDL.Opt(Tokens),
'neurons_fund_investment' : IDL.Opt(Tokens),
'minimum_icp' : IDL.Opt(Tokens),
'minimum_participant_icp' : IDL.Opt(Tokens),
'start_time' : IDL.Opt(GlobalTimeOfDay),
'maximum_icp' : IDL.Opt(Tokens),
'restricted_countries' : IDL.Opt(Countries),
});
const SwapDistribution = IDL.Record({ 'total' : IDL.Opt(Tokens) });
const NeuronDistribution = IDL.Record({
Expand Down
12 changes: 12 additions & 0 deletions packages/nns/candid/governance.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ export interface Committed {
export interface Configure {
operation: [] | [Operation];
}
export interface Countries {
iso_codes: Array<string>;
}
export interface CreateServiceNervousSystem {
url: [] | [string];
governance_parameters: [] | [GovernanceParameters];
Expand Down Expand Up @@ -175,6 +178,9 @@ export interface Follow {
export interface Followees {
followees: Array<NeuronId>;
}
export interface GlobalTimeOfDay {
seconds_after_utc_midnight: [] | [bigint];
}
export interface Governance {
default_followees: Array<[number, Followees]>;
most_recent_monthly_node_provider_rewards:
Expand Down Expand Up @@ -275,6 +281,7 @@ export interface ListProposalInfo {
before_proposal: [] | [NeuronId];
limit: number;
exclude_topic: Int32Array;
include_all_manage_neuron_proposals: [] | [boolean];
include_status: Int32Array;
}
export interface ListProposalInfoResponse {
Expand Down Expand Up @@ -565,13 +572,18 @@ export interface SwapDistribution {
}
export interface SwapParameters {
minimum_participants: [] | [bigint];
duration: [] | [Duration];
neuron_basket_construction_parameters:
| []
| [NeuronBasketConstructionParameters];
confirmation_text: [] | [string];
maximum_participant_icp: [] | [Tokens];
neurons_fund_investment: [] | [Tokens];
minimum_icp: [] | [Tokens];
minimum_participant_icp: [] | [Tokens];
start_time: [] | [GlobalTimeOfDay];
maximum_icp: [] | [Tokens];
restricted_countries: [] | [Countries];
}
export interface Tally {
no: bigint;
Expand Down
10 changes: 9 additions & 1 deletion packages/nns/candid/governance.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit b9fc66eafca530e997313aa68aaac31d41e6a875 'rs/nns/governance/canister/governance.did' by import-candid
// Generated from IC repo commit 509bc5a87192031915768db6e24647cc26f86069 'rs/nns/governance/canister/governance.did' by import-candid
type AccountIdentifier = record { hash : vec nat8 };
type Action = variant {
RegisterKnownNeuron : KnownNeuron;
Expand Down Expand Up @@ -98,6 +98,7 @@ type Command_2 = variant {
};
type Committed = record { sns_governance_canister_id : opt principal };
type Configure = record { operation : opt Operation };
type Countries = record { iso_codes : vec text };
type CreateServiceNervousSystem = record {
url : opt text;
governance_parameters : opt GovernanceParameters;
Expand Down Expand Up @@ -136,6 +137,7 @@ type Duration = record { seconds : opt nat64 };
type ExecuteNnsFunction = record { nns_function : int32; payload : vec nat8 };
type Follow = record { topic : int32; followees : vec NeuronId };
type Followees = record { followees : vec NeuronId };
type GlobalTimeOfDay = record { seconds_after_utc_midnight : opt nat64 };
type Governance = record {
default_followees : vec record { int32; Followees };
most_recent_monthly_node_provider_rewards : opt MostRecentMonthlyNodeProviderRewards;
Expand Down Expand Up @@ -222,6 +224,7 @@ type ListProposalInfo = record {
before_proposal : opt NeuronId;
limit : nat32;
exclude_topic : vec int32;
include_all_manage_neuron_proposals : opt bool;
include_status : vec int32;
};
type ListProposalInfoResponse = record { proposal_info : vec ProposalInfo };
Expand Down Expand Up @@ -474,11 +477,16 @@ type SwapBackgroundInformation = record {
type SwapDistribution = record { total : opt Tokens };
type SwapParameters = record {
minimum_participants : opt nat64;
duration : opt Duration;
neuron_basket_construction_parameters : opt NeuronBasketConstructionParameters;
confirmation_text : opt text;
maximum_participant_icp : opt Tokens;
neurons_fund_investment : opt Tokens;
minimum_icp : opt Tokens;
minimum_participant_icp : opt Tokens;
start_time : opt GlobalTimeOfDay;
maximum_icp : opt Tokens;
restricted_countries : opt Countries;
};
type Tally = record {
no : nat64;
Expand Down
19 changes: 19 additions & 0 deletions packages/nns/candid/governance.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,24 @@ export const idlFactory = ({ IDL }) => {
'dissolve_delay_interval' : IDL.Opt(Duration),
'count' : IDL.Opt(IDL.Nat64),
});
const GlobalTimeOfDay = IDL.Record({
'seconds_after_utc_midnight' : IDL.Opt(IDL.Nat64),
});
const Countries = IDL.Record({ 'iso_codes' : IDL.Vec(IDL.Text) });
const SwapParameters = IDL.Record({
'minimum_participants' : IDL.Opt(IDL.Nat64),
'duration' : IDL.Opt(Duration),
'neuron_basket_construction_parameters' : IDL.Opt(
NeuronBasketConstructionParameters
),
'confirmation_text' : IDL.Opt(IDL.Text),
'maximum_participant_icp' : IDL.Opt(Tokens),
'neurons_fund_investment' : IDL.Opt(Tokens),
'minimum_icp' : IDL.Opt(Tokens),
'minimum_participant_icp' : IDL.Opt(Tokens),
'start_time' : IDL.Opt(GlobalTimeOfDay),
'maximum_icp' : IDL.Opt(Tokens),
'restricted_countries' : IDL.Opt(Countries),
});
const SwapDistribution = IDL.Record({ 'total' : IDL.Opt(Tokens) });
const NeuronDistribution = IDL.Record({
Expand Down Expand Up @@ -532,6 +541,7 @@ export const idlFactory = ({ IDL }) => {
'before_proposal' : IDL.Opt(NeuronId),
'limit' : IDL.Nat32,
'exclude_topic' : IDL.Vec(IDL.Int32),
'include_all_manage_neuron_proposals' : IDL.Opt(IDL.Bool),
'include_status' : IDL.Vec(IDL.Int32),
});
const ListProposalInfoResponse = IDL.Record({
Expand Down Expand Up @@ -917,15 +927,24 @@ export const init = ({ IDL }) => {
'dissolve_delay_interval' : IDL.Opt(Duration),
'count' : IDL.Opt(IDL.Nat64),
});
const GlobalTimeOfDay = IDL.Record({
'seconds_after_utc_midnight' : IDL.Opt(IDL.Nat64),
});
const Countries = IDL.Record({ 'iso_codes' : IDL.Vec(IDL.Text) });
const SwapParameters = IDL.Record({
'minimum_participants' : IDL.Opt(IDL.Nat64),
'duration' : IDL.Opt(Duration),
'neuron_basket_construction_parameters' : IDL.Opt(
NeuronBasketConstructionParameters
),
'confirmation_text' : IDL.Opt(IDL.Text),
'maximum_participant_icp' : IDL.Opt(Tokens),
'neurons_fund_investment' : IDL.Opt(Tokens),
'minimum_icp' : IDL.Opt(Tokens),
'minimum_participant_icp' : IDL.Opt(Tokens),
'start_time' : IDL.Opt(GlobalTimeOfDay),
'maximum_icp' : IDL.Opt(Tokens),
'restricted_countries' : IDL.Opt(Countries),
});
const SwapDistribution = IDL.Record({ 'total' : IDL.Opt(Tokens) });
const NeuronDistribution = IDL.Record({
Expand Down
36 changes: 36 additions & 0 deletions packages/nns/candid/sns_wasm.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ export const idlFactory = ({ IDL }) => {
'Hash' : IDL.Vec(IDL.Nat8),
});
const AddWasmResponse = IDL.Record({ 'result' : IDL.Opt(Result) });
const NeuronBasketConstructionParameters = IDL.Record({
'dissolve_delay_interval_seconds' : IDL.Nat64,
'count' : IDL.Nat64,
});
const Canister = IDL.Record({ 'id' : IDL.Opt(IDL.Principal) });
const DappCanisters = IDL.Record({ 'canisters' : IDL.Vec(Canister) });
const CfNeuron = IDL.Record({
'nns_neuron_id' : IDL.Nat64,
'amount_icp_e8s' : IDL.Nat64,
});
const CfParticipant = IDL.Record({
'hotkey_principal' : IDL.Text,
'cf_neurons' : IDL.Vec(CfNeuron),
});
const NeuronsFundParticipants = IDL.Record({
'participants' : IDL.Vec(CfParticipant),
});
const TreasuryDistribution = IDL.Record({ 'total_e8s' : IDL.Nat64 });
const NeuronDistribution = IDL.Record({
'controller' : IDL.Opt(IDL.Principal),
Expand Down Expand Up @@ -51,30 +68,48 @@ export const idlFactory = ({ IDL }) => {
'url' : IDL.Opt(IDL.Text),
'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64),
'max_dissolve_delay_bonus_percentage' : IDL.Opt(IDL.Nat64),
'nns_proposal_id' : IDL.Opt(IDL.Nat64),
'min_participant_icp_e8s' : IDL.Opt(IDL.Nat64),
'neuron_basket_construction_parameters' : IDL.Opt(
NeuronBasketConstructionParameters
),
'fallback_controller_principal_ids' : IDL.Vec(IDL.Text),
'token_symbol' : IDL.Opt(IDL.Text),
'final_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),
'max_icp_e8s' : IDL.Opt(IDL.Nat64),
'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),
'confirmation_text' : IDL.Opt(IDL.Text),
'logo' : IDL.Opt(IDL.Text),
'name' : IDL.Opt(IDL.Text),
'swap_start_timestamp_seconds' : IDL.Opt(IDL.Nat64),
'swap_due_timestamp_seconds' : IDL.Opt(IDL.Nat64),
'initial_voting_period_seconds' : IDL.Opt(IDL.Nat64),
'neuron_minimum_dissolve_delay_to_vote_seconds' : IDL.Opt(IDL.Nat64),
'description' : IDL.Opt(IDL.Text),
'max_neuron_age_seconds_for_age_bonus' : IDL.Opt(IDL.Nat64),
'min_participants' : IDL.Opt(IDL.Nat64),
'initial_reward_rate_basis_points' : IDL.Opt(IDL.Nat64),
'wait_for_quiet_deadline_increase_seconds' : IDL.Opt(IDL.Nat64),
'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),
'dapp_canisters' : IDL.Opt(DappCanisters),
'neurons_fund_participants' : IDL.Opt(NeuronsFundParticipants),
'max_age_bonus_percentage' : IDL.Opt(IDL.Nat64),
'initial_token_distribution' : IDL.Opt(InitialTokenDistribution),
'reward_rate_transition_duration_seconds' : IDL.Opt(IDL.Nat64),
'token_name' : IDL.Opt(IDL.Text),
'max_participant_icp_e8s' : IDL.Opt(IDL.Nat64),
'proposal_reject_cost_e8s' : IDL.Opt(IDL.Nat64),
'restricted_countries' : IDL.Opt(Countries),
'min_icp_e8s' : IDL.Opt(IDL.Nat64),
});
const DeployNewSnsRequest = IDL.Record({
'sns_init_payload' : IDL.Opt(SnsInitPayload),
});
const DappCanistersTransferResult = IDL.Record({
'restored_dapp_canisters' : IDL.Vec(Canister),
'nns_controlled_dapp_canisters' : IDL.Vec(Canister),
'sns_controlled_dapp_canisters' : IDL.Vec(Canister),
});
const SnsCanisterIds = IDL.Record({
'root' : IDL.Opt(IDL.Principal),
'swap' : IDL.Opt(IDL.Principal),
Expand All @@ -83,6 +118,7 @@ export const idlFactory = ({ IDL }) => {
'governance' : IDL.Opt(IDL.Principal),
});
const DeployNewSnsResponse = IDL.Record({
'dapp_canisters_transfer_result' : IDL.Opt(DappCanistersTransferResult),
'subnet_id' : IDL.Opt(IDL.Principal),
'error' : IDL.Opt(SnsWasmError),
'canisters' : IDL.Opt(SnsCanisterIds),
Expand Down
40 changes: 40 additions & 0 deletions packages/nns/candid/sns_wasm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,33 @@ export interface AddWasmResponse {
export interface AirdropDistribution {
airdrop_neurons: Array<NeuronDistribution>;
}
export interface Canister {
id: [] | [Principal];
}
export interface CfNeuron {
nns_neuron_id: bigint;
amount_icp_e8s: bigint;
}
export interface CfParticipant {
hotkey_principal: string;
cf_neurons: Array<CfNeuron>;
}
export interface Countries {
iso_codes: Array<string>;
}
export interface DappCanisters {
canisters: Array<Canister>;
}
export interface DappCanistersTransferResult {
restored_dapp_canisters: Array<Canister>;
nns_controlled_dapp_canisters: Array<Canister>;
sns_controlled_dapp_canisters: Array<Canister>;
}
export interface DeployNewSnsRequest {
sns_init_payload: [] | [SnsInitPayload];
}
export interface DeployNewSnsResponse {
dapp_canisters_transfer_result: [] | [DappCanistersTransferResult];
subnet_id: [] | [Principal];
error: [] | [SnsWasmError];
canisters: [] | [SnsCanisterIds];
Expand Down Expand Up @@ -82,13 +102,20 @@ export interface ListUpgradeStepsRequest {
export interface ListUpgradeStepsResponse {
steps: Array<ListUpgradeStep>;
}
export interface NeuronBasketConstructionParameters {
dissolve_delay_interval_seconds: bigint;
count: bigint;
}
export interface NeuronDistribution {
controller: [] | [Principal];
dissolve_delay_seconds: bigint;
memo: bigint;
stake_e8s: bigint;
vesting_period_seconds: [] | [bigint];
}
export interface NeuronsFundParticipants {
participants: Array<CfParticipant>;
}
export interface PrettySnsVersion {
archive_wasm_hash: string;
root_wasm_hash: string;
Expand All @@ -109,26 +136,39 @@ export interface SnsInitPayload {
url: [] | [string];
max_dissolve_delay_seconds: [] | [bigint];
max_dissolve_delay_bonus_percentage: [] | [bigint];
nns_proposal_id: [] | [bigint];
min_participant_icp_e8s: [] | [bigint];
neuron_basket_construction_parameters:
| []
| [NeuronBasketConstructionParameters];
fallback_controller_principal_ids: Array<string>;
token_symbol: [] | [string];
final_reward_rate_basis_points: [] | [bigint];
max_icp_e8s: [] | [bigint];
neuron_minimum_stake_e8s: [] | [bigint];
confirmation_text: [] | [string];
logo: [] | [string];
name: [] | [string];
swap_start_timestamp_seconds: [] | [bigint];
swap_due_timestamp_seconds: [] | [bigint];
initial_voting_period_seconds: [] | [bigint];
neuron_minimum_dissolve_delay_to_vote_seconds: [] | [bigint];
description: [] | [string];
max_neuron_age_seconds_for_age_bonus: [] | [bigint];
min_participants: [] | [bigint];
initial_reward_rate_basis_points: [] | [bigint];
wait_for_quiet_deadline_increase_seconds: [] | [bigint];
transaction_fee_e8s: [] | [bigint];
dapp_canisters: [] | [DappCanisters];
neurons_fund_participants: [] | [NeuronsFundParticipants];
max_age_bonus_percentage: [] | [bigint];
initial_token_distribution: [] | [InitialTokenDistribution];
reward_rate_transition_duration_seconds: [] | [bigint];
token_name: [] | [string];
max_participant_icp_e8s: [] | [bigint];
proposal_reject_cost_e8s: [] | [bigint];
restricted_countries: [] | [Countries];
min_icp_e8s: [] | [bigint];
}
export interface SnsUpgrade {
next_version: [] | [SnsVersion];
Expand Down
Loading

0 comments on commit 0697cdc

Please sign in to comment.