Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
max-dfinity committed Mar 3, 2025
1 parent 58db016 commit 9e98a3b
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 86 deletions.
8 changes: 0 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ members = [
"rs/nervous_system/common/test_canister",
"rs/nervous_system/common/test_keys",
"rs/nervous_system/common/test_utils",
"rs/nervous_system/common/time_helpers",
"rs/nervous_system/common/validation",
"rs/nervous_system/histogram",
"rs/nervous_system/humanize",
Expand Down
41 changes: 0 additions & 41 deletions rs/nervous_system/common/time_helpers/BUILD.bazel

This file was deleted.

7 changes: 0 additions & 7 deletions rs/nervous_system/common/time_helpers/Cargo.toml

This file was deleted.

18 changes: 0 additions & 18 deletions rs/nervous_system/common/time_helpers/src/lib.rs

This file was deleted.

2 changes: 1 addition & 1 deletion rs/nervous_system/timers/src/test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub use ic_cdk_timers::TimerId;
use ic_cdk_timers::TimerId;
use slotmap::SlotMap;
use std::cell::RefCell;
use std::collections::BTreeMap;
Expand Down
1 change: 0 additions & 1 deletion rs/nns/governance/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ DEPENDENCIES = [
"//rs/nervous_system/canisters",
"//rs/nervous_system/clients",
"//rs/nervous_system/common",
"//rs/nervous_system/common/time_helpers",
"//rs/nervous_system/governance",
"//rs/nervous_system/linear_map",
"//rs/nervous_system/long_message",
Expand Down
1 change: 0 additions & 1 deletion rs/nns/governance/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ ic-nervous-system-canisters = { path = "../../nervous_system/canisters" }
ic-nervous-system-clients = { path = "../../nervous_system/clients" }
ic-nervous-system-common = { path = "../../nervous_system/common" }
ic-nervous-system-common-build-metadata = { path = "../../nervous_system/common/build_metadata" }
ic-nervous-system-common-time-helpers = { path = "../../nervous_system/common/time_helpers" }
ic-nervous-system-governance = { path = "../../nervous_system/governance" }
ic-nervous-system-linear-map = { path = "../../nervous_system/linear_map" }
ic-nervous-system-long-message = { path = "../../nervous_system/long_message" }
Expand Down
5 changes: 0 additions & 5 deletions rs/nns/governance/src/canister_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ pub fn set_governance_for_tests(gov: Governance) {
GOVERNANCE.set(gov);
}

#[cfg(test)]
pub fn set_governance_no_validation(gov: Governance) {
GOVERNANCE.set(gov);
}

#[derive(Default)]
pub struct CanisterEnv {
#[cfg(any(test, feature = "test"))]
Expand Down
2 changes: 2 additions & 0 deletions rs/nns/governance/src/governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6869,6 +6869,8 @@ impl Governance {
} else {
let mut reward_distribution = RewardsDistribution::new();
for (neuron_id, used_voting_rights) in voters_to_used_voting_right {
// TODO DO NOT MERGE - should we do this check here at all, or just defer
// to distribution
if self.neuron_store.contains(neuron_id) {
let reward = (used_voting_rights * total_available_e8s_equivalent_float
/ total_voting_rights) as u64;
Expand Down
8 changes: 5 additions & 3 deletions rs/nns/governance/src/governance/benches.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::canister_state::CanisterRandomnessGenerator;
use crate::governance::REWARD_DISTRIBUTION_PERIOD_SECONDS;
use crate::heap_governance_data::HeapGovernanceData;
use crate::pb::v1::{RewardEvent, WaitForQuietState};
Expand Down Expand Up @@ -598,9 +599,10 @@ fn distribute_rewards_with_stable_neurons() -> BenchResult {

let mut governance = Governance::new(
governance_proto,
Box::new(MockEnvironment::new(vec![], now_seconds)),
Box::new(StubIcpLedger {}),
Box::new(StubCMC {}),
Arc::new(MockEnvironment::new(vec![], now_seconds)),
Arc::new(StubIcpLedger {}),
Arc::new(StubCMC {}),
Box::new(CanisterRandomnessGenerator::new()),
);

bench_fn(|| governance.distribute_rewards(Tokens::new(10_000_000, 0).unwrap()))
Expand Down

0 comments on commit 9e98a3b

Please sign in to comment.