chore: use vec for encoding (#9442)

This commit is contained in:
Matthias Seitz
2024-07-11 13:46:51 +02:00
committed by GitHub
parent a1e93b79aa
commit 6e70bab36e

View File

@ -2,7 +2,6 @@ use super::access_list::AccessList;
use crate::{keccak256, Bytes, ChainId, Signature, TxKind, TxType, B256, U256};
use alloy_eips::eip7702::SignedAuthorization;
use alloy_rlp::{length_of_length, Decodable, Encodable, Header};
use bytes::BytesMut;
use reth_codecs::{main_codec, Compact};
use std::mem;
@ -233,7 +232,7 @@ impl TxEip7702 {
/// Outputs the signature hash of the transaction by first encoding without a signature, then
/// hashing.
pub(crate) fn signature_hash(&self) -> B256 {
let mut buf = BytesMut::with_capacity(self.payload_len_for_signature());
let mut buf = Vec::with_capacity(self.payload_len_for_signature());
self.encode_for_signing(&mut buf);
keccak256(&buf)
}