aries_cloudagent.protocols.endorse_transaction.v1_0 package

Subpackages

Submodules

aries_cloudagent.protocols.endorse_transaction.v1_0.controller module

Protocol controller for endorse transaction.

class aries_cloudagent.protocols.endorse_transaction.v1_0.controller.Controller(protocol: str)[source]

Bases: object

Endorse transaction protocol controller.

determine_goal_codes() → Sequence[str][source]

Return defined goal_codes.

aries_cloudagent.protocols.endorse_transaction.v1_0.manager module

Class to manage transactions.

class aries_cloudagent.protocols.endorse_transaction.v1_0.manager.TransactionManager(profile: aries_cloudagent.core.profile.Profile)[source]

Bases: object

Class for managing transactions.

cancel_transaction(transaction: aries_cloudagent.protocols.endorse_transaction.v1_0.models.transaction_record.TransactionRecord, state: str)[source]

Cancel a Transaction Request.

Parameters:
  • transaction – The transaction record which would be cancelled
  • state – The state of the transaction record
Returns:

The updated transaction and the cancelled transaction response

complete_transaction(transaction: aries_cloudagent.protocols.endorse_transaction.v1_0.models.transaction_record.TransactionRecord, endorser: bool = False)[source]

Complete a transaction.

This is the final state where the received ledger transaction is written to the ledger.

Parameters:transaction – The transaction record which would be completed
Returns:The updated transaction
create_endorse_response(transaction: aries_cloudagent.protocols.endorse_transaction.v1_0.models.transaction_record.TransactionRecord, state: str, use_endorser_did: str = None)[source]

Create a response to endorse a transaction.

Parameters:
  • transaction – The transaction record which would be endorsed.
  • state – The state of the transaction record
Returns:

The updated transaction and an endorsed response

create_record(messages_attach: str, connection_id: str, meta_data: dict = None)[source]

Create a new Transaction Record.

Parameters:
  • messages_attach – messages to attach, JSON-dumped
  • connection_id – The connection_id of the ConnRecord between author and endorser
Returns:

The transaction Record

create_refuse_response(transaction: aries_cloudagent.protocols.endorse_transaction.v1_0.models.transaction_record.TransactionRecord, state: str, refuser_did: str)[source]

Create a response to refuse a transaction.

Parameters:
  • transaction – The transaction record which would be refused
  • state – The state of the transaction record
Returns:

The updated transaction and the refused response

create_request(transaction: aries_cloudagent.protocols.endorse_transaction.v1_0.models.transaction_record.TransactionRecord, signature: str = None, signed_request: dict = None, expires_time: str = None, endorser_write_txn: bool = None, author_goal_code: str = None, signer_goal_code: str = None)[source]

Create a new Transaction Request.

Parameters:
  • transaction – The transaction from which the request is created.
  • expires_time – The time till which the endorser should endorse the transaction.
Returns:

The transaction Record and transaction request

endorsed_txn_post_processing(transaction: aries_cloudagent.protocols.endorse_transaction.v1_0.models.transaction_record.TransactionRecord, ledger_response: dict = None, connection_record: aries_cloudagent.connections.models.conn_record.ConnRecord = None)[source]

Store record in wallet, and kick off any required post-processing.

Parameters:transaction – The transaction from which the schema/cred_def would be stored in wallet.
profile

Accessor for the current Profile.

Returns:The Profile for this transaction manager
receive_cancel_transaction(response: aries_cloudagent.protocols.endorse_transaction.v1_0.messages.cancel_transaction.CancelTransaction, connection_id: str)[source]

Update the transaction record to cancel a transaction request.

Parameters:
  • response – The cancel transaction response
  • connection_id – The connection_id related to this Transaction Record
receive_endorse_response(response: aries_cloudagent.protocols.endorse_transaction.v1_0.messages.endorsed_transaction_response.EndorsedTransactionResponse)[source]

Update the transaction record with the endorsed response.

Parameters:response – The Endorsed Transaction Response
receive_refuse_response(response: aries_cloudagent.protocols.endorse_transaction.v1_0.messages.refused_transaction_response.RefusedTransactionResponse)[source]

Update the transaction record with a refused response.

Parameters:response – The refused transaction response
receive_request(request: aries_cloudagent.protocols.endorse_transaction.v1_0.messages.transaction_request.TransactionRequest, connection_id: str)[source]

Receive a Transaction request.

Parameters:
  • request – A Transaction Request
  • connection_id – The connection id related to this transaction record
receive_transaction_acknowledgement(response: aries_cloudagent.protocols.endorse_transaction.v1_0.messages.transaction_acknowledgement.TransactionAcknowledgement, connection_id: str)[source]

Update the transaction record after receiving the transaction acknowledgement.

Parameters:
  • response – The transaction acknowledgement
  • connection_id – The connection_id related to this Transaction Record
receive_transaction_resend(response: aries_cloudagent.protocols.endorse_transaction.v1_0.messages.transaction_resend.TransactionResend, connection_id: str)[source]

Update the transaction with a resend request.

Parameters:
  • response – The Resend transaction response
  • connection_id – The connection_id related to this Transaction Record
set_transaction_my_job(record: aries_cloudagent.connections.models.conn_record.ConnRecord, transaction_my_job: str)[source]

Set transaction_my_job.

Parameters:
  • record – The connection record in which to set transaction jobs
  • transaction_my_job – My transaction job
Returns:

The transaction job that is send to other agent

set_transaction_their_job(tx_job_received: aries_cloudagent.protocols.endorse_transaction.v1_0.messages.transaction_job_to_send.TransactionJobToSend, receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt)[source]

Set transaction_their_job.

Parameters:
  • tx_job_received – The transaction job that is received from the other agent
  • receipt – The Message Receipt Object
transaction_resend(transaction: aries_cloudagent.protocols.endorse_transaction.v1_0.models.transaction_record.TransactionRecord, state: str)[source]

Resend a transaction request.

Parameters:
  • transaction – The transaction record which needs to be resend
  • state – the state of the transaction record
Returns:

The updated transaction and the resend response

exception aries_cloudagent.protocols.endorse_transaction.v1_0.manager.TransactionManagerError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Transaction error.

aries_cloudagent.protocols.endorse_transaction.v1_0.message_types module

Message type identifiers for Transactions.

aries_cloudagent.protocols.endorse_transaction.v1_0.routes module

aries_cloudagent.protocols.endorse_transaction.v1_0.transaction_jobs module

Class to manage jobs in Connection Record.

class aries_cloudagent.protocols.endorse_transaction.v1_0.transaction_jobs.TransactionJob[source]

Bases: enum.Enum

Represents jobs in Connection Record.

TRANSACTION_AUTHOR = (1,)
TRANSACTION_ENDORSER = (2,)

aries_cloudagent.protocols.endorse_transaction.v1_0.util module

Endorser utilities.

aries_cloudagent.protocols.endorse_transaction.v1_0.util.get_endorser_connection_id(profile: aries_cloudagent.core.profile.Profile)[source]

Determine default endorser connection for author.

aries_cloudagent.protocols.endorse_transaction.v1_0.util.is_author_role(profile: aries_cloudagent.core.profile.Profile)[source]

Check if agent is running in author mode.