Skip to content

Commit 35f3948

Browse files
docs(nns): Resurrect request and response comments. (#3671)
Recently, we deleted a bunch of request and response types from NNS governance.proto. Although the types themselves are not necessary, the comments contained valuable information, which could (and should) have been copied to governance.did. This PR corrects that oversight. # References Types deleted in recent PRs: * [ListNeurons] * [ManageNeuronResponse] * [NeuronInfo] [ListNeurons]: #3546 [ManageNeuronResponse]: #3573 [NeuronInfo]: #3639
1 parent a5684f4 commit 35f3948

File tree

1 file changed

+48
-5
lines changed

1 file changed

+48
-5
lines changed

rs/nns/governance/canister/governance.did

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -434,18 +434,37 @@ type ListKnownNeuronsResponse = record {
434434
known_neurons : vec KnownNeuron;
435435
};
436436

437+
// Parameters of the list_neurons method.
437438
type ListNeurons = record {
438-
include_public_neurons_in_full_neurons : opt bool;
439+
// These fields select neurons to be in the result set.
439440
neuron_ids : vec nat64;
440-
include_empty_neurons_readable_by_caller : opt bool;
441441
include_neurons_readable_by_caller : bool;
442+
443+
// Only has an effect when include_neurons_readable_by_caller.
444+
include_empty_neurons_readable_by_caller : opt bool;
445+
446+
// When a public neuron is a member of the result set, include it in the
447+
// full_neurons field (of ListNeuronsResponse). This does not affect which
448+
// neurons are part of the result set.
449+
include_public_neurons_in_full_neurons : opt bool;
450+
442451
page_number: opt nat64;
443452
page_size: opt nat64;
444453
};
445454

455+
// Output of the list_neurons method.
446456
type ListNeuronsResponse = record {
457+
// Per the NeuronInfo type, this is a redacted view of the neurons in the
458+
// result set consisting of information that require no special privileges to
459+
// view.
447460
neuron_infos : vec record { nat64; NeuronInfo };
461+
462+
// If the caller has the necessary special privileges (or the neuron is
463+
// public, and the request sets include_public_neurons_in_full_neurons to
464+
// true), then all the information about the neurons in the result set is made
465+
// available here.
448466
full_neurons : vec Neuron;
467+
449468
total_pages_available: opt nat64;
450469
};
451470

@@ -493,6 +512,8 @@ type MakingSnsProposal = record {
493512
proposer_id : opt NeuronId;
494513
};
495514

515+
// Not to be confused with ManageNeuronRequest. (Yes, this is very structurally
516+
// similar to that, but not actually exactly equivalent.)
496517
type ManageNeuron = record {
497518
id : opt NeuronId;
498519
command : opt Command;
@@ -518,13 +539,22 @@ type ManageNeuronCommandRequest = variant {
518539
// KEEP THIS IN SYNC WITH COMMAND!
519540
};
520541

542+
// Parameters of the manage_neuron method.
521543
type ManageNeuronRequest = record {
522-
id : opt NeuronId;
523-
command : opt ManageNeuronCommandRequest;
544+
// Which neuron to operate on.
524545
neuron_id_or_subaccount : opt NeuronIdOrSubaccount;
546+
547+
// What operation to perform on the neuron.
548+
command : opt ManageNeuronCommandRequest;
549+
550+
// Deprecated. Use neuron_id_or_subaccount instead.
551+
id : opt NeuronId;
525552
};
526553

554+
// Output of the manage_neuron method.
527555
type ManageNeuronResponse = record {
556+
// Corresponds to the command field in ManageNeuronRequest, which determines
557+
// what operation was performed.
528558
command : opt Command_1;
529559
};
530560

@@ -730,14 +760,26 @@ type NeuronInFlightCommand = record {
730760
timestamp : nat64;
731761
};
732762

733-
// In general, this is a subset of Neuron.
763+
// A limit view of Neuron that allows some aspects of all neurons to be read by
764+
// anyone (i.e. without having to be the neuron's controller nor one of its
765+
// hotkeys).
766+
//
767+
// As such, the meaning of each field in this type is generally the same as the
768+
// one of the same (or at least similar) name in Neuron.
734769
type NeuronInfo = record {
735770
dissolve_delay_seconds : nat64;
736771
recent_ballots : vec BallotInfo;
737772
neuron_type : opt int32;
738773
created_timestamp_seconds : nat64;
739774
state : int32;
775+
776+
// The amount of ICP (and staked maturity) locked in this neuron.
777+
//
778+
// This is the foundation of the neuron's voting power.
779+
//
780+
// cached_neuron_stake_e8s - neuron_fees_e8s + staked_maturity_e8s_equivalent
740781
stake_e8s : nat64;
782+
741783
joined_community_fund_timestamp_seconds : opt nat64;
742784
retrieved_at_timestamp_seconds : nat64;
743785
visibility : opt int32;
@@ -752,6 +794,7 @@ type NeuronInfo = record {
752794
// Now that this is set to deciding_voting_power, this actually does get
753795
// zeroed out.
754796
voting_power : nat64;
797+
755798
voting_power_refreshed_timestamp_seconds : opt nat64;
756799
deciding_voting_power : opt nat64;
757800
potential_voting_power : opt nat64;

0 commit comments

Comments
 (0)