erc20-demurrage-token

ERC20 token with redistributed continual demurrage
Log | Files | Refs | README

commit d6e71424f3aeb60309beffee5fc7264b36f4a16a
parent aeebdd348b371f8e87bf08fecc0f289045c102f5
Author: nolash <dev@holbrook.no>
Date:   Sat,  5 Jun 2021 08:59:21 +0200

Apply single redistribution test

Diffstat:
Mpython/tests/test_single.py | 22++++++++++++++++++++++
1 file changed, 22 insertions(+), 0 deletions(-)

diff --git 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()