Skip to content
Prev Previous commit
Next Next commit
Developing (197-integration-test-for-erc20-wrapper-contract)
  • Loading branch information
vakond committed Sep 20, 2021
commit e48e7f200159f618ec48444c58547e730872c109
20 changes: 10 additions & 10 deletions proxy/test_erc20_wrapper_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ def deploy_erc20_wrapper_contract(self):
tx_deploy = proxy.eth.account.sign_transaction(tx_constructor, admin.key)
#print('tx_deploy:', tx_deploy)
tx_deploy_hash = proxy.eth.send_raw_transaction(tx_deploy.rawTransaction)
#print('tx_deploy_hash:', tx_deploy_hash.hex())
print('tx_deploy_hash:', tx_deploy_hash.hex())
tx_deploy_receipt = proxy.eth.wait_for_transaction_receipt(tx_deploy_hash)
#print('tx_deploy_receipt:', tx_deploy_receipt)
print('tx_deploy_receipt:', tx_deploy_receipt)
print('deploy status:', tx_deploy_receipt.status)
self.contract_address= tx_deploy_receipt.contractAddress

Expand Down Expand Up @@ -148,25 +148,25 @@ def test_erc20_totalSupply(self):
ts = erc20.functions.totalSupply().call()
self.assertEqual(ts, 100000000000000)

#@unittest.skip("a.i.")
@unittest.skip("a.i.")
def test_erc20_balanceOf(self):
erc20 = proxy.eth.contract(address=self.contract_address, abi=self.interface['abi'])
b = erc20.functions.balanceOf(admin.address).call()
self.assertGreater(b, 0)
b = erc20.functions.balanceOf(user.address).call()
self.assertEqual(b, 0)

@unittest.skip("a.i.")
#@unittest.skip("a.i.")
def test_erc20_transfer(self):
erc20 = proxy.eth.contract(address=self.contract_address, abi=self.interface['abi'])
nonce = proxy.eth.get_transaction_count(proxy.eth.default_account)
tx = {'nonce': nonce}
#tx = erc20.functions.transfer(user.address, 1000).buildTransaction(tx)
#print('tx:',tx)
#tx = proxy.eth.account.sign_transaction(tx, admin.key)
#tx_hash = proxy.eth.send_raw_transaction(tx.rawTransaction)
#tx_receipt = proxy.eth.wait_for_transaction_receipt(tx_hash)
#self.assertIsNotNone(tx_receipt)
tx = erc20.functions.transfer(user.address, 1000).buildTransaction(tx)
tx = proxy.eth.account.sign_transaction(tx, admin.key)
tx_hash = proxy.eth.send_raw_transaction(tx.rawTransaction)
print('tx_hash:',tx_hash)
tx_receipt = proxy.eth.wait_for_transaction_receipt(tx_hash)
self.assertIsNotNone(tx_receipt)

@unittest.skip("a.i.")
def test_02_execute_with_right_nonce(self):
Expand Down