Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 7e57cbe

Browse files
fix: tests
1 parent 477d992 commit 7e57cbe

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

packages/web3/test/integration/web3-plugin-add-tx.test.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
1818
/* eslint-disable @typescript-eslint/no-magic-numbers */
1919

2020
import { Transaction, Web3Account } from 'web3-eth-accounts';
21+
import { transactionSchema } from 'web3-eth';
2122
import { SupportedProviders, Web3, Web3PluginBase } from '../../src';
2223
import {
2324
createAccount,
@@ -51,6 +52,14 @@ describe('Add New Tx as a Plugin', () => {
5152
});
5253
it('should receive correct type of tx', async () => {
5354
web3.registerPlugin(new Eip4844Plugin());
55+
web3.config.customTransactionSchema = {
56+
type: 'object',
57+
properties: {
58+
...transactionSchema.properties,
59+
customField: { format: 'string' },
60+
},
61+
};
62+
web3.eth.config.customTransactionSchema = web3.config.customTransactionSchema;
5463
const tx = {
5564
from: account1.address,
5665
to: account2.address,
@@ -70,8 +79,9 @@ describe('Add New Tx as a Plugin', () => {
7079
});
7180
},
7281
);
73-
expect(Number((await waitForEvent).type)).toBe(TRANSACTION_TYPE);
74-
expect(BigInt((await waitForEvent).customField)).toBe(BigInt(42));
82+
const { type, customField } = await waitForEvent;
83+
expect(Number(type)).toBe(TRANSACTION_TYPE);
84+
expect(BigInt(customField)).toBe(BigInt(42));
7585
await expect(sub).rejects.toThrow();
7686
});
7787
});

0 commit comments

Comments
 (0)