Skip to content

Commit

Permalink
improve mnt transfer EVM test (#936)
Browse files Browse the repository at this point in the history
* improve mnt transfer EVM test

1. fixed test util's display of prev & current state
2. updated fixture's contract bytecode and made sure EVM behavior is
   expected

* add test cases for long token ID

* fix token ID

* minor

* fix root hash
  • Loading branch information
ninjaahhh authored Nov 16, 2021
1 parent d5808ef commit 07b43a2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,22 @@
"post": {
"ConstantinopleFix": [
{
"hash": "0x8c1cab0408d24a2eb99e95765c046878d2ff5fd6f221709a26845aca1add61d6",
"hash": "0x606816f0b9968977f7a593d6d17208b851ab868c6bc7a8034de434dbc4d2a344",
"indexes": {
"data": 0,
"gas": 0,
"value": 0,
"transferTokenId": 0
},
"logs": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
},
{
"hash": "0x2a39e58d7a961d2979249a7dab088b89c95a9e328ea6d344b6ebb89031b4ac39",
"indexes": {
"data": 1,
"gas": 0,
"value": 0,
"transferTokenId": 0
}
}
]
},
Expand All @@ -45,14 +53,14 @@
"0x8bb0": "0x0f7832d890000",
"0x1234": "0x9"
},
"code": "608060405234801561001057600080fd5b5061010e806100206000396000f3fe608060405260043610603e5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166390b4902781146043575b600080fd5b348015604e57600080fd5b50607560048036036060811015606357600080fd5b50803590602081013590604001356087565b60408051918252519081900360200190f35b6000608f60c3565b84815260208082018590526040820184905282606083600064514b430002600019f1151560bb57600080fd5b509392505050565b606060405190810160405280600390602082028038833950919291505056fea165627a7a72305820140e93e6d0727652332a820d62917a2091a3e807df1d9a454a1ebe542e25592a0029",
"code": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806390b4902714610030575b600080fd5b6100706004803603606081101561004657600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050610086565b6040518082815260200191505060405180910390f35b60006100906100f8565b848160006003811061009e57fe5b60200201818152505083816001600381106100b557fe5b60200201818152505082816002600381106100cc57fe5b602002018181525050602082606083600064514b430002600019f16100f057600080fd5b509392505050565b604051806060016040528060039060208202803883398082019150509050509056fea265627a7a723158208279dcc675268973e1d770d00f53c1c4028ba89a3f47d630884e9dd77af9c25c64736f6c63430005110032",
"nonce": "0x00",
"storage": {
}
},
"0xbfd5b36fa6f5de48d807397e9b68d0a0d694e38e": {
"balance": "0x00",
"code": "6080604052348015600f57600080fd5b50606f80601d6000396000f3fe6080604052600a6024565b6040816000808064514b430001600019f150506001600055005b602060405190810160405280600190602082028038833950919291505056fea165627a7a72305820b402355b87dfda3dd5a1faa36cb6f0ef8f317cac5d280661af787367d1f8b8dc0029",
"code": "0x6080604052600a6028565b604081600080600064514b430001600019f150600160008190555050005b604051806020016040528060019060208202803883398082019150509050509056fea265627a7a723158203c7281fa897cd5f97a5c8e50b85d8d4b5775c642d24f1f56813223533e629f3b64736f6c63430005110032",
"nonce": "0x00",
"storage": {
}
Expand All @@ -64,14 +72,16 @@
"_hex": "0xbfd5b36fa6f5de48d807397e9b68d0a0d694e38e"
},
"uint256 token_id": {
"_hex": "0x1234"
"_hex": "0x1234",
"_hex2": "1046823949374975479359571919336054293237424652288"
},
"uint256 value": {
"_hex": "0x09"
}
},
"data": [
"0x90b49027000000000000000000000000bfd5b36fa6f5de48d807397e9b68d0a0d694e38e00000000000000000000000000000000000000000000000000000000000012340000000000000000000000000000000000000000000000000000000000000009"
"0x90b49027000000000000000000000000bfd5b36fa6f5de48d807397e9b68d0a0d694e38e00000000000000000000000000000000000000000000000000000000000012340000000000000000000000000000000000000000000000000000000000000009",
"0x90b49027000000000000000000000000bfd5b36fa6f5de48d807397e9b68d0a0d694e38e000000000000000000000000b75d3598fd4950000000000043a3163a810700000000000000000000000000000000000000000000000000000000000000000009"
],
"gasLimit": [
"0x2dc6c0"
Expand Down
2 changes: 1 addition & 1 deletion quarkchain/evm/tests/new_statetest_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def compute_state_test_unit(state, txdata, indices, konfig, is_qkc_state, qkc_en
tx.v = parse_int_or_hex(txdata["v"])
tx._in_mutable_context = False
# Run it
prev = state.to_dict()
prev = copy.deepcopy(state.to_dict())
success, output = apply_transaction(state, tx, tx_wrapper_hash=bytes(32))
except InvalidTransaction as e:
print("Exception: %r" % e)
Expand Down

0 comments on commit 07b43a2

Please sign in to comment.