Conversation
looks great |
ChainEra::Homestead => ethereum::new_homestead_test(), | ||
}.to_engine().unwrap(); | ||
ChainEra::Frontier => ethereum::new_mainnet_like().engine, | ||
ChainEra::Homestead => ethereum::new_homestead_test().engine |
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.
trailing comma missing.
this is a rather disstressing change. the engine factory was a temporary place-holder for a dynamically-loaded plugin architecture; this change doesn't help achieve that goal. it rearchitects the |
removing
|
I will try address all questions and concerns here:
Currently there is no single place where whole json spec is validated. we have multiple unwraps in spec, builtin and verification. Besides that, there are
This may be my misunderstanding... I see
I had the same concerns, but then I noticed that the only spec function that we use* (excluding
I think it's the other way around. On master branch, it's very difficult to create
Using JSON is completely optional and nothing relies on it now.
I'm aware of that. And there is the same issue with genesis seal. That's true that this pr doesn't help achieve that goal, but imo it does not make it more difficult. |
I understand that this pr introduces two things that could be done separately (deserialization && object ownership refactoring), but it was just much easier to do this things together. |
|
@@ -27,33 +27,6 @@ use substate::*; | |||
use tests::helpers::*; | |||
use ethjson; | |||
|
|||
struct TestEngineFrontier { |
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.
why removed?
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.
Exactly the same structure was defined in ethcore/src/tests/helpers.rs
probably good to go in, but i'd reconsider the naming in light of the architecture alteration. |
Do you have any suggestions? |
Having thought about it |
the goal of this pr is to cleanup loading spec and get rid of all unwraps (or at least as many as possible).
changes:
engineName
withengine
engine
fieldFromJson
trait fromethcore
toEngine
method from spec.engine
is now a spec propertyspec
is no longer a property ofengine
This pr is so big mostly because I had to change a lot of test functions...
todo: