From 311f9ee85cfc52cf4195d1853862977dd0476010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yago=20P=C3=A9rez=20V=C3=A1zquez?= Date: Fri, 6 Oct 2023 22:42:05 +0200 Subject: [PATCH] Simplify --- packages/protocol-kit/src/Safe.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/protocol-kit/src/Safe.ts b/packages/protocol-kit/src/Safe.ts index 1bf279225..9dcfb8f74 100644 --- a/packages/protocol-kit/src/Safe.ts +++ b/packages/protocol-kit/src/Safe.ts @@ -1267,20 +1267,15 @@ class Safe { * @returns The Safe signature */ async signMessageHash(hash: string, isSmartContract = false): Promise { - 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 }