File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -173,16 +173,19 @@ impl StorageBackend for ChallengeStorageBackend {
173173 prefix : & [ u8 ] ,
174174 limit : u32 ,
175175 ) -> Result < Vec < ( Vec < u8 > , Vec < u8 > ) > , StorageHostError > {
176- let prefix_bytes = if prefix. is_empty ( ) {
176+ // Keys are stored hex-encoded (see build_challenge_storage_key),
177+ // so the prefix must also be hex-encoded for the scan to match.
178+ let hex_prefix = hex:: encode ( prefix) ;
179+ let prefix_filter: Option < & [ u8 ] > = if prefix. is_empty ( ) {
177180 None
178181 } else {
179- Some ( prefix )
182+ Some ( hex_prefix . as_bytes ( ) )
180183 } ;
181184
182185 let result = tokio:: task:: block_in_place ( || {
183186 tokio:: runtime:: Handle :: current ( ) . block_on ( self . storage . list_prefix (
184187 challenge_id,
185- prefix_bytes ,
188+ prefix_filter ,
186189 limit as usize ,
187190 None ,
188191 ) )
You can’t perform that action at this time.
0 commit comments