Skip to content

Commit 7cc93de

Browse files
authored
feat(core): add compat.rs re-export layer for platform SDK types (#19)
* feat(core): add compat.rs re-export layer for platform SDK types Create new term-core crate with src/core/compat.rs providing: - Re-exports of Hotkey, ChallengeId (UUID-based) from platform_core - Re-exports of WeightAssignment, ChallengeRoute (HttpMethod enum), RouteRequest, RouteResponse, ChallengeError, ServerChallenge from platform_challenge_sdk - ChallengeConfigMeta thin wrapper combining metadata + config - Deprecated backward-compatible aliases (LegacyChallengeId, LegacyWeightAssignment, LegacyRoute) with Into conversions - Conversion utilities (weight_u16_to_f64, challenge_id_from_bytes, method_str_to_enum, normalize_weights, etc.) - Prelude submodule for convenient imports - 153 tests (126 unit + 27 doc tests) * fix: use git deps for core crate instead of local paths * fix: resolve sled lock contention in chain storage test
1 parent 5cd4756 commit 7cc93de

File tree

7 files changed

+2365
-9
lines changed

7 files changed

+2365
-9
lines changed

Cargo.lock

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[workspace]
22
resolver = "2"
3-
members = [".", "wasm", "cli", "server", "storage"]
3+
members = [".", "wasm", "cli", "core", "server", "storage"]
44
default-members = ["wasm"]
55

66
[workspace.package]

core/Cargo.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
name = "term-core"
3+
version.workspace = true
4+
edition.workspace = true
5+
authors.workspace = true
6+
license.workspace = true
7+
description = "Core compatibility layer — re-exports platform SDK types for term-challenge"
8+
9+
[dependencies]
10+
platform-core = { git = "https://github.com/PlatformNetwork/platform-v2", branch = "main" }
11+
platform-challenge-sdk = { git = "https://github.com/PlatformNetwork/platform-v2", branch = "main" }
12+
13+
serde = { version = "1.0", features = ["derive"] }
14+
serde_json = "1.0"
15+
uuid = { version = "1", features = ["v4"] }
16+
chrono = { version = "0.4", features = ["serde"] }
17+
async-trait = "0.1"
18+
thiserror = "1.0"
19+
20+
[dev-dependencies]
21+
tokio = { version = "1.40", features = ["rt", "macros"] }

0 commit comments

Comments
 (0)