File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ async fn main() -> Result<()> {
3636 // Create an EIP-1559 type transaction.
3737 let tx = TransactionRequest :: default ( )
3838 . with_from ( alice)
39- . with_to ( vitalik. into ( ) )
39+ . with_to ( vitalik)
4040 . with_value ( U256 :: from ( 100 ) )
4141 // Notice that without the `NonceFiller`, you need to set `nonce` field.
4242 . with_nonce ( 0 )
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ async fn main() -> Result<()> {
4545 // Create an EIP-1559 type transaction.
4646 let tx = TransactionRequest :: default ( )
4747 . with_from ( alice)
48- . with_to ( vitalik. into ( ) )
48+ . with_to ( vitalik)
4949 . with_value ( U256 :: from ( 100 ) )
5050 // Notice that without the `GasFiller`, you need to set the gas related fields.
5151 . with_gas_limit ( 21_000 )
Original file line number Diff line number Diff line change @@ -35,10 +35,8 @@ async fn main() -> Result<()> {
3535 // Notice that the `nonce` field is set by the `NonceFiller`.
3636 // Notice that the gas related fields are set by the `GasFiller`.
3737 // Notice that the `chain_id` field is set by the `ChainIdFiller`.
38- let tx = TransactionRequest :: default ( )
39- . with_from ( alice)
40- . with_to ( vitalik. into ( ) )
41- . with_value ( U256 :: from ( 100 ) ) ;
38+ let tx =
39+ TransactionRequest :: default ( ) . with_from ( alice) . with_to ( vitalik) . with_value ( U256 :: from ( 100 ) ) ;
4240
4341 // Send the transaction, the nonce (0) is automatically managed by the provider.
4442 let builder = provider. send_transaction ( tx. clone ( ) ) . await ?;
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ async fn main() -> Result<()> {
3535 . with_from ( alice)
3636 // Notice that without the `NonceFiller`, you need to manually set the nonce field.
3737 . with_nonce ( 0 )
38- . with_to ( vitalik. into ( ) )
38+ . with_to ( vitalik)
3939 . with_value ( U256 :: from ( 100 ) )
4040 // Notice that without the `GasFiller`, you need to set the gas related fields.
4141 . with_gas_price ( 20_000_000_000 )
Original file line number Diff line number Diff line change @@ -31,10 +31,8 @@ async fn main() -> Result<()> {
3131 . on_http ( rpc_url) ?;
3232
3333 // Create a transaction.
34- let tx = TransactionRequest :: default ( )
35- . with_from ( alice)
36- . with_to ( bob. into ( ) )
37- . with_value ( U256 :: from ( 100 ) ) ;
34+ let tx =
35+ TransactionRequest :: default ( ) . with_from ( alice) . with_to ( bob) . with_value ( U256 :: from ( 100 ) ) ;
3836
3937 // Send the transaction and wait for the receipt.
4038 let pending_tx = provider. send_transaction ( tx) . await ?;
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ async fn main() -> Result<()> {
3838 let input = Bytes :: from ( call) ;
3939
4040 // Call the Chainlink ETH/USD feed contract.
41- let tx = TransactionRequest :: default ( ) . with_to ( ETH_USD_FEED . into ( ) ) . with_input ( input) ;
41+ let tx = TransactionRequest :: default ( ) . with_to ( ETH_USD_FEED ) . with_input ( input) ;
4242
4343 let response = provider. call ( & tx, BlockId :: latest ( ) ) . await ?;
4444 let result = U256 :: from_str ( & response. to_string ( ) ) ?;
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ async fn main() -> Result<()> {
3131 // Build a transaction to send 100 wei from Alice to Bob.
3232 let tx = TransactionRequest :: default ( )
3333 . with_from ( alice)
34- . with_to ( bob. into ( ) )
34+ . with_to ( bob)
3535 . with_nonce ( 0 )
3636 . with_chain_id ( anvil. chain_id ( ) )
3737 . with_value ( U256 :: from ( 100 ) )
Original file line number Diff line number Diff line change @@ -22,10 +22,8 @@ async fn main() -> Result<()> {
2222 let bob = address ! ( "70997970C51812dc3A010C7d01b50e0d17dc79C8" ) ;
2323
2424 // Build a transaction to send 100 wei from Alice to Bob.
25- let tx = TransactionRequest :: default ( )
26- . with_from ( alice)
27- . with_to ( bob. into ( ) )
28- . with_value ( U256 :: from ( 100 ) ) ;
25+ let tx =
26+ TransactionRequest :: default ( ) . with_from ( alice) . with_to ( bob) . with_value ( U256 :: from ( 100 ) ) ;
2927
3028 // Trace the transaction on top of the latest block.
3129 let trace_type = [ TraceType :: Trace ] ;
Original file line number Diff line number Diff line change @@ -24,10 +24,8 @@ async fn main() -> Result<()> {
2424 let bob = anvil. addresses ( ) [ 1 ] ;
2525
2626 // Build a transaction to send 100 wei from Alice to Bob.
27- let tx = TransactionRequest :: default ( )
28- . with_from ( alice)
29- . with_to ( bob. into ( ) )
30- . with_value ( U256 :: from ( 100 ) ) ;
27+ let tx =
28+ TransactionRequest :: default ( ) . with_from ( alice) . with_to ( bob) . with_value ( U256 :: from ( 100 ) ) ;
3129
3230 // Send the transaction and wait for the receipt.
3331 let pending_tx = provider. send_transaction ( tx) . await ?;
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ async fn main() -> Result<()> {
3636 // Build a transaction to send 100 wei to Vitalik from Alice.
3737 let tx = TransactionRequest :: default ( )
3838 . with_from ( alice)
39- . with_to ( address ! ( "d8dA6BF26964aF9D7eEd9e03E53415D37aA96045" ) . into ( ) )
39+ . with_to ( address ! ( "d8dA6BF26964aF9D7eEd9e03E53415D37aA96045" ) )
4040 . with_value ( U256 :: from ( 100 ) ) ;
4141
4242 // Send the transaction and wait for the receipt.
You can’t perform that action at this time.
0 commit comments