-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #153 from rainlanguage/2024-01-30-refactor-no-println
refactor(cli): replace println with tracing info
- Loading branch information
Showing
7 changed files
with
18 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
use alloy_ethers_typecast::transaction::WriteTransactionStatus; | ||
use alloy_sol_types::SolCall; | ||
use std::fmt::Debug; | ||
use tracing::info; | ||
|
||
pub fn display_write_transaction_status<T: SolCall + Debug>(status: WriteTransactionStatus<T>) { | ||
match status { | ||
WriteTransactionStatus::PendingPrepare(_) => { | ||
println!("⏳ Preparing transaction. Please wait."); | ||
info!("⏳ Preparing transaction. Please wait."); | ||
} | ||
WriteTransactionStatus::PendingSign(_) => { | ||
println!("🖋 Please sign the transaction on your Ledger device."); | ||
info!("🖋 Please sign the transaction on your Ledger device."); | ||
} | ||
WriteTransactionStatus::PendingSend(_) => { | ||
println!("⏳ Awaiting transaction confirmation. Please wait."); | ||
info!("⏳ Awaiting transaction confirmation. Please wait."); | ||
} | ||
WriteTransactionStatus::Confirmed(receipt) => { | ||
println!("✅ Transaction confirmed: {:?}", receipt.transaction_hash); | ||
info!("✅ Transaction confirmed: {:?}", receipt.transaction_hash); | ||
} | ||
} | ||
} |