@@ -472,7 +472,10 @@ pub trait ContractInterface {
472472/// A complete contract specification requires a `parameters` section
473473/// and a `contract` section.
474474#[ derive( Debug , Serialize , Deserialize , Clone ) ]
475- #[ cfg_attr( feature = "testing" , derive( arbitrary:: Arbitrary ) ) ]
475+ #[ cfg_attr(
476+ any( feature = "testing" , all( test, any( unix, windows) ) ) ,
477+ derive( arbitrary:: Arbitrary )
478+ ) ]
476479pub struct Contract < ' a > {
477480 #[ serde( borrow) ]
478481 pub parameters : Parameters < ' a > ,
@@ -778,7 +781,10 @@ impl DerefMut for StateSummary<'_> {
778781/// and does not include any other metadata (like the parameters).
779782#[ serde_as]
780783#[ derive( Serialize , Deserialize , Clone ) ]
781- #[ cfg_attr( feature = "testing" , derive( arbitrary:: Arbitrary ) ) ]
784+ #[ cfg_attr(
785+ any( feature = "testing" , all( test, any( unix, windows) ) ) ,
786+ derive( arbitrary:: Arbitrary )
787+ ) ]
782788pub struct ContractCode < ' a > {
783789 // TODO: conver this to Arc<[u8]> instead
784790 #[ serde_as( as = "serde_with::Bytes" ) ]
@@ -911,7 +917,10 @@ impl std::fmt::Debug for ContractCode<'_> {
911917/// The key representing the hash of the contract executable code hash and a set of `parameters`.
912918#[ serde_as]
913919#[ derive( PartialEq , Eq , Clone , Copy , Serialize , Deserialize , Hash ) ]
914- #[ cfg_attr( feature = "testing" , derive( arbitrary:: Arbitrary ) ) ]
920+ #[ cfg_attr(
921+ any( feature = "testing" , all( test, any( unix, windows) ) ) ,
922+ derive( arbitrary:: Arbitrary )
923+ ) ]
915924#[ repr( transparent) ]
916925pub struct ContractInstanceId ( #[ serde_as( as = "[_; CONTRACT_KEY_SIZE]" ) ] [ u8 ; CONTRACT_KEY_SIZE ] ) ;
917926
@@ -989,7 +998,10 @@ impl std::fmt::Debug for ContractInstanceId {
989998/// A complete key specification, that represents a cryptographic hash that identifies the contract.
990999#[ serde_as]
9911000#[ derive( Debug , Eq , Copy , Clone , Serialize , Deserialize ) ]
992- #[ cfg_attr( feature = "testing" , derive( arbitrary:: Arbitrary ) ) ]
1001+ #[ cfg_attr(
1002+ any( feature = "testing" , all( test, any( unix, windows) ) ) ,
1003+ derive( arbitrary:: Arbitrary )
1004+ ) ]
9931005pub struct ContractKey {
9941006 instance : ContractInstanceId ,
9951007 code : Option < CodeHash > ,
0 commit comments