Skip to content

Commit

Permalink
Fix depreated function warning
Browse files Browse the repository at this point in the history
* Improve blockchain unittests
  • Loading branch information
holgern committed Apr 2, 2018
1 parent 68cad02 commit e3262e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions beemgraphenebase/ecdsasig.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ def sign_message(message, wif, hashfn=hashlib.sha256):
if not cnt % 20:
log.info("Still searching for a canonical signature. Tried %d times already!" % cnt)
order = ecdsa.SECP256k1.order
signer = private_key.signer(ec.ECDSA(hashes.SHA256()))
signer.update(message)
sigder = signer.finalize()
sigder = private_key.sign(message, ec.ECDSA(hashes.SHA256()))
r, s = decode_dss_signature(sigder)
signature = ecdsa.util.sigencode_string(r, s, order)
# Make sure signature is canonical!
Expand Down
2 changes: 1 addition & 1 deletion tests/beem/test_blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_blockchain(self, node_param):
self.assertTrue(isinstance(num, int))
block = b.get_current_block()
self.assertTrue(isinstance(block, Block))
self.assertTrue((num - block.identifier) < 2)
self.assertTrue((num - block.identifier) < 3)
block_time = b.block_time(block.identifier)
self.assertEqual(block.time(), block_time)
block_timestamp = b.block_timestamp(block.identifier)
Expand Down

0 comments on commit e3262e4

Please sign in to comment.