Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

407 do not create account if NEW_USER_AIRDROP_AMOUNT is zero #408

Merged
merged 1 commit into from
Dec 23, 2021
Merged
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion proxy/plugin/solana_rest_api_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from ..common_neon.transaction_sender import TransactionSender
from ..common_neon.emulator_interactor import call_emulated
from ..common_neon.utils import get_from_dict
from ..environment import read_elf_params, TIMEOUT_TO_RELOAD_NEON_CONFIG, EXTRA_GAS
from ..environment import NEW_USER_AIRDROP_AMOUNT, read_elf_params, TIMEOUT_TO_RELOAD_NEON_CONFIG, EXTRA_GAS


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -104,6 +104,9 @@ def get_token_balance_or_airdrop(client: SolanaClient, signer: SolanaAccount, et
return get_token_balance_gwei(client, solana_account)
except SolanaAccountNotFoundError:
logger.debug(f"Account not found: {eth_account} aka: {solana_account} - create")
if NEW_USER_AIRDROP_AMOUNT == 0:
return 0

create_eth_account_and_airdrop(client, signer, eth_account)
return get_token_balance_gwei(client, solana_account)

Expand Down