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 classTransactionContext.BuilderTransaction context builder. -
Method Summary
Modifier and Type Method Description static TransactionContext.Builderbuilder()Returns the builder of the transaction context.PublicKeygetAuthorPk()Returns public key of the transaction author.ForkgetFork()Returns database view allowing R/W operations.intgetServiceId()Returns the numeric id of the service instance.StringgetServiceName()Returns the name of the service instance.HashCodegetTransactionMessageHash()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.
-