Fixed unused imports and variables
This commit is contained in:
@@ -68,7 +68,7 @@ impl EvmClient {
|
||||
mut tx: provider::Transaction,
|
||||
signer: &dyn crate::signer::Signer,
|
||||
) -> Result<ethers_core::types::H256, EvmError> {
|
||||
use ethers_core::types::{U256, H256, Bytes, Address};
|
||||
use ethers_core::types::{U256, H256};
|
||||
use std::str::FromStr;
|
||||
use serde_json::json;
|
||||
use crate::provider::{send_rpc, parse_signature_rs_v};
|
||||
@@ -131,7 +131,7 @@ impl EvmClient {
|
||||
|
||||
// 3. Sign the RLP-encoded unsigned transaction
|
||||
let sig = signer.sign(&rlp_unsigned).await?;
|
||||
let (r, s, v) = parse_signature_rs_v(&sig, tx.chain_id.unwrap()).ok_or_else(|| EvmError::Signing("Invalid signature format".to_string()))?;
|
||||
let (r, s, _v) = parse_signature_rs_v(&sig, tx.chain_id.unwrap()).ok_or_else(|| EvmError::Signing("Invalid signature format".to_string()))?;
|
||||
|
||||
// 4. RLP encode signed transaction (EIP-155)
|
||||
use rlp::RlpStream;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//! Rhai bindings for EVM Client module
|
||||
//! Provides a single source of truth for scripting integration for EVM actions.
|
||||
|
||||
use rhai::{Engine, Map};
|
||||
use rhai::Engine;
|
||||
pub use crate::EvmClient; // Ensure EvmClient is public and defined in lib.rs
|
||||
|
||||
/// Register EVM Client APIs with the Rhai scripting engine.
|
||||
@@ -25,7 +25,7 @@ pub fn register_rhai_api(engine: &mut Engine, evm_client: std::sync::Arc<EvmClie
|
||||
engine.register_type::<RhaiEvmClient>();
|
||||
engine.register_fn("get_balance", RhaiEvmClient::get_balance);
|
||||
// Register instance for scripts
|
||||
let rhai_ec = RhaiEvmClient { inner: evm_client.clone() };
|
||||
let _rhai_ec = RhaiEvmClient { inner: evm_client.clone() };
|
||||
// Rhai does not support register_global_constant; pass the client as a parameter or use module scope.
|
||||
}
|
||||
|
||||
|
@@ -2,7 +2,6 @@
|
||||
//! These use block_on for native, and should be adapted for WASM as needed.
|
||||
|
||||
use crate::EvmClient;
|
||||
use rhai::Map;
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
use tokio::runtime::Handle;
|
||||
|
@@ -37,7 +37,6 @@
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[tokio::test]
|
||||
async fn test_get_balance_real_address() {
|
||||
use ethers_core::types::{Address, U256};
|
||||
use evm_client::provider::get_balance;
|
||||
|
||||
// Vitalik's address
|
||||
|
Reference in New Issue
Block a user