Skip to content
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

Open
wants to merge 5 commits into
base: develop-2022
Choose a base branch
from
Open

Conversation

icodezjb
Copy link
Member

@icodezjb icodezjb commented Jan 1, 2024

No description provided.

cli/src/cli.rs Show resolved Hide resolved
cli/src/cli.rs Show resolved Hide resolved
cli/src/cli.rs Show resolved Hide resolved
runner.sync_run(|mut config| {
let components = new_partial::<
chainx_runtime::RuntimeApi,
chainx_executor::ChainXExecutor,
Copy link
Contributor

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);
Copy link
Contributor

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");
Copy link
Contributor

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 ?

Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants