forked from neonevm/neon-tests
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into NDEV-2981-traceCal…
…l-overrides-param # Conflicts: # integration/tests/tracer/test_tracer_debug_methods.py
- Loading branch information
Showing
5 changed files
with
497 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity >=0.7.0; | ||
|
||
import "../libraries/external/QueryAccount.sol"; | ||
|
||
contract QueryAccountCaller { | ||
|
||
event QueryResultUint256(bool success, uint256 result); | ||
event QueryResultBytes(bool success, bytes result); | ||
|
||
function queryOwner(uint256 solana_address) external returns (bool, uint256) { | ||
(bool success, uint256 result) = QueryAccount.owner(solana_address); | ||
emit QueryResultUint256(success, result); | ||
return (success, result); | ||
} | ||
|
||
function queryLength(uint256 solana_address) external view returns (bool, uint256) { | ||
(bool success, uint256 result) = QueryAccount.length(solana_address); | ||
return (success, result); | ||
} | ||
|
||
function queryLamports(uint256 solana_address) external view returns (bool, uint256) { | ||
(bool success, uint256 result) = QueryAccount.lamports(solana_address); | ||
return (success, result); | ||
} | ||
|
||
function queryExecutable(uint256 solana_address) external view returns (bool, bool) { | ||
(bool success, bool result) = QueryAccount.executable(solana_address); | ||
return (success, result); | ||
} | ||
|
||
function queryRentEpoch(uint256 solana_address) external view returns (bool, uint256) { | ||
(bool success, uint256 result) = QueryAccount.rent_epoch(solana_address); | ||
return (success, result); | ||
} | ||
|
||
function queryData(uint256 solana_address, uint64 offset, uint64 len) external returns (bool, bytes memory) { | ||
(bool success, bytes memory result) = QueryAccount.data(solana_address, offset, len); | ||
emit QueryResultBytes(success, result); | ||
return (success, result); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Overview | ||
|
||
Validate QueryAccount library | ||
|
||
# Tests list | ||
|
||
| Test case | Description | XFailed | | ||
|------------------------------------------|-----------------------------------------------------------------------------------------------------|---------| | ||
| test_owner_positive | Verifies correct owner address retrieval for a Solana account | | | ||
| test_owner_through_transaction_positive | Verifies correct Solana address owner retrieval through a transaction (not function call) | | | ||
| test_owner_negative_address_max_int | Tests behavior of queryOwner function with maximum possible integer as Solana address | | | ||
| test_length_positive | Checks if queryLength function returns correct data length for a Solana account | | | ||
| test_length_negative_address_max_int | Tests behavior of queryLength function with maximum possible integer as Solana address | | | ||
| test_lamports_positive | Ensures correct retrieval of lamports for a Solana account | | | ||
| test_lamports_negative_address_max_int | Tests behavior of queryLamports function with maximum possible integer as Solana address | | | ||
| test_executable_true | Checks if queryExecutable function correctly identifies EVM loader-associated account as executable | | | ||
| test_executable_false | Verifies queryExecutable function correctly identifies regular Solana account as non-executable | | | ||
| test_executable_negative_address_max_int | Tests behavior of queryExecutable function with maximum possible integer as Solana address | | | ||
| test_rent_epoch_positive | Ensures correct retrieval of rent epoch for a Solana account | | | ||
| test_rent_epoch_negative_address_max_int | Tests behavior of queryRentEpoch function with maximum possible integer as Solana address | | | ||
| test_data_positive | Checks if queryData function returns correct data for an EVM loader-associated Solana account | | | ||
| test_data_through_transaction_positive | Checks if queryData function returns correct data through a transaction (not function call) | | | ||
| test_data_negative_address_max_int | Tests behavior of queryData function with maximum possible integer as Solana address | | | ||
| test_data_negative_invalid_offset | Verifies error handling of queryData function when providing an invalid offset | | | ||
| test_data_negative_length_zero | Ensures queryData function returns an error when the provided length is zero | | | ||
| test_data_negative_invalid_length | Tests error handling of queryData function when providing an invalid length | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.