ox 1.8.15 → 1.8.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +108 -0
- package/dist/core/AbiError.d.ts +52 -6
- package/dist/core/AbiError.d.ts.map +1 -1
- package/dist/core/AbiError.js +60 -4
- package/dist/core/AbiError.js.map +1 -1
- package/dist/core/AbiEvent.d.ts +5 -3
- package/dist/core/AbiEvent.d.ts.map +1 -1
- package/dist/core/AbiEvent.js +89 -58
- package/dist/core/AbiEvent.js.map +1 -1
- package/dist/core/AbiFunction.d.ts +48 -2
- package/dist/core/AbiFunction.d.ts.map +1 -1
- package/dist/core/AbiFunction.js +59 -3
- package/dist/core/AbiFunction.js.map +1 -1
- package/dist/core/AbiItem.d.ts.map +1 -1
- package/dist/core/AbiItem.js +15 -5
- package/dist/core/AbiItem.js.map +1 -1
- package/dist/core/AbiParameters.d.ts +1 -1
- package/dist/core/AbiParameters.d.ts.map +1 -1
- package/dist/core/AbiParameters.js +8 -2
- package/dist/core/AbiParameters.js.map +1 -1
- package/dist/core/Address.d.ts +17 -2
- package/dist/core/Address.d.ts.map +1 -1
- package/dist/core/Address.js +17 -1
- package/dist/core/Address.js.map +1 -1
- package/dist/core/Authorization.d.ts +24 -2
- package/dist/core/Authorization.d.ts.map +1 -1
- package/dist/core/Authorization.js +29 -2
- package/dist/core/Authorization.js.map +1 -1
- package/dist/core/Base58.d.ts.map +1 -1
- package/dist/core/Base58.js +16 -4
- package/dist/core/Base58.js.map +1 -1
- package/dist/core/Blobs.d.ts +2 -3
- package/dist/core/Blobs.d.ts.map +1 -1
- package/dist/core/Blobs.js +38 -43
- package/dist/core/Blobs.js.map +1 -1
- package/dist/core/Bytes.d.ts.map +1 -1
- package/dist/core/Bytes.js +10 -2
- package/dist/core/Bytes.js.map +1 -1
- package/dist/core/Cbor.d.ts +13 -6
- package/dist/core/Cbor.d.ts.map +1 -1
- package/dist/core/Cbor.js +31 -18
- package/dist/core/Cbor.js.map +1 -1
- package/dist/core/Ens.js +2 -2
- package/dist/core/Ens.js.map +1 -1
- package/dist/core/FrameReceipt.d.ts.map +1 -1
- package/dist/core/FrameReceipt.js +4 -1
- package/dist/core/FrameReceipt.js.map +1 -1
- package/dist/core/Hex.d.ts.map +1 -1
- package/dist/core/Hex.js +34 -31
- package/dist/core/Hex.js.map +1 -1
- package/dist/core/Keystore.d.ts +31 -2
- package/dist/core/Keystore.d.ts.map +1 -1
- package/dist/core/Keystore.js +28 -2
- package/dist/core/Keystore.js.map +1 -1
- package/dist/core/Rlp.d.ts +1 -1
- package/dist/core/Rlp.d.ts.map +1 -1
- package/dist/core/Rlp.js +107 -0
- package/dist/core/Rlp.js.map +1 -1
- package/dist/core/RpcTransport.d.ts.map +1 -1
- package/dist/core/RpcTransport.js +3 -1
- package/dist/core/RpcTransport.js.map +1 -1
- package/dist/core/Secp256k1.d.ts.map +1 -1
- package/dist/core/Secp256k1.js +4 -1
- package/dist/core/Secp256k1.js.map +1 -1
- package/dist/core/Signature.d.ts +1 -1
- package/dist/core/Signature.d.ts.map +1 -1
- package/dist/core/Signature.js +4 -2
- package/dist/core/Signature.js.map +1 -1
- package/dist/core/Siwe.d.ts +4 -0
- package/dist/core/Siwe.d.ts.map +1 -1
- package/dist/core/Siwe.js +29 -3
- package/dist/core/Siwe.js.map +1 -1
- package/dist/core/Transaction.d.ts.map +1 -1
- package/dist/core/Transaction.js +4 -2
- package/dist/core/Transaction.js.map +1 -1
- package/dist/core/TransactionReceipt.d.ts.map +1 -1
- package/dist/core/TransactionReceipt.js +8 -2
- package/dist/core/TransactionReceipt.js.map +1 -1
- package/dist/core/TxEnvelopeEip1559.d.ts.map +1 -1
- package/dist/core/TxEnvelopeEip1559.js +2 -1
- package/dist/core/TxEnvelopeEip1559.js.map +1 -1
- package/dist/core/TxEnvelopeEip2930.d.ts.map +1 -1
- package/dist/core/TxEnvelopeEip2930.js +2 -1
- package/dist/core/TxEnvelopeEip2930.js.map +1 -1
- package/dist/core/TxEnvelopeEip7702.d.ts +1 -1
- package/dist/core/TxEnvelopeEip7702.d.ts.map +1 -1
- package/dist/core/TxEnvelopeEip7702.js +6 -1
- package/dist/core/TxEnvelopeEip7702.js.map +1 -1
- package/dist/core/TxEnvelopeLegacy.d.ts.map +1 -1
- package/dist/core/TxEnvelopeLegacy.js +49 -7
- package/dist/core/TxEnvelopeLegacy.js.map +1 -1
- package/dist/core/TypedData.d.ts +3 -1
- package/dist/core/TypedData.d.ts.map +1 -1
- package/dist/core/TypedData.js +23 -11
- package/dist/core/TypedData.js.map +1 -1
- package/dist/core/Value.d.ts.map +1 -1
- package/dist/core/Value.js +14 -3
- package/dist/core/Value.js.map +1 -1
- package/dist/core/internal/abiParameters.d.ts +3 -3
- package/dist/core/internal/abiParameters.d.ts.map +1 -1
- package/dist/core/internal/abiParameters.js +99 -69
- package/dist/core/internal/abiParameters.js.map +1 -1
- package/dist/core/internal/base58.d.ts.map +1 -1
- package/dist/core/internal/base58.js +9 -3
- package/dist/core/internal/base58.js.map +1 -1
- package/dist/core/internal/caches.d.ts +6 -0
- package/dist/core/internal/caches.d.ts.map +1 -1
- package/dist/core/internal/caches.js +3 -1
- package/dist/core/internal/caches.js.map +1 -1
- package/dist/core/internal/codec/hex.d.ts +13 -0
- package/dist/core/internal/codec/hex.d.ts.map +1 -1
- package/dist/core/internal/codec/hex.js +25 -2
- package/dist/core/internal/codec/hex.js.map +1 -1
- package/dist/core/internal/codec/int.d.ts.map +1 -1
- package/dist/core/internal/codec/int.js +48 -32
- package/dist/core/internal/codec/int.js.map +1 -1
- package/dist/core/internal/cursor.d.ts +24 -4
- package/dist/core/internal/cursor.d.ts.map +1 -1
- package/dist/core/internal/cursor.js +62 -11
- package/dist/core/internal/cursor.js.map +1 -1
- package/dist/core/internal/lru.d.ts +11 -12
- package/dist/core/internal/lru.d.ts.map +1 -1
- package/dist/core/internal/lru.js +22 -32
- package/dist/core/internal/lru.js.map +1 -1
- package/dist/core/internal/promise.d.ts.map +1 -1
- package/dist/core/internal/promise.js +13 -7
- package/dist/core/internal/promise.js.map +1 -1
- package/dist/erc4337/UserOperation.d.ts.map +1 -1
- package/dist/erc4337/UserOperation.js +1 -3
- package/dist/erc4337/UserOperation.js.map +1 -1
- package/dist/erc6492/SignatureErc6492.d.ts +1 -1
- package/dist/erc6492/SignatureErc6492.d.ts.map +1 -1
- package/dist/erc6492/SignatureErc6492.js +1 -1
- package/dist/erc6492/SignatureErc6492.js.map +1 -1
- package/dist/erc7821/Execute.d.ts +45 -0
- package/dist/erc7821/Execute.d.ts.map +1 -1
- package/dist/erc7821/Execute.js +70 -2
- package/dist/erc7821/Execute.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/tempo/KeyAuthorization.d.ts +9 -3
- package/dist/tempo/KeyAuthorization.d.ts.map +1 -1
- package/dist/tempo/KeyAuthorization.js +16 -0
- package/dist/tempo/KeyAuthorization.js.map +1 -1
- package/dist/tempo/SignatureEnvelope.d.ts +1 -1
- package/dist/tempo/SignatureEnvelope.d.ts.map +1 -1
- package/dist/tempo/SignatureEnvelope.js +53 -54
- package/dist/tempo/SignatureEnvelope.js.map +1 -1
- package/dist/tempo/TransactionReceipt.d.ts.map +1 -1
- package/dist/tempo/TransactionReceipt.js +4 -1
- package/dist/tempo/TransactionReceipt.js.map +1 -1
- package/dist/tempo/TransactionRequest.d.ts +1 -1
- package/dist/tempo/TransactionRequest.d.ts.map +1 -1
- package/dist/tempo/TransactionRequest.js +5 -2
- package/dist/tempo/TransactionRequest.js.map +1 -1
- package/dist/tempo/TxEnvelopeTempo.d.ts +30 -1
- package/dist/tempo/TxEnvelopeTempo.d.ts.map +1 -1
- package/dist/tempo/TxEnvelopeTempo.js +51 -2
- package/dist/tempo/TxEnvelopeTempo.js.map +1 -1
- package/dist/tempo/ZoneId.d.ts +3 -1
- package/dist/tempo/ZoneId.d.ts.map +1 -1
- package/dist/tempo/ZoneId.js +7 -1
- package/dist/tempo/ZoneId.js.map +1 -1
- package/dist/tempo/internal/virtualMasterPool.d.ts.map +1 -1
- package/dist/tempo/internal/virtualMasterPool.js +17 -6
- package/dist/tempo/internal/virtualMasterPool.js.map +1 -1
- package/dist/tempo/internal/webauthnData.d.ts +23 -0
- package/dist/tempo/internal/webauthnData.d.ts.map +1 -0
- package/dist/tempo/internal/webauthnData.js +75 -0
- package/dist/tempo/internal/webauthnData.js.map +1 -0
- package/dist/webauthn/Registration.d.ts +2 -0
- package/dist/webauthn/Registration.d.ts.map +1 -1
- package/dist/webauthn/Registration.js +2 -6
- package/dist/webauthn/Registration.js.map +1 -1
- package/dist/zod/TypedData.d.ts +4 -4
- package/dist/zod/tempo/KeyAuthorization.d.ts.map +1 -1
- package/dist/zod/tempo/KeyAuthorization.js +4 -2
- package/dist/zod/tempo/KeyAuthorization.js.map +1 -1
- package/dist/zod/tempo/SignatureEnvelope.d.ts.map +1 -1
- package/dist/zod/tempo/SignatureEnvelope.js +29 -29
- package/dist/zod/tempo/SignatureEnvelope.js.map +1 -1
- package/package.json +2 -2
- package/src/core/AbiError.ts +82 -8
- package/src/core/AbiEvent.bench.ts +45 -0
- package/src/core/AbiEvent.ts +120 -68
- package/src/core/AbiFunction.bench.ts +16 -0
- package/src/core/AbiFunction.ts +76 -4
- package/src/core/AbiItem.ts +13 -4
- package/src/core/AbiParameters.bench.ts +33 -0
- package/src/core/AbiParameters.ts +8 -1
- package/src/core/Address.ts +18 -1
- package/src/core/Authorization.ts +34 -4
- package/src/core/Base58.bench.ts +28 -0
- package/src/core/Base58.ts +15 -4
- package/src/core/Blobs.bench.ts +40 -0
- package/src/core/Blobs.ts +47 -55
- package/src/core/Bytes.bench.ts +34 -0
- package/src/core/Bytes.ts +10 -2
- package/src/core/Cbor.ts +36 -14
- package/src/core/Ens.ts +2 -2
- package/src/core/FrameReceipt.ts +4 -1
- package/src/core/Hex.bench.ts +17 -0
- package/src/core/Hex.ts +29 -32
- package/src/core/Keystore.ts +40 -3
- package/src/core/Rlp.ts +139 -1
- package/src/core/Rlp_tx.bench.ts +55 -0
- package/src/core/RpcTransport.ts +3 -1
- package/src/core/Secp256k1.ts +4 -1
- package/src/core/Signature.ts +7 -3
- package/src/core/Siwe.ts +29 -3
- package/src/core/Transaction.ts +4 -2
- package/src/core/TransactionReceipt.ts +8 -2
- package/src/core/TxEnvelopeEip1559.ts +4 -1
- package/src/core/TxEnvelopeEip2930.ts +4 -1
- package/src/core/TxEnvelopeEip7702.ts +9 -2
- package/src/core/TxEnvelopeLegacy.ts +58 -7
- package/src/core/TypedData.bench.ts +50 -0
- package/src/core/TypedData.ts +24 -11
- package/src/core/Value.ts +14 -3
- package/src/core/_test/AbiError.test.ts +105 -2
- package/src/core/_test/AbiEvent.fuzz.ts +1 -1
- package/src/core/_test/AbiEvent.test-d.ts +46 -0
- package/src/core/_test/AbiEvent.test.ts +646 -11
- package/src/core/_test/AbiFunction.test.ts +79 -6
- package/src/core/_test/AbiParameters.adversarial.fuzz.ts +1 -0
- package/src/core/_test/AbiParameters.decode.test.ts +143 -0
- package/src/core/_test/AbiParameters.encode.test.ts +36 -1
- package/src/core/_test/AbiParameters.test.ts +15 -0
- package/src/core/_test/Address.test.ts +41 -0
- package/src/core/_test/Authorization.test.ts +130 -0
- package/src/core/_test/Bytes.test.ts +33 -0
- package/src/core/_test/Caches.test.ts +20 -1
- package/src/core/_test/Cbor.test.ts +26 -0
- package/src/core/_test/FrameReceipt.test.ts +13 -0
- package/src/core/_test/Keystore.test.ts +65 -1
- package/src/core/_test/Rlp.fuzz.ts +55 -1
- package/src/core/_test/Rlp.test.ts +64 -0
- package/src/core/_test/RpcTransport.test.ts +15 -2
- package/src/core/_test/Secp256k1.test.ts +36 -0
- package/src/core/_test/Signature.test.ts +102 -0
- package/src/core/_test/Siwe.test.ts +123 -0
- package/src/core/_test/Transaction.test.ts +17 -0
- package/src/core/_test/TransactionEnvelopeEip1559.test.ts +28 -0
- package/src/core/_test/TransactionEnvelopeEip2930.test.ts +28 -0
- package/src/core/_test/TransactionEnvelopeEip7702.test.ts +133 -0
- package/src/core/_test/TransactionEnvelopeLegacy.test.ts +322 -1
- package/src/core/_test/TransactionReceipt.test.ts +41 -0
- package/src/core/_test/TypedData.test.ts +197 -0
- package/src/core/_test/Value.test.ts +21 -0
- package/src/core/_test/internal/cursor.test.ts +71 -0
- package/src/core/internal/abiParameters.ts +123 -81
- package/src/core/internal/base58.ts +9 -3
- package/src/core/internal/caches.ts +3 -1
- package/src/core/internal/codec/hex.ts +27 -2
- package/src/core/internal/codec/int.ts +45 -32
- package/src/core/internal/cursor.ts +84 -19
- package/src/core/internal/lru.ts +21 -35
- package/src/core/internal/promise.ts +11 -5
- package/src/erc4337/UserOperation.ts +3 -4
- package/src/erc4337/_test/UserOperation.test.ts +59 -1
- package/src/erc6492/SignatureErc6492.ts +1 -1
- package/src/erc6492/_test/SignatureErc6492.test.ts +48 -1
- package/src/erc7821/Execute.ts +83 -2
- package/src/erc7821/_test/Execute.test.ts +217 -1
- package/src/index.ts +1 -1
- package/src/tempo/KeyAuthorization.test.ts +91 -0
- package/src/tempo/KeyAuthorization.ts +32 -3
- package/src/tempo/SignatureEnvelope.test.ts +300 -28
- package/src/tempo/SignatureEnvelope.ts +62 -54
- package/src/tempo/TransactionReceipt.test.ts +8 -0
- package/src/tempo/TransactionReceipt.ts +4 -1
- package/src/tempo/TransactionRequest.test.ts +30 -0
- package/src/tempo/TransactionRequest.ts +7 -2
- package/src/tempo/TxEnvelopeTempo.test.ts +310 -0
- package/src/tempo/TxEnvelopeTempo.ts +64 -1
- package/src/tempo/VirtualMaster.bench.ts +7 -0
- package/src/tempo/ZoneId.test.ts +11 -0
- package/src/tempo/ZoneId.ts +7 -1
- package/src/tempo/configurableAccounts.e2e.test.ts +1 -1
- package/src/tempo/internal/virtualMasterPool.ts +20 -6
- package/src/tempo/internal/webauthnData.ts +84 -0
- package/src/version.ts +1 -1
- package/src/webauthn/Registration.ts +4 -6
- package/src/webauthn/_test/Registration.browser.test.ts +14 -0
- package/src/webauthn/_test/Registration.test.ts +60 -0
- package/src/zod/tempo/KeyAuthorization.ts +12 -5
- package/src/zod/tempo/SignatureEnvelope.ts +38 -32
- package/src/zod/tempo/_test/KeyAuthorization.test.ts +36 -0
- package/src/zod/tempo/_test/SignatureEnvelope.test.ts +138 -4
- package/src/core/_test/internal/lru.test.ts +0 -38
- package/src/core/_test/internal/uid.test.ts +0 -7
- package/src/core/internal/uid.ts +0 -15
|
@@ -324,6 +324,36 @@ describe('deserialize', () => {
|
|
|
324
324
|
)
|
|
325
325
|
})
|
|
326
326
|
|
|
327
|
+
test('authorization chainId above safe integer range', () => {
|
|
328
|
+
expect(() =>
|
|
329
|
+
TxEnvelopeEip7702.deserialize(
|
|
330
|
+
`0x04${Rlp.fromHex([
|
|
331
|
+
Hex.fromNumber(1), // chainId
|
|
332
|
+
'0x', // nonce
|
|
333
|
+
Hex.fromNumber(1), // maxPriorityFeePerGas
|
|
334
|
+
Hex.fromNumber(1), // maxFeePerGas
|
|
335
|
+
Hex.fromNumber(1), // gas
|
|
336
|
+
'0x0000000000000000000000000000000000000000', // to
|
|
337
|
+
'0x', // value
|
|
338
|
+
'0x', // data
|
|
339
|
+
[], // accessList
|
|
340
|
+
[
|
|
341
|
+
[
|
|
342
|
+
'0x20000000000001',
|
|
343
|
+
'0x0000000000000000000000000000000000000000',
|
|
344
|
+
'0x01',
|
|
345
|
+
'0x',
|
|
346
|
+
'0x01',
|
|
347
|
+
'0x02',
|
|
348
|
+
],
|
|
349
|
+
], // authorizationList
|
|
350
|
+
]).slice(2)}`,
|
|
351
|
+
),
|
|
352
|
+
).toThrowErrorMatchingInlineSnapshot(
|
|
353
|
+
`[Hex.IntegerOutOfRangeError: Number \`9007199254740992\` is not in safe unsigned integer range (\`0\` to \`9007199254740991\`)]`,
|
|
354
|
+
)
|
|
355
|
+
})
|
|
356
|
+
|
|
327
357
|
test('invalid access list (invalid address)', () => {
|
|
328
358
|
expect(() =>
|
|
329
359
|
TxEnvelopeEip7702.deserialize(
|
|
@@ -423,6 +453,109 @@ describe('deserialize', () => {
|
|
|
423
453
|
Missing Attributes: r, s]
|
|
424
454
|
`)
|
|
425
455
|
})
|
|
456
|
+
|
|
457
|
+
describe('authorization tuple length', () => {
|
|
458
|
+
const address = '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c'
|
|
459
|
+
const r =
|
|
460
|
+
'0x68a020a209d3d56c46f38cc50a33f704f4a9a10a59377f8dd762ac66910e9b90'
|
|
461
|
+
const s =
|
|
462
|
+
'0x7e865ad05c4035ab5792787d4a0297a43617ae897930a6fe4d822b8faea52064'
|
|
463
|
+
|
|
464
|
+
const serialize = (authorization: readonly Hex.Hex[]) =>
|
|
465
|
+
`0x04${Rlp.fromHex([
|
|
466
|
+
'0x01', // chainId
|
|
467
|
+
'0x', // nonce
|
|
468
|
+
'0x01', // maxPriorityFeePerGas
|
|
469
|
+
'0x01', // maxFeePerGas
|
|
470
|
+
'0x01', // gas
|
|
471
|
+
'0x0000000000000000000000000000000000000000', // to
|
|
472
|
+
'0x', // value
|
|
473
|
+
'0x', // data
|
|
474
|
+
[], // accessList
|
|
475
|
+
[authorization], // authorizationList
|
|
476
|
+
'0x', // yParity
|
|
477
|
+
'0x01', // r
|
|
478
|
+
'0x02', // s
|
|
479
|
+
]).slice(2)}` as const
|
|
480
|
+
|
|
481
|
+
test('6 fields round trip', () => {
|
|
482
|
+
const serialized = serialize(['0x01', address, '0x03', '0x01', r, s])
|
|
483
|
+
expect(
|
|
484
|
+
TxEnvelopeEip7702.serialize(
|
|
485
|
+
TxEnvelopeEip7702.deserialize(serialized),
|
|
486
|
+
),
|
|
487
|
+
).toBe(serialized)
|
|
488
|
+
})
|
|
489
|
+
|
|
490
|
+
test('3 fields', () => {
|
|
491
|
+
expect(() =>
|
|
492
|
+
TxEnvelopeEip7702.deserialize(serialize(['0x01', address, '0x03'])),
|
|
493
|
+
).toThrowErrorMatchingInlineSnapshot(`
|
|
494
|
+
[Authorization.InvalidError: Invalid authorization.
|
|
495
|
+
|
|
496
|
+
Details: Expected [chainId, address, nonce, yParity, r, s].]
|
|
497
|
+
`)
|
|
498
|
+
})
|
|
499
|
+
|
|
500
|
+
test('4 fields', () => {
|
|
501
|
+
expect(() =>
|
|
502
|
+
TxEnvelopeEip7702.deserialize(
|
|
503
|
+
serialize(['0x01', address, '0x03', '0x01']),
|
|
504
|
+
),
|
|
505
|
+
).toThrowErrorMatchingInlineSnapshot(`
|
|
506
|
+
[Authorization.InvalidError: Invalid authorization.
|
|
507
|
+
|
|
508
|
+
Details: Expected [chainId, address, nonce, yParity, r, s].]
|
|
509
|
+
`)
|
|
510
|
+
})
|
|
511
|
+
|
|
512
|
+
test('5 fields', () => {
|
|
513
|
+
expect(() =>
|
|
514
|
+
TxEnvelopeEip7702.deserialize(
|
|
515
|
+
serialize(['0x01', address, '0x03', '0x01', r]),
|
|
516
|
+
),
|
|
517
|
+
).toThrowErrorMatchingInlineSnapshot(`
|
|
518
|
+
[Authorization.InvalidError: Invalid authorization.
|
|
519
|
+
|
|
520
|
+
Details: Expected [chainId, address, nonce, yParity, r, s].]
|
|
521
|
+
`)
|
|
522
|
+
})
|
|
523
|
+
|
|
524
|
+
test('7 fields', () => {
|
|
525
|
+
expect(() =>
|
|
526
|
+
TxEnvelopeEip7702.deserialize(
|
|
527
|
+
serialize(['0x01', address, '0x03', '0x01', r, s, '0xdeadbeef']),
|
|
528
|
+
),
|
|
529
|
+
).toThrowErrorMatchingInlineSnapshot(`
|
|
530
|
+
[Authorization.InvalidError: Invalid authorization.
|
|
531
|
+
|
|
532
|
+
Details: Expected [chainId, address, nonce, yParity, r, s].]
|
|
533
|
+
`)
|
|
534
|
+
})
|
|
535
|
+
|
|
536
|
+
test('not a list', () => {
|
|
537
|
+
expect(() =>
|
|
538
|
+
TxEnvelopeEip7702.deserialize(
|
|
539
|
+
`0x04${Rlp.fromHex([
|
|
540
|
+
'0x01', // chainId
|
|
541
|
+
'0x', // nonce
|
|
542
|
+
'0x01', // maxPriorityFeePerGas
|
|
543
|
+
'0x01', // maxFeePerGas
|
|
544
|
+
'0x01', // gas
|
|
545
|
+
'0x0000000000000000000000000000000000000000', // to
|
|
546
|
+
'0x', // value
|
|
547
|
+
'0x', // data
|
|
548
|
+
[], // accessList
|
|
549
|
+
['0x010203040506'], // authorizationList
|
|
550
|
+
]).slice(2)}`,
|
|
551
|
+
),
|
|
552
|
+
).toThrowErrorMatchingInlineSnapshot(`
|
|
553
|
+
[Authorization.InvalidError: Invalid authorization.
|
|
554
|
+
|
|
555
|
+
Details: Expected [chainId, address, nonce, yParity, r, s].]
|
|
556
|
+
`)
|
|
557
|
+
})
|
|
558
|
+
})
|
|
426
559
|
})
|
|
427
560
|
})
|
|
428
561
|
|
|
@@ -23,6 +23,34 @@ describe('assert', () => {
|
|
|
23
23
|
)
|
|
24
24
|
})
|
|
25
25
|
|
|
26
|
+
test('invalid chainId (not a positive safe integer)', () => {
|
|
27
|
+
expect(() =>
|
|
28
|
+
TxEnvelopeLegacy.assert({ chainId: Number.NaN }),
|
|
29
|
+
).toThrowErrorMatchingInlineSnapshot(
|
|
30
|
+
`[TransactionEnvelope.InvalidChainIdError: Chain ID "NaN" is invalid.]`,
|
|
31
|
+
)
|
|
32
|
+
expect(() =>
|
|
33
|
+
TxEnvelopeLegacy.assert({ chainId: 1.5 }),
|
|
34
|
+
).toThrowErrorMatchingInlineSnapshot(
|
|
35
|
+
`[TransactionEnvelope.InvalidChainIdError: Chain ID "1.5" is invalid.]`,
|
|
36
|
+
)
|
|
37
|
+
expect(() =>
|
|
38
|
+
TxEnvelopeLegacy.assert({ chainId: Number.MAX_SAFE_INTEGER + 1 }),
|
|
39
|
+
).toThrowErrorMatchingInlineSnapshot(
|
|
40
|
+
`[TransactionEnvelope.InvalidChainIdError: Chain ID "9007199254740992" is invalid.]`,
|
|
41
|
+
)
|
|
42
|
+
expect(() =>
|
|
43
|
+
TxEnvelopeLegacy.assert({ chainId: '1' as never }),
|
|
44
|
+
).toThrowErrorMatchingInlineSnapshot(
|
|
45
|
+
`[TransactionEnvelope.InvalidChainIdError: Chain ID "1" is invalid.]`,
|
|
46
|
+
)
|
|
47
|
+
expect(() =>
|
|
48
|
+
TxEnvelopeLegacy.assert({ chainId: 1n as never }),
|
|
49
|
+
).toThrowErrorMatchingInlineSnapshot(
|
|
50
|
+
`[TransactionEnvelope.InvalidChainIdError: Chain ID "1" is invalid.]`,
|
|
51
|
+
)
|
|
52
|
+
})
|
|
53
|
+
|
|
26
54
|
test('invalid address', () => {
|
|
27
55
|
expect(() => TxEnvelopeLegacy.assert({ to: '0x123', chainId: 1 }))
|
|
28
56
|
.toThrowErrorMatchingInlineSnapshot(`
|
|
@@ -266,6 +294,35 @@ describe('deserialize', () => {
|
|
|
266
294
|
}
|
|
267
295
|
`)
|
|
268
296
|
})
|
|
297
|
+
|
|
298
|
+
test('largest safe v', () => {
|
|
299
|
+
const serialized = Rlp.fromHex([
|
|
300
|
+
'0x01', // nonce
|
|
301
|
+
'0x02', // gasPrice
|
|
302
|
+
'0x5208', // gas
|
|
303
|
+
'0x70997970c51812dc3a010c7d01b50e0d17dc79c8', // to
|
|
304
|
+
'0x03', // value
|
|
305
|
+
'0x', // data
|
|
306
|
+
Hex.fromNumber(Number.MAX_SAFE_INTEGER), // v
|
|
307
|
+
`0x${'ff'.repeat(32)}`, // r
|
|
308
|
+
`0x${'ff'.repeat(32)}`, // s
|
|
309
|
+
])
|
|
310
|
+
expect(TxEnvelopeLegacy.deserialize(serialized)).toMatchInlineSnapshot(`
|
|
311
|
+
{
|
|
312
|
+
"chainId": 4503599627370478,
|
|
313
|
+
"gas": 21000n,
|
|
314
|
+
"gasPrice": 2n,
|
|
315
|
+
"nonce": 1n,
|
|
316
|
+
"r": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
317
|
+
"s": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
|
|
318
|
+
"to": "0x70997970c51812dc3a010c7d01b50e0d17dc79c8",
|
|
319
|
+
"type": "legacy",
|
|
320
|
+
"v": 9007199254740991,
|
|
321
|
+
"value": 3n,
|
|
322
|
+
"yParity": 0,
|
|
323
|
+
}
|
|
324
|
+
`)
|
|
325
|
+
})
|
|
269
326
|
})
|
|
270
327
|
|
|
271
328
|
describe('errors', () => {
|
|
@@ -362,6 +419,148 @@ describe('deserialize', () => {
|
|
|
362
419
|
'[Signature.InvalidVError: Value `35` is an invalid v value. v must be 27, 28 or >=35.]',
|
|
363
420
|
)
|
|
364
421
|
})
|
|
422
|
+
|
|
423
|
+
const fields = [
|
|
424
|
+
'0x01', // nonce
|
|
425
|
+
'0x02', // gasPrice
|
|
426
|
+
'0x5208', // gas
|
|
427
|
+
'0x70997970c51812dc3a010c7d01b50e0d17dc79c8', // to
|
|
428
|
+
'0x03', // value
|
|
429
|
+
'0x', // data
|
|
430
|
+
] as const
|
|
431
|
+
const word =
|
|
432
|
+
'0x1111111111111111111111111111111111111111111111111111111111111111'
|
|
433
|
+
|
|
434
|
+
test('unsigned: invalid `to`', () => {
|
|
435
|
+
const to = '0x11111111111111111111111111111111111111'
|
|
436
|
+
expect(() =>
|
|
437
|
+
TxEnvelopeLegacy.deserialize(
|
|
438
|
+
Rlp.fromHex(['0x01', '0x02', '0x5208', to, '0x03', '0x']),
|
|
439
|
+
),
|
|
440
|
+
).toThrowErrorMatchingInlineSnapshot(`
|
|
441
|
+
[Address.InvalidAddressError: Address "0x11111111111111111111111111111111111111" is invalid.
|
|
442
|
+
|
|
443
|
+
Details: Address is not a 20 byte (40 hexadecimal character) value.]
|
|
444
|
+
`)
|
|
445
|
+
expect(() =>
|
|
446
|
+
TxEnvelopeLegacy.deserialize(
|
|
447
|
+
Rlp.fromHex([
|
|
448
|
+
'0x01',
|
|
449
|
+
'0x02',
|
|
450
|
+
'0x5208',
|
|
451
|
+
to,
|
|
452
|
+
'0x03',
|
|
453
|
+
'0x',
|
|
454
|
+
'0x01',
|
|
455
|
+
'0x',
|
|
456
|
+
'0x',
|
|
457
|
+
]),
|
|
458
|
+
),
|
|
459
|
+
).toThrowErrorMatchingInlineSnapshot(`
|
|
460
|
+
[Address.InvalidAddressError: Address "0x11111111111111111111111111111111111111" is invalid.
|
|
461
|
+
|
|
462
|
+
Details: Address is not a 20 byte (40 hexadecimal character) value.]
|
|
463
|
+
`)
|
|
464
|
+
})
|
|
465
|
+
|
|
466
|
+
test('gasPrice longer than 32 bytes', () => {
|
|
467
|
+
const gasPrice = `0x01${'00'.repeat(32)}` as const
|
|
468
|
+
const [nonce, , ...rest] = fields
|
|
469
|
+
expect(() =>
|
|
470
|
+
TxEnvelopeLegacy.deserialize(Rlp.fromHex([nonce, gasPrice, ...rest])),
|
|
471
|
+
).toThrowErrorMatchingInlineSnapshot(
|
|
472
|
+
`[TransactionEnvelope.GasPriceTooHighError: The gas price (\`gasPrice\`) cannot be higher than the maximum allowed value (2^256-1).]`,
|
|
473
|
+
)
|
|
474
|
+
expect(() =>
|
|
475
|
+
TxEnvelopeLegacy.deserialize(
|
|
476
|
+
Rlp.fromHex([nonce, gasPrice, ...rest, '0x25', word, word]),
|
|
477
|
+
),
|
|
478
|
+
).toThrowErrorMatchingInlineSnapshot(
|
|
479
|
+
`[TransactionEnvelope.GasPriceTooHighError: The gas price (\`gasPrice\`) cannot be higher than the maximum allowed value (2^256-1).]`,
|
|
480
|
+
)
|
|
481
|
+
})
|
|
482
|
+
|
|
483
|
+
test('r or s longer than 32 bytes', () => {
|
|
484
|
+
expect(() =>
|
|
485
|
+
TxEnvelopeLegacy.deserialize(
|
|
486
|
+
Rlp.fromHex([...fields, '0x25', `${word}11`, word]),
|
|
487
|
+
),
|
|
488
|
+
).toThrowErrorMatchingInlineSnapshot(
|
|
489
|
+
`[Signature.InvalidRError: Value \`0x111111111111111111111111111111111111111111111111111111111111111111\` is an invalid r value. r must be a positive integer less than 2^256.]`,
|
|
490
|
+
)
|
|
491
|
+
expect(() =>
|
|
492
|
+
TxEnvelopeLegacy.deserialize(
|
|
493
|
+
Rlp.fromHex([...fields, '0x25', word, `${word}11`]),
|
|
494
|
+
),
|
|
495
|
+
).toThrowErrorMatchingInlineSnapshot(
|
|
496
|
+
`[Signature.InvalidSError: Value \`0x111111111111111111111111111111111111111111111111111111111111111111\` is an invalid s value. s must be a positive integer less than 2^256.]`,
|
|
497
|
+
)
|
|
498
|
+
})
|
|
499
|
+
|
|
500
|
+
test('list in place of a field', () => {
|
|
501
|
+
const signed = [...fields, '0x25', word, word] as const
|
|
502
|
+
expect(() =>
|
|
503
|
+
TxEnvelopeLegacy.deserialize(
|
|
504
|
+
Rlp.fromHex([['0x01', '0x02'], ...fields.slice(1)]),
|
|
505
|
+
),
|
|
506
|
+
).toThrowErrorMatchingInlineSnapshot(`
|
|
507
|
+
[TransactionEnvelope.InvalidSerializedError: Invalid serialized transaction of type "legacy" was provided.
|
|
508
|
+
|
|
509
|
+
Serialized Transaction: "0xdec20102028252089470997970c51812dc3a010c7d01b50e0d17dc79c80380"]
|
|
510
|
+
`)
|
|
511
|
+
for (const tuple of [fields, signed])
|
|
512
|
+
for (let i = 0; i < tuple.length; i++)
|
|
513
|
+
expect(() =>
|
|
514
|
+
TxEnvelopeLegacy.deserialize(
|
|
515
|
+
Rlp.fromHex(tuple.map((x, j) => (i === j ? [x] : x))),
|
|
516
|
+
),
|
|
517
|
+
).toThrowError(
|
|
518
|
+
'Invalid serialized transaction of type "legacy" was provided.',
|
|
519
|
+
)
|
|
520
|
+
expect(() =>
|
|
521
|
+
TxEnvelopeLegacy.deserialize(Rlp.fromHex([...fields, '0x25', [], []])),
|
|
522
|
+
).toThrowError(
|
|
523
|
+
'Invalid serialized transaction of type "legacy" was provided.',
|
|
524
|
+
)
|
|
525
|
+
})
|
|
526
|
+
|
|
527
|
+
test('byte string in place of the list', () => {
|
|
528
|
+
expect(() => TxEnvelopeLegacy.deserialize('0x86aabbccddeeff'))
|
|
529
|
+
.toThrowErrorMatchingInlineSnapshot(`
|
|
530
|
+
[TransactionEnvelope.InvalidSerializedError: Invalid serialized transaction of type "legacy" was provided.
|
|
531
|
+
|
|
532
|
+
Serialized Transaction: "0x86aabbccddeeff"]
|
|
533
|
+
`)
|
|
534
|
+
})
|
|
535
|
+
|
|
536
|
+
test('v above the safe integer range', () => {
|
|
537
|
+
// 2^53 + 15
|
|
538
|
+
expect(() =>
|
|
539
|
+
TxEnvelopeLegacy.deserialize(
|
|
540
|
+
Rlp.fromHex([...fields, '0x2000000000000f', word, word]),
|
|
541
|
+
),
|
|
542
|
+
).toThrowErrorMatchingInlineSnapshot(`
|
|
543
|
+
[TransactionEnvelope.InvalidSerializedError: Invalid serialized transaction of type "legacy" was provided.
|
|
544
|
+
|
|
545
|
+
Serialized Transaction: "0xf86601028252089470997970c51812dc3a010c7d01b50e0d17dc79c80380872000000000000fa01111111111111111111111111111111111111111111111111111111111111111a01111111111111111111111111111111111111111111111111111111111111111"]
|
|
546
|
+
`)
|
|
547
|
+
// 2^53 + 1 (unsigned)
|
|
548
|
+
expect(() =>
|
|
549
|
+
TxEnvelopeLegacy.deserialize(
|
|
550
|
+
Rlp.fromHex([...fields, '0x20000000000001', '0x', '0x']),
|
|
551
|
+
),
|
|
552
|
+
).toThrowError(
|
|
553
|
+
'Invalid serialized transaction of type "legacy" was provided.',
|
|
554
|
+
)
|
|
555
|
+
// 2^1100
|
|
556
|
+
expect(() =>
|
|
557
|
+
TxEnvelopeLegacy.deserialize(
|
|
558
|
+
Rlp.fromHex([...fields, `0x10${'00'.repeat(137)}`, word, word]),
|
|
559
|
+
),
|
|
560
|
+
).toThrowError(
|
|
561
|
+
'Invalid serialized transaction of type "legacy" was provided.',
|
|
562
|
+
)
|
|
563
|
+
})
|
|
365
564
|
})
|
|
366
565
|
})
|
|
367
566
|
|
|
@@ -507,6 +706,50 @@ describe('hash', () => {
|
|
|
507
706
|
`"0x5e427e088ae00b084b41e198c52440aa43b2d6f8f1f01246fd25d4e9b6ebfdab"`,
|
|
508
707
|
)
|
|
509
708
|
})
|
|
709
|
+
|
|
710
|
+
test('options: presign: chain ID carried by `v`', () => {
|
|
711
|
+
const unsigned = {
|
|
712
|
+
gas: 21000n,
|
|
713
|
+
gasPrice: 1000000000n,
|
|
714
|
+
nonce: 665n,
|
|
715
|
+
to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
|
716
|
+
value: 1000000000000000000n,
|
|
717
|
+
} as const
|
|
718
|
+
const payload = TxEnvelopeLegacy.getSignPayload(
|
|
719
|
+
TxEnvelopeLegacy.from({ ...unsigned, chainId: 1 }),
|
|
720
|
+
)
|
|
721
|
+
const { r, s, yParity } = Secp256k1.sign({
|
|
722
|
+
payload,
|
|
723
|
+
privateKey: accounts[0].privateKey,
|
|
724
|
+
})
|
|
725
|
+
|
|
726
|
+
// EIP-155 `v`, no `chainId`
|
|
727
|
+
const envelope = TxEnvelopeLegacy.from({
|
|
728
|
+
...unsigned,
|
|
729
|
+
r,
|
|
730
|
+
s,
|
|
731
|
+
v: 37 + yParity,
|
|
732
|
+
})
|
|
733
|
+
expect(
|
|
734
|
+
TxEnvelopeLegacy.hash(envelope, { presign: true }),
|
|
735
|
+
).toMatchInlineSnapshot(
|
|
736
|
+
`"0x4c1dec0d90aa1a17cb0aa735b5550e43a1bd27cd1cacb8987522576fa6220e46"`,
|
|
737
|
+
)
|
|
738
|
+
expect(TxEnvelopeLegacy.hash(envelope, { presign: true })).toBe(payload)
|
|
739
|
+
expect(TxEnvelopeLegacy.getSignPayload(envelope)).toBe(
|
|
740
|
+
TxEnvelopeLegacy.getSignPayload(
|
|
741
|
+
TxEnvelopeLegacy.deserialize(TxEnvelopeLegacy.serialize(envelope)),
|
|
742
|
+
),
|
|
743
|
+
)
|
|
744
|
+
|
|
745
|
+
// pre-EIP-155 `v`, no `chainId`
|
|
746
|
+
expect(
|
|
747
|
+
TxEnvelopeLegacy.hash(
|
|
748
|
+
TxEnvelopeLegacy.from({ ...unsigned, r, s, v: 27 + yParity }),
|
|
749
|
+
{ presign: true },
|
|
750
|
+
),
|
|
751
|
+
).toBe(TxEnvelopeLegacy.getSignPayload(TxEnvelopeLegacy.from(unsigned)))
|
|
752
|
+
})
|
|
510
753
|
})
|
|
511
754
|
|
|
512
755
|
describe('serialize', () => {
|
|
@@ -787,7 +1030,7 @@ describe('serialize', () => {
|
|
|
787
1030
|
value: BigInt('0x0'),
|
|
788
1031
|
})
|
|
789
1032
|
expect(serialized).toEqual(
|
|
790
|
-
'
|
|
1033
|
+
'0xe280808305208094c00000000000000000000000000000000000000080808284f38080',
|
|
791
1034
|
)
|
|
792
1035
|
})
|
|
793
1036
|
|
|
@@ -803,6 +1046,84 @@ describe('serialize', () => {
|
|
|
803
1046
|
'[Signature.InvalidVError: Value `29` is an invalid v value. v must be 27, 28 or >=35.]',
|
|
804
1047
|
)
|
|
805
1048
|
})
|
|
1049
|
+
|
|
1050
|
+
describe('v + chainId', () => {
|
|
1051
|
+
const signed = {
|
|
1052
|
+
...transaction,
|
|
1053
|
+
chainId: 1,
|
|
1054
|
+
r: '0x60fdd29ff912ce880cd3edaf9f932dc61d3dae823ea77e0323f94adb9f6a72fe',
|
|
1055
|
+
s: '0x60fdd29ff912ce880cd3edaf9f932dc61d3dae823ea77e0323f94adb9f6a72fe',
|
|
1056
|
+
} as const
|
|
1057
|
+
|
|
1058
|
+
test('behavior: v as parity', () => {
|
|
1059
|
+
expect(
|
|
1060
|
+
[0, 1, 27, 28, 37, 38].map((v) => {
|
|
1061
|
+
const { chainId, v: v_ } = TxEnvelopeLegacy.deserialize(
|
|
1062
|
+
TxEnvelopeLegacy.serialize({ ...signed, v }),
|
|
1063
|
+
)
|
|
1064
|
+
return { chainId, v: v_ }
|
|
1065
|
+
}),
|
|
1066
|
+
).toMatchInlineSnapshot(`
|
|
1067
|
+
[
|
|
1068
|
+
{
|
|
1069
|
+
"chainId": 1,
|
|
1070
|
+
"v": 37,
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
"chainId": 1,
|
|
1074
|
+
"v": 38,
|
|
1075
|
+
},
|
|
1076
|
+
{
|
|
1077
|
+
"chainId": 1,
|
|
1078
|
+
"v": 37,
|
|
1079
|
+
},
|
|
1080
|
+
{
|
|
1081
|
+
"chainId": 1,
|
|
1082
|
+
"v": 38,
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
"chainId": 1,
|
|
1086
|
+
"v": 37,
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
"chainId": 1,
|
|
1090
|
+
"v": 38,
|
|
1091
|
+
},
|
|
1092
|
+
]
|
|
1093
|
+
`)
|
|
1094
|
+
})
|
|
1095
|
+
|
|
1096
|
+
test('error: v encodes another chain', () => {
|
|
1097
|
+
expect(() =>
|
|
1098
|
+
TxEnvelopeLegacy.serialize({ ...signed, v: 40 }),
|
|
1099
|
+
).toThrowErrorMatchingInlineSnapshot(
|
|
1100
|
+
`[TransactionEnvelope.InvalidChainIdError: Chain ID "1" is invalid.]`,
|
|
1101
|
+
)
|
|
1102
|
+
expect(() =>
|
|
1103
|
+
TxEnvelopeLegacy.serialize({ ...signed, v: 35 }),
|
|
1104
|
+
).toThrowErrorMatchingInlineSnapshot(
|
|
1105
|
+
`[TransactionEnvelope.InvalidChainIdError: Chain ID "1" is invalid.]`,
|
|
1106
|
+
)
|
|
1107
|
+
expect(() =>
|
|
1108
|
+
TxEnvelopeLegacy.serialize({ ...signed, chainId: 17000, v: 37 }),
|
|
1109
|
+
).toThrowErrorMatchingInlineSnapshot(
|
|
1110
|
+
`[TransactionEnvelope.InvalidChainIdError: Chain ID "17000" is invalid.]`,
|
|
1111
|
+
)
|
|
1112
|
+
})
|
|
1113
|
+
|
|
1114
|
+
test('error: invalid v', () => {
|
|
1115
|
+
expect(() =>
|
|
1116
|
+
TxEnvelopeLegacy.serialize({ ...signed, v: 29 }),
|
|
1117
|
+
).toThrowErrorMatchingInlineSnapshot(
|
|
1118
|
+
`[Signature.InvalidVError: Value \`29\` is an invalid v value. v must be 27, 28 or >=35.]`,
|
|
1119
|
+
)
|
|
1120
|
+
expect(() =>
|
|
1121
|
+
TxEnvelopeLegacy.serialize({ ...signed, v: 2 }),
|
|
1122
|
+
).toThrowErrorMatchingInlineSnapshot(
|
|
1123
|
+
`[Signature.InvalidVError: Value \`2\` is an invalid v value. v must be 27, 28 or >=35.]`,
|
|
1124
|
+
)
|
|
1125
|
+
})
|
|
1126
|
+
})
|
|
806
1127
|
})
|
|
807
1128
|
|
|
808
1129
|
describe('toRpc', () => {
|
|
@@ -4,6 +4,47 @@ import { describe, expect, test } from 'vp/test'
|
|
|
4
4
|
import { anvilMainnet } from '../../../test/prool.js'
|
|
5
5
|
|
|
6
6
|
describe('fromRpc', () => {
|
|
7
|
+
test('behavior: unknown status and type named like `Object.prototype` keys', () => {
|
|
8
|
+
const { frameReceipts, status, type } = TransactionReceipt.fromRpc({
|
|
9
|
+
blockHash:
|
|
10
|
+
'0xc350d807505fb835650f0013632c5515592987ba169bbc6626d9fc54d91f0f0b',
|
|
11
|
+
blockNumber: '0x12f296f',
|
|
12
|
+
contractAddress: null,
|
|
13
|
+
cumulativeGasUsed: '0x82515',
|
|
14
|
+
effectiveGasPrice: '0x21c2f6c09',
|
|
15
|
+
frameReceipts: [
|
|
16
|
+
{
|
|
17
|
+
executionGasUsed: '0x0',
|
|
18
|
+
gasUsed: '0x0',
|
|
19
|
+
logs: [],
|
|
20
|
+
stateGasUsed: '0x0',
|
|
21
|
+
status: 'constructor',
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',
|
|
25
|
+
gasUsed: '0x2abba',
|
|
26
|
+
logs: [],
|
|
27
|
+
logsBloom: '0x',
|
|
28
|
+
status: '__proto__',
|
|
29
|
+
to: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',
|
|
30
|
+
transactionHash:
|
|
31
|
+
'0x353fdfc38a2f26115daadee9f5b8392ce62b84f410957967e2ed56b35338cdd0',
|
|
32
|
+
transactionIndex: '0x2',
|
|
33
|
+
type: 'toString',
|
|
34
|
+
} as unknown as TransactionReceipt.Rpc)
|
|
35
|
+
expect({
|
|
36
|
+
frameStatus: frameReceipts?.[0]?.status,
|
|
37
|
+
status,
|
|
38
|
+
type,
|
|
39
|
+
}).toMatchInlineSnapshot(`
|
|
40
|
+
{
|
|
41
|
+
"frameStatus": undefined,
|
|
42
|
+
"status": undefined,
|
|
43
|
+
"type": "toString",
|
|
44
|
+
}
|
|
45
|
+
`)
|
|
46
|
+
})
|
|
47
|
+
|
|
7
48
|
test('default', () => {
|
|
8
49
|
const receipt = TransactionReceipt.fromRpc({
|
|
9
50
|
blobGasPrice: '0x42069',
|