Facility to convert fake key to real one for testing.

pull/1451/head
jMyles 2019-12-12 18:46:53 -08:00
parent e88d0bcf42
commit 092d9049db
1 changed files with 14 additions and 0 deletions

View File

@ -50,6 +50,20 @@ class NotAPublicKey:
def to_bytes(self, *args, **kwargs):
return b"this is not a public key... but it is 64 bytes.. so, ya know" + self.serial
def i_want_to_be_a_real_boy(self):
_umbral_pubkey = self._umbral_pubkey_from_bytes(bytes(self))
self.__dict__ = _umbral_pubkey.__dict__
self.__class__ = _umbral_pubkey.__class__
@property
def params(self):
# Holy heck, metamock hacking.
self.i_want_to_be_a_real_boy()
return self.params
def __eq__(self, other):
return bytes(self) == bytes(other)
class NotAPrivateKey:
params = default_params()