-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Dev chain #3385
Conversation
pub fn new_ethereum_olympic() -> Spec { load_bundled!("ethereum/olympic") } | ||
|
||
/// Create a new Frontier mainnet chain spec. | ||
pub fn new_ethereum_frontier() -> Spec { load_bundled!("ethereum/frontier") } |
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.
maybe just introduce a new module Ethereum
rather than inserting _ethereum
into the names manually.
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 thought the best place would be Spec
constructor methods instead of free functions, but I don't think these can be namespaced on the call site, thus the addition. Should they be made functions?
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.
free functions (as they were) are fairly idiomatic, especially when there are as many different presets as we have.
@@ -135,6 +135,12 @@ impl From<ethjson::spec::Spec> for Spec { | |||
} | |||
} | |||
|
|||
macro_rules! load_bundled { | |||
($e:expr) => { | |||
Spec::load(include_bytes!(concat!("../../res/", $e, ".json")) as &[u8]).expect("Chain spec is invalid") |
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.
the error messages here might get a little worse than before. the concat!
macro can customize the expect
message as well.
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.
This is purely for us if we decide to add an invalid spec, it will not even compile then.
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.
seems to me that the error wouldn't get triggered until runtime
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.
ah yes, I confused with include_bytes
. Improved now.
LGTM other than tiny grumble |
parity --chain dev
runsInstantSeal
Engine. The chain has account created with "" phrase prepopulated with large balance.Useful for UI and Dapp development.