Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
driftluo committed Dec 24, 2024
1 parent 636ca0b commit cc246b8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/tests/ckb_rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ pub static TRANSACTION_HASH_VEC: LazyLock<Vec<H256>> = LazyLock::new(|| {
#[test]
fn test_get_block() {
let ckb_client = CkbRpcClient::new(TEST_CKB_RPC_URL);
println!("1");
println!("111");
let block = ckb_client.get_block(BLOCK_HASH.clone()).unwrap();
println!("2");
println!("222");
let block = block.unwrap();
// println!("> block: {}", serde_json::to_string_pretty(&block).unwrap());
let block_from_json = core::BlockView::from(block);

let block = ckb_client.get_packed_block(BLOCK_HASH.clone()).unwrap();
println!("333");
assert!(block.is_some());
let block = block.unwrap();
// println!("> block: {}", serde_json::to_string_pretty(&block).unwrap());
Expand All @@ -51,20 +52,22 @@ fn test_get_block() {

// by number
let block = ckb_client.get_block_by_number(BLOCK_NUMBER.into()).unwrap();
println!("444");
let block = block.unwrap();
// println!("> block: {}", serde_json::to_string_pretty(&block).unwrap());
let block_from_json_n = core::BlockView::from(block);

let block = ckb_client
.get_packed_block_by_number(BLOCK_NUMBER.into())
.unwrap();
println!("555");
assert!(block.is_some());
let block = block.unwrap();
// println!("> block: {}", serde_json::to_string_pretty(&block).unwrap());

let block_from_types_n =
ckb_types::packed::Block::new_unchecked(block.into_bytes()).into_view();

println!("666");
assert_eq!(block_from_json_n, block_from_types_n);
assert_eq!(block_from_json, block_from_json_n);
}
Expand Down

0 comments on commit cc246b8

Please sign in to comment.