commit 5a70844664db38cf120fccd004656a8987801c52
parent d9024fcf2ccdea199fa84a1b2b3d7092c48c73e7
Author: lash <dev@holbrook.no>
Date: Fri, 2 Jun 2023 16:19:19 +0100
Add balance check for consume method
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/python/tests/test_base.py b/python/tests/test_base.py
@@ -43,6 +43,14 @@ class TestBookingBase(TestBooking):
r = self.rpc.do(o)
self.assertEqual(r['status'], 1)
+ c = ERC20(self.chain_spec)
+ o = c.balance_of(self.token_address, self.accounts[0], sender_address=self.accounts[0])
+ r = self.rpc.do(o)
+ balance = c.parse_balance_of(r)
+ expected_balance = self.initial_supply - (self.resolution_unit * 13)
+ self.assertEqual(balance, expected_balance)
+
+ c = Booking(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
(tx_hash_hex, o) = c.consume(self.address, self.accounts[0], 42, 1)
self.rpc.do(o)
o = receipt(tx_hash_hex)