From 54fa020e9ec90b1211a2cb0a0dcd8f9379f4bb3c Mon Sep 17 00:00:00 2001 From: Joe Pegler Date: Mon, 1 Jul 2024 17:02:46 +0100 Subject: [PATCH] test: safe chore: lint --- tests/paymaster/write.test.ts | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/paymaster/write.test.ts b/tests/paymaster/write.test.ts index fa63a82e9..acbc0569c 100644 --- a/tests/paymaster/write.test.ts +++ b/tests/paymaster/write.test.ts @@ -259,6 +259,40 @@ describe("Paymaster:Write", () => { ) }, 60000) + test("should check sending txs with paymasterServiceData.smartAccountInfo set to SAFE", async () => { + await topUp(smartAccountAddress, BigInt(1000000000000000000)) + const balanceOfRecipient = await checkBalance(recipient) + + const { wait } = await smartAccount.sendTransaction( + { + to: recipient, + value: 1n + }, + { + nonceOptions, + paymasterServiceData: { + mode: PaymasterMode.SPONSORED, + smartAccountInfo: { + name: "SAFE", + version: "1.4.1" + } + } + } + ) + + const { + receipt: { transactionHash }, + success + } = await wait() + + expect(success).toBe("true") + + const newBalanceOfRecipient = await checkBalance(recipient) + + expect(transactionHash).toBeTruthy() + expect(newBalanceOfRecipient - balanceOfRecipient).toBe(1n) + }, 60000) + test("should withdraw all native token", async () => { await nonZeroBalance(smartAccountAddress) const balanceOfSABefore = await checkBalance(smartAccountAddress)