helper_bitcoin pylint fixes

v0.6
lakshyacis 3 years ago
parent 31e3d60fb0
commit 27c58b05f3
No known key found for this signature in database
GPG Key ID: D2C539C8EC63E9EB
  1. 19
      src/helper_bitcoin.py
  2. 4
      src/helper_sent.py

@ -1,11 +1,19 @@
"""
Calculates bitcoin and testnet address from pubkey
"""
import hashlib
from debug import logger
from pyelliptic import arithmetic
# This function expects that pubkey begin with \x04
def calculateBitcoinAddressFromPubkey(pubkey):
"""This function expects that pubkey begin's with the bitcoin prefix"""
"""Calculate bitcoin address from given pubkey (65 bytes long hex string)"""
if len(pubkey) != 65:
print 'Could not calculate Bitcoin address from pubkey because function was passed a pubkey that was', len(pubkey), 'bytes long rather than 65.'
logger.error('Could not calculate Bitcoin address from pubkey because'
' function was passed a pubkey that was'
' %i bytes long rather than 65.', len(pubkey))
return "error"
ripe = hashlib.new('ripemd160')
sha = hashlib.new('sha256')
@ -25,8 +33,11 @@ def calculateBitcoinAddressFromPubkey(pubkey):
def calculateTestnetAddressFromPubkey(pubkey):
"""This function expects that pubkey begin with the testnet prefix"""
if len(pubkey) != 65:
print 'Could not calculate Bitcoin address from pubkey because function was passed a pubkey that was', len(pubkey), 'bytes long rather than 65.'
logger.error('Could not calculate Bitcoin address from pubkey because'
' function was passed a pubkey that was'
' %i bytes long rather than 65.', len(pubkey))
return "error"
ripe = hashlib.new('ripemd160')
sha = hashlib.new('sha256')

@ -1,3 +1,7 @@
"""
Insert operation into sent table
"""
from helper_sql import *
def insert(t):

Loading…
Cancel
Save