Interface ExecutionContext


  • public interface ExecutionContext
    An execution context. The context provides access to the blockchain data for the executing service, and also contains the required information for the transaction execution.

    The context is provided by the framework and users shouldn't create context instances manually except in tests.

    See Also:
    Transaction
    • Method Detail

      • getServiceData

        default Prefixed getServiceData()
        Returns the prefixed database access for the executing service. Allows R/W operations.

        A shortcut for context.getBlockchainData().getExecutingServiceData().

        See Also:
        getBlockchainData()
      • getTransactionMessageHash

        Optional<com.exonum.binding.common.hash.HashCode> getTransactionMessageHash()
        Returns SHA-256 hash of the transaction message that carried the payload of the transaction; or Optional.empty() if no message corresponds to this context.

        Each transaction message is uniquely identified by its hash; the messages are persisted in the blockchain and can be fetched by this hash.

      • getAuthorPk

        Optional<com.exonum.binding.common.crypto.PublicKey> getAuthorPk()
        Returns public key of the transaction author; or Optional.empty() if no transaction message corresponds to this context.

        The corresponding transaction message, if any, is guaranteed to have a correct CryptoFunctions.ed25519() signature with this public key.