Skip to content

Commit

Permalink
#428 add getcode test for resized accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
otselnik committed Feb 3, 2022
1 parent a8dcfa7 commit 9d2e907
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions proxy/testing/test_resize_storage_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ def setUpClass(self):

self.contract = proxy.eth.contract(
address=receipt.contractAddress,
abi=contract.abi
abi=contract.abi,
bytecode=interface['bin']
)

def test_resize_storage_account(self):
def test_01_resize_storage_account(self):
print("\n\nresize_storage_account")
nonce = proxy.eth.get_transaction_count(self.account.address)
tx = self.contract.functions.inc().buildTransaction({'nonce': nonce})
Expand All @@ -72,4 +73,12 @@ def test_resize_storage_account(self):
receipt = proxy.eth.wait_for_transaction_receipt(signature)
self.assertIsNotNone(receipt)

def test_02_get_code_for_resized_storage_account(self):
print("\n\nget_code_for_resized_storage_account")
code = proxy.eth.get_code(self.contract.address)
print("code from proxy: {code.hex()}", code.hex())
print("code from contract: {self.contract.bytecode.hex()}", self.contract.bytecode.hex())
self.assertEqual(code, self.contract.bytecode[-len(code):])

if __name__ == '__main__':
unittest.main()

0 comments on commit 9d2e907

Please sign in to comment.