@@ -7,7 +7,7 @@ use std::process;
77use toml:: value:: Value ;
88
99#[ derive( Serialize , Deserialize , Debug ) ]
10- pub struct MainConfigFile {
10+ pub struct ProjectManifestFile {
1111 project : ProjectConfigFile ,
1212 contracts : Option < Value > ,
1313}
@@ -20,7 +20,7 @@ pub struct ProjectConfigFile {
2020}
2121
2222#[ derive( Serialize , Deserialize , Debug ) ]
23- pub struct MainConfig {
23+ pub struct ProjectManifest {
2424 pub project : ProjectConfig ,
2525 #[ serde( serialize_with = "toml::ser::tables_last" ) ]
2626 pub contracts : BTreeMap < String , ContractConfig > ,
@@ -50,22 +50,22 @@ pub struct NotebookConfig {
5050 pub path : String ,
5151}
5252
53- impl MainConfig {
54- pub fn from_path ( path : & PathBuf ) -> MainConfig {
53+ impl ProjectManifest {
54+ pub fn from_path ( path : & PathBuf ) -> ProjectManifest {
5555 let path = match File :: open ( path) {
5656 Ok ( path) => path,
5757 Err ( _e) => {
5858 println ! ( "Error: unable to locate Clarinet.toml in current directory" ) ;
5959 std:: process:: exit ( 1 ) ;
6060 }
6161 } ;
62- let mut config_file_reader = BufReader :: new ( path) ;
63- let mut config_file_buffer = vec ! [ ] ;
64- config_file_reader
65- . read_to_end ( & mut config_file_buffer )
62+ let mut project_manifest_file_reader = BufReader :: new ( path) ;
63+ let mut project_manifest_file_buffer = vec ! [ ] ;
64+ project_manifest_file_reader
65+ . read_to_end ( & mut project_manifest_file_buffer )
6666 . unwrap ( ) ;
67- let config_file : MainConfigFile = toml:: from_slice ( & config_file_buffer [ ..] ) . unwrap ( ) ;
68- MainConfig :: from_config_file ( config_file )
67+ let project_manifest_file : ProjectManifestFile = toml:: from_slice ( & project_manifest_file_buffer [ ..] ) . unwrap ( ) ;
68+ ProjectManifest :: from_project_manifest_file ( project_manifest_file )
6969 }
7070
7171 pub fn ordered_contracts ( & self ) -> Vec < ( String , ContractConfig ) > {
@@ -124,21 +124,21 @@ impl MainConfig {
124124 dst
125125 }
126126
127- pub fn from_config_file ( config_file : MainConfigFile ) -> MainConfig {
127+ pub fn from_project_manifest_file ( project_manifest_file : ProjectManifestFile ) -> ProjectManifest {
128128 let project = ProjectConfig {
129- name : config_file . project . name . clone ( ) ,
129+ name : project_manifest_file . project . name . clone ( ) ,
130130 requirements : None ,
131- costs_version : config_file . project . costs_version . unwrap_or ( 1 ) ,
131+ costs_version : project_manifest_file . project . costs_version . unwrap_or ( 1 ) ,
132132 } ;
133133
134- let mut config = MainConfig {
134+ let mut config = ProjectManifest {
135135 project,
136136 contracts : BTreeMap :: new ( ) ,
137137 } ;
138138 let mut config_contracts = BTreeMap :: new ( ) ;
139139 let mut config_requirements: Vec < RequirementConfig > = Vec :: new ( ) ;
140140
141- match config_file . project . requirements {
141+ match project_manifest_file . project . requirements {
142142 Some ( Value :: Array ( requirements) ) => {
143143 for link_settings in requirements. iter ( ) {
144144 match link_settings {
@@ -156,7 +156,7 @@ impl MainConfig {
156156 _ => { }
157157 } ;
158158
159- match config_file . contracts {
159+ match project_manifest_file . contracts {
160160 Some ( Value :: Table ( contracts) ) => {
161161 for ( contract_name, contract_settings) in contracts. iter ( ) {
162162 match contract_settings {
0 commit comments