Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Commit

Permalink
add timeout to generate funding script
Browse files Browse the repository at this point in the history
  • Loading branch information
doodyparizada committed Oct 9, 2018
1 parent 3c7172b commit 76b7ad3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions generate_funding_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class config:
STELLAR_KIN_TOKEN_NAME = os.environ['STELLAR_KIN_TOKEN_NAME']
OUTPUT_DIR = os.getenv('OUTPUT_DIR', '.')
AMOUNT = 100000
REQ_TIMEOUT = 10


def wrap_error(func):
Expand Down Expand Up @@ -44,7 +45,8 @@ def trust_kin(private_seed):
@retry(5, 1)
def fund_lumens(public_address):
res = requests.get(config.XLM_FAUCET,
params={'addr': public_address})
params={'addr': public_address},
timeout=config.REQ_TIMEOUT)
res.raise_for_status()
return res.json()

Expand All @@ -54,7 +56,8 @@ def fund_lumens(public_address):
def fund_kin(public_address):
res = requests.get(config.KIN_FAUCET + '/fund',
params={'account': public_address,
'amount': config.AMOUNT})
'amount': config.AMOUNT},
timeout=config.REQ_TIMEOUT)
res.raise_for_status()
return res.json()

Expand Down

0 comments on commit 76b7ad3

Please sign in to comment.