Skip to content

Commit f061af2

Browse files
fix: signEIP712 must accept any structure that implements EIP712Hashable
1 parent 08daa88 commit f061af2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/web3swift/Web3/Web3+Signing.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public struct Web3Signer {
3131
return compressedSignature
3232
}
3333

34-
public static func signEIP712(safeTx: SafeTx,
34+
public static func signEIP712(_ eip712Hashable: EIP712Hashable,
3535
keystore: BIP32Keystore,
3636
verifyingContract: EthereumAddress,
3737
account: EthereumAddress,
@@ -41,7 +41,7 @@ public struct Web3Signer {
4141
let domainSeparator: EIP712DomainHashable = EIP712Domain(chainId: chainId, verifyingContract: verifyingContract)
4242

4343
let password = password ?? ""
44-
let hash = try eip712encode(domainSeparator: domainSeparator, message: safeTx)
44+
let hash = try eip712encode(domainSeparator: domainSeparator, message: eip712Hashable)
4545

4646
guard let signature = try Web3Signer.signPersonalMessage(hash, keystore: keystore, account: account, password: password) else {
4747
throw Web3Error.dataError

0 commit comments

Comments
 (0)