Skip to content

Commit

Permalink
spelling mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Sep 20, 2023
1 parent 8aaf0f8 commit 57f3967
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cashu/core/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def step0_carol_privkey():
return seckey


def step0_carol_checksig_redeemscrip(carol_pubkey):
def step0_carol_checksig_redeemscript(carol_pubkey):
"""Create script"""
txin_redeemScript = CScript([carol_pubkey, OP_CHECKSIG])
# txin_redeemScript = CScript([-123, OP_CHECKLOCKTIMEVERIFY])
Expand Down Expand Up @@ -111,7 +111,7 @@ def verify_bitcoin_script(txin_redeemScript_b64, txin_signature_b64):
# ---------
# CAROL defines scripthash and ALICE mints them
alice_privkey = step0_carol_privkey()
txin_redeemScript = step0_carol_checksig_redeemscrip(alice_privkey.pub)
txin_redeemScript = step0_carol_checksig_redeemscript(alice_privkey.pub)
print("Script:", txin_redeemScript.__repr__())
txin_p2sh_address = step1_carol_create_p2sh_address(txin_redeemScript)
print(f"Carol sends Alice secret = P2SH:{txin_p2sh_address}")
Expand All @@ -128,7 +128,7 @@ def verify_bitcoin_script(txin_redeemScript_b64, txin_signature_b64):
# CAROL redeems with MINT

# CAROL PRODUCES txin_redeemScript and txin_signature to send to MINT
txin_redeemScript = step0_carol_checksig_redeemscrip(alice_privkey.pub)
txin_redeemScript = step0_carol_checksig_redeemscript(alice_privkey.pub)
txin_signature = step2_carol_sign_tx(txin_redeemScript, alice_privkey).scriptSig

txin_redeemScript_b64 = base64.urlsafe_b64encode(txin_redeemScript).decode()
Expand Down
12 changes: 6 additions & 6 deletions cashu/wallet/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
from ..core.migrations import migrate_databases
from ..core.p2pk import sign_p2pk_sign
from ..core.script import (
step0_carol_checksig_redeemscrip,
step0_carol_checksig_redeemscript,
step0_carol_privkey,
step1_carol_create_p2sh_address,
step2_carol_sign_tx,
Expand Down Expand Up @@ -787,11 +787,11 @@ async def _generate_secret(self, randombits=128) -> str:
db=self.db, keyset_id=self.keyset_id
)
logger.trace(f"secret_counter: {secret_counter}")
s, _, _ = await self.generate_determinstic_secret(secret_counter)
s, _, _ = await self.generate_deterministic_secret(secret_counter)
# return s.decode("utf-8")
return hashlib.sha256(s).hexdigest()

async def generate_determinstic_secret(
async def generate_deterministic_secret(
self, counter: int
) -> Tuple[bytes, bytes, str]:
"""
Expand Down Expand Up @@ -840,7 +840,7 @@ async def generate_n_secrets(
f"Generating secret nr {secret_counters[0]} to {secret_counters[-1]}."
)
secrets_rs_derivationpaths = [
await self.generate_determinstic_secret(s) for s in secret_counters
await self.generate_deterministic_secret(s) for s in secret_counters
]
# secrets are supplied as str
secrets = [hashlib.sha256(s[0]).hexdigest() for s in secrets_rs_derivationpaths]
Expand Down Expand Up @@ -874,7 +874,7 @@ async def generate_secrets_from_to(
), "from_counter must be smaller than to_counter"
secret_counters = [c for c in range(from_counter, to_counter + 1)]
secrets_rs_derivationpaths = [
await self.generate_determinstic_secret(s) for s in secret_counters
await self.generate_deterministic_secret(s) for s in secret_counters
]
# secrets are supplied as str
secrets = [hashlib.sha256(s[0]).hexdigest() for s in secrets_rs_derivationpaths]
Expand Down Expand Up @@ -1532,7 +1532,7 @@ async def split_to_send(
async def create_p2sh_address_and_store(self) -> str:
"""Creates a P2SH lock script and stores the script and signature in the database."""
alice_privkey = step0_carol_privkey()
txin_redeemScript = step0_carol_checksig_redeemscrip(alice_privkey.pub)
txin_redeemScript = step0_carol_checksig_redeemscript(alice_privkey.pub)
txin_p2sh_address = step1_carol_create_p2sh_address(txin_redeemScript)
txin_signature = step2_carol_sign_tx(txin_redeemScript, alice_privkey).scriptSig
txin_redeemScript_b64 = base64.urlsafe_b64encode(txin_redeemScript).decode()
Expand Down

0 comments on commit 57f3967

Please sign in to comment.