@@ -15,13 +15,13 @@ use wallet::protocol_wallet_api::MemWallet;
1515
1616#[ test]
1717fn test_initial_tx_creation ( ) -> anyhow:: Result < ( ) > {
18- let env = TestEnv :: new ( ) ?;
18+ let mut env = TestEnv :: new ( ) ?;
1919 // env.start_explorer_in_container()?;
20- let ( _, _) = initial_tx_creation ( & env) ?;
20+ let ( _, _) = initial_tx_creation ( & mut env) ?;
2121 Ok ( ( ) )
2222}
2323
24- pub fn funded_wallet ( env : & TestEnv ) -> MemWallet {
24+ pub fn funded_wallet ( env : & mut TestEnv ) -> MemWallet {
2525 // TODO move this line to TestEnv
2626 let client =
2727 BdkElectrumClient :: new ( Client :: new ( & env. electrum_url ( ) ) . unwrap ( ) ) ;
@@ -36,7 +36,7 @@ pub fn funded_wallet(env: &TestEnv) -> MemWallet {
3636 wallet
3737}
3838
39- fn initial_tx_creation ( env : & TestEnv ) -> anyhow:: Result < ( BMPProtocol , BMPProtocol ) > {
39+ fn initial_tx_creation ( env : & mut TestEnv ) -> anyhow:: Result < ( BMPProtocol , BMPProtocol ) > {
4040 tracing:: debug!( "running..." ) ;
4141
4242 let alice_funds = funded_wallet ( env) ;
@@ -84,11 +84,11 @@ fn initial_tx_creation(env: &TestEnv) -> anyhow::Result<(BMPProtocol, BMPProtoco
8484
8585#[ test]
8686fn test_swap ( ) -> anyhow:: Result < ( ) > {
87- let env = TestEnv :: new ( ) ?;
87+ let mut env = TestEnv :: new ( ) ?;
8888 // env.start_explorer_in_container()?;
8989
9090 // create all transaction and Broadcast DepositTx already
91- let ( mut alice, mut bob) = initial_tx_creation ( & env) ?;
91+ let ( mut alice, mut bob) = initial_tx_creation ( & mut env) ?;
9292 dbg ! ( alice. swap_tx. unsigned_tx( ) ?) ;
9393 dbg ! ( bob. swap_tx. unsigned_tx( ) ?) ;
9494
@@ -114,11 +114,11 @@ fn test_swap() -> anyhow::Result<()> {
114114
115115#[ test]
116116fn test_warning ( ) -> anyhow:: Result < ( ) > {
117- let env = TestEnv :: new ( ) ?;
117+ let mut env = TestEnv :: new ( ) ?;
118118 // env.start_explorer_in_container()?;
119119
120120 // create all transaction and Broadcast DepositTx already
121- let ( alice, _bob) = initial_tx_creation ( & env) ?;
121+ let ( alice, _bob) = initial_tx_creation ( & mut env) ?;
122122 dbg ! ( alice. warning_tx_me. signed_tx( ) ?) ;
123123 // alice broadcasts WarningTx
124124 dbg ! ( alice. warning_tx_me. broadcast( & alice. ctx) ?) ;
@@ -128,11 +128,11 @@ fn test_warning() -> anyhow::Result<()> {
128128
129129#[ test]
130130fn test_claim ( ) -> anyhow:: Result < ( ) > {
131- let env = TestEnv :: new ( ) ?;
131+ let mut env = TestEnv :: new ( ) ?;
132132 // env.start_explorer_in_container()?;
133133
134134 // create all transaction and Broadcast DepositTx already
135- let ( alice, _bob) = initial_tx_creation ( & env) ?;
135+ let ( alice, _bob) = initial_tx_creation ( & mut env) ?;
136136 // alice broadcasts WarningTx
137137 alice. warning_tx_me . broadcast ( & alice. ctx ) ?;
138138 env. mine_block ( ) ?;
@@ -157,11 +157,11 @@ fn test_claim() -> anyhow::Result<()> {
157157
158158#[ test]
159159fn test_claim_too_early ( ) -> anyhow:: Result < ( ) > {
160- let env = TestEnv :: new ( ) ?;
160+ let mut env = TestEnv :: new ( ) ?;
161161 // env.start_explorer_in_container()?;
162162
163163 // create all transaction and Broadcast DepositTx already
164- let ( alice, _bob) = initial_tx_creation ( & env) ?;
164+ let ( alice, _bob) = initial_tx_creation ( & mut env) ?;
165165 alice. warning_tx_me . broadcast ( & alice. ctx ) ?;
166166 // env.mine_block()?;
167167 env. mine_block ( ) ?; // we have set time-delay t2 to 2 Blocks
@@ -183,11 +183,11 @@ fn test_claim_too_early() -> anyhow::Result<()> {
183183
184184#[ test]
185185fn test_redirect ( ) -> anyhow:: Result < ( ) > {
186- let env = TestEnv :: new ( ) ?;
186+ let mut env = TestEnv :: new ( ) ?;
187187 // env.start_explorer_in_container()?;
188188
189189 // create all transaction and Broadcast DepositTx already
190- let ( alice, bob) = initial_tx_creation ( & env) ?;
190+ let ( alice, bob) = initial_tx_creation ( & mut env) ?;
191191 // alice broadcasts WarningTx
192192 let bob_warn_id = bob. warning_tx_me . broadcast ( & bob. ctx ) ?;
193193 env. mine_block ( ) ?;
@@ -201,11 +201,11 @@ fn test_redirect() -> anyhow::Result<()> {
201201
202202#[ test]
203203fn test_q_tik ( ) -> anyhow:: Result < ( ) > {
204- let env = TestEnv :: new ( ) ?;
204+ let mut env = TestEnv :: new ( ) ?;
205205 // env.start_explorer_in_container()?;
206206
207207 // create all transaction and Broadcast DepositTx already
208- let ( mut alice, bob) = initial_tx_creation ( & env) ?;
208+ let ( mut alice, bob) = initial_tx_creation ( & mut env) ?;
209209
210210 // message
211211 let sighash = bob. swap_tx . builder . input_sighash ( ) ?;
0 commit comments