mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(primitives): use with_capacity for sighash (#108)
This commit is contained in:
@ -130,7 +130,7 @@ impl Transaction {
|
||||
/// Heavy operation that return hash over rlp encoded transaction.
|
||||
/// It is only used for signature signing.
|
||||
pub fn signature_hash(&self) -> TxHash {
|
||||
let mut encoded = vec![];
|
||||
let mut encoded = Vec::with_capacity(self.length());
|
||||
self.encode(&mut encoded);
|
||||
keccak256(encoded).into()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user