public interface StoreUtilities
An object that provides methods for reconstructing data from the store of a node.
Most methods refer to the uncommitted store, that is, to the store including
previous transactions that have not been committed yet.
Others refer to the committed state instead. If the node has no notion of commit,
the semantics of both kinds of methods coincide.
-
Method Summary
Modifier and TypeMethodDescriptiongetBalanceUncommitted(StorageReference contract) Yields the (green) balance of the given (normal or red/green) contract.Yields the class name of the given object, whose creation might not be committed yet.Yields the class tag of the given object, whose creation might not be committed yet.Yields the creator of the given event.getCurrentSupplyUncommitted(StorageReference validators) Yields the current supply of coins of the given validators object.Yields the uncommitted eager fields of the given object, that is, their last updates, possibly still uncommitted.Yields the gamete account of the node, if the latter is already initialized.Yields the gas station inside the manifest of the node, if the latter is already initialized.getLastUpdateToFieldUncommitted(StorageReference object, FieldSignature field) Yields the most recent update to the given field of the object with the given storage reference.getLastUpdateToFinalFieldUncommitted(StorageReference object, FieldSignature field) Yields the most recent update for the givenfinalfield of the object with the given storage reference.Yields the manifest of the node, if the latter is already initialized.getNonceUncommitted(StorageReference account) Yields the nonce of the given externally owned account.getPublicKeyUncommitted(StorageReference account) Yields the Base64-encoded public key of the given account.getRedBalanceUncommitted(StorageReference contract) Yields the red balance of the given red/green contract.getStateCommitted(StorageReference object) Yields the committed state of the given object, that is, the last updates committed for its fields.Yields the reference to the transaction, possibly not yet committed, that has installed the Takamaka base classes in the store of the node.getTotalBalanceUncommitted(StorageReference contract) Yields the total balance of the given contract (green plus red, if any).Yields the validators contract inside the manifest of the node, if the latter is already initialized.Yields the versions contract inside the manifest of the node, if the latter is already initialized.booleanDetermines if the node is initialized, that is, its manifest has been set, although possibly not yet committed.
-
Method Details
-
nodeIsInitializedUncommitted
boolean nodeIsInitializedUncommitted()Determines if the node is initialized, that is, its manifest has been set, although possibly not yet committed.- Returns:
- true if and only if that condition holds
-
getTakamakaCodeUncommitted
Optional<TransactionReference> getTakamakaCodeUncommitted()Yields the reference to the transaction, possibly not yet committed, that has installed the Takamaka base classes in the store of the node.- Returns:
- the reference, if any
-
getManifestUncommitted
Optional<StorageReference> getManifestUncommitted()Yields the manifest of the node, if the latter is already initialized.- Returns:
- the manifest, if any
-
getGasStationUncommitted
Optional<StorageReference> getGasStationUncommitted()Yields the gas station inside the manifest of the node, if the latter is already initialized.- Returns:
- the gas station, if any
-
getValidatorsUncommitted
Optional<StorageReference> getValidatorsUncommitted()Yields the validators contract inside the manifest of the node, if the latter is already initialized.- Returns:
- the validators contract, if any
-
getVersionsUncommitted
Optional<StorageReference> getVersionsUncommitted()Yields the versions contract inside the manifest of the node, if the latter is already initialized.- Returns:
- the versions contract, if any
-
getGameteUncommitted
Optional<StorageReference> getGameteUncommitted()Yields the gamete account of the node, if the latter is already initialized.- Returns:
- the gamete account, if any
-
getBalanceUncommitted
Yields the (green) balance of the given (normal or red/green) contract.- Parameters:
contract- the contract- Returns:
- the balance
-
getRedBalanceUncommitted
Yields the red balance of the given red/green contract.- Parameters:
contract- the contract- Returns:
- the red balance
-
getTotalBalanceUncommitted
Yields the total balance of the given contract (green plus red, if any).- Parameters:
contract- the contract- Returns:
- the total balance
-
getPublicKeyUncommitted
Yields the Base64-encoded public key of the given account.- Returns:
- the public key
-
getCreatorUncommitted
Yields the creator of the given event.- Parameters:
event- the event- Returns:
- the reference to the creator
-
getNonceUncommitted
Yields the nonce of the given externally owned account.- Parameters:
account- the account- Returns:
- the nonce
-
getCurrentSupplyUncommitted
Yields the current supply of coins of the given validators object.- Parameters:
validators- the validators object- Returns:
- the current supply
-
getClassNameUncommitted
Yields the class name of the given object, whose creation might not be committed yet.- Parameters:
object- the object- Returns:
- the class name
-
getClassTagUncommitted
Yields the class tag of the given object, whose creation might not be committed yet.- Parameters:
object- the object- Returns:
- the class tag
-
getEagerFieldsUncommitted
Yields the uncommitted eager fields of the given object, that is, their last updates, possibly still uncommitted.- Parameters:
object- the reference to the object- Returns:
- the last updates to the eager fields of
object
-
getStateCommitted
Yields the committed state of the given object, that is, the last updates committed for its fields.- Parameters:
object- the reference to the object- Returns:
- the state
-
getLastUpdateToFieldUncommitted
Optional<UpdateOfField> getLastUpdateToFieldUncommitted(StorageReference object, FieldSignature field) Yields the most recent update to the given field of the object with the given storage reference. If this node has some form of commit, this last update might not necessarily be already committed.- Parameters:
object- the storage reference of the objectfield- the field whose update is being looked for- Returns:
- the update, if any
-
getLastUpdateToFinalFieldUncommitted
Optional<UpdateOfField> getLastUpdateToFinalFieldUncommitted(StorageReference object, FieldSignature field) Yields the most recent update for the givenfinalfield of the object with the given storage reference. If this node has some form of commit, the last update might not necessarily be already committed. Its implementation can be identical to that ofgetLastUpdateToFieldUncommitted(StorageReference, FieldSignature), or instead exploit the fact that the field isfinal, for an optimized look-up.- Parameters:
object- the storage referencefield- the field whose update is being looked for- Returns:
- the update, if any
-