Interface TransactionContext
public interface TransactionContext
Transaction context class. Contains required information for the transaction execution.
The context is provided by the framework and users shouldn't create context instances manually
except tests.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TransactionContext.Builder
Transaction context builder. -
Method Summary
Modifier and Type Method Description static TransactionContext.Builder
builder()
Returns the builder of the transaction context.PublicKey
getAuthorPk()
Returns public key of the transaction author.Fork
getFork()
Returns database view allowing R/W operations.int
getServiceId()
Returns the numeric id of the service instance.String
getServiceName()
Returns the name of the service instance.HashCode
getTransactionMessageHash()
Returns SHA-256 hash of the transaction message that carried the payload from which the transaction was created.
-
Method Details
-
getFork
Fork getFork()Returns database view allowing R/W operations. -
getTransactionMessageHash
HashCode getTransactionMessageHash()Returns SHA-256 hash of the transaction message that carried the payload from which the transaction was created. Each transaction message is uniquely identified by its hash; the messages are persisted in the blockchain and can be fetched by this hash. -
getAuthorPk
PublicKey getAuthorPk()Returns public key of the transaction author. The corresponding transaction message is guaranteed to have a correctCryptoFunctions.ed25519()
signature with this public key. -
getServiceName
String getServiceName()Returns the name of the service instance.- See Also:
ServiceInstanceSpec.getName()
-
getServiceId
int getServiceId()Returns the numeric id of the service instance.- See Also:
ServiceInstanceSpec.getId()
-
builder
Returns the builder of the transaction context.
-