Skip to content

Commit 28d28f6

Browse files
jxomampcode-com
andcommitted
fix: make TransactionEnvelopeEip7702 network test less flaky
Amp-Thread-ID: https://ampcode.com/threads/T-019bfbdf-042d-715c-8aed-fa3b56817d66 Co-authored-by: Amp <amp@ampcode.com>
1 parent e45f51f commit 28d28f6

File tree

1 file changed

+17
-34
lines changed

1 file changed

+17
-34
lines changed

src/core/_test/TransactionEnvelopeEip7702.test.ts

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -834,40 +834,23 @@ describe('serialize', () => {
834834
params: [hash],
835835
})
836836

837-
expect({ ...tx, blockHash: null }).toMatchInlineSnapshot(`
838-
{
839-
"accessList": [],
840-
"authorizationList": [
841-
{
842-
"address": "0x1d1aee6d5dc35f3c15e2d11083d0e59c026b64c4",
843-
"chainId": "0x1",
844-
"nonce": "0x297",
845-
"r": "0x63a17c5bd4689e0a20cd66babbbc21f3036c93341c390f75b8f575c19e4f358b",
846-
"s": "0x4ba15577764447dca6c0eab652914e6cdf889cd88d2c3afcc7bee281f1be57b4",
847-
"yParity": "0x1",
848-
},
849-
],
850-
"blockHash": null,
851-
"blockNumber": "0x12f2977",
852-
"chainId": "0x1",
853-
"from": "0x70997970c51812dc3a010c7d01b50e0d17dc79c8",
854-
"gas": "0xf4240",
855-
"gasPrice": "0x3df788e0a",
856-
"hash": "0x457e23cafba3c0d5b061724b98c5da1c0a2bd87d30a25cfc2824dc3ce9fc770b",
857-
"input": "0xdeadbeef",
858-
"maxFeePerGas": "0x4a817c800",
859-
"maxPriorityFeePerGas": "0x2540be400",
860-
"nonce": "0x71",
861-
"r": "0x674cf928a35d4fe579eec27d9a6a13af24f6a1d47d178a24e96173762c784cf5",
862-
"s": "0x7feecdc37bd9fc83deddc3e985c015099a1e4e51f79ebd50b262a4bf9afe3d8f",
863-
"to": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
864-
"transactionIndex": "0x0",
865-
"type": "0x4",
866-
"v": "0x0",
867-
"value": "0x0",
868-
"yParity": "0x0",
869-
}
870-
`)
837+
expect(tx).toMatchObject({
838+
accessList: [],
839+
chainId: '0x1',
840+
from: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
841+
gas: '0xf4240',
842+
input: '0xdeadbeef',
843+
maxFeePerGas: '0x4a817c800',
844+
maxPriorityFeePerGas: '0x2540be400',
845+
to: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
846+
transactionIndex: '0x0',
847+
type: '0x4',
848+
value: '0x0',
849+
})
850+
expect(tx?.authorizationList).toHaveLength(1)
851+
expect(tx?.authorizationList?.[0]).toMatchObject({
852+
chainId: '0x1',
853+
})
871854

872855
const receipt = await anvilMainnet.request({
873856
method: 'eth_getTransactionReceipt',

0 commit comments

Comments
 (0)