Fix tests
This commit is contained in:
parent
62772084b9
commit
a245174c24
|
@ -90,7 +90,7 @@ class Blockchain:
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def new_block(self, proof: int, previous_hash: Optional[str]=None) -> Dict[str, Any]:
|
def new_block(self, proof, previous_hash):
|
||||||
"""
|
"""
|
||||||
Create a new Block in the Blockchain
|
Create a new Block in the Blockchain
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ class Blockchain:
|
||||||
'timestamp': time(),
|
'timestamp': time(),
|
||||||
'transactions': self.current_transactions,
|
'transactions': self.current_transactions,
|
||||||
'proof': proof,
|
'proof': proof,
|
||||||
'previous_hash': previous_hash or self.hash(last_block),
|
'previous_hash': previous_hash or self.hash(self.chain[-1]),
|
||||||
}
|
}
|
||||||
|
|
||||||
# Reset the current list of transactions
|
# Reset the current list of transactions
|
||||||
|
@ -131,7 +131,7 @@ class Blockchain:
|
||||||
return self.last_block['index'] + 1
|
return self.last_block['index'] + 1
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def last_block(self) -> Dict[str, Any]:
|
def last_block(self):
|
||||||
return self.chain[-1]
|
return self.chain[-1]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in New Issue