Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: safe #527

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions tests/paymaster/write.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading