@@ -128,7 +128,7 @@ async def async_test(self):
128
128
assert_equal (await wallet .get_best_block (), block_id )
129
129
130
130
balance = await wallet .get_balance ()
131
- assert_in (f "Coins amount: 151" , balance )
131
+ assert_in ("Coins amount: 151" , balance )
132
132
assert_not_in ("Tokens" , balance )
133
133
134
134
# issue a valid token
@@ -142,7 +142,7 @@ async def async_test(self):
142
142
self .generate_block ()
143
143
assert_in ("Success" , await wallet .sync ())
144
144
balance = await wallet .get_balance ()
145
- assert_in (f "Coins amount: 50" , balance )
145
+ assert_in ("Coins amount: 50" , balance )
146
146
assert_not_in ("Tokens" , balance )
147
147
148
148
amount_to_mint = random .randint (1 , 10000 )
@@ -153,7 +153,7 @@ async def async_test(self):
153
153
assert_in ("Success" , await wallet .sync ())
154
154
balance = await wallet .get_balance ()
155
155
print (balance )
156
- assert_in (f "Coins amount: 0" , balance )
156
+ assert_in ("Coins amount: 0" , balance )
157
157
assert_in (f"Token: { token_id } amount: { amount_to_mint } " , balance )
158
158
159
159
########################################################################################
@@ -165,7 +165,7 @@ async def async_test(self):
165
165
166
166
alice_amount_to_swap = amount_to_mint
167
167
alice_htlc_tx = await wallet .create_htlc_transaction (alice_amount_to_swap , token_id , alice_secret_hash , bob_address , refund_address , 6 )
168
- alice_signed_tx_obj = signed_tx_obj .decode (ScaleBytes ("0x" + alice_htlc_tx ))
168
+ alice_signed_tx_obj = signed_tx_obj .decode (ScaleBytes ("0x" + alice_htlc_tx [ 'tx' ] ))
169
169
alice_htlc_outputs = alice_signed_tx_obj ['transaction' ]['outputs' ]
170
170
alice_htlc_change_dest = alice_htlc_outputs [1 ]['Transfer' ][1 ]
171
171
alice_htlc_tx_id = hash_object (base_tx_obj , alice_signed_tx_obj ['transaction' ])
@@ -200,7 +200,7 @@ async def async_test(self):
200
200
201
201
bob_amount_to_swap = 150
202
202
bob_htlc_tx = await wallet .create_htlc_transaction (bob_amount_to_swap , None , alice_secret_hash , alice_address , refund_address , 6 )
203
- bob_signed_tx_obj = signed_tx_obj .decode (ScaleBytes ("0x" + bob_htlc_tx ))
203
+ bob_signed_tx_obj = signed_tx_obj .decode (ScaleBytes ("0x" + bob_htlc_tx [ 'tx' ] ))
204
204
bob_htlc_outputs = bob_signed_tx_obj ['transaction' ]['outputs' ]
205
205
bob_htlc_change_dest = bob_htlc_outputs [1 ]['Transfer' ][1 ]
206
206
bob_htlc_tx_id = hash_object (base_tx_obj , bob_signed_tx_obj ['transaction' ])
@@ -227,7 +227,7 @@ async def async_test(self):
227
227
alice_refund_ptx = output .split ('\n ' )[2 ]
228
228
229
229
# Alice's htlc tx can now be broadcasted
230
- output = await wallet .submit_transaction (alice_htlc_tx )
230
+ output = await wallet .submit_transaction (alice_htlc_tx [ 'tx' ] )
231
231
assert_in ("The transaction was submitted successfully" , output )
232
232
233
233
# Alice signs Bob's refund
@@ -238,22 +238,22 @@ async def async_test(self):
238
238
bob_refund_ptx = output .split ('\n ' )[2 ]
239
239
240
240
# Bob's htlc tx can now be broadcasted
241
- output = await wallet .submit_transaction (bob_htlc_tx )
241
+ output = await wallet .submit_transaction (bob_htlc_tx [ 'tx' ] )
242
242
assert_in ("The transaction was submitted successfully" , output )
243
243
244
244
self .generate_block ()
245
245
assert_in ("Success" , await wallet .sync ())
246
246
247
247
# Check Alice's balance
248
248
balance = await wallet .get_balance ()
249
- assert_in (f "Coins amount: 0" , balance )
249
+ assert_in ("Coins amount: 0" , balance )
250
250
assert_not_in ("Tokens" , balance )
251
251
252
252
# Check Bob's balance now
253
253
await self .switch_to_wallet (wallet , 'bob_wallet' )
254
254
assert_in ("Success" , await wallet .sync ())
255
255
balance = await wallet .get_balance ()
256
- assert_in (f "Coins amount: 0" , balance )
256
+ assert_in ("Coins amount: 0" , balance )
257
257
assert_not_in ("Tokens" , balance )
258
258
259
259
########################################################################################
@@ -270,7 +270,7 @@ async def async_test(self):
270
270
assert_in ("Spending at height 9, locked until height 10" , output )
271
271
272
272
balance = await wallet .get_balance ()
273
- assert_in (f "Coins amount: 0" , balance )
273
+ assert_in ("Coins amount: 0" , balance )
274
274
assert_not_in ("Tokens" , balance )
275
275
276
276
# Bob signs and spends the refund
@@ -286,7 +286,7 @@ async def async_test(self):
286
286
assert_in ("Spending at height 9, locked until height 10" , output )
287
287
288
288
balance = await wallet .get_balance ()
289
- assert_in (f "Coins amount: 0" , balance )
289
+ assert_in ("Coins amount: 0" , balance )
290
290
assert_not_in ("Tokens" , balance )
291
291
292
292
########################################################################################
@@ -304,7 +304,7 @@ async def async_test(self):
304
304
self .generate_block ()
305
305
assert_in ("Success" , await wallet .sync ())
306
306
balance = await wallet .get_balance ()
307
- assert_in (f "Coins amount: 0" , balance )
307
+ assert_in ("Coins amount: 0" , balance )
308
308
assert_not_in ("Tokens" , balance )
309
309
310
310
self .generate_block ()
@@ -316,13 +316,13 @@ async def async_test(self):
316
316
await self .switch_to_wallet (wallet , 'alice_wallet' )
317
317
assert_in ("Success" , await wallet .sync ())
318
318
balance = await wallet .get_balance ()
319
- assert_in (f "Coins amount: 0" , balance )
319
+ assert_in ("Coins amount: 0" , balance )
320
320
assert_in (f"Token: { token_id } amount: { alice_amount_to_swap } " , balance )
321
321
322
322
await self .switch_to_wallet (wallet , 'bob_wallet' )
323
323
assert_in ("Success" , await wallet .sync ())
324
324
balance = await wallet .get_balance ()
325
- assert_in (f"Coins amount: 150 " , balance )
325
+ assert_in (f"Coins amount: { bob_amount_to_swap } " , balance )
326
326
assert_not_in ("Tokens" , balance )
327
327
328
328
0 commit comments