public interface Transaction
You shall usually extend AbstractTransaction
rather than implementing
this interface.
Modifier and Type | Method and Description |
---|---|
void |
execute(Fork view)
Execute the transaction, possibly modifying the blockchain state.
|
BinaryMessage |
getMessage()
Returns this transaction as a binary Exonum message.
|
default HashCode |
hash()
Returns a hash of this transaction — a SHA-256 hash of the transaction message.
|
default java.lang.String |
info()
Returns some information about this transaction in JSON format.
|
boolean |
isValid()
Returns true if this transaction is valid: its data holds the invariants,
it has a correct signature, etc.
|
boolean isValid()
This method is intended to check the internal consistency of a transaction. You shall not access any external objects in this method (e.g., files, network resources, databases).
If this method returns false, the transaction is considered incorrect, and Exonum discards it. Exonum never records invalid transactions into a blockchain.
void execute(Fork view)
view
- a database view, which allows to modify the blockchain statedefault java.lang.String info()
default HashCode hash()
BinaryMessage getMessage()
Copyright © 2018 Exonum. All rights reserved.