-
Notifications
You must be signed in to change notification settings - Fork 130
Conversation
@@ -85,6 +85,19 @@ public void createFromJsonNoAllocs() throws Exception { | |||
assertThat(header.getParentHash()).isEqualTo(Hash.ZERO); | |||
} | |||
|
|||
@Test | |||
public void createFromJsonWithContract() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might remove this test and edit createFromJsonWithAllocs
but i left it here in order to prove that it passes the case described in issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it could go either way but I think it's worth having a test that covers this more complex case specifically. I've added a few assertions for the contract account's code and storage for good measure.
* Use final for local variables * Use most general applicable interface for variable declaration (Map instead of LinkedHashMap) * Use a plain HashMap instead of LinkedHashMap as order doesn't actually matter * Take advantage of Map.forEach to improve readability. * Regenerate GenesisAccount.toString so it includes the additional fields. * Remove unnecessary @SuppressWarnings annotations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution - extremely helpful. I've applied a few minor tweaks in GenesisState
(see 2241271) just to follow the typical conventions we use (or at lest try to stick with). All just small details though.
Welcome to the Pantheon contributors club. :)
@@ -85,6 +85,19 @@ public void createFromJsonNoAllocs() throws Exception { | |||
assertThat(header.getParentHash()).isEqualTo(Hash.ZERO); | |||
} | |||
|
|||
@Test | |||
public void createFromJsonWithContract() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it could go either way but I think it's worth having a test that covers this more complex case specifically. I've added a few assertions for the contract account's code and storage for good measure.
PR description
Support for contract code read from genesis file.
Fixed Issue(s)
fixes: #662