Skip to content

Commit 8044595

Browse files
committed
fix: RPC challenge_get/list now shows correct emissionWeight and mechanismId
- challenge_get: fall back to config.emission_weight when challenge_weights map is empty - challenge_list: add mechanismId and emissionWeight fields to response
1 parent 2513e49 commit 8044595

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/rpc-server/src/jsonrpc.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,8 @@ impl RpcHandler {
927927
"owner": c.owner.to_hex(),
928928
"version": c.module.version,
929929
"routesCount": routes_count,
930+
"mechanismId": c.config.mechanism_id,
931+
"emissionWeight": c.config.emission_weight,
930932
})
931933
})
932934
.collect();
@@ -983,7 +985,7 @@ impl RpcHandler {
983985
.challenge_weights
984986
.get(&c.challenge_id)
985987
.map(|w| w.weight_ratio)
986-
.unwrap_or(0.0);
988+
.unwrap_or(c.config.emission_weight);
987989

988990
JsonRpcResponse::result(
989991
id,

0 commit comments

Comments
 (0)