|
25 | 25 | import base58 |
26 | 26 | import traceback |
27 | 27 | import threading |
28 | | -from .solana_rest_api_tools import EthereumAddress, create_account_with_seed, getTokens, \ |
29 | | - getAccountInfo, call_signed, call_emulated, \ |
30 | | - Trx, EthereumError, create_collateral_pool_address, getTokenAddr, STORAGE_SIZE, neon_config_load, MINIMAL_GAS_PRICE |
| 28 | +from .solana_rest_api_tools import EthereumAddress, getTokens, getAccountInfo, \ |
| 29 | + call_signed, call_emulated, EthereumError, neon_config_load, MINIMAL_GAS_PRICE |
31 | 30 | from solana.rpc.commitment import Commitment, Confirmed |
32 | 31 | from web3 import Web3 |
33 | 32 | import logging |
|
45 | 44 |
|
46 | 45 | EXTRA_GAS = int(os.environ.get("EXTRA_GAS", "0")) |
47 | 46 |
|
48 | | -class PermanentAccounts: |
49 | | - def __init__(self, client, signer, proxy_id): |
50 | | - self.operator = signer.public_key() |
51 | | - self.operator_token = getTokenAddr(self.operator) |
52 | | - self.proxy_id = proxy_id |
53 | | - |
54 | | - proxy_id_bytes = proxy_id.to_bytes((proxy_id.bit_length() + 7) // 8, 'big') |
55 | | - |
56 | | - storage_seed = keccak_256(b"storage" + proxy_id_bytes).hexdigest()[:32] |
57 | | - storage_seed = bytes(storage_seed, 'utf8') |
58 | | - self.storage = create_account_with_seed(client, funding=signer, base=signer, seed=storage_seed, storage_size=STORAGE_SIZE) |
59 | | - |
60 | | - holder_seed = keccak_256(b"holder" + proxy_id_bytes).hexdigest()[:32] |
61 | | - holder_seed = bytes(holder_seed, 'utf8') |
62 | | - self.holder = create_account_with_seed(client, funding=signer, base=signer, seed=holder_seed, storage_size=STORAGE_SIZE) |
63 | | - |
64 | | - collateral_pool_index = proxy_id % 4 |
65 | | - self.collateral_pool_index_buf = collateral_pool_index.to_bytes(4, 'little') |
66 | | - self.collateral_pool_address = create_collateral_pool_address(collateral_pool_index) |
67 | | - |
68 | | - |
69 | 47 | class EthereumModel: |
70 | 48 | def __init__(self): |
71 | 49 | # Initialize user account |
@@ -98,7 +76,6 @@ def __init__(self): |
98 | 76 | proxy_id_glob.value += 1 |
99 | 77 | logger.debug("worker id {}".format(self.proxy_id)) |
100 | 78 |
|
101 | | - self.perm_accs = PermanentAccounts(self.client, self.signer, self.proxy_id) |
102 | 79 | neon_config_load(self) |
103 | 80 | pass |
104 | 81 |
|
@@ -415,7 +392,7 @@ def eth_sendRawTransaction(self, rawTrx): |
415 | 392 | ] |
416 | 393 | }) |
417 | 394 | try: |
418 | | - signature = call_signed(self.signer, self.client, trx, self.perm_accs, steps=250) |
| 395 | + signature = call_signed(self.signer, self.client, trx, steps=250) |
419 | 396 |
|
420 | 397 | logger.debug('Transaction signature: %s %s', signature, eth_signature) |
421 | 398 |
|
|
0 commit comments