Skip to content

Commit

Permalink
feat: Add logging for additional parameters, signature payload, and p…
Browse files Browse the repository at this point in the history
…ayload in transaction processing
  • Loading branch information
S0c5 committed May 1, 2024
1 parent a037923 commit 615d643
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions sube/examples/send_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.await
.map_err(|err| anyhow!(format!("SubeError {:?}", err)))?;

println!("response: {:?}", response);
println!("Secret phrase: \"{phrase}\"");
println!("Default Account: 0x{}", account.unwrap());

Expand Down
5 changes: 5 additions & 0 deletions sube/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,19 +362,24 @@ 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(),
additional_params.clone(),
]
.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));
Expand Down

0 comments on commit 615d643

Please sign in to comment.