Skip to content

Commit

Permalink
Use Blackcoin variables
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackcoinDev committed Sep 26, 2024
1 parent de2e2cb commit 88c13a7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion blackcoinutils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@


# Monetary constants
SATOSHIS_PER_BITCOIN = 100000000
SATOSHIS_PER_BLACKCOIN = 100000000
NEGATIVE_SATOSHI = -1

# Block
Expand Down
8 changes: 4 additions & 4 deletions blackcoinutils/hdwallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from typing import Optional

from hdwallet import HDWallet as ext_HDWallet # type: ignore
from hdwallet.symbols import BTC, BTCTEST # type: ignore
from hdwallet.symbols import BLK, BLKTEST # type: ignore

from blackcoinutils.setup import is_mainnet
from blackcoinutils.keys import PrivateKey
Expand All @@ -39,13 +39,13 @@ def __init__(
path: Optional[str] = None,
mnemonic: Optional[str] = None,
):
"""Instantiate a hdwallet object using the corresponding library with BTC"""
"""Instantiate a hdwallet object using the corresponding library with BLK"""

symbol = None
if is_mainnet():
symbol = BTC
symbol = BLK
else:
symbol = BTCTEST
symbol = BLKTEST

self.hdw = ext_HDWallet(symbol)

Expand Down
4 changes: 2 additions & 2 deletions blackcoinutils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import hashlib
from ecdsa import ellipticcurve # type: ignore
from blackcoinutils.constants import SATOSHIS_PER_BITCOIN, LEAF_VERSION_TAPSCRIPT
from blackcoinutils.constants import SATOSHIS_PER_BLACKCOIN, LEAF_VERSION_TAPSCRIPT
from blackcoinutils.schnorr import full_pubkey_gen, point_add, point_mul, G
import struct

Expand Down Expand Up @@ -179,7 +179,7 @@ def to_satoshis(num: int | float | Decimal):
"""
# we need to round because of how floats are stored internally:
# e.g. 0.29 * 100000000 = 28999999.999999996
return int(round(num * SATOSHIS_PER_BITCOIN))
return int(round(num * SATOSHIS_PER_BLACKCOIN))


def prepend_compact_size(data: bytes) -> bytes:
Expand Down

0 comments on commit 88c13a7

Please sign in to comment.