mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: Support erc20 system tx from address
This commit is contained in:
@ -23,7 +23,7 @@ use reth_execution_types::BlockExecutionResult;
|
||||
use reth_primitives::{
|
||||
EthPrimitives, Receipt, Recovered, RecoveredBlock, SealedBlock, TransactionSigned,
|
||||
};
|
||||
use reth_primitives_traits::{transaction::signed::HL_SYSTEM_TX_FROM_ADDR, NodePrimitives};
|
||||
use reth_primitives_traits::{transaction::signed::is_impersonated_tx, NodePrimitives};
|
||||
use reth_revm::{context_interface::result::ResultAndState, db::State, DatabaseCommit};
|
||||
|
||||
/// Factory for [`EthExecutionStrategy`].
|
||||
@ -191,7 +191,7 @@ where
|
||||
}
|
||||
|
||||
let hash = tx.hash();
|
||||
let is_system_transaction = tx.signer() == HL_SYSTEM_TX_FROM_ADDR;
|
||||
let is_system_transaction = is_impersonated_tx(tx.signature(), tx.gas_price()).is_some();
|
||||
|
||||
// Execute transaction.
|
||||
let result_and_state =
|
||||
|
||||
@ -21,7 +21,7 @@ use reth_primitives_traits::{
|
||||
sync::OnceLock,
|
||||
transaction::{
|
||||
error::TransactionConversionError,
|
||||
signed::{is_impersonated_tx, RecoveryError, HL_SYSTEM_TX_FROM_ADDR},
|
||||
signed::{is_impersonated_tx, RecoveryError},
|
||||
},
|
||||
InMemorySize, SignedTransaction,
|
||||
};
|
||||
@ -836,8 +836,8 @@ impl SignedTransaction for TransactionSigned {
|
||||
|
||||
fn recover_signer(&self) -> Result<Address, RecoveryError> {
|
||||
let signature = self.signature();
|
||||
if is_impersonated_tx(signature, self.gas_price()) {
|
||||
return Ok(HL_SYSTEM_TX_FROM_ADDR);
|
||||
if let Some(address) = is_impersonated_tx(signature, self.gas_price()) {
|
||||
return Ok(address);
|
||||
}
|
||||
let signature_hash = self.signature_hash();
|
||||
recover_signer(&self.signature, signature_hash)
|
||||
|
||||
Reference in New Issue
Block a user