public MevBundle SendBundle(int blockNumber, params BundleTransaction[] txs) { byte[][] bundleBytes = txs.Select(t => Rlp.Encode(t, RlpBehaviors.SkipTypedWrapping).Bytes).ToArray(); Keccak[] revertingTxHashes = txs.Where(t => t.CanRevert).Select(t => t.Hash !).ToArray(); MevBundleRpc mevBundleRpc = new() { BlockNumber = blockNumber, Txs = bundleBytes, RevertingTxHashes = revertingTxHashes }; ResultWrapper <bool> resultOfBundle = MevRpcModule.eth_sendBundle(mevBundleRpc); resultOfBundle.GetResult().ResultType.Should().NotBe(ResultType.Failure); resultOfBundle.GetData().Should().Be(true); return(new MevBundle(blockNumber, txs)); } }
protected override async Task <TestBlockchain> Build(ISpecProvider?specProvider = null, UInt256?initialValues = null) { TestBlockchain chain = await base.Build(specProvider, initialValues); MevRpcModule = new MevRpcModule(new JsonRpcConfig(), BundlePool, BlockFinder, StateReader, _tracerFactory, SpecProvider, Signer); return(chain); }