-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix babe epoch command #696
base: develop-2022
Are you sure you want to change the base?
Conversation
runner.sync_run(|mut config| { | ||
let components = new_partial::< | ||
chainx_runtime::RuntimeApi, | ||
chainx_executor::ChainXExecutor, |
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.
we have 3 type runtime, maybe re-use the macro construct_async_run
let bytes = hex::decode(&self.bytes).expect("require hex string without 0x"); | ||
let epoch: EpochChangesFor<chainx_runtime::Block, Epoch> = | ||
Decode::decode(&mut &bytes[..]).expect("Decode must success"); | ||
println!("epoch: {:?}", epoch); |
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.
we can change the println!
to log
?
|
||
client | ||
.insert_aux(&[(BABE_EPOCH_CHANGES_KEY, &epoch.encode()[..])], &[]) | ||
.expect("Insert to db must success"); |
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.
those expect can change to Err and using ?
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 advice not commit this file in git? I think provide this file in validator doc is more batter
No description provided.