Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
yagopv committed Oct 6, 2023
1 parent 0c175b6 commit 311f9ee
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/protocol-kit/src/Safe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1267,20 +1267,15 @@ class Safe {
* @returns The Safe signature
*/
async signMessageHash(hash: string, isSmartContract = false): Promise<SafeSignature> {
let signature
const safeMessageHash = await this.getMessageHash(hash)
const signature = await generateSignature(this.#ethAdapter, safeMessageHash)

if (isSmartContract) {
const signerSafeMessageHash = await this.getMessageHash(hash)
signature = await generateSignature(this.#ethAdapter, signerSafeMessageHash)
const safeAddress = await this.getAddress()

return new EthSafeSignature(safeAddress, signature.data, isSmartContract)
}

const safeMessageHash = await this.getMessageHash(hash)

signature = await generateSignature(this.#ethAdapter, safeMessageHash)

return signature
}

Expand Down

0 comments on commit 311f9ee

Please sign in to comment.