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:
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Interface Description
    static class  ExecutionContext.Builder
    Transaction context builder.
  • Method Summary

    Modifier and Type Method Description
    static ExecutionContext.Builder builder()
    Returns the builder of the transaction context.
    java.util.Optional<PublicKey> getAuthorPk()
    Returns public key of the transaction author; or Optional.empty() if no transaction message corresponds to this context.
    BlockchainData getBlockchainData()
    Returns the database access object allowing R/W operations.
    default Prefixed getServiceData()
    Returns the prefixed database access for the executing service.
    int getServiceId()
    Returns the numeric id of the service instance.
    java.lang.String getServiceName()
    Returns the name of the service instance.
    java.util.Optional<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.