Skip to content

Commit

Permalink
[feat]: Switch to ethers instead of ethers_*
Browse files Browse the repository at this point in the history
  • Loading branch information
woxjro committed Oct 28, 2023
1 parent e1bb72c commit b0a1ad0
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 50 deletions.
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ edition = "2021"
[dependencies]
cfonts = "1.1.0"
chrono = "0.4.26"
ethers-core = "2.0.8"
ethers-etherscan = "2.0.10"
ethers-providers = "2.0.8"
ethers = { git = "https://github.com/woxjro/ethers-rs", branch = "feat/etherscan/stats" }
futures = "0.3.28"
ratatui = { version = "0.22.0", features = ["all-widgets"] }
serde_json = "1.0.104"
Expand Down
25 changes: 0 additions & 25 deletions examples/rpc_get_block.rs

This file was deleted.

2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::ethers::types::TransactionWithReceipt;
use crate::network::IoEvent;
use crate::route::{ActiveBlock, Route};
use crate::widget::StatefulList;
use ethers_core::types::{Block, NameOrAddress, Transaction, TxHash, U64};
use ethers::core::types::{Block, NameOrAddress, Transaction, TxHash, U64};
use ratatui::widgets::{ListState, TableState};
use statistics::Statistics;
use std::sync::mpsc::Sender;
Expand Down
2 changes: 1 addition & 1 deletion src/app/block.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ethers_core::types::Block;
use ethers::core::types::Block;

pub enum SelectableBlockDetailItem {
Transactions,
Expand Down
2 changes: 1 addition & 1 deletion src/app/event_handling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::app::{
block::SelectableBlockDetailItem, statistics::Statistics,
transaction::SelectableTransactionDetailItem, App, InputMode,
};
use ethers_core::types::NameOrAddress;
use ethers::core::types::NameOrAddress;

use crate::network::IoEvent;
use crate::route::{ActiveBlock, Route, RouteId};
Expand Down
2 changes: 1 addition & 1 deletion src/app/statistics.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use ethers_core::types::{Block, Transaction, U64};
use ethers::core::types::{Block, Transaction, U64};

#[derive(Clone, Debug)]
pub struct Statistics {
Expand Down
2 changes: 1 addition & 1 deletion src/ethers.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub mod types {
use ethers_core::types::{Address, Transaction, TransactionReceipt, U256};
use ethers::core::types::{Address, Transaction, TransactionReceipt, U256};
use url::Url;

#[derive(Clone, Debug, PartialEq)]
Expand Down
8 changes: 4 additions & 4 deletions src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ use crate::ethers::types::{AddressInfo, TransactionWithReceipt};
use crate::route::{ActiveBlock, Route, RouteId};
use crate::widget::StatefulList;
use crate::Etherscan;
use ethers_core::types::Chain;
use ethers_core::types::{
use ethers::core::types::Chain;
use ethers::core::types::{
Address, Block, BlockId, BlockNumber, NameOrAddress, Transaction, TxHash, H256, U64,
};
use ethers_etherscan::Client;
use ethers_providers::{Http, Middleware, Provider};
use ethers::etherscan::Client;
use ethers::providers::{Http, Middleware, Provider};
use futures::future::join_all;
use std::error::Error;
use std::sync::Arc;
Expand Down
2 changes: 1 addition & 1 deletion src/route.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::ethers::types::{AddressInfo, TransactionWithReceipt};
use ethers_core::types::{Block, Transaction};
use ethers::core::types::{Block, Transaction};

#[derive(PartialEq, Clone)]
pub enum RouteId {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/home/address_info.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::app::App;
use crate::ethers::types::AddressInfo;
use crate::route::ActiveBlock;
use ethers_core::utils::format_ether;
use ethers::core::utils::format_ether;
use ratatui::{prelude::*, widgets::*};

pub fn render<B: Backend>(
Expand Down
2 changes: 1 addition & 1 deletion src/ui/home/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mod withdrawals;
use crate::app::App;
use crate::route::ActiveBlock;
use crate::route::RouteId;
use ethers_core::types::{Block as EBlock, Transaction};
use ethers::core::types::{Block as EBlock, Transaction};
use ratatui::{prelude::*, widgets::*};

pub fn render<B: Backend>(
Expand Down
2 changes: 1 addition & 1 deletion src/ui/home/block/block_info.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::app::{block::SelectableBlockDetailItem, App};
use crate::route::{ActiveBlock, RouteId};
use ethers_core::types::{Block as EBlock, Transaction};
use ethers::core::types::{Block as EBlock, Transaction};
use ratatui::{prelude::*, widgets::*};

pub fn render<B: Backend>(
Expand Down
2 changes: 1 addition & 1 deletion src/ui/home/block/fee_info.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::app::{block::SelectableBlockDetailItem, App};
use crate::route::{ActiveBlock, RouteId};
use ethers_core::types::{Block as EBlock, Transaction};
use ethers::core::types::{Block as EBlock, Transaction};
use ratatui::{prelude::*, widgets::*};

pub fn render<B: Backend>(
Expand Down
4 changes: 2 additions & 2 deletions src/ui/home/block/gas_info.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::app::{block::SelectableBlockDetailItem, App};
use crate::route::{ActiveBlock, RouteId};
use ethers_core::types::{Block as EBlock, Transaction};
use ethers_core::utils::{format_ether, format_units};
use ethers::core::types::{Block as EBlock, Transaction};
use ethers::core::utils::{format_ether, format_units};
use ratatui::{prelude::*, widgets::*};

pub fn render<B: Backend>(
Expand Down
4 changes: 2 additions & 2 deletions src/ui/home/block/transactions.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::app::App;
use crate::route::{ActiveBlock, RouteId};
use ethers_core::types::{Block as EBlock, Transaction, U64};
use ethers_core::utils::{format_ether, format_units};
use ethers::core::types::{Block as EBlock, Transaction, U64};
use ethers::core::utils::{format_ether, format_units};
use ratatui::{prelude::*, widgets::*};

pub fn render<B: Backend>(
Expand Down
2 changes: 1 addition & 1 deletion src/ui/home/block/withdrawals.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::app::App;
use crate::route::{ActiveBlock, RouteId};
use ethers_core::types::{Block as EBlock, Transaction};
use ethers::core::types::{Block as EBlock, Transaction};
use ratatui::{prelude::*, widgets::*};

pub fn render<B: Backend>(
Expand Down
2 changes: 1 addition & 1 deletion src/ui/home/latest_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::app::App;
use crate::route::ActiveBlock;
use crate::widget::Spinner;
use chrono::Utc;
use ethers_core::utils::format_ether;
use ethers::core::utils::format_ether;
use ratatui::{prelude::*, widgets::*};

pub fn render<B: Backend>(f: &mut Frame<B>, app: &mut App, rect: Rect) {
Expand Down
4 changes: 2 additions & 2 deletions src/ui/home/transaction.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::app::{transaction::SelectableTransactionDetailItem, App};
use crate::ethers::types::TransactionWithReceipt;
use crate::route::ActiveBlock;
use ethers_core::types::U64;
use ethers_core::utils::{format_ether, format_units};
use ethers::core::types::U64;
use ethers::core::utils::{format_ether, format_units};
use ratatui::{prelude::*, widgets::*};

pub fn render<B: Backend>(
Expand Down

0 comments on commit b0a1ad0

Please sign in to comment.