From f151420bb727f4c7862e8f2d23e35235e638a112 Mon Sep 17 00:00:00 2001 From: Iris Date: Fri, 24 Nov 2023 12:19:05 +0100 Subject: [PATCH] fix: use New ExecutionEncoding in account & add tx hash in logs --- bot/src/bot.rs | 9 +++++---- bot/src/main.rs | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bot/src/bot.rs b/bot/src/bot.rs index 3f0243a..4943d3d 100644 --- a/bot/src/bot.rs +++ b/bot/src/bot.rs @@ -416,9 +416,10 @@ pub async fn renew_domains( ) .await { - Ok(_) => { + Ok(tx_hash) => { logger.info(format!( - "Sent a tx to renew {} domains", + "Sent a tx {} to renew {} domains", + FieldElement::to_string(&tx_hash), domains_to_renew.len() )); } @@ -438,7 +439,7 @@ pub async fn send_transaction( config: &Config, account: &SingleOwnerAccount, LocalWallet>, aggregate_results: AggregateResults, -) -> Result<()> { +) -> Result { let mut calldata: Vec = Vec::new(); calldata .push(FieldElement::from_dec_str(&aggregate_results.domains.len().to_string()).unwrap()); @@ -480,7 +481,7 @@ pub async fn send_transaction( .await; match result { - Ok(_) => Ok(()), + Ok(tx_result) => Ok(tx_result.transaction_hash), Err(e) => { let error_message = format!("An error occurred while renewing domains: {}", e); Err(anyhow::anyhow!(error_message)) diff --git a/bot/src/main.rs b/bot/src/main.rs index 9b0a5fb..be3e326 100644 --- a/bot/src/main.rs +++ b/bot/src/main.rs @@ -100,7 +100,7 @@ async fn main() { signer, conf.account.address, chainid, - starknet::accounts::ExecutionEncoding::Legacy, + starknet::accounts::ExecutionEncoding::New, ); logger.info("Started");