Skip to content

Commit

Permalink
Merge pull request #29 from ckb-cell/chore/terrible-naming
Browse files Browse the repository at this point in the history
chore: update a terrible function naming
  • Loading branch information
Flouse authored Apr 19, 2024
2 parents 0ab417f + c5b4a15 commit b9412ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/api_service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl SpvRpc for SpvRpcImpl {
};

let spv_client_cell = spv_instance
.find_best_spv_client_include_height(stg_tip_height)
.find_best_spv_client_not_greater_than_height(stg_tip_height)
.map_err(|err| {
let message = format!(
"failed to get SPV cell base on height {stg_tip_height} from fetched data"
Expand Down
7 changes: 5 additions & 2 deletions src/components/ckb_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub trait CkbRpcClientExtension {
) -> Result<SpvClientCell> {
let instance = self.find_spv_cells(spv_type_script)?;
if let Some(height) = height_opt {
instance.find_best_spv_client_include_height(height)
instance.find_best_spv_client_not_greater_than_height(height)
} else {
instance.find_tip_spv_client()
}
Expand Down Expand Up @@ -174,7 +174,10 @@ impl SpvInstance {
.cloned()
}

pub(crate) fn find_best_spv_client_include_height(&self, height: u32) -> Result<SpvClientCell> {
pub(crate) fn find_best_spv_client_not_greater_than_height(
&self,
height: u32,
) -> Result<SpvClientCell> {
let SpvInstance { ref info, clients } = self;
let mut info = info.to_owned();
for _ in 0..clients.len() {
Expand Down

0 comments on commit b9412ed

Please sign in to comment.