developing signature processing in wot
This commit is contained in:
parent
650e943182
commit
08d8fda857
@ -6,12 +6,12 @@ import nacl.exceptions
|
||||
from getbykey import get_identity_by_key
|
||||
|
||||
|
||||
def process_trust_signature(signature: bytes):
|
||||
if len(signature) != 128:
|
||||
def process_trust_signature(sig_payload: bytes):
|
||||
if len(sig_payload) != 128:
|
||||
logger.warn(
|
||||
f'Signature size is invalid for a signed identity')
|
||||
signer = signature[:32]
|
||||
signed = signature[32:65]
|
||||
signer = sig_payload[:32]
|
||||
signed = sig_payload[32:65]
|
||||
signature = signature[65:]
|
||||
|
||||
# If bad signature, it raises nacl.exceptions.BadSignatureError
|
||||
|
@ -15,11 +15,13 @@ sys.path.append(".")
|
||||
sys.path.append('static-data/default-plugins/wot/')
|
||||
sys.path.append("src/")
|
||||
from wot import identity
|
||||
from wot import process_block
|
||||
|
||||
|
||||
class BlockProcessingTest(unittest.TestCase):
|
||||
class TrustSignatureProcessing(unittest.TestCase):
|
||||
def test_block_processing_trust(self):
|
||||
identity1 = identity.Identity()
|
||||
identity2 = identity.Identity()
|
||||
identity1.trust(identity2)
|
||||
|
||||
|
||||
unittest.main()
|
Loading…
Reference in New Issue
Block a user