def test_state_proof_returned_for_get_revoc_reg_entry(looper, nodeSetWithOneNodeResponding, sdk_wallet_steward, sdk_pool_handle, sdk_wallet_client, send_revoc_reg_entry): revoc_reg_def = send_revoc_reg_entry[0] revoc_reg_entry_data = send_revoc_reg_entry[1][0]['operation'] timestamp = int(time.time()) req = looper.loop.run_until_complete(build_get_revoc_reg_request( sdk_wallet_client[1], get_revoc_reg_def_id(sdk_wallet_steward[1], revoc_reg_def[0]), timestamp)) rep = sdk_get_and_check_replies(looper, [sdk_sign_and_submit_req(sdk_pool_handle, sdk_wallet_client, req)]) result = rep[0][1]['result'] expected_data = revoc_reg_entry_data data = result.get(DATA) del expected_data['type'] del data['seqNo'] del data['txnTime'] assert DATA in result assert data assert data == expected_data assert result[TXN_TIME] check_valid_proof(result)
def check_get_delta(looper, sdk_wallet_client, sdk_wallet_steward, revoc_reg_def, timestamp_fr, timestamp_to, sdk_pool_handle, revoc_reg_entry_data, check_data=True): req = looper.loop.run_until_complete( build_get_revoc_reg_delta_request( sdk_wallet_client[1], get_revoc_reg_def_id(sdk_wallet_steward[1], revoc_reg_def[0]), timestamp_fr, timestamp_to)) rep = sdk_get_and_check_replies( looper, [sdk_sign_and_submit_req(sdk_pool_handle, sdk_wallet_client, req)]) if check_data: result = rep[0][1]['result'] expected_data = revoc_reg_entry_data data = result.get(DATA)['value']['accum_to'] del data['seqNo'] del data['txnTime'] if 'type' in expected_data: del expected_data['type'] assert DATA in result assert data assert data == expected_data assert result[TXN_TIME] check_valid_proof(result)