Fix inconsistency between CheckInherentsResult::new()/default() (#1561)

This commit is contained in:
Bastian Köcher
2019-01-25 11:22:04 +01:00
committed by Benjamin Kampmann
parent 661e91e2c7
commit 6543207062
+11 -7
View File
@@ -59,9 +59,7 @@ pub struct InherentData {
impl InherentData {
/// Create a new instance.
pub fn new() -> Self {
Self {
data: Default::default(),
}
Self::default()
}
/// Put data for an inherent into the internal storage.
@@ -153,7 +151,7 @@ impl codec::Decode for InherentData {
///
/// When a fatal error occurres, all other errors are removed and the implementation needs to
/// abbort checking inherents.
#[derive(Encode, Decode, Clone, Default)]
#[derive(Encode, Decode, Clone)]
pub struct CheckInherentsResult {
/// Did the check succeed?
okay: bool,
@@ -163,15 +161,21 @@ pub struct CheckInherentsResult {
errors: InherentData,
}
impl CheckInherentsResult {
/// Create a new instance.
pub fn new() -> Self {
impl Default for CheckInherentsResult {
fn default() -> Self {
Self {
okay: true,
errors: InherentData::new(),
fatal_error: false,
}
}
}
impl CheckInherentsResult {
/// Create a new instance.
pub fn new() -> Self {
Self::default()
}
/// Put an error into the result.
///