diff --git a/light-client-lib/src/service.rs b/light-client-lib/src/service.rs index 9ba9854..38328c6 100644 --- a/light-client-lib/src/service.rs +++ b/light-client-lib/src/service.rs @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize}; use crate::storage; #[cfg_attr(target_arch = "wasm32", wasm_bindgen::prelude::wasm_bindgen)] -#[derive(Deserialize, Serialize, Eq, PartialEq)] +#[derive(Deserialize, Serialize, Eq, PartialEq, Debug)] #[serde(rename_all = "snake_case")] pub enum SetScriptsCommand { // Replace all scripts with new scripts, non-exist scripts will be deleted @@ -39,7 +39,7 @@ pub enum FetchStatus { NotFound, } -#[derive(Deserialize, Serialize)] +#[derive(Deserialize, Serialize, Debug)] pub struct ScriptStatus { pub script: Script, pub script_type: ScriptType, diff --git a/light-client-lib/src/storage/db/browser.rs b/light-client-lib/src/storage/db/browser.rs index 6311bfd..ae096a3 100644 --- a/light-client-lib/src/storage/db/browser.rs +++ b/light-client-lib/src/storage/db/browser.rs @@ -3,6 +3,7 @@ use std::{ collections::{HashMap, HashSet}, path::Path, sync::atomic::AtomicBool, + usize, }; use super::super::{ @@ -367,11 +368,11 @@ impl Storage { start_key_bound: key_prefix_clone.clone(), order: CursorDirection::NextUnique, take_while: Box::new(move |raw_key: &[u8]| raw_key.starts_with(&key_prefix_clone)), - limit: 1, + limit: usize::MAX, skip: 0, }) .unwrap(); - + debug!("raw get filter script response: {:#?}", value); if let DbCommandResponse::Iterator { kvs } = value { kvs.into_iter() .map(|kv| (kv.key, kv.value)) diff --git a/light-client-wasm/src/lib.rs b/light-client-wasm/src/lib.rs index 80e7dd6..a7150db 100644 --- a/light-client-wasm/src/lib.rs +++ b/light-client-wasm/src/lib.rs @@ -26,7 +26,7 @@ use ckb_light_client_lib::{ types::RunEnv, verify::verify_tx, }; -use log::debug; +use log::{debug, info}; use serde::{Deserialize, Serialize}; use serde_wasm_bindgen::Serializer; use wasm_bindgen::prelude::*; @@ -477,7 +477,7 @@ pub fn set_scripts( .into_iter() .map(serde_wasm_bindgen::from_value::) .collect::, _>>()?; - + debug!("Update scripts, {:?}, {:?}", scripts, command); STORAGE_WITH_DATA .get() .unwrap()