Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions docs/tests/audit/evm/opcodes/test_extcodehash.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ Verify EIP-1052: EXTCODEHASH opcode

# Tests list

| Test case | Description | XFailed |
|-------------------------------------------------------------------------------|------------------------------------------------------------|---------|
| TestExtCodeHashOpcode::test_extcodehash_for_contract_address | Execute via eth_call | |
| TestExtCodeHashOpcode::test_extcodehash_with_send_tx_for_contract_address | Execute via transaction | |
| TestExtCodeHashOpcode::test_extcodehash_for_empty_account | Execute for empty account and eth_call | |
| TestExtCodeHashOpcode::test_extcodehash_with_send_tx_for_empty_account | Execute for empty account via transaction | |
| TestExtCodeHashOpcode::test_extcodehash_for_non_existing_account | Execute for not existing account and eth_call | |
| TestExtCodeHashOpcode::test_extcodehash_with_send_tx_for_non_existing_account | Execute for not existing account in transaction | |
| TestExtCodeHashOpcode::test_extcodehash_for_destroyed_contract | Execute for destroyed contract with eth_call | |
| TestExtCodeHashOpcode::test_extcodehash_with_send_tx_for_destroyed_contract | Execute for destroyed contract in transaction | |
| TestExtCodeHashOpcode::test_extcodehash_for_reverted_destroyed_contract | Execute for revert contract in eth_call | |
| TestExtCodeHashOpcode::test_extcodehash_for_precompiled_contract | Execute for precompiled contract in eth_call | |
| TestExtCodeHashOpcode::test_extcodehash_with_send_tx_for_precompiled_contract | Execute for precompiled contract in transaction | |
| TestExtCodeHashOpcode::test_extcodehash_for_new_account_with_changed_balance | Execute for a new account with changing balance in one trx | |
| TestExtCodeHashOpcode::test_extcodehash_for_new_account_with_changed_nonce | Execute for a new account with changing nonce in one trx | |
| Test case | Description | XFailed |
|-------------------------------------------------------------------------------|------------------------------------------------------------|-----------|
| TestExtCodeHashOpcode::test_extcodehash_for_contract_address | Execute via eth_call | |
| TestExtCodeHashOpcode::test_extcodehash_with_send_tx_for_contract_address | Execute via transaction | |
| TestExtCodeHashOpcode::test_extcodehash_for_empty_account | Execute for empty account and eth_call | |
| TestExtCodeHashOpcode::test_extcodehash_with_send_tx_for_empty_account | Execute for empty account via transaction | |
| TestExtCodeHashOpcode::test_extcodehash_for_non_existing_account | Execute for not existing account and eth_call | |
| TestExtCodeHashOpcode::test_extcodehash_with_send_tx_for_non_existing_account | Execute for not existing account in transaction | |
| TestExtCodeHashOpcode::test_extcodehash_for_destroyed_contract | Execute for destroyed contract with eth_call | |
| TestExtCodeHashOpcode::test_extcodehash_with_send_tx_for_destroyed_contract | Execute for destroyed contract in transaction | |
| TestExtCodeHashOpcode::test_extcodehash_for_reverted_destroyed_contract | Execute for revert contract in eth_call | |
| TestExtCodeHashOpcode::test_extcodehash_for_precompiled_contract | Execute for precompiled contract in eth_call | |
| TestExtCodeHashOpcode::test_extcodehash_with_send_tx_for_precompiled_contract | Execute for precompiled contract in transaction | |
| TestExtCodeHashOpcode::test_extcodehash_for_new_account_with_changed_balance | Execute for a new account with changing balance in one trx | |
| TestExtCodeHashOpcode::test_extcodehash_for_new_account_with_changed_nonce | Execute for a new account with changing nonce in one trx | NDEV-2666 |
1 change: 1 addition & 0 deletions integration/tests/basic/evm/opcodes/test_extcodehash.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def test_extcodehash_for_new_account_with_changed_balance(self, eip1052_checker,
assert event_logs[0]["args"]["hash"].hex() == ZERO_HASH
assert event_logs[1]["args"]["hash"] == keccak(self.web3_client.eth.get_code(new_acc.address, "latest"))

@pytest.mark.skip(reason="bug NDEV-2666")
def test_extcodehash_for_new_account_with_changed_nonce(self, eip1052_checker, json_rpc_client):
new_account = self.web3_client.create_account()

Expand Down
2 changes: 1 addition & 1 deletion integration/tests/basic/rpc/test_rpc_estimate_gas.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_rpc_estimate_gas_erc20(self, erc20_simple):

assert "gas" in transaction
estimated_gas = transaction["gas"]
assert estimated_gas == 1_394_160
assert estimated_gas == 1_415_040

def test_rpc_estimate_gas_spl(self, erc20_spl):
recipient_account = self.accounts[1]
Expand Down
16 changes: 9 additions & 7 deletions integration/tests/neon_evm/test_cancel_trx.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

from .solana_utils import send_transaction, solana_client, \
send_transaction_step_from_instruction
from .utils.constants import TAG_FINALIZED_STATE, TAG_STATE
from .utils.constants import TAG_FINALIZED_STATE
from .utils.contract import make_contract_call_trx
from .utils.storage import create_holder
from .utils.instructions import make_Cancel
from .utils.layouts import FINALIZED_STORAGE_ACCOUNT_INFO_LAYOUT, STORAGE_ACCOUNT_INFO_LAYOUT
from .utils.layouts import FINALIZED_STORAGE_ACCOUNT_INFO_LAYOUT
from .utils.transaction_checks import check_holder_account_tag


Expand All @@ -18,6 +18,8 @@ def test_cancel_trx(self, operator_keypair, rw_lock_contract, user_account, trea
signed_tx = make_contract_call_trx(user_account, rw_lock_contract, "unchange_storage(uint8,uint8)", [1, 1])

storage_account = create_holder(operator_keypair)
user_nonce_before_first_step = evm_loader.get_neon_nonce(user_account.eth_address)

trx = send_transaction_step_from_instruction(operator_keypair, evm_loader, treasury_pool, storage_account,
signed_tx,
[rw_lock_contract.solana_address,
Expand All @@ -27,16 +29,16 @@ def test_cancel_trx(self, operator_keypair, rw_lock_contract, user_account, trea

receipt = solana_client.get_transaction(trx.value)
assert receipt.value.transaction.meta.err is None
check_holder_account_tag(storage_account, STORAGE_ACCOUNT_INFO_LAYOUT, TAG_STATE)

user_nonce = evm_loader.get_neon_nonce(user_account.eth_address)
user_nonce_after_first_step = evm_loader.get_neon_nonce(user_account.eth_address)
assert user_nonce_before_first_step + 1 == user_nonce_after_first_step
trx = Transaction()
trx.add(
make_Cancel(evm_loader, storage_account, operator_keypair, signed_tx.hash,
[rw_lock_contract.solana_address,
rw_lock_contract.balance_account_address,
user_account.balance_account_address])
rw_lock_contract.balance_account_address,
user_account.balance_account_address])
)
send_transaction(solana_client, trx, operator_keypair)
check_holder_account_tag(storage_account, FINALIZED_STORAGE_ACCOUNT_INFO_LAYOUT, TAG_FINALIZED_STATE)
assert user_nonce < evm_loader.get_neon_nonce(user_account.eth_address)
assert user_nonce_after_first_step == evm_loader.get_neon_nonce(user_account.eth_address)
7 changes: 2 additions & 5 deletions integration/tests/neon_evm/test_holder_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
from .solana_utils import solana_client, write_transaction_to_holder_account, \
send_transaction_step_from_account, get_solana_balance, execute_transaction_steps_from_account
from .utils.assert_messages import InstructionAsserts
from .utils.constants import EVM_LOADER, TAG_STATE
from .utils.constants import EVM_LOADER
from .utils.contract import make_deployment_transaction, make_contract_call_trx
from .utils.ethereum import make_eth_transaction
from .utils.instructions import make_WriteHolder
from .utils.layouts import STORAGE_ACCOUNT_INFO_LAYOUT, HOLDER_ACCOUNT_INFO_LAYOUT
from .utils.layouts import HOLDER_ACCOUNT_INFO_LAYOUT
from .utils.storage import create_holder, delete_holder


Expand Down Expand Up @@ -112,9 +112,6 @@ def test_write_to_not_finalized_holder(rw_lock_contract, user_account, evm_loade
[user_account.solana_account_address,
user_account.balance_account_address,
rw_lock_contract.solana_address], 1, operator_keypair)
account_data = solana_client.get_account_info(new_holder_acc, commitment=Confirmed).value.data
parsed_data = STORAGE_ACCOUNT_INFO_LAYOUT.parse(account_data)
assert parsed_data.tag == TAG_STATE

signed_tx2 = make_contract_call_trx(user_account, rw_lock_contract, "unchange_storage(uint8,uint8)", [1, 1])

Expand Down
165 changes: 0 additions & 165 deletions integration/tests/neon_evm/test_parallel.py

This file was deleted.

Loading