Skip to content

Commit faf89cc

Browse files
committed
chore: test added isGasFeeSponsored flag check
1 parent 0a5a3ad commit faf89cc

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

packages/transaction-controller/src/utils/batch.test.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,33 @@ describe('Batch Utils', () => {
810810
},
811811
);
812812

813+
it.each([true, false])(
814+
'passes isGasFeeSponsored flag (%s) through to addTransaction when provided (EIP-7702 path)',
815+
async (isGasFeeSponsored) => {
816+
isAccountUpgradedToEIP7702Mock.mockResolvedValueOnce({
817+
delegationAddress: undefined,
818+
isSupported: true,
819+
});
820+
821+
addTransactionMock.mockResolvedValueOnce({
822+
transactionMeta: TRANSACTION_META_MOCK,
823+
result: Promise.resolve(''),
824+
});
825+
826+
request.request.isGasFeeSponsored = isGasFeeSponsored;
827+
828+
await addTransactionBatch(request);
829+
830+
expect(addTransactionMock).toHaveBeenCalledTimes(1);
831+
expect(addTransactionMock).toHaveBeenCalledWith(
832+
expect.any(Object),
833+
expect.objectContaining({
834+
isGasFeeSponsored,
835+
}),
836+
);
837+
},
838+
);
839+
813840
describe('validates security', () => {
814841
it('using transaction params', async () => {
815842
isAccountUpgradedToEIP7702Mock.mockResolvedValueOnce({

0 commit comments

Comments
 (0)