@@ -110,6 +110,7 @@ fn tests(required_forbidden_pairs: &[(&[&str], &[&str])]) {
110110 let ( tempdir, address) = match deploy (
111111 PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( path) ,
112112 contract,
113+ true ,
113114 ) {
114115 Ok ( ( tempdir, address) ) => ( tempdir, address) ,
115116 Err ( Error ( severity, error) ) => {
@@ -143,14 +144,15 @@ fn tests(required_forbidden_pairs: &[(&[&str], &[&str])]) {
143144 assert ! ( failures. is_empty( ) ) ;
144145}
145146
146- fn deploy ( path : impl AsRef < Path > , contract : & str ) -> Result < ( TempDir , String ) > {
147+ fn deploy ( path : impl AsRef < Path > , contract : & str , activate : bool ) -> Result < ( TempDir , String ) > {
147148 let tempdir = tempdir ( ) . unwrap ( ) ;
148149 let dir = & tempdir;
149150
150151 let rust_toolchain_toml =
151152 PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "integration/stylus/rust-toolchain.toml" ) ;
152153 copy ( rust_toolchain_toml, dir. path ( ) . join ( "rust-toolchain.toml" ) ) . unwrap ( ) ;
153154
155+ // smoelius: Compile.
154156 command (
155157 dir,
156158 [
@@ -165,31 +167,26 @@ fn deploy(path: impl AsRef<Path>, contract: &str) -> Result<(TempDir, String)> {
165167 ] ,
166168 ) ?;
167169
168- command (
169- dir,
170- [
171- "cargo" ,
172- "stylus" ,
173- "check" ,
174- & format ! ( "--wasm-file={contract}.wasm" ) ,
175- ] ,
176- )
177- . unwrap ( ) ;
170+ let wasm_file = format ! ( "--wasm-file={contract}.wasm" ) ;
178171
179- let stdout = command (
180- dir,
181- [
182- "cargo" ,
183- "stylus" ,
184- "deploy" ,
185- & format ! ( "--wasm-file={contract}.wasm" ) ,
186- "--endpoint=http://localhost:8547" ,
187- "--private-key" ,
188- PRIVATE_KEY ,
189- "--no-verify" ,
190- ] ,
191- )
192- . unwrap ( ) ;
172+ // smoelius: Check.
173+ command ( dir, [ "cargo" , "stylus" , "check" , & wasm_file] ) . unwrap ( ) ;
174+
175+ // smoelius: Deploy.
176+ let mut deploy_args = vec ! [
177+ "cargo" ,
178+ "stylus" ,
179+ "deploy" ,
180+ & wasm_file,
181+ "--endpoint=http://localhost:8547" ,
182+ "--private-key" ,
183+ PRIVATE_KEY ,
184+ "--no-verify" ,
185+ ] ;
186+ if !activate {
187+ deploy_args. push ( "--no-activate" ) ;
188+ }
189+ let stdout = command ( dir, deploy_args) . unwrap ( ) ;
193190
194191 let address = stdout
195192 . lines ( )
0 commit comments