[PIE-1805] Create stub trace_replayBlockTransactions json-rpc method (#1873)

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
This commit is contained in:
mbaxter
2019-08-22 12:49:58 -04:00
committed by GitHub
parent 75ad205fe9
commit 45a5b9c781
157 changed files with 27491 additions and 343 deletions

View File

@@ -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) {

File diff suppressed because it is too large Load Diff