Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions rs/nns/governance/src/proposals/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,19 @@ impl ValidProposalAction {
env: Arc<dyn Environment>,
) -> Result<SelfDescribingProposalAction, GovernanceError> {
match self {
// ExecuteNnsFunction is the only case where we need to call `canister_metadata` to get
// the candid file of an external canister, and hence it's the only one with `await`.
ValidProposalAction::ExecuteNnsFunction(execute_nns_function) => {
execute_nns_function.to_self_describing_action(env).await
}

ValidProposalAction::Motion(motion) => Ok(motion.to_self_describing_action()),
ValidProposalAction::ApproveGenesisKyc(approve_genesis_kyc) => {
Ok(approve_genesis_kyc.to_self_describing_action())
}
ValidProposalAction::AddOrRemoveNodeProvider(add_or_remove_node_provider) => {
Ok(add_or_remove_node_provider.to_self_describing_action())
}

ValidProposalAction::ExecuteNnsFunction(execute_nns_function) => {
execute_nns_function.to_self_describing_action(env).await
}
ValidProposalAction::RegisterKnownNeuron(register_known_neuron) => {
Ok(register_known_neuron.to_self_describing_action())
}
Expand All @@ -251,6 +253,9 @@ impl ValidProposalAction {
ValidProposalAction::FulfillSubnetRentalRequest(fulfill_subnet_rental_request) => {
Ok(fulfill_subnet_rental_request.to_self_describing_action())
}
ValidProposalAction::CreateServiceNervousSystem(create_service_nervous_system) => {
Ok(create_service_nervous_system.to_self_describing_action())
}
_ => Err(GovernanceError::new_with_message(
ErrorType::InvalidProposal,
"Self describing proposal actions are not supported for this proposal action yet.",
Expand Down
Loading