Ejemplo n.º 1
0
def send_aml_request(looper, sdk_wallet_trustee, sdk_pool_handle, version, aml, context):
    req = looper.loop.run_until_complete(build_acceptance_mechanisms_request(
        sdk_wallet_trustee[1],
        aml,
        version, context))
    req = sdk_sign_and_send_prepared_request(looper, sdk_wallet_trustee, sdk_pool_handle, req)
    return sdk_get_and_check_replies(looper, [req])[0]
Ejemplo n.º 2
0
def taa_aml_request_module(looper, aml_request_kwargs, sdk_pool_handle):
    res = looper.loop.run_until_complete(
        build_acceptance_mechanisms_request(
            aml_request_kwargs['identifier'],
            json.dumps(aml_request_kwargs['operation'][AML]),
            aml_request_kwargs['operation'][AML_VERSION],
            aml_request_kwargs['operation'][AML_CONTEXT]))
    return res
Ejemplo n.º 3
0
def taa_aml_request(looper, aml_request_kwargs, sdk_pool_handle):
    aml_request_kwargs = deepcopy(aml_request_kwargs)
    aml_request_kwargs['operation'][AML_VERSION] = randomString()
    aml_request_kwargs['operation'][AML_CONTEXT] = randomString()
    return looper.loop.run_until_complete(
        build_acceptance_mechanisms_request(
            aml_request_kwargs['identifier'],
            json.dumps(aml_request_kwargs['operation'][AML]),
            aml_request_kwargs['operation'][AML_VERSION],
            aml_request_kwargs['operation'][AML_CONTEXT]))
Ejemplo n.º 4
0
 def acceptance_mechanism(self, sdk_trustee_wallet, aml, aml_context=None):
     acceptance_mechanism_future = build_acceptance_mechanisms_request(
         sdk_trustee_wallet[1], aml, "0.0.1", aml_context)
     acceptance_mechanism_request = self._looper.loop.run_until_complete(
         acceptance_mechanism_future)
     acceptance_mechanism_request = self._sdk.sdk_json_to_request_object(
         json.loads(acceptance_mechanism_request))
     acceptance_mechanism_request = self._sign_sdk(
         acceptance_mechanism_request, sdk_trustee_wallet)
     return acceptance_mechanism_request
def aml_on_ledger(looper, sdk_pool_handle, sdk_wallet_trustee):
    ver = random.randint(1, 10000)
    aml_req_future = build_acceptance_mechanisms_request(sdk_wallet_trustee[1], "{\"test\":\"aml\"}", str(ver), None)
    aml_req = looper.loop.run_until_complete(aml_req_future)
    aml_resp_future = sign_and_submit_request(sdk_pool_handle, sdk_wallet_trustee[0], sdk_wallet_trustee[1], aml_req)
    aml_resp = looper.loop.run_until_complete(aml_resp_future)
    aml = json.loads(aml_resp)
    assert aml["result"]
    assert aml["result"][TXN_METADATA]
    assert aml["result"][TXN_METADATA][TXN_METADATA_SEQ_NO]
    return aml["result"][TXN_METADATA][TXN_METADATA_SEQ_NO]
Ejemplo n.º 6
0
 def taa_aml_request(self):
     return self.looper.loop.run_until_complete(
         build_acceptance_mechanisms_request(
             self.trustee_wallet[1],
             json.dumps({'Nice way': 'very good way to accept agreement'}),
             randomString(), randomString()))
Ejemplo n.º 7
0
def taa_aml_request_module(looper, sdk_pool_handle, sdk_wallet_trustee):
    return looper.loop.run_until_complete(
        build_acceptance_mechanisms_request(
            sdk_wallet_trustee[1],
            json.dumps({'Nice way': 'very good way to accept agreement'}),
            randomString(), randomString()))