From f43a76e26b305897a5d3dfe3e14de1bb8119a645 Mon Sep 17 00:00:00 2001 From: Nadezhda Popova Date: Fri, 13 Dec 2024 13:53:17 +0200 Subject: [PATCH] fixup! fixup! fixup! fixup! fixup! test: add test for receivers account precheck Signed-off-by: Nadezhda Popova --- packages/relay/src/lib/precheck.ts | 2 +- packages/relay/tests/lib/eth/eth_sendRawTransaction.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/relay/src/lib/precheck.ts b/packages/relay/src/lib/precheck.ts index f0c313b15e..27a0e8ac54 100644 --- a/packages/relay/src/lib/precheck.ts +++ b/packages/relay/src/lib/precheck.ts @@ -388,7 +388,7 @@ export class Precheck { const verifyAccount = await this.mirrorNodeClient.getAccount(tx.to, requestDetails); // When `receiver_sig_required` is set to true, the receiver's account must sign all incoming transactions. - if (verifyAccount !== null && verifyAccount.receiver_sig_required === true) { + if (verifyAccount && verifyAccount.receiver_sig_required) { throw predefined.RECEIVER_SIGNATURE_ENABLED; } } diff --git a/packages/relay/tests/lib/eth/eth_sendRawTransaction.spec.ts b/packages/relay/tests/lib/eth/eth_sendRawTransaction.spec.ts index dad1335b35..28970ef870 100644 --- a/packages/relay/tests/lib/eth/eth_sendRawTransaction.spec.ts +++ b/packages/relay/tests/lib/eth/eth_sendRawTransaction.spec.ts @@ -131,7 +131,7 @@ describe('@ethSendRawTransaction eth_sendRawTransaction spec', async function () const RECEIVER_ACCOUNT_RES = { account: ACCOUNT_ADDRESS_1, balance: { - balance: Hbar.from(100_000_000_000, HbarUnit.Hbar).to(HbarUnit.Tinybar), + balance: Hbar.from(1, HbarUnit.Hbar).to(HbarUnit.Tinybar), }, receiver_sig_required: false, };