feat(ethers-core/Chain): implement Default trait (#976)
This commit is contained in:
parent
e0f5fe5325
commit
4fd9c7800e
|
@ -2,7 +2,7 @@ use serde::Deserialize;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
use core::convert::TryFrom;
|
use core::convert::TryFrom;
|
||||||
use std::{fmt, str::FromStr};
|
use std::{default, fmt, str::FromStr};
|
||||||
|
|
||||||
use crate::types::U256;
|
use crate::types::U256;
|
||||||
|
|
||||||
|
@ -177,3 +177,14 @@ impl Chain {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl default::Default for Chain {
|
||||||
|
fn default() -> Self {
|
||||||
|
Chain::Mainnet
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_default_chain() {
|
||||||
|
assert_eq!(Chain::default(), Chain::Mainnet);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue