Update to work with squeaklib 0.3.1 (#66)

This commit is contained in:
Jonathan Zernik 2020-07-05 16:37:45 -07:00 committed by GitHub
parent ce6991214a
commit 220b1eed22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 9 deletions

View file

@ -204,7 +204,7 @@ def run():
# Decrypt the decryption key
decryption_key = encrypted_decryption_key.get_decryption_key(preimage, iv)
serialized_decryption_key = decryption_key.serialize()
serialized_decryption_key = decryption_key.get_bytes()
print("new decryption key: " + str(decryption_key))
print("new decryption key: " + str(serialized_decryption_key))

View file

@ -1,5 +1,5 @@
importlib_resources==1.4.0
squeaklib
squeaklib==0.3.1
argparse
googleapis-common-protos
grpcio

View file

@ -1,5 +1,5 @@
importlib_resources==1.4.0
squeaklib
squeaklib==0.3.1
argparse
googleapis-common-protos
grpcio

View file

@ -64,14 +64,14 @@ class PostgresDb():
squeak.hashReplySqk.hex(),
squeak.hashBlock.hex(),
squeak.nBlockHeight,
bytes(squeak.scriptPubKey),
squeak.vchScriptPubKey,
squeak.vchEncryptionKey,
squeak.vchEncDatakey.hex(),
squeak.vchIv.hex(),
squeak.nTime,
squeak.nNonce,
bytes(squeak.encContent.vchEncContent).hex(),
bytes(squeak.scriptSig),
squeak.vchScriptSig,
str(squeak.GetAddress()),
squeak.vchDecryptionKey,
))
@ -96,15 +96,15 @@ class PostgresDb():
hashReplySqk=bytes.fromhex(row[4]),
hashBlock=bytes.fromhex(row[5]),
nBlockHeight=row[6],
scriptPubKey=CScript(row[7].tobytes()),
vchScriptPubKey=row[7],
vchEncryptionKey=row[8],
vchEncDatakey=bytes.fromhex(row[9]),
vchIv=bytes.fromhex((row[10])),
nTime=row[11],
nNonce=row[12],
encContent=CSqueakEncContent(bytes.fromhex((row[13]))),
scriptSig=CScript((row[14].tobytes())),
vchDecryptionKey=(row[16]),
vchScriptSig=row[14],
vchDecryptionKey=row[16],
)
return squeak

View file

@ -46,5 +46,5 @@ def example_squeak(signing_key):
@pytest.fixture
def bad_squeak(signing_key):
squeak = make_squeak(signing_key, 'hello!', )
squeak.SetDataKey(b'deadbeef')
squeak.ClearDecryptionKey()
return squeak