From 418b09a9547445cc934f734022b3c8a66b0a6d84 Mon Sep 17 00:00:00 2001 From: lesa-telos Date: Mon, 14 Oct 2024 18:46:30 +0200 Subject: [PATCH] Remove prints for the tests. --- crates/antelope/tests/chain.rs | 19 ++++--------------- crates/antelope/tests/client.rs | 11 ++--------- crates/antelope/tests/serializer.rs | 6 +----- 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/crates/antelope/tests/chain.rs b/crates/antelope/tests/chain.rs index 863c9f4..480207c 100644 --- a/crates/antelope/tests/chain.rs +++ b/crates/antelope/tests/chain.rs @@ -104,23 +104,12 @@ fn asset() { fn block_id() { let string = "048865fb643bca3b644647177f0cf363f7956794d0a7ec3bc6d29d93d9637308"; - let block_id = match hex::decode(string) { - Ok(bytes) => match BlockId::from_bytes(&bytes) { - Ok(block_id) => block_id, - Err(err) => { - print!("Error creating BlockId: {}", err); - return; - } - }, - Err(err) => { - print!("Error decoding hex string: {}", err); - return; - } - }; + let block_id_bytes = hex::decode(string).unwrap(); + let block_id = BlockId::from_bytes(&block_id_bytes).unwrap(); - //assert_eq!(block_id.to_string(), string); assert_eq!(block_id.block_num().to_string(), "76047867"); - assert!(block_id.block_num() == 76047867); + assert_eq!(block_id.block_num(), 76047867); + //assert!(block_id.block_num().equals(UInt32::from(76047867))); UInt32 not // implemented yet diff --git a/crates/antelope/tests/client.rs b/crates/antelope/tests/client.rs index 934dc77..8daa38a 100644 --- a/crates/antelope/tests/client.rs +++ b/crates/antelope/tests/client.rs @@ -22,9 +22,6 @@ async fn chain_get_info() { let result = client.v1_chain.get_info().await; - if let Err(e) = &result { - println!("Deserialization error: {:?}", e); - } assert!(result.is_ok()); let result_unwrapped = result.unwrap(); @@ -117,7 +114,7 @@ async fn chain_send_transaction() { "Failed transaction result should be err" ); let failure_response = failed_result.err().unwrap(); - println!("{:?}", failure_response); + match failure_response { ClientError::SERVER(err) => { assert_eq!(err.error.code, 3050003); @@ -154,8 +151,7 @@ async fn chan_get_account() { } Err(e) => { // Log or handle errors here to understand parsing issues - println!("Failed to parse JSON: {:?}", e); - panic!("Parsing failed for the given JSON data."); + panic!("Failed to parse JSON: {:?}", e); } } } @@ -167,9 +163,6 @@ pub async fn chain_get_abi() { let result = client.v1_chain.get_abi("eosio.token".to_string()).await; - if let Err(e) = &result { - println!("Deserialization error: {:?}", e); - } assert!(result.is_ok()); let abi_object = result.unwrap(); diff --git a/crates/antelope/tests/serializer.rs b/crates/antelope/tests/serializer.rs index 3747cc3..eed4931 100644 --- a/crates/antelope/tests/serializer.rs +++ b/crates/antelope/tests/serializer.rs @@ -1152,11 +1152,7 @@ fn setcode() { hasher.update(&wasm); let wasm_hash = hasher.finalize(); let wasm_hash_hex = bytes_to_hex(&wasm_hash.to_vec()); - println!( - "Setting contract for account: {:?}, with hash: {:?}", - account.as_string(), - wasm_hash_hex - ); + assert_eq!( wasm_hash_hex, "295586a9f3b2de36d637dbde251106cee7b23d3fd1e4d0162df43c3bbaa6e800"