mirror of
git://holbrook.no/erc20-demurrage-token
synced 2026-04-27 10:31:04 +02:00
Save highest two bits in redistribuction work for remainder handling
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user