miner/miner.py
def valid_proof(last_proof, proof, difficulty):
    """
    Validates the Proof:  Does hash(block_string, proof) contain 6
    leading zeroes?
    difficutly returned by last proof function
    """

    guess = f'{last_proof}{proof}'.encode()
    
    guess_hash = hashlib.sha256(guess).hexdigest()
    
    beg = guess_hash[:difficulty]

    dif = difficulty
    string= "0"
    while dif > 1:
        string += "0"
        dif -= 1
 
    if beg == string:
        print("HEEEEELLLLLLLYEAAAAAAAAAAAAH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
        return True
    else:
        return False

    # TODO
    # pass

    Validates the Proof:  Does hash(block_string, proof) contain 6
    leading zeroes?
    difficutly returned by last proof function
    
Validates the Proof:  Does hash(block_string, proof) contain 6
leading zeroes.
difficutly returned by last proof function
Validates the Proof : Does hash ( block_string proof ) contain 6 leading zeroes . difficutly returned by last proof function
def valid_proof(last_proof, proof, difficulty):
    guess = f'{last_proof}{proof}'.encode()
    guess_hash = hashlib.sha256(guess).hexdigest()
    beg = guess_hash[:difficulty]
    dif = difficulty
    string= "0"
    while dif > 1:
        string += "0"
        dif -= 1
    if beg == string:
        print("HEEEEELLLLLLLYEAAAAAAAAAAAAH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
        return True
    else:
        return False
def valid_proof ( last_proof , proof , difficulty ) : guess = f'{last_proof}{proof}' . encode ( ) guess_hash = hashlib . sha256 ( guess ) . hexdigest ( ) beg = guess_hash [ : difficulty ] dif = difficulty string = "0" while dif > 1 : string += "0" dif -= 1 if beg == string : print ( "HEEEEELLLLLLLYEAAAAAAAAAAAAH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ) return True else : return False
Validates the Proof:  Does hash(block_string, proof) contain 6
leading zeroes?
Validates the Proof : Does hash ( block_string proof ) contain 6 leading zeroes?
"""
    Validates the Proof:  Does hash(block_string, proof) contain 6
    leading zeroes?
    difficutly returned by last proof function
    """ # TODO # pass
last_proof
proof
difficulty