This is an automated email from the ASF dual-hosted git repository.
toulmean pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-tuweni.git
The following commit(s) were added to refs/heads/main by this push:
new 2e258c0 Add astor.json and a test to check the proper hash is created
new c7cfa14 Merge pull request #238 from atoulme/add_astor_test
2e258c0 is described below
commit 2e258c0331276a723f97165a8feb5180deef3577
Author: Antoine Toulme <[email protected]>
AuthorDate: Sun May 16 22:36:29 2021 -0700
Add astor.json and a test to check the proper hash is created
---
build.gradle | 1 +
.../apache/tuweni/eth/genesis/GenesisFileTest.java | 10 ++++
eth/src/test/resources/astor.json | 57 ++++++++++++++++++++++
3 files changed, 68 insertions(+)
diff --git a/build.gradle b/build.gradle
index 91701fb..4a9dde5 100644
--- a/build.gradle
+++ b/build.gradle
@@ -115,6 +115,7 @@ if (file('.git').exists()) {
'devp2p-eth/src/test/resources/mainnet.json',
'devp2p-eth/src/test/resources/besu-dev.json',
'dist/netty-license/*',
+ 'eth/src/test/resources/astor.json',
'eth/src/test/resources/mainnet.json',
'eth-client/src/main/resources/mainnet.json',
'eth-client/src/main/resources/default.json',
diff --git
a/eth/src/test/java/org/apache/tuweni/eth/genesis/GenesisFileTest.java
b/eth/src/test/java/org/apache/tuweni/eth/genesis/GenesisFileTest.java
index e618e57..0782dcb 100644
--- a/eth/src/test/java/org/apache/tuweni/eth/genesis/GenesisFileTest.java
+++ b/eth/src/test/java/org/apache/tuweni/eth/genesis/GenesisFileTest.java
@@ -111,4 +111,14 @@ class GenesisFileTest {
file.toBlock().getHeader().getHash());
}
+ @Test
+ void testAstorGenesis() throws IOException {
+ InputStream input =
GenesisFileTest.class.getResourceAsStream("/astor.json");
+ byte[] contents = input.readAllBytes();
+ GenesisFile file = GenesisFile.read(contents);
+ assertEquals(
+
Hash.fromHexString("0xf9c534ad514bc380e23a74e788c3d1f2446f9ad1cb74f0dbb48ea56c0315f5bc"),
+ file.toBlock().getHeader().getHash());
+ }
+
}
diff --git a/eth/src/test/resources/astor.json
b/eth/src/test/resources/astor.json
new file mode 100644
index 0000000..137dc95
--- /dev/null
+++ b/eth/src/test/resources/astor.json
@@ -0,0 +1,57 @@
+
+{
+ "config": {
+ "chainId": 212,
+ "ecip1049Block": 0,
+ "keccak256": {
+ }
+ },
+ "nonce": "0x42",
+ "timestamp": "0x0",
+ "extraData":
"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",
+ "gasLimit": "0x1fffffffffffff",
+ "difficulty": "0x10000000000",
+ "mixHash":
"0x0000000000000000000000000000000000000000000000000000000000000000",
+ "coinbase": "0x0000000000000000000000000000000000000000",
+ "alloc": {
+ "6e3da3dd22f043958fdb862db5876e5e52a3d7b7": {
+ "balance": "90000000000000000000000"
+ },
+ "46652437dc2f978952c5f5667533874c294e4e84": {
+ "balance": "90000000000000000000000"
+ },
+ "3d650ae1134709a9f2f1c7785cd99400482cdd97": {
+ "balance": "90000000000000000000000"
+ },
+ "e6b2d417af0e3686982dba572fcda575a4e8f575": {
+ "balance": "90000000000000000000000"
+ },
+ "d118ab56776b158c70a0d03ed5ff03392a63deaf": {
+ "balance": "90000000000000000000000"
+ },
+ "2bac997f3c4a51e655d14733aa1d75817443779a": {
+ "balance": "90000000000000000000000"
+ },
+ "bd74228dca706ab4ab7d8b856ec6700624420831": {
+ "balance": "90000000000000000000000"
+ },
+ "33bc5fb03008d7f0001638f48bfff2d628d16882": {
+ "balance": "90000000000000000000000"
+ },
+ "ef826b2e0f6bf62edfe628dbeaa1af58f40f3b06": {
+ "balance": "90000000000000000000000"
+ },
+ "7defc96deecc05288ff177ca08c025ed5c139a95": {
+ "balance": "90000000000000000000000"
+ },
+ "2958DB51a0b4c458d0aa183E8cFB4f2E95cf6E75": {
+ "balance": "90000000000000000000000"
+ },
+ "B460ce2C10d959251792D72b7E2B3EC684F013f1": {
+ "balance": "90000000000000000000000"
+ },
+ "25848A733da7c782fB963D2e562cF7246bD5b6df": {
+ "balance": "90000000000000000000000"
+ }
+ }
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]