Annotation Type Transaction
@Target(METHOD) @Retention(RUNTIME) public @interface Transaction
The method should be a
The annotated method shall have the following parameters (in this particular order):
- transaction arguments either as
byteor as a protobuf message. Protobuf messages are deserialized using a
- transaction execution context as
ExecutionContext. It allows to access the information about this transaction and modify the blockchain state through the included database access object.
The annotated method might throw ExecutionException if the transaction cannot be executed normally and has to be rolled back. The transaction will be committed as failed (error kind SERVICE). The error code with the optional description will be saved in the storage.
If the annotated method throws any other exception, it is considered an unexpected error. The transaction will be committed as failed (error kind UNEXPECTED).
Exonum rolls back any changes made by a transaction that threw an exception. It also saves any error into the registry of call errors. The transaction clients can request the error information to know the reason of the failure.
Required Element Summary
Required Elements Modifier and Type Required Element Description
valueThe transaction type identifier.