Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5984c19
cherrypick part of changes
Dec 1, 2021
613a469
create indexer.py
Dec 1, 2021
c0d0e6c
remove solana_receipts_update.py
Dec 1, 2021
3f6b5c4
Cherry pick files from old branch
Dec 1, 2021
0790298
add requirement
Dec 1, 2021
340c854
fix refactoring issues
Dec 1, 2021
7449b38
Fix inspection issues
Dec 1, 2021
b3dacfa
fix last issue
Dec 1, 2021
a50cd47
Merge branch '336_indexer_refactoring' into 337_сreate_base_airdroppe…
Dec 1, 2021
2b8f879
Merge remote-tracking branch 'origin/develop' into 337_сreate_base_ai…
Dec 2, 2021
f51f2ed
simplify tests
Dec 2, 2021
6678924
add test
Dec 2, 2021
5d454b7
Merge remote-tracking branch 'origin/develop' into 337_сreate_base_ai…
Dec 3, 2021
add136a
add price provider
Dec 1, 2021
9a4be44
fix PriceProvider, add test
Dec 1, 2021
07aaca8
Add tests. Check worn on all nets
Dec 1, 2021
7a46c12
refactoring
Dec 1, 2021
2fc1424
integrate price_provider into airdropper
Dec 2, 2021
d157d67
integrate price provider
Dec 2, 2021
8a6abfd
use new faucet method
Dec 3, 2021
3d4dec9
add new parameter to airdropper main
Dec 3, 2021
5c29832
Test discriptions for airdropper
Dec 3, 2021
6a4efdc
Comments for price provider tests
Dec 3, 2021
14aeeed
remove unnecessary comment
Dec 3, 2021
bd35791
Merge remote-tracking branch 'origin/develop' into 338_create_sol_pri…
Dec 3, 2021
ff1f557
Merge remote-tracking branch 'origin/develop' into 338_create_sol_pri…
Dec 6, 2021
c28ca8e
fix error
Dec 6, 2021
8c68755
Merge remote-tracking branch 'origin/develop' into 338_create_sol_pri…
Dec 7, 2021
5325895
Merge remote-tracking branch 'origin/develop' into 338_create_sol_pri…
Dec 8, 2021
a1cbad2
fix airdropper run
Dec 10, 2021
4ed6d78
remove duplicated code
Dec 15, 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
Test discriptions for airdropper
  • Loading branch information
ivanl committed Dec 3, 2021
commit 5c29832171bbed0588881089893ba6435e2e2f31
32 changes: 22 additions & 10 deletions proxy/testing/test_airdropper.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def setUpClass(cls) -> None:
cls.neon_decimals)

def setUp(self) -> None:
print(f"\n\n{self._testMethodName}\n{self._testMethodDoc}")
self.faucet = MockFaucet(self.faucet_port)
self.faucet.start()
time.sleep(0.2)
Expand All @@ -78,8 +79,9 @@ def test_success_process_trx_with_one_airdrop(self,
mock_sql_dict_contains,
mock_sql_dict_setitem,
mock_get_price):
print("\n\nShould airdrop to new address - one target in transaction")

"""
Should airdrop to new address - one target in transaction
"""
sol_price = 341
airdrop_amount = int(pow(10, self.neon_decimals) * (AIRDROP_AMOUNT_SOL * sol_price) / NEON_PRICE_USD)
mock_get_price.side_effect = [sol_price]
Expand All @@ -103,8 +105,9 @@ def test_failed_process_trx_with_one_airdrop_price_provider_error(self,
mock_sql_dict_contains,
mock_sql_dict_setitem,
mock_get_price):
print("\n\nShould not airdrop to new address due to price provider error")

"""
Should not airdrop to new address due to price provider error
"""
mock_get_price.side_effect = [None]
mock_sql_dict_contains.side_effect = [False] # new eth address
self.faucet.request_neon_in_galans_mock.side_effect = [Response("{}", status=200, mimetype='application/json')]
Expand All @@ -125,7 +128,9 @@ def test_failed_airdrop_contract_not_in_whitelist(self,
mock_sql_dict_contains,
mock_sql_dict_setitem,
mock_is_allowed_contract):
print("\n\nShould not airdrop for contract that is not in whitelist")
"""
Should not airdrop for contract that is not in whitelist
"""
mock_is_allowed_contract.side_effect = [False]
self.airdropper.process_trx_airdropper_mode(pre_token_airdrop_trx1)

Expand All @@ -143,8 +148,9 @@ def test_faucet_failure(self,
mock_sql_dict_contains,
mock_sql_dict_setitem,
mock_get_price):
print("\n\nShould not add address to processed list due to faucet error")

"""
Should not add address to processed list due to faucet error
"""
sol_price = 341
airdrop_amount = int(pow(10, self.neon_decimals) * (AIRDROP_AMOUNT_SOL * sol_price) / NEON_PRICE_USD)
mock_get_price.side_effect = [sol_price]
Expand All @@ -166,7 +172,9 @@ def test_faucet_failure(self,
def test_process_trx_with_one_airdrop_for_already_processed_address(self,
mock_sql_dict_contains,
mock_sql_dict_setitem):
print("\n\nShould not airdrop to repeated address")
"""
Should not airdrop to repeated address
"""
mock_sql_dict_contains.side_effect = [True] # eth address processed later

self.airdropper.process_trx_airdropper_mode(pre_token_airdrop_trx1)
Expand All @@ -184,7 +192,9 @@ def test_complex_transation(self,
mock_sql_dict_contains,
mock_sql_dict_setitem,
mock_get_price):
print("\n\nShould airdrop to several targets in one transaction")
"""
Should airdrop to several targets in one transaction
"""
sol_price1 = 341
sol_price2 = 225
airdrop_amount1 = int(pow(10, self.neon_decimals) * (AIRDROP_AMOUNT_SOL * sol_price1) / NEON_PRICE_USD)
Expand Down Expand Up @@ -212,7 +222,9 @@ def test_complex_transation(self,
def test_no_airdrop_instructions(self,
mock_sql_dict_contains,
mock_sql_dict_setitem):
print("\n\nShould not airdrop when instructions are inconsistent")
"""
Should not airdrop when instructions are inconsistent
"""
self.airdropper.process_trx_airdropper_mode(create_sol_acc_and_airdrop_trx)

mock_sql_dict_contains.assert_not_called()
Expand Down