Save highest two bits in redistribuction work for remainder handling

This commit is contained in:
nolash
2021-02-05 08:45:44 +01:00
parent ed9d9b3833
commit d795a77deb
2 changed files with 14 additions and 3 deletions

View File

@@ -56,12 +56,14 @@ class Test(unittest.TestCase):
pass
@unittest.skip('test')
def test_hello(self):
self.assertEqual(self.contract.functions.actualPeriod().call(), 1)
self.eth_tester.mine_blocks(PERIOD)
self.assertEqual(self.contract.functions.actualPeriod().call(), 2)
@unittest.skip('test')
def test_mint(self):
tx_hash = self.contract.functions.mintTo(self.w3.eth.accounts[1], 1024).transact()
r = self.w3.eth.getTransactionReceipt(tx_hash)
@@ -86,6 +88,7 @@ class Test(unittest.TestCase):
tx_hash = self.contract.functions.transfer(self.w3.eth.accounts[2], 500).transact({'from': self.w3.eth.accounts[1]})
r = self.w3.eth.getTransactionReceipt(tx_hash)
self.assertEqual(r.status, 1)
logg.debug('tx {}'.format(r))
balance_alice = self.contract.functions.balanceOf(self.w3.eth.accounts[1]).call()
self.assertEqual(balance_alice, 524)
@@ -93,7 +96,12 @@ class Test(unittest.TestCase):
balance_bob = self.contract.functions.balanceOf(self.w3.eth.accounts[2]).call()
self.assertEqual(balance_bob, 500)
tx_hash = self.contract.functions.transfer(self.w3.eth.accounts[2], 500).transact({'from': self.w3.eth.accounts[1]})
r = self.w3.eth.getTransactionReceipt(tx_hash)
self.assertEqual(r.status, 1)
logg.debug('tx {}'.format(r))
@unittest.skip('test')
def test_apply_tax(self):
self.eth_tester.mine_blocks(PERIOD)
tx_hash = self.contract.functions.applyTax().transact()
@@ -108,6 +116,7 @@ class Test(unittest.TestCase):
self.assertEqual(self.contract.functions.demurrageModifier().call(), 960400)
@unittest.skip('test')
def test_tax_balance(self):
tx_hash = self.contract.functions.mintTo(self.w3.eth.accounts[1], 1000).transact()
r = self.w3.eth.getTransactionReceipt(tx_hash)
@@ -122,6 +131,7 @@ class Test(unittest.TestCase):
self.assertEqual(balance, 980)
@unittest.skip('test')
def test_taxed_transfer(self):
tx_hash = self.contract.functions.mintTo(self.w3.eth.accounts[1], 1000000).transact()
r = self.w3.eth.getTransactionReceipt(tx_hash)