import std/[tables], eth/keys, stew/endians2, nimcrypto/sha2, chronicles, ./engine_client, ./cancun/blobs, ../../../nimbus/transaction, ../../../nimbus/common, ../../../nimbus/utils/utils type BaseTx* = object of RootObj recipient*: Option[EthAddress] gasLimit* : GasInt amount* : UInt256 payload* : seq[byte] txType* : Option[TxType] BigInitcodeTx* = object of BaseTx initcodeLength*: int padByte* : uint8 initcode* : seq[byte] # Blob transaction creator BlobTx* = object of BaseTx gasFee* : GasInt gasTip* : GasInt blobGasFee*: UInt256 blobID* : BlobID blobCount* : int TestAccount* = object key : PrivateKey address: EthAddress index : int TxSender* = ref object accounts: seq[TestAccount] nonceMap: Table[EthAddress, uint64] txSent : int chainId : ChainID MakeTxParams* = object chainId*: ChainID key* : PrivateKey nonce* : AccountNonce CustomTransactionData* = object nonce* : Option[uint64] gasPriceOrGasFeeCap*: Option[GasInt] gasTipCap* : Option[GasInt] gas* : Option[GasInt] to* : Option[common.EthAddress] value* : Option[UInt256] data* : Option[seq[byte]] chainId* : Option[ChainId] signature* : Option[UInt256] const TestAccountCount = 1000 gasPrice* = 30.gwei gasTipPrice* = 1.gwei func toAddress(key: PrivateKey): EthAddress = toKeyPair(key).pubkey.toCanonicalAddress() proc createAccount(idx: int): TestAccount = let seed = toBytesBE(idx.uint64) seedHash = sha256.digest(seed) result.index = idx result.key = PrivateKey.fromRaw(seedHash.data).valueOr: echo error quit(QuitFailure) result.address = toAddress(result.key) proc createAccounts(sender: TxSender) = for i in 0..