mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: convert hash field to OnceLock<TxHash> on TransactionSigned (#12596)
Co-authored-by: joshieDo <93316087+joshieDo@users.noreply.github.com>
This commit is contained in:
@ -551,7 +551,7 @@ impl<TX: DbTx + 'static, N: NodeTypes> DatabaseProvider<TX, N> {
|
||||
.map(|tx| match transaction_kind {
|
||||
TransactionVariant::NoHash => TransactionSigned {
|
||||
// Caller explicitly asked for no hash, so we don't calculate it
|
||||
hash: B256::ZERO,
|
||||
hash: Default::default(),
|
||||
signature: tx.signature,
|
||||
transaction: tx.transaction,
|
||||
},
|
||||
@ -1500,7 +1500,7 @@ impl<TX: DbTx + 'static, N: NodeTypes<ChainSpec: EthereumHardforks>> Transaction
|
||||
fn transaction_by_hash(&self, hash: TxHash) -> ProviderResult<Option<TransactionSigned>> {
|
||||
if let Some(id) = self.transaction_id(hash)? {
|
||||
Ok(self.transaction_by_id_no_hash(id)?.map(|tx| TransactionSigned {
|
||||
hash,
|
||||
hash: hash.into(),
|
||||
signature: tx.signature,
|
||||
transaction: tx.transaction,
|
||||
}))
|
||||
@ -1518,7 +1518,7 @@ impl<TX: DbTx + 'static, N: NodeTypes<ChainSpec: EthereumHardforks>> Transaction
|
||||
if let Some(transaction_id) = self.transaction_id(tx_hash)? {
|
||||
if let Some(tx) = self.transaction_by_id_no_hash(transaction_id)? {
|
||||
let transaction = TransactionSigned {
|
||||
hash: tx_hash,
|
||||
hash: tx_hash.into(),
|
||||
signature: tx.signature,
|
||||
transaction: tx.transaction,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user