Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
5a3e9a6
Use neonlabsorg/evm_loader:stable image for build
Oct 12, 2021
e59efe2
Merge remote-tracking branch 'origin/develop'
Oct 19, 2021
44dd154
Merge remote-tracking branch 'origin/develop'
Oct 21, 2021
21d20a1
Launch all uniswap tests for master branch
vasiliy-zaznobin Nov 16, 2021
4e03e73
Merge remote-tracking branch 'origin/develop'
Nov 16, 2021
e496b27
VERSION = (0, 4, 0)
vasiliy-zaznobin Nov 16, 2021
fe41d64
EVM_LOADER_REVISION:=v0.4.0
vasiliy-zaznobin Nov 16, 2021
5467c50
EVM_LOADER_REVISION:=stable
vasiliy-zaznobin Nov 16, 2021
e15d847
Merge remote-tracking branch 'origin/develop'
vasiliy-zaznobin Dec 7, 2021
2416591
NEON_PROXY_PKG_VERSION = '0.5.0'
vasiliy-zaznobin Dec 7, 2021
168e428
VERSION = (0, 4, 0)
vasiliy-zaznobin Nov 16, 2021
3125645
EVM_LOADER_REVISION:=v0.4.0
vasiliy-zaznobin Nov 16, 2021
07f175d
EVM_LOADER_REVISION:=stable
vasiliy-zaznobin Nov 16, 2021
0bbb26b
289 implement eth get storage at (#298)
ivandzen Nov 18, 2021
7841b07
#256 create and airdrop eth account (#259)
rozhkovdmitrii Nov 18, 2021
ce05c81
#305 Remove extra args from ether2program (#309)
rozhkovdmitrii Nov 19, 2021
6ca860a
Change default logDB postgress pass (#317)
rozhkovdmitrii Nov 23, 2021
b3b322f
#311 Create account and airdrop on gas estimation if it's preset
rozhkovdmitrii Nov 24, 2021
c860ed0
neonbals/neon-evm#371 Update STORAGE_ACCOUNT_INFO_LAYOUT (#315)
sinev-valentine Nov 24, 2021
9bb3f89
319 add neon cli version handler (#325)
vasiliy-zaznobin Nov 24, 2021
081bc75
fix storage account check (#327)
sinev-valentine Nov 24, 2021
7845ca9
#320 add neon proxy version handler (#323)
vasiliy-zaznobin Nov 25, 2021
f299c57
313 concurrent execution of solana program dump (#314)
ivandzen Nov 25, 2021
0a5dc2d
fix scripts (#329)
ivandzen Nov 25, 2021
7964cad
#318 JSON_RPC "params" field may be omitted (#322)
mich-master Nov 26, 2021
01df8a4
#336 indexer refactoring (#340)
ivandzen Dec 2, 2021
d9a8e51
#333 fix indexer errors (#334)
otselnik Dec 2, 2021
f4b178c
#291 Proxy refactoring (#324)
otselnik Dec 2, 2021
5ced809
#337 сreate base airdropper service (#343)
ivandzen Dec 3, 2021
ae7b392
#337 fix running airdropper (#347)
ivandzen Dec 6, 2021
9feca6a
#351 fix canceller droping running transactions (#352)
otselnik Dec 6, 2021
2f0a0df
349 improve neon proxy logging to filter a request and the correspond…
vasiliy-zaznobin Dec 6, 2021
3b36864
#349 Fix using log sending solana transaction (#353)
vasiliy-zaznobin Dec 6, 2021
6bb8509
#295 iterative execution (#332)
otselnik Dec 6, 2021
56044ea
#354 Check result for errors (#355)
otselnik Dec 7, 2021
0bad34c
#360 pass transaction too large upper (#361)
otselnik Dec 7, 2021
9e8344c
NEON_PROXY_PKG_VERSION = '0.5.0'
vasiliy-zaznobin Dec 7, 2021
981c178
Merge remote-tracking branch 'origin/develop->master_0.5.0' into deve…
vasiliy-zaznobin Dec 7, 2021
4c87c95
Merge pull request #362 from neonlabsorg/develop->master_0.5.0
vasiliy-zaznobin Dec 7, 2021
2ccfcce
Merge remote-tracking branch 'origin/develop' into develop->master_0.…
vasiliy-zaznobin Dec 8, 2021
28881d2
Merge pull request #363 from neonlabsorg/develop->master_0.5.0-rc2
vasiliy-zaznobin Dec 8, 2021
3771577
Merge remote-tracking branch 'origin/develop' into develop->master_0.…
vasiliy-zaznobin Dec 13, 2021
1e4c4ab
Merge pull request #372 from neonlabsorg/develop->master_0.5.0_rc3
vasiliy-zaznobin Dec 13, 2021
cacf6f8
Master 0.5.0 rc4 (#380)
vasiliy-zaznobin Dec 16, 2021
5ce4d3d
0.5.0-rc4 (#386)
vasiliy-zaznobin Dec 16, 2021
6a3dbd9
Neon-proxy/v0.5.0 (#388)
vasiliy-zaznobin Dec 17, 2021
424cf24
Merge remote-tracking branch 'origin/master' into master_v0.5.0->develop
vasiliy-zaznobin Dec 17, 2021
5aef94b
Neon-proxy/v0.5.1-dev
vasiliy-zaznobin Dec 17, 2021
03c051b
stable->latest
vasiliy-zaznobin Dec 17, 2021
3e43911
VERSION = (0, 5, 1)
vasiliy-zaznobin Dec 17, 2021
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
Prev Previous commit
Next Next commit
289 implement eth get storage at (#298)
* create eth_getStorageAt prototype

* implement eth_getStorageAt

* fix test

* Fix review issues, add UTs

* handle neon-cli errors

* add test

Co-authored-by: ivanl <[email protected]>
  • Loading branch information
2 people authored and vasiliy-zaznobin committed Dec 7, 2021
commit 0bbb26b16e2a462837ea80d9e8d983e45fe99c35
17 changes: 16 additions & 1 deletion proxy/plugin/solana_rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import os
from ..indexer.utils import get_trx_results, LogDB
from ..indexer.sql_dict import SQLDict
from proxy.environment import evm_loader_id, solana_cli, solana_url
from proxy.environment import evm_loader_id, solana_cli, solana_url, neon_cli

logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
Expand Down Expand Up @@ -195,6 +195,21 @@ def getBlockBySlot(self, slot, full):
}
return ret

def eth_getStorageAt(self, account, position, block_identifier):
'''Retrieves storage data by given position
Currently supports only 'latest' block
'''
if block_identifier != "latest":
logger.debug(f"Block type '{block_identifier}' is not supported yet")
raise RuntimeError(f"Not supported block identifier: {block_identifier}")

try:
value = neon_cli().call('get-storage-at', account, position)
return value
except Exception as err:
logger.debug(f"Neon-cli failed to execute: {err}")
return '0x00'

def eth_getBlockByHash(self, trx_hash, full):
"""Returns information about a block by hash.
trx_hash - Hash of a block.
Expand Down
32 changes: 32 additions & 0 deletions proxy/test_eth_sendRawTransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,38 @@ def test_07_execute_long_transaction(self):
print('times_to_calculate:', times_to_calculate)
print('time_duration:', time_duration)

def test_get_storage_at(self):
print("\nhttps://github.com/neonlabsorg/proxy-model.py/issues/289")
right_nonce = proxy.eth.get_transaction_count(proxy.eth.default_account)
value_to_store = 452356
trx_store = self.storage_contract.functions.store(value_to_store).buildTransaction({'nonce': right_nonce})
print('trx_store:', trx_store)
trx_store_signed = proxy.eth.account.sign_transaction(trx_store, eth_account.key)
print('trx_store_signed:', trx_store_signed)
trx_store_hash = proxy.eth.send_raw_transaction(trx_store_signed.rawTransaction)
print('trx_store_hash:', trx_store_hash.hex())
trx_store_receipt = proxy.eth.wait_for_transaction_receipt(trx_store_hash)
print('trx_store_receipt:', trx_store_receipt)

number_pos = 0
value_received = proxy.eth.get_storage_at(self.storage_contract.address, number_pos, "latest")
print('eth_getStorageAt existing address and index => ', value_received.hex())
self.assertEqual(int.from_bytes(value_received, byteorder='big'), value_to_store)

non_existing_pos = 12
value_received = proxy.eth.get_storage_at(self.storage_contract.address, non_existing_pos, "latest")
print('eth_getStorageAt existing address and non-existing index => ', value_received.hex())
self.assertEqual(int.from_bytes(value_received, byteorder='big'), 0)

non_exising_address = b'\xe1\xda\xb7\xa6\x17\x6f\x87\x68\xF5\x3a\x42\x5f\x29\x61\x73\x60\x5e\xd5\x08\x32'
value_received = proxy.eth.get_storage_at(non_exising_address, non_existing_pos, "latest")
print('eth_getStorageAt non-existing address => ', value_received.hex())
self.assertEqual(int.from_bytes(value_received, byteorder='big'), 0)

not_a_contract_address = proxy.eth.default_account
value_received = proxy.eth.get_storage_at(not_a_contract_address, 0, "latest")
print('eth_getStorageAt not_a_contract_address address => ', value_received.hex())
self.assertEqual(int.from_bytes(value_received, byteorder='big'), 0)

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