MCPcopy Create free account
hub / github.com/ElementsProject/elements / set

Method set

test/functional/test_framework/key.py:346–353  ·  view source on GitHub ↗

Construct a private key object with given 32-byte secret and compressed flag.

(self, secret, compressed)

Source from the content-addressed store, hash-verified

344 self.valid = False
345
346 def set(self, secret, compressed):
347 """Construct a private key object with given 32-byte secret and compressed flag."""
348 assert(len(secret) == 32)
349 secret = int.from_bytes(secret, 'big')
350 self.valid = (secret > 0 and secret < SECP256K1_ORDER)
351 if self.valid:
352 self.secret = secret
353 self.compressed = compressed
354
355 def generate(self, compressed=True):
356 """Generate a random private key (compressed or uncompressed)."""

Callers 9

spenders_taproot_activeFunction · 0.95
gen_test_vectorsMethod · 0.95
generateMethod · 0.95
setup_nodesMethod · 0.45
setup_zmq_testMethod · 0.45
__init__Method · 0.45
SetMethod · 0.45
WriteMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected