diff --git a/src/actions/public/estimateFeesPerGas.test.ts b/src/actions/public/estimateFeesPerGas.test.ts index da36b25..59c694e 100644 --- a/src/actions/public/estimateFeesPerGas.test.ts +++ b/src/actions/public/estimateFeesPerGas.test.ts @@ -23,9 +23,7 @@ test('default', async () => { const { maxFeePerGas, maxPriorityFeePerGas } = await estimateFeesPerGas(client) - expect(maxFeePerGas).toBe( - (block.baseFeePerGas! * 120n) / 100n + maxPriorityFeePerGas, - ) + expect(maxFeePerGas).toBe(block.baseFeePerGas! + maxPriorityFeePerGas) expect(maxPriorityFeePerGas).toBeDefined() }) @@ -37,9 +35,7 @@ describe('internal_estimateFeesPerGas', () => { block: { baseFeePerGas } as any, request: { maxPriorityFeePerGas } as any, }) - expect(maxFeePerGas).toBe( - (baseFeePerGas * 120n) / 100n + maxPriorityFeePerGas, - ) + expect(maxFeePerGas).toBe(baseFeePerGas + maxPriorityFeePerGas) }) test('maxFeePerGas request args', async () => { diff --git a/src/actions/public/getAccountPendingInfo.test.ts b/src/actions/public/getAccountPendingInfo.test.ts index 2d68f79..7f654a0 100644 --- a/src/actions/public/getAccountPendingInfo.test.ts +++ b/src/actions/public/getAccountPendingInfo.test.ts @@ -51,7 +51,7 @@ test('with tx', async () => { ).toMatchInlineSnapshot(` { "localNonce": 0n, - "nextPendingTx": 45869683219349642423684220173494286329207765601632196501992601067641417510919n, + "nextPendingTx": 34993918322552798075736612473029692312583248690501399920505890097382783775166n, "pendingCount": 1n, "pendingNonce": 0n, } @@ -67,7 +67,7 @@ test('with tx', async () => { ).toMatchInlineSnapshot(` { "localNonce": 0n, - "nextPendingTx": 45869683219349642423684220173494286329207765601632196501992601067641417510919n, + "nextPendingTx": 34993918322552798075736612473029692312583248690501399920505890097382783775166n, "pendingCount": 2n, "pendingNonce": 0n, } @@ -84,7 +84,7 @@ test('with tx', async () => { ).toMatchInlineSnapshot(` { "localNonce": 0n, - "nextPendingTx": 45869683219349642423684220173494286329207765601632196501992601067641417510919n, + "nextPendingTx": 34993918322552798075736612473029692312583248690501399920505890097382783775166n, "pendingCount": 3n, "pendingNonce": 0n, } diff --git a/src/actions/public/getAccountPendingTransactions.test.ts b/src/actions/public/getAccountPendingTransactions.test.ts index 563b6c4..5c084d5 100644 --- a/src/actions/public/getAccountPendingTransactions.test.ts +++ b/src/actions/public/getAccountPendingTransactions.test.ts @@ -26,97 +26,24 @@ afterAll(async () => { }) test('default', async () => { - expect( - await getAccountPendingTransactions(client, { - address: sourceAccount.address, - }), - ).toMatchInlineSnapshot(` - { - "firstTxStatus": "ready", - "pendingCount": 2n, - "pendingTransactions": [ - { - "blockHash": null, - "chainId": 201029, - "contractCreated": null, - "data": "0x", - "epochHeight": 0n, - "from": "NET201029:TYPE.USER:AAM085E78N2F8HY6C02U5TZ7VBJ6XREEF6A6STZJ3X", - "gas": 21000n, - "gasPrice": 1200000000n, - "hash": "0xd96c3e5b62e7396971c9e88b52aee75962f485a795d250b65dcfa211d4fec1b5", - "nonce": 0, - "r": "0x3c9e64f061a7e902ba8fc8d68d71a3122cac15d32982792e6c6ade300059587f", - "s": "0x7ca8d1618c58bb0bbf94846e442891ac00d717121f30393470770511db8d7e3a", - "status": null, - "storageLimit": 0n, - "to": "NET201029:TYPE.USER:AAM085E78N2F8HY6C02U5TZ7VBJ6XREEF6A6STZJ3X", - "transactionIndex": null, - "type": "legacy", - "v": 1n, - "value": 10000000000000000n, - }, - { - "blockHash": null, - "chainId": 201029, - "contractCreated": null, - "data": "0x", - "epochHeight": 0n, - "from": "NET201029:TYPE.USER:AAM085E78N2F8HY6C02U5TZ7VBJ6XREEF6A6STZJ3X", - "gas": 21000n, - "gasPrice": 1200000000n, - "hash": "0x4b05eec3ebaa8ad200bded2d2d68754fa7e6c0a568bd91050b35236e2a97d76d", - "nonce": 1, - "r": "0x6cefd6d8bf9d2bc760ade644d4fa57a8105c2d5100e83c5aa240896de7e67365", - "s": "0x342d80c056de4de57b033700c749f9dadfc407b063441b58f9b6eea02bb8e3d9", - "status": null, - "storageLimit": 0n, - "to": "NET201029:TYPE.USER:AAM085E78N2F8HY6C02U5TZ7VBJ6XREEF6A6STZJ3X", - "transactionIndex": null, - "type": "legacy", - "v": 0n, - "value": 10000000000000000n, - }, - ], - } - `) + const pendingTransactions = await getAccountPendingTransactions(client, { + address: sourceAccount.address, + }) + + expect(pendingTransactions.pendingCount).toBe(2n) + expect(pendingTransactions.firstTxStatus).toBe('ready') + expect(pendingTransactions.pendingTransactions.length).toBe(2) }) test('with nonce', async () => { - expect( - await getAccountPendingTransactions(client, { - address: sourceAccount.address, - nonce: 1, - }), - ).toMatchInlineSnapshot(` - { - "firstTxStatus": "ready", - "pendingCount": 1n, - "pendingTransactions": [ - { - "blockHash": null, - "chainId": 201029, - "contractCreated": null, - "data": "0x", - "epochHeight": 0n, - "from": "NET201029:TYPE.USER:AAM085E78N2F8HY6C02U5TZ7VBJ6XREEF6A6STZJ3X", - "gas": 21000n, - "gasPrice": 1200000000n, - "hash": "0x4b05eec3ebaa8ad200bded2d2d68754fa7e6c0a568bd91050b35236e2a97d76d", - "nonce": 1, - "r": "0x6cefd6d8bf9d2bc760ade644d4fa57a8105c2d5100e83c5aa240896de7e67365", - "s": "0x342d80c056de4de57b033700c749f9dadfc407b063441b58f9b6eea02bb8e3d9", - "status": null, - "storageLimit": 0n, - "to": "NET201029:TYPE.USER:AAM085E78N2F8HY6C02U5TZ7VBJ6XREEF6A6STZJ3X", - "transactionIndex": null, - "type": "legacy", - "v": 0n, - "value": 10000000000000000n, - }, - ], - } - `) + const pendingTransactions = await getAccountPendingTransactions(client, { + address: sourceAccount.address, + nonce: 1, + }) + + expect(pendingTransactions.pendingCount).toBe(1n) + expect(pendingTransactions.firstTxStatus).toBe('ready') + expect(pendingTransactions.pendingTransactions.length).toBe(1) expect( await getAccountPendingTransactions(client, { @@ -133,94 +60,21 @@ test('with nonce', async () => { }) test('with limit', async () => { - expect( - await getAccountPendingTransactions(client, { - address: sourceAccount.address, - limit: 1, - }), - ).toMatchInlineSnapshot(` - { - "firstTxStatus": "ready", - "pendingCount": 2n, - "pendingTransactions": [ - { - "blockHash": null, - "chainId": 201029, - "contractCreated": null, - "data": "0x", - "epochHeight": 0n, - "from": "NET201029:TYPE.USER:AAM085E78N2F8HY6C02U5TZ7VBJ6XREEF6A6STZJ3X", - "gas": 21000n, - "gasPrice": 1200000000n, - "hash": "0xd96c3e5b62e7396971c9e88b52aee75962f485a795d250b65dcfa211d4fec1b5", - "nonce": 0, - "r": "0x3c9e64f061a7e902ba8fc8d68d71a3122cac15d32982792e6c6ade300059587f", - "s": "0x7ca8d1618c58bb0bbf94846e442891ac00d717121f30393470770511db8d7e3a", - "status": null, - "storageLimit": 0n, - "to": "NET201029:TYPE.USER:AAM085E78N2F8HY6C02U5TZ7VBJ6XREEF6A6STZJ3X", - "transactionIndex": null, - "type": "legacy", - "v": 1n, - "value": 10000000000000000n, - }, - ], - } - `) + const pendingTransactions = await getAccountPendingTransactions(client, { + address: sourceAccount.address, + limit: 1, + }) - expect( - await getAccountPendingTransactions(client, { - address: sourceAccount.address, - limit: 999, - }), - ).toMatchInlineSnapshot(` - { - "firstTxStatus": "ready", - "pendingCount": 2n, - "pendingTransactions": [ - { - "blockHash": null, - "chainId": 201029, - "contractCreated": null, - "data": "0x", - "epochHeight": 0n, - "from": "NET201029:TYPE.USER:AAM085E78N2F8HY6C02U5TZ7VBJ6XREEF6A6STZJ3X", - "gas": 21000n, - "gasPrice": 1200000000n, - "hash": "0xd96c3e5b62e7396971c9e88b52aee75962f485a795d250b65dcfa211d4fec1b5", - "nonce": 0, - "r": "0x3c9e64f061a7e902ba8fc8d68d71a3122cac15d32982792e6c6ade300059587f", - "s": "0x7ca8d1618c58bb0bbf94846e442891ac00d717121f30393470770511db8d7e3a", - "status": null, - "storageLimit": 0n, - "to": "NET201029:TYPE.USER:AAM085E78N2F8HY6C02U5TZ7VBJ6XREEF6A6STZJ3X", - "transactionIndex": null, - "type": "legacy", - "v": 1n, - "value": 10000000000000000n, - }, - { - "blockHash": null, - "chainId": 201029, - "contractCreated": null, - "data": "0x", - "epochHeight": 0n, - "from": "NET201029:TYPE.USER:AAM085E78N2F8HY6C02U5TZ7VBJ6XREEF6A6STZJ3X", - "gas": 21000n, - "gasPrice": 1200000000n, - "hash": "0x4b05eec3ebaa8ad200bded2d2d68754fa7e6c0a568bd91050b35236e2a97d76d", - "nonce": 1, - "r": "0x6cefd6d8bf9d2bc760ade644d4fa57a8105c2d5100e83c5aa240896de7e67365", - "s": "0x342d80c056de4de57b033700c749f9dadfc407b063441b58f9b6eea02bb8e3d9", - "status": null, - "storageLimit": 0n, - "to": "NET201029:TYPE.USER:AAM085E78N2F8HY6C02U5TZ7VBJ6XREEF6A6STZJ3X", - "transactionIndex": null, - "type": "legacy", - "v": 0n, - "value": 10000000000000000n, - }, - ], - } - `) + expect(pendingTransactions.pendingCount).toBe(2n) + expect(pendingTransactions.firstTxStatus).toBe('ready') + expect(pendingTransactions.pendingTransactions.length).toBe(1) + + const pendingTransactions2 = await getAccountPendingTransactions(client, { + address: sourceAccount.address, + limit: 999, + }) + + expect(pendingTransactions2.pendingCount).toBe(2n) + expect(pendingTransactions2.firstTxStatus).toBe('ready') + expect(pendingTransactions2.pendingTransactions.length).toBe(2) }) diff --git a/src/actions/public/getBalance.test.ts b/src/actions/public/getBalance.test.ts index c51f018..be656c5 100644 --- a/src/actions/public/getBalance.test.ts +++ b/src/actions/public/getBalance.test.ts @@ -56,7 +56,7 @@ test('gets balance when transaction', async () => { expect( await getBalance(client, { address: sourceAccount.address }), - ).toMatchInlineSnapshot('9989999974800000000000n') + ).toMatchInlineSnapshot('9989999979000000000000n') expect( await getBalance(client, { address: targetAccount.address }), diff --git a/src/actions/public/getTransaction.test.ts b/src/actions/public/getTransaction.test.ts index 229da95..f118e01 100644 --- a/src/actions/public/getTransaction.test.ts +++ b/src/actions/public/getTransaction.test.ts @@ -58,14 +58,14 @@ test('default', async () => { `"NET201029:TYPE.USER:AAM085E78N2F8HY6C02U5TZ7VBJ6XREEF6A6STZJ3X"`, ) expect(tx.hash).toMatchInlineSnapshot( - `"0x2e277f2031cb9dcb57d174b99e1f33f4f0141f5bd2e6ddbfa9675ddbedff164b"`, + `"0x2544af3be3c64246d01e2c38372f34135a55baefa90477d5e70ab2296065416e"`, ) expect(tx.nonce).toMatchInlineSnapshot('0') expect(tx.r).toMatchInlineSnapshot( - `"0xcf3f05859dd82398bec754f12f8ba4bf60cf9d98ed6d2a1397a919fd5e69ccc2"`, + `"0xa3df516d1c0134073e2247d0e4004bcf9562f4cd0cba705ca04209d816c5b47c"`, ) expect(tx.s).toMatchInlineSnapshot( - `"0x491b9484ef00f5e7f4b2e7bd687ccbba5d3b2c7b3bc531fb50468dae9f4e57d2"`, + `"0x53ad709a9e8a35428c85de544d964bef07f15c20f0516c523e8aa5565eb27058"`, ) }) diff --git a/src/actions/public/getTransactionReceipt.test.ts b/src/actions/public/getTransactionReceipt.test.ts index 3b4d3b5..879e4d1 100644 --- a/src/actions/public/getTransactionReceipt.test.ts +++ b/src/actions/public/getTransactionReceipt.test.ts @@ -66,7 +66,7 @@ test('default', async () => { ) expect(receipt.transactionHash).toMatchInlineSnapshot( - `"0x2e277f2031cb9dcb57d174b99e1f33f4f0141f5bd2e6ddbfa9675ddbedff164b"`, + `"0x2544af3be3c64246d01e2c38372f34135a55baefa90477d5e70ab2296065416e"`, ) expect(receipt.epochNumber).toMatchInlineSnapshot('1n') diff --git a/src/actions/wallet/prepareTransactionRequest.test.ts b/src/actions/wallet/prepareTransactionRequest.test.ts index 8304490..9f2a82f 100644 --- a/src/actions/wallet/prepareTransactionRequest.test.ts +++ b/src/actions/wallet/prepareTransactionRequest.test.ts @@ -44,7 +44,7 @@ test('default', async () => { "epochHeight": 0n, "from": "net201029:aam085e78n2f8hy6c02u5tz7vbj6xreef6a6stzj3x", "gas": 21000n, - "gasPrice": 1200000000n, + "gasPrice": 1000000000n, "storageLimit": 0n, "to": "net201029:aam085e78n2f8hy6c02u5tz7vbj6xreef6a6stzj3x", "type": "legacy", diff --git a/src/clients/createWalletClient.test.ts b/src/clients/createWalletClient.test.ts index 2318c47..5e4e261 100644 --- a/src/clients/createWalletClient.test.ts +++ b/src/clients/createWalletClient.test.ts @@ -388,7 +388,6 @@ describe('args: transport', () => { "getConfirmationRiskByHash": [Function], "getContractEvents": [Function], "getCurrentSyncPhase": [Function], - "getDepositList": [Function], "getEpochNumber": [Function], "getEpochReceipts": [Function], diff --git a/src/utils/abi/encodeAbiParameters.test.ts b/src/utils/abi/encodeAbiParameters.test.ts index 3faa9f2..541267b 100644 --- a/src/utils/abi/encodeAbiParameters.test.ts +++ b/src/utils/abi/encodeAbiParameters.test.ts @@ -346,7 +346,7 @@ describe('static', () => { ` [AbiEncodingBytesSizeMismatchError: Size of bytes "0x0000000000000000000000000000000000000000000000000000000000000000000000000123456789abcdef" (bytes44) does not match expected size (bytes8). - Version: viem@2.21.32] + Version: viem@2.21.43] `, ) }) @@ -386,7 +386,7 @@ describe('static', () => { ` [AbiEncodingBytesSizeMismatchError: Size of bytes "0x000000000000000000000000000000000000000000000000000000000000000420" (bytes33) does not match expected size (bytes16). - Version: viem@2.21.32] + Version: viem@2.21.43] `, ) })