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

Update block.rs for pending block #405

Merged
merged 3 commits into from
Dec 9, 2020
Merged

Conversation

yq0810
Copy link
Contributor

@yq0810 yq0810 commented Nov 13, 2020

No description provided.

@@ -14,7 +14,7 @@ pub struct BlockHeader {
pub uncles_hash: H256,
/// Miner/author's address.
#[serde(rename = "miner")]
pub author: H160,
pub author: Option<H160>,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's really weird that author/miner is not set, I can't find any evidence of this change. Since this is an edge case and I can imagine anyone really wanting to handle the None case, let's please use default value instead of Option.

Suggested change
pub author: Option<H160>,
#[serde(default)]
pub author: H160,

@@ -63,7 +63,7 @@ pub struct Block<TX> {
pub uncles_hash: H256,
/// Miner/author's address.
#[serde(rename = "miner")]
pub author: H160,
pub author: Option<H160>,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub author: Option<H160>,
#[serde(default)]
pub author: H160,

@tomusdrw tomusdrw merged commit 38174e0 into tomusdrw:master Dec 9, 2020
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