mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-08-25 11:21:12 +00:00
refactor and add pin support to program facades
This commit is contained in:
@@ -106,7 +106,7 @@ class KeycardWallet:
|
||||
public_only = True,
|
||||
keypath = path
|
||||
)
|
||||
# TODO (marvin) clean this up
|
||||
|
||||
public_key = public_key.public_key
|
||||
public_key = VerifyingKey.from_string(public_key[1:], curve=SECP256k1)
|
||||
public_key = public_key.to_string("compressed")[1:]
|
||||
@@ -117,11 +117,12 @@ class KeycardWallet:
|
||||
print(f"Error getting public key: {e}")
|
||||
return None
|
||||
|
||||
|
||||
def sign_message_for_path(self, message: bytes = b"DefaultMessageTestDefaultMessage", path: str = "m/44'/60'/0'/0/0") -> bytes | None:
|
||||
try:
|
||||
if not self.card.is_secure_channel_open or not self.card.is_pin_verified:
|
||||
return None
|
||||
|
||||
|
||||
signature = self.card.sign_with_path(
|
||||
digest = message,
|
||||
path = path,
|
||||
|
||||
Reference in New Issue
Block a user