Skip to content

Commit

Permalink
Rename find_pow_for_root_and_difficulty to generate_pow_for_root_and_…
Browse files Browse the repository at this point in the history
…difficulty
  • Loading branch information
dsiganos committed Feb 21, 2024
1 parent 8ad7bde commit 95e156c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion block.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ def sign(self, signing_key: ed25519_blake2b.keys.SigningKey) -> None:

def generate_work(self, min_difficulty: int) -> None:
root_int = int.from_bytes(self.root(), byteorder='big')
self.work = pow.find_pow_for_root_and_difficulty(root_int, min_difficulty)
self.work = pow.generate_pow_for_root_and_difficulty(root_int, min_difficulty)

@classmethod
def parse(cls, data: bytes):
Expand Down
2 changes: 1 addition & 1 deletion examples/pow_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def generate_pow_hash(nonce, root):
return int.from_bytes(alg.digest(), byteorder='little')


def find_pow_for_root_and_difficulty(root, target_difficulty):
def generate_pow_for_root_and_difficulty(root, target_difficulty):
nonce = random_nonce()
difficulty = generate_pow_hash(nonce, root)
while difficulty < target_difficulty:
Expand Down
2 changes: 1 addition & 1 deletion pow.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def generate_pow_hash(nonce: int, root: int) -> int:
return int.from_bytes(alg.digest(), byteorder='little')


def find_pow_for_root_and_difficulty(root: int, target_difficulty: int) -> int:
def generate_pow_for_root_and_difficulty(root: int, target_difficulty: int) -> int:
nonce = random_nonce()
difficulty = generate_pow_hash(nonce, root)
while difficulty < target_difficulty:
Expand Down

0 comments on commit 95e156c

Please sign in to comment.