@@ -1444,7 +1444,6 @@ type
14441444 blobVersionedHashes: seq [Eth2Digest ]
14451445 hasAuthorizationList: bool
14461446 authorizationList: seq [ETHAuthorization ]
1447- initcodes: seq [seq [byte ]]
14481447 signature: seq [byte ]
14491448 bytes: TypedTransaction
14501449
@@ -1492,59 +1491,49 @@ proc ETHTransactionsCreateFromJson(
14921491 return nil
14931492
14941493 # Check fork consistency
1495- static : doAssert totalSerializedFields (TransactionObject ) == 24 ,
1494+ static : doAssert totalSerializedFields (TransactionObject ) == 23 ,
14961495 " Only update this number once code is adjusted to check new fields!"
14971496 let txType =
14981497 case data.`type`.get (0 .Quantity ):
14991498 of 0 .Quantity :
15001499 if data.yParity.isSome or data.accessList.isSome or
15011500 data.maxFeePerGas.isSome or data.maxPriorityFeePerGas.isSome or
15021501 data.maxFeePerBlobGas.isSome or data.blobVersionedHashes.isSome or
1503- data.authorizationList.isSome or data.initCodes.isSome :
1502+ data.authorizationList.isSome:
15041503 return nil
15051504 TxLegacy
15061505 of 1 .Quantity :
15071506 if data.chainId.isNone or data.accessList.isNone:
15081507 return nil
15091508 if data.maxFeePerGas.isSome or data.maxPriorityFeePerGas.isSome or
15101509 data.maxFeePerBlobGas.isSome or data.blobVersionedHashes.isSome or
1511- data.authorizationList.isSome or data.initCodes.isSome :
1510+ data.authorizationList.isSome:
15121511 return nil
15131512 TxEip2930
15141513 of 2 .Quantity :
15151514 if data.chainId.isNone or data.accessList.isNone or
15161515 data.maxFeePerGas.isNone or data.maxPriorityFeePerGas.isNone:
15171516 return nil
15181517 if data.maxFeePerBlobGas.isSome or data.blobVersionedHashes.isSome or
1519- data.authorizationList.isSome or data.initCodes.isSome :
1518+ data.authorizationList.isSome:
15201519 return nil
15211520 TxEip1559
15221521 of 3 .Quantity :
15231522 if data.to.isNone or data.chainId.isNone or data.accessList.isNone or
15241523 data.maxFeePerGas.isNone or data.maxPriorityFeePerGas.isNone or
15251524 data.maxFeePerBlobGas.isNone or data.blobVersionedHashes.isNone:
15261525 return nil
1527- if data.authorizationList.isSome or data.initCodes.isSome :
1526+ if data.authorizationList.isSome:
15281527 return nil
15291528 TxEip4844
15301529 of 4 .Quantity :
15311530 if data.to.isNone or data.chainId.isNone or data.accessList.isNone or
15321531 data.maxFeePerGas.isNone or data.maxPriorityFeePerGas.isNone or
15331532 data.authorizationList.isNone:
15341533 return nil
1535- if data.maxFeePerBlobGas.isSome or data.blobVersionedHashes.isSome or
1536- data.initCodes.isSome:
1534+ if data.maxFeePerBlobGas.isSome or data.blobVersionedHashes.isSome:
15371535 return nil
15381536 TxEip7702
1539- of 6 .Quantity :
1540- if data.to.isNone or data.chainId.isNone or data.accessList.isNone or
1541- data.maxFeePerGas.isNone or data.maxPriorityFeePerGas.isNone or
1542- data.initCodes.isNone:
1543- return nil
1544- if data.maxFeePerBlobGas.isSome or data.blobVersionedHashes.isSome or
1545- data.authorizationList.isSome:
1546- return nil
1547- TxEip7873
15481537 else :
15491538 return nil
15501539
@@ -1567,17 +1556,6 @@ proc ETHTransactionsCreateFromJson(
15671556 for authorization in data.authorizationList.get:
15681557 if authorization.v > uint8 .high:
15691558 return nil
1570- if data.initCodes.isSome:
1571- const MAX_INITCODE_COUNT = 256
1572- if data.initCodes.get.len == 0 or
1573- data.initCodes.get.len > MAX_INITCODE_COUNT :
1574- return nil
1575- for initCode in data.initCodes.get:
1576- const
1577- MAX_CODE_SIZE = 0x 6000
1578- MAX_INITCODE_SIZE = 2 * MAX_CODE_SIZE
1579- if initCode.len == 0 or initCode.len > MAX_INITCODE_SIZE :
1580- return nil
15811559 let
15821560 tx = eth_types.EthTransaction (
15831561 txType: txType,
@@ -1613,11 +1591,6 @@ proc ETHTransactionsCreateFromJson(
16131591 data.authorizationList.get
16141592 else :
16151593 @ [],
1616- initCodes:
1617- if data.initCodes.isSome:
1618- data.initCodes.get
1619- else :
1620- @ [],
16211594 V: distinctBase (data.v),
16221595 R: data.r,
16231596 S: data.s)
@@ -1712,7 +1685,6 @@ proc ETHTransactionsCreateFromJson(
17121685 blobVersionedHashes: tx.versionedHashes.mapIt (Eth2Digest (data: it.data)),
17131686 hasAuthorizationList: tx.txType == TxEip7702 ,
17141687 authorizationList: authorizationList,
1715- initcodes: tx.initCodes,
17161688 signature: @ rawSig,
17171689 bytes: rlpBytes.TypedTransaction )
17181690
@@ -2224,46 +2196,6 @@ func ETHAuthorizationGetSignatureBytes(
22242196 cast [ptr UncheckedArray [byte ]](
22252197 addr distinctBase (authorization[].signature)[0 ])
22262198
2227- func ETHTransactionGetNumInitcodes (
2228- transaction: ptr ETHTransaction ): cint {.exported .} =
2229- # # Indicates the total number of initcodes of a transaction.
2230- # #
2231- # # * Individual initcodes may be inspected using
2232- # # `ETHTransactionGetInitcode`.
2233- # #
2234- # # Parameters:
2235- # # * `transaction` - Transaction.
2236- # #
2237- # # Returns:
2238- # # * Number of available initcodes.
2239- transaction[].initcodes.len.cint
2240-
2241- func ETHTransactionGetInitcodeBytes (
2242- transaction: ptr ETHTransaction ,
2243- initcodeIndex: cint ,
2244- numBytes #[ out]# : ptr cint ): ptr UncheckedArray [byte ] {.exported .} =
2245- # # Obtains an individual initcode by sequential index
2246- # # in a transaction.
2247- # #
2248- # # * The returned value is allocated in the given transaction.
2249- # # It must neither be released nor written to, and the transaction
2250- # # must not be released while the returned value is in use.
2251- # #
2252- # # Parameters:
2253- # # * `transaction` - Transaction.
2254- # # * `initcodeIndex` - Sequential initcode index.
2255- # # * `numBytes` [out] - Length of buffer.
2256- # #
2257- # # Returns:
2258- # # * Buffer with initcode.
2259- numBytes[] = transaction[].initcodes[initcodeIndex.int ].len.cint
2260- if transaction[].initcodes[initcodeIndex.int ].len == 0 :
2261- # https://github.com/nim-lang/Nim/issues/22389
2262- const defaultBytes: cstring = " "
2263- return cast [ptr UncheckedArray [byte ]](defaultBytes)
2264- cast [ptr UncheckedArray [byte ]](
2265- addr transaction[].initcodes[initcodeIndex.int ][0 ])
2266-
22672199func ETHTransactionGetSignatureBytes (
22682200 transaction: ptr ETHTransaction ,
22692201 numBytes #[ out]# : ptr cint ): ptr UncheckedArray [byte ] {.exported .} =
0 commit comments