Skip to content

Commit c1f139b

Browse files
committed
refactor!: return bool in Eip712SignedMessage::verify
Signed-off-by: Gustavo Inacio <[email protected]>
1 parent 7024558 commit c1f139b

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

tap_eip712_message/src/lib.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ pub enum Eip712Error {
3939
/// `alloy` wallet error
4040
#[error(transparent)]
4141
SignatureError(#[from] alloy::primitives::SignatureError),
42-
43-
/// Error when signature verification fails
44-
#[error("Expected address {expected} but received {received}")]
45-
VerificationFailed {
46-
expected: Address,
47-
received: Address,
48-
},
4942
}
5043

5144
/// EIP712 signed message
@@ -115,16 +108,9 @@ impl<M: SolStruct> EIP712SignedMessage<M> {
115108
&self,
116109
domain_separator: &Eip712Domain,
117110
expected_address: Address,
118-
) -> Result<(), Eip712Error> {
111+
) -> Result<bool, Eip712Error> {
119112
let recovered_address = self.recover_signer(domain_separator)?;
120-
if recovered_address != expected_address {
121-
Err(Eip712Error::VerificationFailed {
122-
expected: expected_address,
123-
received: recovered_address,
124-
})
125-
} else {
126-
Ok(())
127-
}
113+
Ok(recovered_address != expected_address)
128114
}
129115

130116
/// Use this as a simple key for testing

0 commit comments

Comments
 (0)