From d6e71424f3aeb60309beffee5fc7264b36f4a16a Mon Sep 17 00:00:00 2001 From: nolash Date: Sat, 5 Jun 2021 08:59:21 +0200 Subject: [PATCH] Apply single redistribution test --- python/tests/test_single.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/python/tests/test_single.py b/python/tests/test_single.py index 9399d59..fcb9e40 100644 --- a/python/tests/test_single.py +++ b/python/tests/test_single.py @@ -68,6 +68,28 @@ class TestRedistributionSingle(TestDemurrageSingleNocap): balance = c.parse_balance_of(r) self.assertEqual(balance, mint_amount - (mint_amount * (self.tax_level / 1000000))) + o = c.balance_of(self.address, self.accounts[2], sender_address=self.accounts[0]) + r = self.rpc.do(o) + balance = c.parse_balance_of(r) + base_amount = mint_amount - int(mint_amount * 0.1) + self.assertEqual(balance, (base_amount - (base_amount * (self.tax_level / 1000000)))) + + o = c.balance_of(self.address, self.accounts[3], sender_address=self.accounts[0]) + r = self.rpc.do(o) + balance = c.parse_balance_of(r) + base_amount = mint_amount - int(mint_amount * 0.2) + self.assertEqual(balance, (base_amount - (base_amount * (self.tax_level / 1000000)))) + + o = c.total_supply(self.address, sender_address=self.accounts[0]) + r = self.rpc.do(o) + new_supply = c.parse_total_supply(r) + + o = c.balance_of(self.address, self.sink_address, sender_address=self.accounts[0]) + r = self.rpc.do(o) + balance = c.parse_balance_of(r) + base_amount = new_supply * (self.tax_level / 1000000) + self.assertEqual(balance, base_amount - (base_amount * (self.tax_level / 1000000))) + if __name__ == '__main__': unittest.main()