From 615d643f2f2da89ef0963195359c6a3e7c92f9a2 Mon Sep 17 00:00:00 2001 From: david barinas Date: Wed, 1 May 2024 18:08:45 -0500 Subject: [PATCH] feat: Add logging for additional parameters, signature payload, and payload in transaction processing --- sube/examples/send_tx.rs | 1 + sube/src/lib.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/sube/examples/send_tx.rs b/sube/examples/send_tx.rs index 3578fc3..4c75bae 100644 --- a/sube/examples/send_tx.rs +++ b/sube/examples/send_tx.rs @@ -47,6 +47,7 @@ async fn main() -> Result<(), Box> { .await .map_err(|err| anyhow!(format!("SubeError {:?}", err)))?; + println!("response: {:?}", response); println!("Secret phrase: \"{phrase}\""); println!("Default Account: 0x{}", account.unwrap()); diff --git a/sube/src/lib.rs b/sube/src/lib.rs index d052a2a..9e917bf 100644 --- a/sube/src/lib.rs +++ b/sube/src/lib.rs @@ -362,6 +362,8 @@ where log::info!("encoded call {:?}", hex::encode(&encoded_call)); + log::info!("additional_params {:?}", hex::encode(&additional_params)); + let signature_payload = [ encoded_call.clone(), extra_params.clone(), @@ -369,12 +371,15 @@ where ] .concat(); + log::info!("signature_payload {:?}", hex::encode(&signature_payload)); let payload = if signature_payload.len() > 256 { hash(&meta::Hasher::Blake2_256, &signature_payload[..]) } else { signature_payload }; + log::info!("payload {:?}", hex::encode(&payload)); + let signature = signer(payload.as_slice()).await?; log::info!("signature {:?}", hex::encode(&signature));