Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Merge pull request #2910 from gratipay/fix-bitcoin-payout-script
Browse files Browse the repository at this point in the history
Fixing small probs in bitcoin_payout script
  • Loading branch information
chadwhitacre committed Nov 7, 2014
2 parents a6f1c07 + ac8ba6d commit ad3b553
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ def bitcoin_payout(username='', amount='', api_key_fragment=''):
[gratipay] $ env/bin/invoke bitcoin_payout --username=username --amount=amount [--api-key-fragment=12e4s678]
"""

if not os.environ.get('DATABASE_URL'):
load_prod_envvars()

if not username or not amount:
print(bitcoin_payout.__doc__)
sys.exit(1)
Expand Down Expand Up @@ -233,7 +236,7 @@ def coinbase_request(url, body=None):
load_prod_envvars()
nonce = int(time.time() * 1e6)
message = str(nonce) + url + ('' if body is None else body)
signature = hmac.new(os.environ['COINBASE_API_SECRET'], message, hashlib.sha256).hexdigest()
signature = hmac.new(str(os.environ['COINBASE_API_SECRET']), message, hashlib.sha256).hexdigest()

headers = {
'ACCESS_KEY' : os.environ['COINBASE_API_KEY'],
Expand Down

0 comments on commit ad3b553

Please sign in to comment.