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.
- Loading branch information
1 parent
aa8787d
commit 45d3cdb
Showing
3 changed files
with
59 additions
and
0 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,12 @@ | ||
pragma solidity 0.8.12; | ||
|
||
contract saveZeros { | ||
|
||
bytes32[64] public b; // prefills the contract storage | ||
uint256 public number; | ||
|
||
|
||
function saveZero() public { // should not create a new account | ||
number = 0; | ||
} | ||
} |
Empty file.
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,47 @@ | ||
from solana.keypair import Keypair | ||
|
||
from integration.tests.neon_evm.utils.contract import deploy_contract | ||
from integration.tests.neon_evm.utils.neon_api_client import NeonApiClient | ||
from utils.evm_loader import EvmLoader | ||
from utils.solana_client import SolanaClient | ||
from utils.types import Contract, Caller, TreasuryPool | ||
|
||
|
||
class TestStorageCells: | ||
def test_zeros( | ||
self, | ||
operator_keypair: Keypair, | ||
user_account: Caller, | ||
evm_loader: EvmLoader, | ||
treasury_pool: TreasuryPool, | ||
neon_api_client: NeonApiClient, | ||
sol_client: SolanaClient, | ||
): | ||
# Deploy the contract | ||
contract: Contract = deploy_contract( | ||
operator=operator_keypair, | ||
user=user_account, | ||
contract_file_name="issues/Ndev3234.sol", | ||
evm_loader=evm_loader, | ||
treasury_pool=treasury_pool, | ||
contract_name="saveZeros", | ||
version="0.8.12", | ||
) | ||
|
||
emulate_result_do_nothing_1 = neon_api_client.emulate_contract_call( | ||
sender=user_account.eth_address.hex(), | ||
contract=contract.eth_address.hex(), | ||
function_signature="doNothing()", | ||
) | ||
accounts_after_deploy = len(emulate_result_do_nothing_1["solana_accounts"]) | ||
print(f"Accounts after deploy: {accounts_after_deploy}") | ||
|
||
# Emulate storing zero | ||
emulate_result_zero = neon_api_client.emulate_contract_call( | ||
sender=user_account.eth_address.hex(), | ||
contract=contract.eth_address.hex(), | ||
function_signature="saveZero()", | ||
) | ||
|
||
accounts_after_storing_zero = len(emulate_result_zero["solana_accounts"]) | ||
assert accounts_after_storing_zero == accounts_after_deploy |