Skip to content

Commit

Permalink
fix: use New ExecutionEncoding in account & add tx hash in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
irisdv committed Nov 24, 2023
1 parent 6a5b736 commit f151420
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions bot/src/bot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
));
}
Expand All @@ -438,7 +439,7 @@ pub async fn send_transaction(
config: &Config,
account: &SingleOwnerAccount<JsonRpcClient<HttpTransport>, LocalWallet>,
aggregate_results: AggregateResults,
) -> Result<()> {
) -> Result<FieldElement> {
let mut calldata: Vec<FieldElement> = Vec::new();
calldata
.push(FieldElement::from_dec_str(&aggregate_results.domains.len().to_string()).unwrap());
Expand Down Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion bot/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async fn main() {
signer,
conf.account.address,
chainid,
starknet::accounts::ExecutionEncoding::Legacy,
starknet::accounts::ExecutionEncoding::New,
);

logger.info("Started");
Expand Down

0 comments on commit f151420

Please sign in to comment.