Last active
May 12, 2022 00:23
-
-
Save ObiajuluM/8da69c628879161c019a9256aa168d65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import TypedDict | |
from cryptoconditions import PreimageSha256 | |
def genCondition_Fulfillment(secret: bytes) -> TypedDict: | |
"""Generate a condition and fulfillment for escrows""" | |
fufill = PreimageSha256(preimage=secret) | |
return { | |
"condition": str.upper(fufill.condition_binary.hex()), | |
"fulfillment": str.upper(fufill.serialize_binary().hex())} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment