Skip to content

Commit b8cd1e9

Browse files
inline perform_call_canister calls.
1 parent 8dac694 commit b8cd1e9

File tree

1 file changed

+10
-64
lines changed

1 file changed

+10
-64
lines changed

rs/nns/governance/src/governance.rs

Lines changed: 10 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,15 @@ use crate::{
3636
ArchivedMonthlyNodeProviderRewards, Ballot, BlessAlternativeGuestOsVersion,
3737
CreateServiceNervousSystem, Followees, GetNeuronsFundAuditInfoRequest,
3838
GetNeuronsFundAuditInfoResponse, Governance as GovernanceProto, GovernanceError,
39-
InstallCode, KnownNeuron, ListKnownNeuronsResponse, ManageNeuron,
39+
KnownNeuron, ListKnownNeuronsResponse, ManageNeuron,
4040
MonthlyNodeProviderRewards, Motion, NetworkEconomics, NeuronState,
4141
NeuronsFundAuditInfo, NeuronsFundData,
4242
NeuronsFundParticipation as NeuronsFundParticipationPb,
4343
NeuronsFundSnapshot as NeuronsFundSnapshotPb, NnsFunction, NodeProvider, Proposal,
4444
ProposalData, ProposalRewardStatus, ProposalStatus, RestoreAgingSummary, RewardEvent,
4545
RewardNodeProvider, RewardNodeProviders, SettleNeuronsFundParticipationRequest,
46-
SettleNeuronsFundParticipationResponse, StopOrStartCanister,
47-
SuccessfulProposalExecutionValue, TakeCanisterSnapshot, Tally, Topic,
48-
UpdateCanisterSettings, UpdateNodeProvider, Vote, VotingPowerEconomics,
46+
SettleNeuronsFundParticipationResponse, SuccessfulProposalExecutionValue, Tally, Topic,
47+
UpdateNodeProvider, Vote, VotingPowerEconomics,
4948
WaitForQuietState, archived_monthly_node_provider_rewards,
5049
create_service_nervous_system::LedgerParameters,
5150
get_neurons_fund_audit_info_response,
@@ -4259,15 +4258,13 @@ impl Governance {
42594258
.await;
42604259
}
42614260
ValidProposalAction::InstallCode(install_code) => {
4262-
self.perform_install_code(pid, install_code).await;
4261+
self.perform_call_canister(pid, install_code).await;
42634262
}
42644263
ValidProposalAction::StopOrStartCanister(stop_or_start) => {
4265-
self.perform_stop_or_start_canister(pid, stop_or_start)
4266-
.await;
4264+
self.perform_call_canister(pid, stop_or_start).await;
42674265
}
42684266
ValidProposalAction::UpdateCanisterSettings(update_settings) => {
4269-
self.perform_update_canister_settings(pid, update_settings)
4270-
.await;
4267+
self.perform_call_canister(pid, update_settings).await;
42714268
}
42724269
ValidProposalAction::FulfillSubnetRentalRequest(fulfill_subnet_rental_request) => {
42734270
self.perform_fulfill_subnet_rental_request(pid, fulfill_subnet_rental_request)
@@ -4280,19 +4277,16 @@ impl Governance {
42804277
bless_alternative_guest_os_version,
42814278
),
42824279
ValidProposalAction::TakeCanisterSnapshot(take_canister_snapshot) => {
4283-
self.perform_take_canister_snapshot(pid, take_canister_snapshot)
4280+
self.perform_call_canister(pid, take_canister_snapshot)
42844281
.await;
42854282
}
42864283
ValidProposalAction::LoadCanisterSnapshot(load_canister_snapshot) => {
4287-
self.perform_load_canister_snapshot(pid, load_canister_snapshot)
4284+
self.perform_call_canister(pid, load_canister_snapshot)
42884285
.await;
42894286
}
42904287
ValidProposalAction::CreateCanisterAndInstallCode(create_canister_and_install_code) => {
4291-
self.perform_create_canister_and_install_code(
4292-
pid,
4293-
create_canister_and_install_code,
4294-
)
4295-
.await;
4288+
self.perform_call_canister(pid, create_canister_and_install_code)
4289+
.await;
42964290
}
42974291
}
42984292
}
@@ -4329,27 +4323,6 @@ impl Governance {
43294323
Ok(())
43304324
}
43314325

4332-
async fn perform_install_code(&mut self, proposal_id: u64, install_code: InstallCode) {
4333-
self.perform_call_canister(proposal_id, install_code).await;
4334-
}
4335-
4336-
async fn perform_stop_or_start_canister(
4337-
&mut self,
4338-
proposal_id: u64,
4339-
stop_or_start: StopOrStartCanister,
4340-
) {
4341-
self.perform_call_canister(proposal_id, stop_or_start).await;
4342-
}
4343-
4344-
async fn perform_update_canister_settings(
4345-
&mut self,
4346-
proposal_id: u64,
4347-
update_settings: UpdateCanisterSettings,
4348-
) {
4349-
self.perform_call_canister(proposal_id, update_settings)
4350-
.await;
4351-
}
4352-
43534326
async fn perform_fulfill_subnet_rental_request(
43544327
&mut self,
43554328
proposal_id: u64,
@@ -4361,24 +4334,6 @@ impl Governance {
43614334
self.set_proposal_execution_status::<()>(proposal_id, result.map(|()| vec![]));
43624335
}
43634336

4364-
async fn perform_load_canister_snapshot(
4365-
&mut self,
4366-
proposal_id: u64,
4367-
load_canister_snapshot: pb::v1::LoadCanisterSnapshot,
4368-
) {
4369-
self.perform_call_canister(proposal_id, load_canister_snapshot)
4370-
.await;
4371-
}
4372-
4373-
async fn perform_create_canister_and_install_code(
4374-
&mut self,
4375-
proposal_id: u64,
4376-
create_canister_and_install_code: pb::v1::CreateCanisterAndInstallCode,
4377-
) {
4378-
self.perform_call_canister(proposal_id, create_canister_and_install_code)
4379-
.await;
4380-
}
4381-
43824337
fn perform_bless_alternative_guest_os_version(
43834338
&mut self,
43844339
proposal_id: u64,
@@ -4388,15 +4343,6 @@ impl Governance {
43884343
self.set_proposal_execution_status::<()>(proposal_id, result.map(|()| vec![]));
43894344
}
43904345

4391-
async fn perform_take_canister_snapshot(
4392-
&mut self,
4393-
proposal_id: u64,
4394-
take_canister_snapshot: TakeCanisterSnapshot,
4395-
) {
4396-
self.perform_call_canister(proposal_id, take_canister_snapshot)
4397-
.await;
4398-
}
4399-
44004346
/// Sends request, decodes reply, and sets proposal execution status (this last part was
44014347
/// added later in Mar, 2026).
44024348
async fn perform_call_canister<Request>(&mut self, proposal_id: u64, request: Request)

0 commit comments

Comments
 (0)