Esempio n. 1
0
def test_old_txn_metadata_digest_fallback(looper, sdk_wallet_client):
    # Create signed request and convert to legacy txn
    req_str = sdk_signed_random_requests(looper, sdk_wallet_client, 1)[0]
    req = deserialize_req(req_str)
    txn = req_to_legacy_txn(req_str)

    # Check that digests still can be extracted correctly
    assert get_payload_digest(txn) == req.payload_digest
    assert get_digest(txn) == None
Esempio n. 2
0
def test_old_txn_metadata_multisig_digest_fallback(looper, sdk_wallet_client, sdk_wallet_client2):
    # Create signed request and convert to legacy txn
    req_str = json.dumps(sdk_random_request_objects(1, CURRENT_PROTOCOL_VERSION, sdk_wallet_client[1])[0].as_dict)
    req_str = sdk_multisign_request_object(looper, sdk_wallet_client, req_str)
    req_str = sdk_multisign_request_object(looper, sdk_wallet_client2, req_str)
    req = deserialize_req(req_str)
    txn = req_to_legacy_txn(req_str)

    # Check that digests still can be extracted correctly
    assert get_payload_digest(txn) == req.payload_digest
    assert get_digest(txn) == None
def test_get_payload_digest_old(legacy_txn):
    assert get_payload_digest(legacy_txn) == "58232927bdccad16998a284e807a4e256d138a894c2bf41bbbf9db7cfab59c9c"
Esempio n. 4
0
def test_attrib_txn_payload_digest_req_json(req_json, req):
    txn = reqToTxn(req_json)
    assert get_payload_digest(txn) == req.payload_digest