@@ -7,7 +7,10 @@ use clvm_traits::{ClvmEncoder, ToClvm};
7
7
8
8
use crate :: channel_handler:: game:: Game ;
9
9
use crate :: common:: types:: { AllocEncoder , Amount , Error , GameID , Hash , Sha256Input } ;
10
- use crate :: tests:: simenv:: { GameAction , GameActionResult , SimulatorEnvironment } ;
10
+ use crate :: tests:: game:: { GameAction , GameActionResult } ;
11
+
12
+ #[ cfg( feature = "sim-tests" ) ]
13
+ use crate :: tests:: simenv:: SimulatorEnvironment ;
11
14
12
15
pub fn load_calpoker ( allocator : & mut AllocEncoder , game_id : GameID ) -> Result < Game , Error > {
13
16
Game :: new (
@@ -17,6 +20,7 @@ pub fn load_calpoker(allocator: &mut AllocEncoder, game_id: GameID) -> Result<Ga
17
20
)
18
21
}
19
22
23
+ #[ cfg( feature = "sim-tests" ) ]
20
24
#[ test]
21
25
fn test_load_calpoker ( ) {
22
26
let mut allocator = AllocEncoder :: new ( ) ;
@@ -31,6 +35,7 @@ fn test_load_calpoker() {
31
35
. expect ( "should get a sim env" ) ;
32
36
}
33
37
38
+ #[ cfg( feature = "sim-tests" ) ]
34
39
fn run_calpoker_play_test (
35
40
allocator : & mut AllocEncoder ,
36
41
moves : & [ GameAction ] ,
@@ -77,6 +82,7 @@ pub fn test_moves_1(allocator: &mut AllocEncoder) -> [GameAction; 5] {
77
82
]
78
83
}
79
84
85
+ #[ cfg( feature = "sim-tests" ) ]
80
86
#[ test]
81
87
fn test_play_calpoker_happy_path ( ) {
82
88
let mut allocator = AllocEncoder :: new ( ) ;
@@ -86,6 +92,7 @@ fn test_play_calpoker_happy_path() {
86
92
}
87
93
88
94
#[ test]
95
+ #[ cfg( feature = "sim-tests" ) ]
89
96
fn test_play_calpoker_on_chain_after_1_move_p1 ( ) {
90
97
let mut allocator = AllocEncoder :: new ( ) ;
91
98
@@ -100,6 +107,7 @@ fn test_play_calpoker_on_chain_after_1_move_p1() {
100
107
}
101
108
102
109
#[ test]
110
+ #[ cfg( feature = "sim-tests" ) ]
103
111
fn test_play_calpoker_on_chain_after_1_move_p0_lost_message ( ) {
104
112
let mut allocator = AllocEncoder :: new ( ) ;
105
113
let moves = test_moves_1 ( & mut allocator) ;
@@ -111,6 +119,7 @@ fn test_play_calpoker_on_chain_after_1_move_p0_lost_message() {
111
119
}
112
120
113
121
#[ test]
122
+ #[ cfg( feature = "sim-tests" ) ]
114
123
fn test_play_calpoker_on_chain_after_1_move_p0 ( ) {
115
124
let mut allocator = AllocEncoder :: new ( ) ;
116
125
let moves = test_moves_1 ( & mut allocator) ;
@@ -121,6 +130,7 @@ fn test_play_calpoker_on_chain_after_1_move_p0() {
121
130
}
122
131
123
132
#[ test]
133
+ #[ cfg( feature = "sim-tests" ) ]
124
134
fn test_play_calpoker_on_chain_after_2_moves_p0 ( ) {
125
135
let mut allocator = AllocEncoder :: new ( ) ;
126
136
let moves = test_moves_1 ( & mut allocator) ;
@@ -130,7 +140,9 @@ fn test_play_calpoker_on_chain_after_2_moves_p0() {
130
140
let test4 = run_calpoker_play_test ( & mut allocator, & on_chain_moves_3) . expect ( "should work" ) ;
131
141
debug ! ( "play_result {test4:?}" ) ;
132
142
}
143
+
133
144
#[ test]
145
+ #[ cfg( feature = "sim-tests" ) ]
134
146
fn test_play_calpoker_on_chain_after_2_moves_p1 ( ) {
135
147
let mut allocator = AllocEncoder :: new ( ) ;
136
148
let moves = test_moves_1 ( & mut allocator) ;
0 commit comments