Skip to content

Commit 63d0436

Browse files
committed
add test for weights rate limit v tempo
1 parent 4d2632d commit 63d0436

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pallets/subtensor/src/tests/networks.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,3 +326,20 @@ fn test_register_subnet_high_lock_cost() {
326326
assert_eq!(SubnetAlphaIn::<Test>::get(netuid), lock_cost);
327327
})
328328
}
329+
330+
#[test]
331+
fn test_tempo_greater_than_weight_set_rate_limit() {
332+
new_test_ext(1).execute_with(|| {
333+
let subnet_owner_hotkey = U256::from(1);
334+
let subnet_owner_coldkey = U256::from(2);
335+
336+
let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey);
337+
338+
// Get tempo
339+
let tempo = SubtensorModule::get_tempo(netuid);
340+
341+
let weights_set_rate_limit = SubtensorModule::get_weights_set_rate_limit(netuid);
342+
343+
assert!(tempo as u64 >= weights_set_rate_limit);
344+
})
345+
}

0 commit comments

Comments
 (0)