File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ pub(crate) struct DeployConfig {
1111 /// Chain configuration.
1212 pub chain : ChainConfig ,
1313 /// Contract configurations.
14+ #[ serde( default ) ]
1415 pub contracts : ContractsConfig ,
1516}
1617
@@ -23,7 +24,7 @@ pub(crate) struct ChainConfig {
2324}
2425
2526/// All contract configurations.
26- #[ derive( Debug , Deserialize ) ]
27+ #[ derive( Debug , Deserialize , Default ) ]
2728pub ( crate ) struct ContractsConfig {
2829 /// `AdminProxy` contract config (optional).
2930 pub admin_proxy : Option < AdminProxyConfig > ,
@@ -94,6 +95,17 @@ owner = "0x0000000000000000000000000000000000000000"
9495 assert ! ( config. validate( ) . is_err( ) ) ;
9596 }
9697
98+ #[ test]
99+ fn no_contracts_section ( ) {
100+ let toml = r#"
101+ [chain]
102+ chain_id = 1
103+ "# ;
104+ let config: DeployConfig = toml:: from_str ( toml) . unwrap ( ) ;
105+ config. validate ( ) . unwrap ( ) ;
106+ assert ! ( config. contracts. admin_proxy. is_none( ) ) ;
107+ }
108+
97109 #[ test]
98110 fn admin_proxy_only ( ) {
99111 let toml = r#"
You can’t perform that action at this time.
0 commit comments