Skip to content

Commit

Permalink
Adjust the integration test (faucet-refactoring) (#433)
Browse files Browse the repository at this point in the history
Integration test for faucet has been adapted to the new version of the faucet service.
  • Loading branch information
vakond authored Jan 12, 2022
1 parent 9c15118 commit cccfcf1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions proxy/docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ services:
image: neonlabsorg/proxy:${REVISION}
environment:
FAUCET_RPC_PORT: 3333
FAUCET_RPC_ALLOWED_ORIGINS: http://airdropper
FAUCET_RPC_ALLOWED_ORIGINS: '["http://airdropper"]'
FAUCET_WEB3_ENABLE: 'false'
WEB3_RPC_URL: http://proxy:9090/solana
WEB3_RPC_URL: 'http://proxy:9090/solana'
WEB3_PRIVATE_KEY: ''
NEON_ERC20_TOKENS:
NEON_ERC20_MAX_AMOUNT: 1000
FAUCET_SOLANA_ENABLE: 'true'
SOLANA_URL: http://solana:8899
NEON_OPERATOR_KEYFILE: /root/.config/solana/id.json
SOLANA_URL: 'http://solana:8899'
NEON_OPERATOR_KEYFILE: '/root/.config/solana/id.json'
NEON_ETH_MAX_AMOUNT: 10
TEST_FAUCET_INIT_NEON_BALANCE: 10000
hostname: faucet
Expand Down
11 changes: 6 additions & 5 deletions proxy/testing/test_neon_faucet.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,13 @@ def deploy_erc20_token(self, name):
return tx_deploy_receipt.contractAddress

def start_faucet(self):
os.environ['FAUCET_RPC_BIND'] = '0.0.0.0'
os.environ['FAUCET_RPC_PORT'] = '3333'
os.environ['FAUCET_RPC_ALLOWED_ORIGINS'] = 'http://localhost'
os.environ['FAUCET_RPC_ALLOWED_ORIGINS'] = '["http://localhost"]'
os.environ['FAUCET_WEB3_ENABLE'] = 'true'
os.environ['WEB3_RPC_URL'] = proxy_url
os.environ['WEB3_PRIVATE_KEY'] = admin.key.hex()
os.environ['NEON_ERC20_TOKENS'] = self.token_a + ',' + self.token_b
os.environ['NEON_ERC20_TOKENS'] = '["' + self.token_a + '", "' + self.token_b + '"]'
os.environ['NEON_ERC20_MAX_AMOUNT'] = '1000'
os.environ['FAUCET_SOLANA_ENABLE'] = 'true'
os.environ['SOLANA_URL'] = os.environ.get('SOLANA_URL', 'http://solana:8899')
Expand Down Expand Up @@ -203,9 +204,9 @@ def test_neon_faucet_01_neon_in_galans(self):
self.assertEqual(balance_after - balance_before, 99999000000000)

# @unittest.skip("a.i.")
def test_neon_faucet_02_eth_token(self):
def test_neon_faucet_02_neon(self):
print()
url = 'http://localhost:{}/request_eth_token'.format(os.environ['FAUCET_RPC_PORT'])
url = 'http://localhost:{}/request_neon'.format(os.environ['FAUCET_RPC_PORT'])
# First request - trigger creation of the account without real transfer
data = '{"wallet": "' + user.address + '", "amount": 0}'
r = requests.post(url, data=data)
Expand All @@ -229,7 +230,7 @@ def test_neon_faucet_02_eth_token(self):
# @unittest.skip("a.i.")
def test_neon_faucet_03_erc20_tokens(self):
print()
url = 'http://localhost:{}/request_erc20_tokens'.format(os.environ['FAUCET_RPC_PORT'])
url = 'http://localhost:{}/request_erc20'.format(os.environ['FAUCET_RPC_PORT'])
a_before = self.get_token_balance(self.token_a, user.address)
b_before = self.get_token_balance(self.token_b, user.address)
print('token A balance before:', a_before)
Expand Down

0 comments on commit cccfcf1

Please sign in to comment.