Skip to content

Commit 7ebda00

Browse files
committed
refactor: remove hash function from eip 712 message
Signed-off-by: Gustavo Inacio <[email protected]>
1 parent 1b1d19c commit 7ebda00

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

tap_core/src/eip_712_signed_message.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ impl<M: SolStruct> EIP712SignedMessage<M> {
5151
/// Returns [`Error::InvalidSignature`] if the signature is not valid with provided `verifying_key`
5252
///
5353
pub fn verify(&self, domain_separator: &Eip712Domain, expected_address: Address) -> Result<()> {
54-
let recovery_message_hash = self.hash(domain_separator);
54+
let recovery_message_hash: [u8; 32] =
55+
self.message.eip712_signing_hash(domain_separator).into();
5556
let expected_address: [u8; 20] = expected_address.into();
5657

5758
self.signature
@@ -62,10 +63,4 @@ impl<M: SolStruct> EIP712SignedMessage<M> {
6263
pub fn unique_hash(&self) -> MessageId {
6364
MessageId(self.message.eip712_hash_struct().into())
6465
}
65-
66-
fn hash(&self, domain_separator: &Eip712Domain) -> [u8; 32] {
67-
let recovery_message_hash: [u8; 32] =
68-
self.message.eip712_signing_hash(domain_separator).into();
69-
recovery_message_hash
70-
}
7166
}

0 commit comments

Comments
 (0)