Skip to content

Commit

Permalink
Address MR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
anchpop committed Jul 30, 2024
1 parent d20aece commit 634c864
Show file tree
Hide file tree
Showing 4 changed files with 222 additions and 180 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2006,8 +2006,11 @@ message ClaimSwapNeuronsRequest {
message NeuronRecipe {
// The info that for a participant in the Neurons' Fund
message NeuronsFund {
// The neuron ID of the NNS neuron that participated in the Neurons' Fund.
optional uint64 nns_neuron_id = 1;
// The controller of the NNS neuron that participated in the Neurons' Fund.
optional ic_base_types.pb.v1.PrincipalId nns_neuron_controller = 2;
// The hotkeys of the NNS neuron that participated in the Neurons' Fund.
optional ic_nervous_system.pb.v1.Principals nns_neuron_hotkeys = 3;
}

Expand Down Expand Up @@ -2039,6 +2042,8 @@ message ClaimSwapNeuronsRequest {
repeated NeuronRecipe neuron_recipes = 1;
}

// The set of parameters that define the neurons created in `claim_swap_neurons`. For
// each NeuronRecipe, one neuron will be created.
optional NeuronRecipes neuron_recipes = 2;

// The set of parameters that define the neurons created in `claim_swap_neurons`. For
Expand Down
5 changes: 5 additions & 0 deletions rs/sns/governance/src/gen/ic_sns_governance.pb.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2518,6 +2518,8 @@ pub struct GetModeResponse {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClaimSwapNeuronsRequest {
/// The set of parameters that define the neurons created in `claim_swap_neurons`. For
/// each NeuronRecipe, one neuron will be created.
#[prost(message, optional, tag = "2")]
pub neuron_recipes: ::core::option::Option<claim_swap_neurons_request::NeuronRecipes>,
/// The set of parameters that define the neurons created in `claim_swap_neurons`. For
Expand Down Expand Up @@ -2607,10 +2609,13 @@ pub mod claim_swap_neurons_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NeuronsFund {
/// The neuron ID of the NNS neuron that participated in the Neurons' Fund.
#[prost(uint64, optional, tag = "1")]
pub nns_neuron_id: ::core::option::Option<u64>,
/// The controller of the NNS neuron that participated in the Neurons' Fund.
#[prost(message, optional, tag = "2")]
pub nns_neuron_controller: ::core::option::Option<::ic_base_types::PrincipalId>,
/// The hotkeys of the NNS neuron that participated in the Neurons' Fund.
#[prost(message, optional, tag = "3")]
pub nns_neuron_hotkeys:
::core::option::Option<::ic_nervous_system_proto::pb::v1::Principals>,
Expand Down
4 changes: 4 additions & 0 deletions rs/sns/governance/src/neuron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,10 @@ impl NeuronId {
subaccount[1..1 + id.len()].copy_from_slice(id);
NeuronId::from(subaccount)
}

pub fn test_neuron_ids<const N: usize>() -> [NeuronId; N] {
core::array::from_fn(|i| NeuronId::new_test_neuron_id(10 + i as u64))
}
}

impl From<Subaccount> for NeuronId {
Expand Down
Loading

0 comments on commit 634c864

Please sign in to comment.