Skip to content

Commit ed24984

Browse files
author
Samuel Dare
committed
chore: fix broken test , add just file
1 parent 9799192 commit ed24984

File tree

3 files changed

+44
-4
lines changed

3 files changed

+44
-4
lines changed

justfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env just --justfile
2+
3+
export RUST_BACKTRACE := "full"
4+
export SKIP_WASM_BUILD := "1"
5+
export RUST_BIN_DIR := "target/x86_64-unknown-linux-gnu"
6+
export TARGET := "x86_64-unknown-linux-gnu"
7+
export RUSTV := "nightly-2024-03-05"
8+
export RELEASE_NAME := "development"
9+
10+
default:
11+
@echo "Running all tasks..."
12+
fmt
13+
check
14+
test
15+
benchmarks
16+
clippy
17+
fix
18+
19+
fmt:
20+
@echo "Running cargo fmt..."
21+
cargo +{{RUSTV}} fmt --check --all
22+
23+
check:
24+
@echo "Running cargo check..."
25+
cargo +{{RUSTV}} check --workspace
26+
27+
test:
28+
@echo "Running cargo test..."
29+
cargo +{{RUSTV}} test --workspace
30+
31+
benchmarks:
32+
@echo "Running cargo test with benchmarks..."
33+
cargo +{{RUSTV}} test --workspace --features=runtime-benchmarks
34+
35+
clippy:
36+
@echo "Running cargo clippy..."
37+
cargo +{{RUSTV}} clippy -- -D clippy::panic \
38+
-D clippy::todo \
39+
-D clippy::unimplemented
40+
fix:
41+
@echo "Running cargo fix..."
42+
cargo +{{RUSTV}} fix --workspace
43+
git diff --exit-code || (echo "There are local changes after running 'cargo fix --workspace' ❌" && exit 1)

pallets/subtensor/tests/epoch.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ fn init_run_epochs(
227227
assert_ok!(SubtensorModule::set_weights(
228228
RuntimeOrigin::signed(U256::from(*uid as u64)),
229229
netuid,
230-
hotkey,
231230
vec![*uid],
232231
vec![u16::MAX],
233232
0
@@ -562,7 +561,6 @@ fn test_1_graph() {
562561
assert_ok!(SubtensorModule::set_weights(
563562
RuntimeOrigin::signed(U256::from(uid)),
564563
netuid,
565-
hot,
566564
vec![uid],
567565
vec![u16::MAX],
568566
0

pallets/subtensor/tests/weights.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,7 @@ fn test_no_signature() {
422422
new_test_ext(0).execute_with(|| {
423423
let uids: Vec<u16> = vec![];
424424
let values: Vec<u16> = vec![];
425-
let result =
426-
SubtensorModule::set_weights(RuntimeOrigin::none(), 1, U256::from(1), uids, values, 0);
425+
let result = SubtensorModule::set_weights(RuntimeOrigin::none(), 1, uids, values, 0);
427426
assert_eq!(result, Err(DispatchError::BadOrigin));
428427
});
429428
}

0 commit comments

Comments
 (0)