Skip to content

Commit

Permalink
Upgrade nns governance candid 2023 12 06 (#497)
Browse files Browse the repository at this point in the history
# Motivation

Upgrade `nns/governance` and `nns/governance-test` to latest `ic`
version.

# Changes

- `./scripts/import-candid`
- `./scripts/compile-idl-js`
- update response converters
- nns size limit increased 35 -> 40KB

# Tests

- works

# Todos

- [ ] Add entry to changelog (if necessary).
Not necessary

---------

Co-authored-by: Carly Gundy <47304080+cgundy@users.noreply.github.com>
Co-authored-by: Formatting Committer <nobody@example.com>
  • Loading branch information
3 people authored Dec 7, 2023
1 parent 7eafaa0 commit e314c91
Show file tree
Hide file tree
Showing 13 changed files with 631 additions and 74 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
{
"name": "@dfinity/nns",
"path": "./packages/nns/dist/index.js",
"limit": "35 kB",
"limit": "40 kB",
"ignore": [
"@dfinity/agent",
"@dfinity/candid",
Expand Down
107 changes: 98 additions & 9 deletions packages/nns/candid/governance.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,14 @@ export const idlFactory = ({ IDL }) => {
'caller' : IDL.Opt(IDL.Principal),
'proposer_id' : IDL.Opt(NeuronId),
});
const SeedAccount = IDL.Record({
'error_count' : IDL.Nat64,
'account_id' : IDL.Text,
'neuron_type' : IDL.Int32,
'tag_end_timestamp_seconds' : IDL.Opt(IDL.Nat64),
'tag_start_timestamp_seconds' : IDL.Opt(IDL.Nat64),
});
const SeedAccounts = IDL.Record({ 'accounts' : IDL.Vec(SeedAccount) });
const MostRecentMonthlyNodeProviderRewards = IDL.Record({
'timestamp' : IDL.Nat64,
'rewards' : IDL.Vec(RewardNodeProvider),
Expand All @@ -311,30 +319,48 @@ export const idlFactory = ({ IDL }) => {
'not_dissolving_neurons_count_buckets' : IDL.Vec(
IDL.Tuple(IDL.Nat64, IDL.Nat64)
),
'ect_neuron_count' : IDL.Nat64,
'total_supply_icp' : IDL.Nat64,
'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64,
'dissolved_neurons_count' : IDL.Nat64,
'community_fund_total_maturity_e8s_equivalent' : IDL.Nat64,
'total_staked_e8s_seed' : IDL.Nat64,
'total_staked_maturity_e8s_equivalent_ect' : IDL.Nat64,
'total_staked_e8s' : IDL.Nat64,
'not_dissolving_neurons_count' : IDL.Nat64,
'total_locked_e8s' : IDL.Nat64,
'neurons_fund_total_active_neurons' : IDL.Nat64,
'total_staked_maturity_e8s_equivalent' : IDL.Nat64,
'not_dissolving_neurons_e8s_buckets_ect' : IDL.Vec(
IDL.Tuple(IDL.Nat64, IDL.Float64)
),
'total_staked_e8s_ect' : IDL.Nat64,
'not_dissolving_neurons_staked_maturity_e8s_equivalent_sum' : IDL.Nat64,
'dissolved_neurons_e8s' : IDL.Nat64,
'dissolving_neurons_e8s_buckets_seed' : IDL.Vec(
IDL.Tuple(IDL.Nat64, IDL.Float64)
),
'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,
'not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets' : IDL.Vec(
IDL.Tuple(IDL.Nat64, IDL.Float64)
),
'dissolving_neurons_count_buckets' : IDL.Vec(
IDL.Tuple(IDL.Nat64, IDL.Nat64)
),
'dissolving_neurons_e8s_buckets_ect' : IDL.Vec(
IDL.Tuple(IDL.Nat64, IDL.Float64)
),
'dissolving_neurons_count' : IDL.Nat64,
'dissolving_neurons_e8s_buckets' : IDL.Vec(
IDL.Tuple(IDL.Nat64, IDL.Float64)
),
'total_staked_maturity_e8s_equivalent_seed' : IDL.Nat64,
'community_fund_total_staked_e8s' : IDL.Nat64,
'not_dissolving_neurons_e8s_buckets_seed' : IDL.Vec(
IDL.Tuple(IDL.Nat64, IDL.Float64)
),
'timestamp_seconds' : IDL.Nat64,
'seed_neuron_count' : IDL.Nat64,
});
const RewardEvent = IDL.Record({
'rounds_since_last_distribution' : IDL.Opt(IDL.Nat64),
Expand All @@ -354,6 +380,10 @@ export const idlFactory = ({ IDL }) => {
'transfer_timestamp' : IDL.Nat64,
'block_height' : IDL.Nat64,
});
const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) });
const FollowersMap = IDL.Record({
'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)),
});
const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId });
const Migration = IDL.Record({
'status' : IDL.Opt(IDL.Int32),
Expand Down Expand Up @@ -407,6 +437,7 @@ export const idlFactory = ({ IDL }) => {
'ideal_matched_participation_function' : IDL.Opt(
IdealMatchedParticipationFunction
),
'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),
});
const NeuronsFundData = IDL.Record({
'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation),
Expand Down Expand Up @@ -499,6 +530,7 @@ export const idlFactory = ({ IDL }) => {
'controller' : IDL.Opt(IDL.Principal),
'recent_ballots' : IDL.Vec(BallotInfo),
'kyc_verified' : IDL.Bool,
'neuron_type' : IDL.Opt(IDL.Int32),
'not_for_profit' : IDL.Bool,
'maturity_e8s_equivalent' : IDL.Nat64,
'cached_neuron_stake_e8s' : IDL.Nat64,
Expand All @@ -518,6 +550,7 @@ export const idlFactory = ({ IDL }) => {
const Governance = IDL.Record({
'default_followees' : IDL.Vec(IDL.Tuple(IDL.Int32, Followees)),
'making_sns_proposal' : IDL.Opt(MakingSnsProposal),
'seed_accounts' : IDL.Opt(SeedAccounts),
'most_recent_monthly_node_provider_rewards' : IDL.Opt(
MostRecentMonthlyNodeProviderRewards
),
Expand All @@ -534,6 +567,7 @@ export const idlFactory = ({ IDL }) => {
'latest_reward_event' : IDL.Opt(RewardEvent),
'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer),
'short_voting_period_seconds' : IDL.Nat64,
'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)),
'migrations' : IDL.Opt(Migrations),
'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),
'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)),
Expand All @@ -560,6 +594,7 @@ export const idlFactory = ({ IDL }) => {
const NeuronInfo = IDL.Record({
'dissolve_delay_seconds' : IDL.Nat64,
'recent_ballots' : IDL.Vec(BallotInfo),
'neuron_type' : IDL.Opt(IDL.Int32),
'created_timestamp_seconds' : IDL.Nat64,
'state' : IDL.Int32,
'stake_e8s' : IDL.Nat64,
Expand All @@ -570,7 +605,22 @@ export const idlFactory = ({ IDL }) => {
'age_seconds' : IDL.Nat64,
});
const Result_5 = IDL.Variant({ 'Ok' : NeuronInfo, 'Err' : GovernanceError });
const Result_6 = IDL.Variant({
const GetNeuronsFundAuditInfoRequest = IDL.Record({
'nns_proposal_id' : IDL.Opt(NeuronId),
});
const NeuronsFundAuditInfo = IDL.Record({
'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation),
'initial_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation),
'neurons_fund_refunds' : IDL.Opt(NeuronsFundSnapshot),
});
const Ok = IDL.Record({
'neurons_fund_audit_info' : IDL.Opt(NeuronsFundAuditInfo),
});
const Result_6 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError });
const GetNeuronsFundAuditInfoResponse = IDL.Record({
'result' : IDL.Opt(Result_6),
});
const Result_7 = IDL.Variant({
'Ok' : NodeProvider,
'Err' : GovernanceError,
});
Expand Down Expand Up @@ -662,25 +712,25 @@ export const idlFactory = ({ IDL }) => {
'total_neurons_fund_contribution_icp_e8s' : IDL.Opt(IDL.Nat64),
'sns_governance_canister_id' : IDL.Opt(IDL.Principal),
});
const Result_7 = IDL.Variant({
const Result_8 = IDL.Variant({
'Committed' : Committed,
'Aborted' : IDL.Record({}),
});
const SettleCommunityFundParticipation = IDL.Record({
'result' : IDL.Opt(Result_7),
'result' : IDL.Opt(Result_8),
'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64),
});
const Committed_1 = IDL.Record({
'total_direct_participation_icp_e8s' : IDL.Opt(IDL.Nat64),
'total_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),
'sns_governance_canister_id' : IDL.Opt(IDL.Principal),
});
const Result_8 = IDL.Variant({
const Result_9 = IDL.Variant({
'Committed' : Committed_1,
'Aborted' : IDL.Record({}),
});
const SettleNeuronsFundParticipationRequest = IDL.Record({
'result' : IDL.Opt(Result_8),
'result' : IDL.Opt(Result_9),
'nns_proposal_id' : IDL.Opt(IDL.Nat64),
});
const NeuronsFundNeuron = IDL.Record({
Expand All @@ -689,12 +739,12 @@ export const idlFactory = ({ IDL }) => {
'nns_neuron_id' : IDL.Opt(IDL.Nat64),
'amount_icp_e8s' : IDL.Opt(IDL.Nat64),
});
const Ok = IDL.Record({
const Ok_1 = IDL.Record({
'neurons_fund_neuron_portions' : IDL.Vec(NeuronsFundNeuron),
});
const Result_9 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError });
const Result_10 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : GovernanceError });
const SettleNeuronsFundParticipationResponse = IDL.Record({
'result' : IDL.Opt(Result_9),
'result' : IDL.Opt(Result_10),
});
const UpdateNodeProvider = IDL.Record({
'reward_account' : IDL.Opt(AccountIdentifier),
Expand Down Expand Up @@ -733,7 +783,12 @@ export const idlFactory = ({ IDL }) => {
[Result_5],
[],
),
'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_6], []),
'get_neurons_fund_audit_info' : IDL.Func(
[GetNeuronsFundAuditInfoRequest],
[GetNeuronsFundAuditInfoResponse],
[],
),
'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_7], []),
'get_pending_proposals' : IDL.Func([], [IDL.Vec(ProposalInfo)], []),
'get_proposal_info' : IDL.Func([IDL.Nat64], [IDL.Opt(ProposalInfo)], []),
'list_known_neurons' : IDL.Func([], [ListKnownNeuronsResponse], []),
Expand Down Expand Up @@ -1058,6 +1113,14 @@ export const init = ({ IDL }) => {
'caller' : IDL.Opt(IDL.Principal),
'proposer_id' : IDL.Opt(NeuronId),
});
const SeedAccount = IDL.Record({
'error_count' : IDL.Nat64,
'account_id' : IDL.Text,
'neuron_type' : IDL.Int32,
'tag_end_timestamp_seconds' : IDL.Opt(IDL.Nat64),
'tag_start_timestamp_seconds' : IDL.Opt(IDL.Nat64),
});
const SeedAccounts = IDL.Record({ 'accounts' : IDL.Vec(SeedAccount) });
const MostRecentMonthlyNodeProviderRewards = IDL.Record({
'timestamp' : IDL.Nat64,
'rewards' : IDL.Vec(RewardNodeProvider),
Expand All @@ -1076,30 +1139,48 @@ export const init = ({ IDL }) => {
'not_dissolving_neurons_count_buckets' : IDL.Vec(
IDL.Tuple(IDL.Nat64, IDL.Nat64)
),
'ect_neuron_count' : IDL.Nat64,
'total_supply_icp' : IDL.Nat64,
'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64,
'dissolved_neurons_count' : IDL.Nat64,
'community_fund_total_maturity_e8s_equivalent' : IDL.Nat64,
'total_staked_e8s_seed' : IDL.Nat64,
'total_staked_maturity_e8s_equivalent_ect' : IDL.Nat64,
'total_staked_e8s' : IDL.Nat64,
'not_dissolving_neurons_count' : IDL.Nat64,
'total_locked_e8s' : IDL.Nat64,
'neurons_fund_total_active_neurons' : IDL.Nat64,
'total_staked_maturity_e8s_equivalent' : IDL.Nat64,
'not_dissolving_neurons_e8s_buckets_ect' : IDL.Vec(
IDL.Tuple(IDL.Nat64, IDL.Float64)
),
'total_staked_e8s_ect' : IDL.Nat64,
'not_dissolving_neurons_staked_maturity_e8s_equivalent_sum' : IDL.Nat64,
'dissolved_neurons_e8s' : IDL.Nat64,
'dissolving_neurons_e8s_buckets_seed' : IDL.Vec(
IDL.Tuple(IDL.Nat64, IDL.Float64)
),
'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,
'not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets' : IDL.Vec(
IDL.Tuple(IDL.Nat64, IDL.Float64)
),
'dissolving_neurons_count_buckets' : IDL.Vec(
IDL.Tuple(IDL.Nat64, IDL.Nat64)
),
'dissolving_neurons_e8s_buckets_ect' : IDL.Vec(
IDL.Tuple(IDL.Nat64, IDL.Float64)
),
'dissolving_neurons_count' : IDL.Nat64,
'dissolving_neurons_e8s_buckets' : IDL.Vec(
IDL.Tuple(IDL.Nat64, IDL.Float64)
),
'total_staked_maturity_e8s_equivalent_seed' : IDL.Nat64,
'community_fund_total_staked_e8s' : IDL.Nat64,
'not_dissolving_neurons_e8s_buckets_seed' : IDL.Vec(
IDL.Tuple(IDL.Nat64, IDL.Float64)
),
'timestamp_seconds' : IDL.Nat64,
'seed_neuron_count' : IDL.Nat64,
});
const RewardEvent = IDL.Record({
'rounds_since_last_distribution' : IDL.Opt(IDL.Nat64),
Expand All @@ -1119,6 +1200,10 @@ export const init = ({ IDL }) => {
'transfer_timestamp' : IDL.Nat64,
'block_height' : IDL.Nat64,
});
const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) });
const FollowersMap = IDL.Record({
'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)),
});
const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId });
const Migration = IDL.Record({
'status' : IDL.Opt(IDL.Int32),
Expand Down Expand Up @@ -1172,6 +1257,7 @@ export const init = ({ IDL }) => {
'ideal_matched_participation_function' : IDL.Opt(
IdealMatchedParticipationFunction
),
'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64),
});
const NeuronsFundData = IDL.Record({
'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation),
Expand Down Expand Up @@ -1264,6 +1350,7 @@ export const init = ({ IDL }) => {
'controller' : IDL.Opt(IDL.Principal),
'recent_ballots' : IDL.Vec(BallotInfo),
'kyc_verified' : IDL.Bool,
'neuron_type' : IDL.Opt(IDL.Int32),
'not_for_profit' : IDL.Bool,
'maturity_e8s_equivalent' : IDL.Nat64,
'cached_neuron_stake_e8s' : IDL.Nat64,
Expand All @@ -1283,6 +1370,7 @@ export const init = ({ IDL }) => {
const Governance = IDL.Record({
'default_followees' : IDL.Vec(IDL.Tuple(IDL.Int32, Followees)),
'making_sns_proposal' : IDL.Opt(MakingSnsProposal),
'seed_accounts' : IDL.Opt(SeedAccounts),
'most_recent_monthly_node_provider_rewards' : IDL.Opt(
MostRecentMonthlyNodeProviderRewards
),
Expand All @@ -1299,6 +1387,7 @@ export const init = ({ IDL }) => {
'latest_reward_event' : IDL.Opt(RewardEvent),
'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer),
'short_voting_period_seconds' : IDL.Nat64,
'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)),
'migrations' : IDL.Opt(Migrations),
'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),
'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)),
Expand Down
Loading

0 comments on commit e314c91

Please sign in to comment.