Skip to content

Commit 5eceefd

Browse files
merge from develop
2 parents 618fa61 + fe99f3e commit 5eceefd

File tree

5 files changed

+5
-18
lines changed

5 files changed

+5
-18
lines changed

proxy/common_neon/elf_params.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ class ElfParams:
1717
def __init__(self):
1818
self._elf_param_dict: Dict[str, any] = {}
1919

20-
@property
21-
def treasury_pool_base(self) -> Optional[str]:
22-
return self._elf_param_dict.get("NEON_POOL_BASE")
23-
2420
@property
2521
def treasury_pool_max(self) -> int:
2622
return int(self._elf_param_dict.get("NEON_POOL_COUNT"))

proxy/common_neon/neon_instruction.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ def init_neon_tx(self, neon_tx: NeonTx) -> NeonIxBuilder:
7373
keccak_result = self._neon_tx.hash_signed()
7474
treasury_pool_index = int().from_bytes(keccak_result[:4], "little") % ElfParams().treasury_pool_max
7575
self._treasury_pool_index_buf = treasury_pool_index.to_bytes(4, 'little')
76-
self._treasury_pool_address = self._create_treasury_pool_address(treasury_pool_index)
76+
self._treasury_pool_address = SolPubKey.find_program_address(
77+
[b'treasury_pool', self._treasury_pool_index_buf],
78+
self._evm_program_id
79+
)[0]
7780

7881
return self
7982

@@ -85,13 +88,6 @@ def init_iterative(self, holder: SolPubKey):
8588
self._holder = holder
8689
return self
8790

88-
@staticmethod
89-
def _create_treasury_pool_address(treasury_pool_index):
90-
treasury_seed_prefix = "collateral_seed_"
91-
seed = treasury_seed_prefix + str(treasury_pool_index)
92-
treasury_pool_base = SolPubKey(ElfParams().treasury_pool_base)
93-
return account_with_seed(treasury_pool_base, str.encode(seed))
94-
9591
def make_create_account_with_seed_ix(self, account: SolPubKey, seed: bytes, lamports: int, space: int) -> SolTxIx:
9692
seed_str = str(seed, 'utf8')
9793
self.debug(f"createAccountWithSeedIx {self._operator_account} account({account} seed({seed_str})")

proxy/prepare-deploy-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ solana address || solana-keygen new --no-passphrase
1010
solana airdrop 1000
1111
solana balance
1212

13-
/spl/bin/neon-cli --commitment confirmed --url "${SOLANA_URL}" --evm_loader "${EVM_LOADER}" neon-elf-params > .test-env
13+
neon-cli --commitment confirmed --url "${SOLANA_URL}" --evm_loader "${EVM_LOADER}" neon-elf-params > .test-env
1414
echo "TEST_PROGRAM=$(solana address -k /spl/bin/neon-test-invoke-program-keypair.json)" >> .test-env
1515

1616
export $(cat .test-env | xargs)

proxy/testing/solana_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
keccakprog = "KeccakSecp256k11111111111111111111111111111"
3232
rentid = "SysvarRent111111111111111111111111111111111"
3333
incinerator = "1nc1nerator11111111111111111111111111111111"
34-
collateral_pool_base = "4sW3SZDJB7qXUyCYKA7pFL8eCTfm3REr8oSiKkww7MaT"
3534
COMPUTE_BUDGET_ID: PublicKey = PublicKey("ComputeBudget111111111111111111111111111111")
3635

3736
solana_url = os.environ.get("SOLANA_URL", "http://localhost:8899")

proxy/testing/test_environment.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ def test_read_elf_params(self):
2323
self.assertTrue(neon_token_mint is not None)
2424
self.assertEqual(neon_token_mint, os.environ.get('NEON_TOKEN_MINT', None))
2525

26-
neon_pool_base = elf_params.get('NEON_POOL_BASE', None)
27-
self.assertTrue(neon_pool_base is not None)
28-
self.assertEqual(neon_pool_base, os.environ.get('NEON_POOL_BASE', None))
29-
3026
def test_neon_chain_id(self):
3127
print("\n\nhttps://github.com/neonlabsorg/neon-evm/issues/347")
3228
neon_chain_id = os.environ.get('NEON_CHAIN_ID', None)

0 commit comments

Comments
 (0)