mirror of
https://github.com/vacp2p/linea-besu.git
synced 2026-01-09 21:17:54 -05:00
[PIE-1805] Create stub trace_replayBlockTransactions json-rpc method (#1873)
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
This commit is contained in:
@@ -31,6 +31,8 @@ public final class BlockTestUtil {
|
||||
|
||||
private static final Supplier<ChainResources> testChainSupplier =
|
||||
Suppliers.memoize(BlockTestUtil::supplyTestChainResources);
|
||||
private static final Supplier<ChainResources> mainnetChainSupplier =
|
||||
Suppliers.memoize(BlockTestUtil::supplyMainnetChainResources);
|
||||
private static final Supplier<ChainResources> forkOutdatedSupplier =
|
||||
Suppliers.memoize(BlockTestUtil::supplyOutdatedForkResources);
|
||||
private static final Supplier<ChainResources> forkUpgradedSupplier =
|
||||
@@ -48,6 +50,10 @@ public final class BlockTestUtil {
|
||||
return testChainSupplier.get();
|
||||
}
|
||||
|
||||
public static ChainResources getMainnetResources() {
|
||||
return mainnetChainSupplier.get();
|
||||
}
|
||||
|
||||
public static ChainResources getOutdatedForkResources() {
|
||||
return forkOutdatedSupplier.get();
|
||||
}
|
||||
@@ -64,6 +70,15 @@ public final class BlockTestUtil {
|
||||
return new ChainResources(genesisURL, blocksURL);
|
||||
}
|
||||
|
||||
private static ChainResources supplyMainnetChainResources() {
|
||||
final URL genesisURL =
|
||||
ensureFileUrl(
|
||||
BlockTestUtil.class.getClassLoader().getResource("mainnet-data/mainnet.json"));
|
||||
final URL blocksURL =
|
||||
ensureFileUrl(BlockTestUtil.class.getClassLoader().getResource("mainnet-data/1000.blocks"));
|
||||
return new ChainResources(genesisURL, blocksURL);
|
||||
}
|
||||
|
||||
private static ChainResources supplyOutdatedForkResources() {
|
||||
final URL genesisURL =
|
||||
ensureFileUrl(
|
||||
@@ -119,7 +134,7 @@ public final class BlockTestUtil {
|
||||
try {
|
||||
Files.write(
|
||||
target,
|
||||
Resources.toByteArray(BlockTestUtil.class.getResource("/1000.blocks")),
|
||||
Resources.toByteArray(getMainnetResources().getBlocksURL()),
|
||||
StandardOpenOption.CREATE,
|
||||
StandardOpenOption.TRUNCATE_EXISTING);
|
||||
} catch (final IOException ex) {
|
||||
|
||||
26709
testutil/src/main/resources/mainnet-data/mainnet.json
Normal file
26709
testutil/src/main/resources/mainnet-data/mainnet.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user