Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
zerosnacks committed Apr 24, 2024
1 parent 5c178c4 commit ced55e9
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 26 deletions.
2 changes: 1 addition & 1 deletion examples/fillers/examples/gas_filler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async fn main() -> Result<()> {
// Create an EIP-1559 type transaction.
let tx = TransactionRequest::default()
.with_from(alice)
.with_to(vitalik.into())
.with_to(vitalik)
.with_value(U256::from(100))
// Notice that without the `NonceFiller`, you need to set `nonce` field.
.with_nonce(0)
Expand Down
2 changes: 1 addition & 1 deletion examples/fillers/examples/nonce_filler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async fn main() -> Result<()> {
// Create an EIP-1559 type transaction.
let tx = TransactionRequest::default()
.with_from(alice)
.with_to(vitalik.into())
.with_to(vitalik)
.with_value(U256::from(100))
// Notice that without the `GasFiller`, you need to set the gas related fields.
.with_gas_limit(21_000)
Expand Down
6 changes: 2 additions & 4 deletions examples/fillers/examples/recommended_fillers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ async fn main() -> Result<()> {
// Notice that the `nonce` field is set by the `NonceFiller`.
// Notice that the gas related fields are set by the `GasFiller`.
// Notice that the `chain_id` field is set by the `ChainIdFiller`.
let tx = TransactionRequest::default()
.with_from(alice)
.with_to(vitalik.into())
.with_value(U256::from(100));
let tx =
TransactionRequest::default().with_from(alice).with_to(vitalik).with_value(U256::from(100));

// Send the transaction, the nonce (0) is automatically managed by the provider.
let builder = provider.send_transaction(tx.clone()).await?;
Expand Down
2 changes: 1 addition & 1 deletion examples/fillers/examples/signer_filler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async fn main() -> Result<()> {
.with_from(alice)
// Notice that without the `NonceFiller`, you need to manually set the nonce field.
.with_nonce(0)
.with_to(vitalik.into())
.with_to(vitalik)
.with_value(U256::from(100))
// Notice that without the `GasFiller`, you need to set the gas related fields.
.with_gas_price(20_000_000_000)
Expand Down
6 changes: 2 additions & 4 deletions examples/providers/examples/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ async fn main() -> Result<()> {
.on_http(rpc_url)?;

// Create a transaction.
let tx = TransactionRequest::default()
.with_from(alice)
.with_to(bob.into())
.with_value(U256::from(100));
let tx =
TransactionRequest::default().with_from(alice).with_to(bob).with_value(U256::from(100));

// Send the transaction and wait for the receipt.
let pending_tx = provider.send_transaction(tx).await?;
Expand Down
2 changes: 1 addition & 1 deletion examples/transactions/examples/gas_price_usd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async fn main() -> Result<()> {
let input = Bytes::from(call);

// Call the Chainlink ETH/USD feed contract.
let tx = TransactionRequest::default().with_to(ETH_USD_FEED.into()).with_input(input);
let tx = TransactionRequest::default().with_to(ETH_USD_FEED).with_input(input);

let response = provider.call(&tx, BlockId::latest()).await?;
let result = U256::from_str(&response.to_string())?;
Expand Down
2 changes: 1 addition & 1 deletion examples/transactions/examples/sign_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async fn main() -> Result<()> {
// Build a transaction to send 100 wei from Alice to Bob.
let tx = TransactionRequest::default()
.with_from(alice)
.with_to(bob.into())
.with_to(bob)
.with_nonce(0)
.with_chain_id(anvil.chain_id())
.with_value(U256::from(100))
Expand Down
6 changes: 2 additions & 4 deletions examples/transactions/examples/trace_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ async fn main() -> Result<()> {
let bob = address!("70997970C51812dc3A010C7d01b50e0d17dc79C8");

// Build a transaction to send 100 wei from Alice to Bob.
let tx = TransactionRequest::default()
.with_from(alice)
.with_to(bob.into())
.with_value(U256::from(100));
let tx =
TransactionRequest::default().with_from(alice).with_to(bob).with_value(U256::from(100));

// Trace the transaction on top of the latest block.
let trace_type = [TraceType::Trace];
Expand Down
6 changes: 2 additions & 4 deletions examples/transactions/examples/transfer_eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ async fn main() -> Result<()> {
let bob = anvil.addresses()[1];

// Build a transaction to send 100 wei from Alice to Bob.
let tx = TransactionRequest::default()
.with_from(alice)
.with_to(bob.into())
.with_value(U256::from(100));
let tx =
TransactionRequest::default().with_from(alice).with_to(bob).with_value(U256::from(100));

// Send the transaction and wait for the receipt.
let pending_tx = provider.send_transaction(tx).await?;
Expand Down
2 changes: 1 addition & 1 deletion examples/wallets/examples/keystore_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async fn main() -> Result<()> {
// Build a transaction to send 100 wei to Vitalik from Alice.
let tx = TransactionRequest::default()
.with_from(alice)
.with_to(address!("d8dA6BF26964aF9D7eEd9e03E53415D37aA96045").into())
.with_to(address!("d8dA6BF26964aF9D7eEd9e03E53415D37aA96045"))
.with_value(U256::from(100));

// Send the transaction and wait for the receipt.
Expand Down
2 changes: 1 addition & 1 deletion examples/wallets/examples/ledger_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async fn main() -> Result<()> {
// Build a transaction to send 100 wei to Vitalik.
let tx = TransactionRequest::default()
.with_from(from)
.with_to(address!("d8dA6BF26964aF9D7eEd9e03E53415D37aA96045").into())
.with_to(address!("d8dA6BF26964aF9D7eEd9e03E53415D37aA96045"))
.with_value(U256::from(100));

// Send the transaction and wait for the receipt.
Expand Down
2 changes: 1 addition & 1 deletion examples/wallets/examples/private_key_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
// Build a transaction to send 100 wei to Vitalik.
let tx = TransactionRequest::default()
.with_from(alice)
.with_to(address!("d8dA6BF26964aF9D7eEd9e03E53415D37aA96045").into())
.with_to(address!("d8dA6BF26964aF9D7eEd9e03E53415D37aA96045"))
.with_value(U256::from(100));

// Send the transaction and wait for the receipt.
Expand Down
2 changes: 1 addition & 1 deletion examples/wallets/examples/trezor_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async fn main() -> Result<()> {
// Build a transaction to send 100 wei to Vitalik.
let tx = TransactionRequest::default()
.with_from(from)
.with_to(address!("d8dA6BF26964aF9D7eEd9e03E53415D37aA96045").into())
.with_to(address!("d8dA6BF26964aF9D7eEd9e03E53415D37aA96045"))
.with_value(U256::from(100));

// Send the transaction and wait for the receipt.
Expand Down
2 changes: 1 addition & 1 deletion examples/wallets/examples/yubi_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async fn main() -> Result<()> {
// Build a transaction to send 100 wei to Vitalik.
let tx = TransactionRequest::default()
.with_from(from)
.with_to(address!("d8dA6BF26964aF9D7eEd9e03E53415D37aA96045").into())
.with_to(address!("d8dA6BF26964aF9D7eEd9e03E53415D37aA96045"))
.with_value(U256::from(100));

// Send the transaction and wait for the receipt.
Expand Down

0 comments on commit ced55e9

Please sign in to comment.