Skip to content

Commit b3f6696

Browse files
hukkinj1darosior
authored andcommitted
Simplify coincurve.PrivateKey to bytes conversion
1 parent 1d28d72 commit b3f6696

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

bip32/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def _derive_unhardened_private_child(privkey, chaincode, index):
4747
except ValueError:
4848
raise BIP32DerivationError("Invalid private key at index {}, try the "
4949
"next one!".format(index))
50-
return bytes.fromhex(child_private.to_hex()), payload[32:]
50+
return child_private.secret, payload[32:]
5151

5252

5353
def _derive_hardened_private_child(privkey, chaincode, index):
@@ -69,7 +69,7 @@ def _derive_hardened_private_child(privkey, chaincode, index):
6969
except ValueError:
7070
raise BIP32DerivationError("Invalid private key at index {}, try the "
7171
"next one!".format(index))
72-
return bytes.fromhex(child_private.to_hex()), payload[32:]
72+
return child_private.secret, payload[32:]
7373

7474

7575
def _derive_public_child(pubkey, chaincode, index):

0 commit comments

Comments
 (0)