Skip to content

Commit

Permalink
Merge pull request #695 from opentensor/devnet_conflcit
Browse files Browse the repository at this point in the history
Devnet conflcit
  • Loading branch information
distributedstatemachine authored Jul 29, 2024
2 parents 4f016d2 + cd23ac2 commit 6843cc7
Show file tree
Hide file tree
Showing 12 changed files with 9 additions and 19 deletions.
6 changes: 3 additions & 3 deletions pallets/collective/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -951,9 +951,9 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
///
/// If not `approved`:
/// - one event deposited.
/// Two removals, one mutation.
/// Computation and i/o `O(P)` where:
/// - `P` is number of active proposals
/// - two removals, one mutation.
/// - computation and i/o `O(P)` where:
/// - `P` is number of active proposals
fn do_approve_proposal(
seats: MemberCount,
yes_votes: MemberCount,
Expand Down
1 change: 0 additions & 1 deletion pallets/subtensor/tests/children.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ fn test_do_set_child_singular_multiple_children() {

// SKIP_WASM_BUILD=1 RUST_LOG=info cargo test --test children -- test_add_singular_child --exact --nocapture
#[test]
#[cfg(not(tarpaulin))]
fn test_add_singular_child() {
new_test_ext(1).execute_with(|| {
let netuid: u16 = 1;
Expand Down
4 changes: 0 additions & 4 deletions pallets/subtensor/tests/coinbase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use sp_core::U256;

// Test the ability to hash all sorts of hotkeys.
#[test]
#[cfg(not(tarpaulin))]
fn test_hotkey_hashing() {
new_test_ext(1).execute_with(|| {
for i in 0..10000 {
Expand All @@ -18,7 +17,6 @@ fn test_hotkey_hashing() {
// Test drain tempo on hotkeys.
// SKIP_WASM_BUILD=1 RUST_LOG=debug cargo test --test coinbase test_hotkey_drain_time -- --nocapture
#[test]
#[cfg(not(tarpaulin))]
fn test_hotkey_drain_time() {
new_test_ext(1).execute_with(|| {
// Block 0
Expand Down Expand Up @@ -46,7 +44,6 @@ fn test_hotkey_drain_time() {
// To run this test specifically, use the following command:
// SKIP_WASM_BUILD=1 RUST_LOG=debug cargo test --test coinbase test_coinbase_basic -- --nocapture
#[test]
#[cfg(not(tarpaulin))]
fn test_coinbase_basic() {
new_test_ext(1).execute_with(|| {
// Define network ID
Expand Down Expand Up @@ -138,7 +135,6 @@ fn test_coinbase_basic() {
// Test getting and setting hotkey emission tempo
// SKIP_WASM_BUILD=1 RUST_LOG=debug cargo test --test coinbase test_set_and_get_hotkey_emission_tempo -- --nocapture
#[test]
#[cfg(not(tarpaulin))]
fn test_set_and_get_hotkey_emission_tempo() {
new_test_ext(1).execute_with(|| {
// Get the default hotkey emission tempo
Expand Down
1 change: 0 additions & 1 deletion pallets/subtensor/tests/difficulty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ mod mock;
use sp_core::U256;

#[test]
#[cfg(not(tarpaulin))]
fn test_registration_difficulty_adjustment() {
new_test_ext(1).execute_with(|| {
// Create Net 1
Expand Down
1 change: 0 additions & 1 deletion pallets/subtensor/tests/epoch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2107,7 +2107,6 @@ fn test_zero_weights() {

// Test that epoch assigns validator permits to highest stake uids, varies uid interleaving and stake values.
#[test]
#[cfg(not(tarpaulin))]
fn test_validator_permits() {
let netuid: u16 = 1;
let tempo: u16 = u16::MAX - 1; // high tempo to skip automatic epochs in on_initialize, use manual epochs instead
Expand Down
4 changes: 4 additions & 0 deletions pallets/subtensor/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ impl CollectiveInterface<AccountId, H256, u32> for TriumvirateVotes {
}

// We call pallet_collective TriumvirateCollective
#[allow(dead_code)]
type TriumvirateCollective = pallet_collective::Instance1;
impl pallet_collective::Config<TriumvirateCollective> for Test {
type RuntimeOrigin = RuntimeOrigin;
Expand All @@ -281,6 +282,7 @@ impl pallet_collective::Config<TriumvirateCollective> for Test {
}

// We call council members Triumvirate
#[allow(dead_code)]
type TriumvirateMembership = pallet_membership::Instance1;
impl pallet_membership::Config<TriumvirateMembership> for Test {
type RuntimeEvent = RuntimeEvent;
Expand All @@ -297,6 +299,7 @@ impl pallet_membership::Config<TriumvirateMembership> for Test {

// This is a dummy collective instance for managing senate members
// Probably not the best solution, but fastest implementation
#[allow(dead_code)]
type SenateCollective = pallet_collective::Instance2;
impl pallet_collective::Config<SenateCollective> for Test {
type RuntimeOrigin = RuntimeOrigin;
Expand All @@ -314,6 +317,7 @@ impl pallet_collective::Config<SenateCollective> for Test {
}

// We call our top K delegates membership Senate
#[allow(dead_code)]
type SenateMembership = pallet_membership::Instance2;
impl pallet_membership::Config<SenateMembership> for Test {
type RuntimeEvent = RuntimeEvent;
Expand Down
1 change: 0 additions & 1 deletion pallets/subtensor/tests/neuron_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ fn test_get_neuron_none() {
}

#[test]
#[cfg(not(tarpaulin))]
fn test_get_neuron_some() {
new_test_ext(1).execute_with(|| {
let netuid: u16 = 1;
Expand Down
1 change: 0 additions & 1 deletion pallets/subtensor/tests/registration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,6 @@ fn test_burn_adjustment() {
}

#[test]
#[cfg(not(tarpaulin))]
fn test_registration_too_many_registrations_per_block() {
new_test_ext(1).execute_with(|| {
let netuid: u16 = 1;
Expand Down
2 changes: 0 additions & 2 deletions pallets/subtensor/tests/serving.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ fn test_serving_set_metadata_update() {
}

#[test]
#[cfg(not(tarpaulin))]
fn test_axon_serving_rate_limit_exceeded() {
new_test_ext(1).execute_with(|| {
let hotkey_account_id = U256::from(1);
Expand Down Expand Up @@ -379,7 +378,6 @@ fn test_prometheus_serving_set_metadata_update() {
}

#[test]
#[cfg(not(tarpaulin))]
fn test_prometheus_serving_rate_limit_exceeded() {
new_test_ext(1).execute_with(|| {
let hotkey_account_id = U256::from(1);
Expand Down
2 changes: 0 additions & 2 deletions pallets/subtensor/tests/staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use sp_core::{H256, U256};
************************************************************/

#[test]
#[cfg(not(tarpaulin))]
fn test_add_stake_dispatch_info_ok() {
new_test_ext(1).execute_with(|| {
let hotkey = U256::from(0);
Expand Down Expand Up @@ -521,7 +520,6 @@ fn test_remove_stake_rate_limit_exceeded() {
}

#[test]
#[cfg(not(tarpaulin))]
fn test_remove_stake_dispatch_info_ok() {
new_test_ext(1).execute_with(|| {
let hotkey = U256::from(0);
Expand Down
3 changes: 0 additions & 3 deletions pallets/subtensor/tests/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use substrate_fixed::types::I32F32;

// Test the call passes through the subtensor module.
#[test]
#[cfg(not(tarpaulin))]
fn test_set_weights_dispatch_info_ok() {
new_test_ext(0).execute_with(|| {
let dests = vec![1, 1];
Expand All @@ -41,7 +40,6 @@ fn test_set_weights_dispatch_info_ok() {
});
}
#[test]
#[cfg(not(tarpaulin))]
fn test_set_rootweights_dispatch_info_ok() {
new_test_ext(0).execute_with(|| {
let dests = vec![1, 1];
Expand Down Expand Up @@ -404,7 +402,6 @@ fn test_weights_err_no_validator_permit() {

// To execute this test: cargo test --package pallet-subtensor --test weights test_set_weights_min_stake_failed -- --nocapture`
#[test]
#[cfg(not(tarpaulin))]
fn test_set_weights_min_stake_failed() {
new_test_ext(0).execute_with(|| {
let dests = vec![0];
Expand Down
2 changes: 2 additions & 0 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ impl pallet_collective::Config<TriumvirateCollective> for Runtime {
}

// We call council members Triumvirate
#[allow(dead_code)]
type TriumvirateMembership = pallet_membership::Instance1;
impl pallet_membership::Config<TriumvirateMembership> for Runtime {
type RuntimeEvent = RuntimeEvent;
Expand All @@ -531,6 +532,7 @@ impl pallet_membership::Config<TriumvirateMembership> for Runtime {
}

// We call our top K delegates membership Senate
#[allow(dead_code)]
type SenateMembership = pallet_membership::Instance2;
impl pallet_membership::Config<SenateMembership> for Runtime {
type RuntimeEvent = RuntimeEvent;
Expand Down

0 comments on commit 6843cc7

Please sign in to comment.