11use std:: fmt:: { self , Display } ;
2- #[ cfg( test) ]
2+ #[ cfg( all ( test, not ( target_env = "sgx" ) ) ) ]
33use std:: net:: Ipv4Addr ;
44use std:: path:: Path ;
55use std:: process:: Command ;
@@ -8,11 +8,11 @@ use std::str::FromStr;
88use anyhow:: { anyhow, ensure} ;
99use argh:: FromArgs ;
1010use lightning_invoice:: Currency ;
11- #[ cfg( test) ]
11+ #[ cfg( all ( test, not ( target_env = "sgx" ) ) ) ]
1212use proptest:: arbitrary:: { any, Arbitrary } ;
13- #[ cfg( test) ]
13+ #[ cfg( all ( test, not ( target_env = "sgx" ) ) ) ]
1414use proptest:: strategy:: { BoxedStrategy , Just , Strategy } ;
15- #[ cfg( test) ]
15+ #[ cfg( all ( test, not ( target_env = "sgx" ) ) ) ]
1616use proptest_derive:: Arbitrary ;
1717
1818use crate :: api:: runner:: Port ;
@@ -83,7 +83,7 @@ impl NodeCommand {
8383 }
8484}
8585
86- #[ cfg( test) ]
86+ #[ cfg( all ( test, not ( target_env = "sgx" ) ) ) ]
8787impl Arbitrary for NodeCommand {
8888 type Parameters = ( ) ;
8989 type Strategy = BoxedStrategy < Self > ;
@@ -98,7 +98,7 @@ impl Arbitrary for NodeCommand {
9898}
9999
100100/// Run the Lexe node
101- #[ cfg_attr( test, derive( Arbitrary ) ) ]
101+ #[ cfg_attr( all ( test, not ( target_env = "sgx" ) ) , derive( Arbitrary ) ) ]
102102#[ derive( Clone , Debug , PartialEq , Eq , FromArgs ) ]
103103#[ argh( subcommand, name = "run" ) ]
104104pub struct RunArgs {
@@ -223,7 +223,7 @@ impl RunArgs {
223223}
224224
225225/// Provision a new Lexe node for a user
226- #[ cfg_attr( test, derive( Arbitrary ) ) ]
226+ #[ cfg_attr( all ( test, not ( target_env = "sgx" ) ) , derive( Arbitrary ) ) ]
227227#[ derive( Clone , Debug , PartialEq , Eq , FromArgs ) ]
228228#[ argh( subcommand, name = "provision" ) ]
229229pub struct ProvisionArgs {
@@ -361,7 +361,7 @@ impl Display for BitcoindRpcInfo {
361361 }
362362}
363363
364- #[ cfg( test) ]
364+ #[ cfg( all ( test, not ( target_env = "sgx" ) ) ) ]
365365impl Arbitrary for BitcoindRpcInfo {
366366 type Parameters = ( ) ;
367367 type Strategy = BoxedStrategy < Self > ;
@@ -466,7 +466,7 @@ impl From<Network> for Currency {
466466 }
467467}
468468
469- #[ cfg( test) ]
469+ #[ cfg( all ( test, not ( target_env = "sgx" ) ) ) ]
470470impl Arbitrary for Network {
471471 type Parameters = ( ) ;
472472 type Strategy = BoxedStrategy < Self > ;
@@ -483,7 +483,7 @@ impl Arbitrary for Network {
483483 }
484484}
485485
486- #[ cfg( test) ]
486+ #[ cfg( all ( test, not ( target_env = "sgx" ) ) ) ]
487487mod test {
488488 use proptest:: proptest;
489489
0 commit comments