Skip to content

Commit cccfcf1

Browse files
authored
Adjust the integration test (faucet-refactoring) (#433)
Integration test for faucet has been adapted to the new version of the faucet service.
1 parent 9c15118 commit cccfcf1

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

proxy/docker-compose-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ services:
8787
image: neonlabsorg/proxy:${REVISION}
8888
environment:
8989
FAUCET_RPC_PORT: 3333
90-
FAUCET_RPC_ALLOWED_ORIGINS: http://airdropper
90+
FAUCET_RPC_ALLOWED_ORIGINS: '["http://airdropper"]'
9191
FAUCET_WEB3_ENABLE: 'false'
92-
WEB3_RPC_URL: http://proxy:9090/solana
92+
WEB3_RPC_URL: 'http://proxy:9090/solana'
9393
WEB3_PRIVATE_KEY: ''
9494
NEON_ERC20_TOKENS:
9595
NEON_ERC20_MAX_AMOUNT: 1000
9696
FAUCET_SOLANA_ENABLE: 'true'
97-
SOLANA_URL: http://solana:8899
98-
NEON_OPERATOR_KEYFILE: /root/.config/solana/id.json
97+
SOLANA_URL: 'http://solana:8899'
98+
NEON_OPERATOR_KEYFILE: '/root/.config/solana/id.json'
9999
NEON_ETH_MAX_AMOUNT: 10
100100
TEST_FAUCET_INIT_NEON_BALANCE: 10000
101101
hostname: faucet

proxy/testing/test_neon_faucet.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,13 @@ def deploy_erc20_token(self, name):
162162
return tx_deploy_receipt.contractAddress
163163

164164
def start_faucet(self):
165+
os.environ['FAUCET_RPC_BIND'] = '0.0.0.0'
165166
os.environ['FAUCET_RPC_PORT'] = '3333'
166-
os.environ['FAUCET_RPC_ALLOWED_ORIGINS'] = 'http://localhost'
167+
os.environ['FAUCET_RPC_ALLOWED_ORIGINS'] = '["http://localhost"]'
167168
os.environ['FAUCET_WEB3_ENABLE'] = 'true'
168169
os.environ['WEB3_RPC_URL'] = proxy_url
169170
os.environ['WEB3_PRIVATE_KEY'] = admin.key.hex()
170-
os.environ['NEON_ERC20_TOKENS'] = self.token_a + ',' + self.token_b
171+
os.environ['NEON_ERC20_TOKENS'] = '["' + self.token_a + '", "' + self.token_b + '"]'
171172
os.environ['NEON_ERC20_MAX_AMOUNT'] = '1000'
172173
os.environ['FAUCET_SOLANA_ENABLE'] = 'true'
173174
os.environ['SOLANA_URL'] = os.environ.get('SOLANA_URL', 'http://solana:8899')
@@ -203,9 +204,9 @@ def test_neon_faucet_01_neon_in_galans(self):
203204
self.assertEqual(balance_after - balance_before, 99999000000000)
204205

205206
# @unittest.skip("a.i.")
206-
def test_neon_faucet_02_eth_token(self):
207+
def test_neon_faucet_02_neon(self):
207208
print()
208-
url = 'http://localhost:{}/request_eth_token'.format(os.environ['FAUCET_RPC_PORT'])
209+
url = 'http://localhost:{}/request_neon'.format(os.environ['FAUCET_RPC_PORT'])
209210
# First request - trigger creation of the account without real transfer
210211
data = '{"wallet": "' + user.address + '", "amount": 0}'
211212
r = requests.post(url, data=data)
@@ -229,7 +230,7 @@ def test_neon_faucet_02_eth_token(self):
229230
# @unittest.skip("a.i.")
230231
def test_neon_faucet_03_erc20_tokens(self):
231232
print()
232-
url = 'http://localhost:{}/request_erc20_tokens'.format(os.environ['FAUCET_RPC_PORT'])
233+
url = 'http://localhost:{}/request_erc20'.format(os.environ['FAUCET_RPC_PORT'])
233234
a_before = self.get_token_balance(self.token_a, user.address)
234235
b_before = self.get_token_balance(self.token_b, user.address)
235236
print('token A balance before:', a_before)

0 commit comments

Comments
 (0)