Skip to content

Commit

Permalink
Fix comment written in Japanese and Remove println! in test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamaguchi committed Sep 2, 2024
1 parent b4f6971 commit 3b7e8c7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
26 changes: 0 additions & 26 deletions crates/esplora/tests/blocking_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,6 @@ impl HdWallet {
let options = SignOptions::default();
wallet.sign(&mut psbt, options)?;
let tx = psbt.extract_tx()?;
println!("tx broadcat {:#?}", tx);
client.broadcast(&tx)?;

Ok(tx.malfix_txid().to_string())
Expand Down Expand Up @@ -674,7 +673,6 @@ fn test_p2c_transfer() -> anyhow::Result<()> {
.client
.call("getbalance", &[false.into()])
.unwrap();
// println!("getbalance(tpc): {:?}", ret);
let balance = wallet.balance(None).unwrap();
assert_eq!(balance, 0);

Expand Down Expand Up @@ -703,7 +701,6 @@ fn test_p2c_transfer() -> anyhow::Result<()> {
let p2c_address = wallet
.calc_p2c_address(public_key.clone(), "content".to_string(), None)
.expect("Failed to calculate P2C address");
// println!("p2c_address: {}", p2c_address);

// Transfer tpc to pay to contract address from other wallet
let txid = env.tapyrusd.client.send_to_address(
Expand All @@ -728,9 +725,6 @@ fn test_p2c_transfer() -> anyhow::Result<()> {

wait_for_confirmation(&env, &client, 1);
wallet.sync(&client, Vec::new()).expect("Failed to sync");
// println!("txid: {}", txid);
// println!("balance: {}", wallet.balance(None).unwrap());
//assert_eq!(wallet.balance(None).unwrap(), 30000);

let outpoint = OutPoint {
txid: txid,
Expand All @@ -749,11 +743,9 @@ fn test_p2c_transfer() -> anyhow::Result<()> {
&client,
);
assert!(ret.is_ok());
// println!("tx {:?}", ret.unwrap());

wait_for_confirmation(&env, &client, 1);
wallet.sync(&client, Vec::new()).expect("Failed to sync");
// println!("balance: {}", wallet.balance(None).unwrap());
Ok(())
}

Expand Down Expand Up @@ -848,9 +840,7 @@ fn test_colored_p2c_transfer() -> anyhow::Result<()> {
.client
.call("getbalance", &[false.into(), color_id.to_string().into()])
.unwrap();
println!("getbalance(colored) {:?}", ret);

// println!("p2c_address {:?}", p2c_address);
//send p2c token from tapyrus core wallet.
let txid: MalFixTxid = env.tapyrusd.client.call(
"transfertoken",
Expand All @@ -862,7 +852,6 @@ fn test_colored_p2c_transfer() -> anyhow::Result<()> {
.client
.call("getbalance", &[false.into(), color_id.to_string().into()])
.unwrap();
println!("getbalance(colored) {:?}", ret);

let contract = tdk_chain::Contract {
contract_id: "contract_id6".to_string(),
Expand All @@ -875,30 +864,16 @@ fn test_colored_p2c_transfer() -> anyhow::Result<()> {
.expect("Failed to store contract");

wait_for_confirmation(&env, &client, 6);
println!(
"tx (transfertoken) {:?}, {:#?}",
txid,
wallet.get_transaction(&txid, &client)
);
wallet
.sync(&client, vec![p2c_address.script_pubkey()])
.expect("Failed to sync");

println!(
"balance: {}",
wallet.balance(Some(color_id.clone())).unwrap()
);
let ret: f64 = env
.tapyrusd
.client
.call("getbalance", &[false.into(), color_id.to_string().into()])
.unwrap();
println!("getbalance(colored) {:?}", ret);

// let wallet = get_wallet(&env);
// wallet.full_sync(&client).expect("Failed to sync");
let balance = wallet.balance(Some(color_id.clone())).unwrap();
// assert_eq!(balance, 400);

let outpoint = OutPoint {
txid: txid,
Expand All @@ -925,7 +900,6 @@ fn test_colored_p2c_transfer() -> anyhow::Result<()> {
);
println!("tx {:?}", ret);
assert!(ret.is_ok());
// println!("tx {:?}", ret.unwrap());

wait_for_confirmation(&env, &client, 1);
wallet.sync(&client, Vec::new()).expect("Failed to sync");
Expand Down
2 changes: 1 addition & 1 deletion crates/wallet/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ pub fn descriptor_to_public_key(descriptor: &Descriptor<DescriptorPublicKey>) ->
_ => None,
}
}
// 他のDescriptorの場合、サポートされていない
// Not supported for other descriptor
_ => None,
}
}
Expand Down

0 comments on commit 3b7e8c7

Please sign in to comment.