Skip to content

Commit

Permalink
CR - changed magic numbers to constants
Browse files Browse the repository at this point in the history
  • Loading branch information
luc10921 committed Apr 17, 2023
1 parent 5ee8ed8 commit da38f18
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions boa3_test/tests/examples_tests/test_wrapped_neo.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,12 @@ def test_wrapped_neo_burn(self):
runner.update_contracts(export_checkpoint=True)
wrapped_neo_address = wrapped_neo_contract.script_hash

runner.add_neo(wrapped_neo_address, 10_000_000)
total_supply = 10_000_000
burned_amount = 100

# adding the same amount of tokens that the wrapped neo smart contract has minted
runner.add_neo(wrapped_neo_address, total_supply)

owner_script_hash = self.OWNER.script_hash.to_array()

# burning zNEO will end up giving NEO to the one who burned it
Expand Down Expand Up @@ -373,12 +376,12 @@ def test_wrapped_neo_transfer_from(self):

# OWNER will give zNEO to OTHER_ACCOUNT_3 so that it can approve another contracts
invokes.append(runner.call_contract(path, 'transfer', owner_script_hash, test_account_3_script_hash,
10_000_000, None))
allowed_amount, None))
expected_results.append(True)
runner.execute(account=self.OWNER)
self.assertEqual(VMState.HALT, runner.vm_state, msg=runner.error)

runner.run_contract(path, 'transfer', owner_script_hash, test_account_3_script_hash, 10_000_000,
runner.run_contract(path, 'transfer', owner_script_hash, test_account_3_script_hash, allowed_amount,
None, account=self.OWNER)

transfer_events = runner.get_events('Transfer')
Expand All @@ -388,7 +391,7 @@ def test_wrapped_neo_transfer_from(self):
sender, receiver, amount = transfer_events[0].arguments
self.assertEqual(owner_script_hash, sender)
self.assertEqual(test_account_3_script_hash, receiver)
self.assertEqual(10_000_000, amount)
self.assertEqual(allowed_amount, amount)

# this approve will succeed, because OTHER_ACCOUNT_3 have enough zNEO
invokes.append(runner.call_contract(path, 'approve', test_account_3_script_hash, test_account_1_script_hash,
Expand Down

0 comments on commit da38f18

Please sign in to comment.