File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -1158,11 +1158,25 @@ impl RpcHandler {
11581158 // Verify the challenge has registered routes
11591159 {
11601160 let routes = self . challenge_routes . read ( ) ;
1161- if !routes. contains_key ( & challenge_id) {
1162- // Try to find by name
1161+ let has_routes = routes. contains_key ( & challenge_id) ;
1162+ drop ( routes) ;
1163+
1164+ if !has_routes {
1165+ // Check chain_state.challenge_routes for WASM challenges
11631166 let chain = self . chain_state . read ( ) ;
1164- let found = chain. challenges . values ( ) . any ( |c| c. name == challenge_id) ;
1165- if !found {
1167+ let challenge_uuid = uuid:: Uuid :: parse_str ( & challenge_id)
1168+ . ok ( )
1169+ . map ( platform_core:: ChallengeId ) ;
1170+
1171+ let found_in_chain = challenge_uuid
1172+ . as_ref ( )
1173+ . map ( |id| chain. challenge_routes . contains_key ( id) )
1174+ . unwrap_or ( false ) ;
1175+
1176+ // Also check legacy challenges by name
1177+ let found_legacy = chain. challenges . values ( ) . any ( |c| c. name == challenge_id) ;
1178+
1179+ if !found_in_chain && !found_legacy {
11661180 return JsonRpcResponse :: error (
11671181 id,
11681182 CHALLENGE_NOT_FOUND ,
You can’t perform that action at this time.
0 commit comments