diff --git a/Cargo.toml b/Cargo.toml index 72e73a1a..9ab2961c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ members = [ "crates/p2p-consensus", "crates/wasm-runtime-interface", "crates/challenge-sdk-wasm", + "challenges/term-challenge-wasm", "bins/validator-node", "bins/utils", "bins/mock-subtensor", diff --git a/crates/challenge-sdk-wasm/src/lib.rs b/crates/challenge-sdk-wasm/src/lib.rs index 82e16686..a15483d6 100644 --- a/crates/challenge-sdk-wasm/src/lib.rs +++ b/crates/challenge-sdk-wasm/src/lib.rs @@ -38,11 +38,18 @@ pub fn pack_ptr_len(ptr: i32, len: i32) -> i64 { /// functions (`evaluate`, `validate`, `get_name`, `get_version`, /// `generate_task`, `setup_environment`, and `alloc`). /// +/// The type must provide a `const fn new() -> Self` constructor so that the +/// challenge instance can be placed in a `static`. +/// /// # Usage /// /// ```ignore /// struct MyChallenge; /// +/// impl MyChallenge { +/// pub const fn new() -> Self { Self } +/// } +/// /// impl platform_challenge_sdk_wasm::Challenge for MyChallenge { /// fn name(&self) -> &'static str { "my-challenge" } /// fn version(&self) -> &'static str { "0.1.0" }