-
public interface StoreUtilitiesAn 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BigIntegergetBalanceUncommitted(StorageReference contract)Yields the (green) balance of the given (normal or red/green) contract.StringgetClassNameUncommitted(StorageReference object)Yields the class name of the given object, whose creation might not be committed yet.ClassTaggetClassTagUncommitted(StorageReference object)Yields the class tag of the given object, whose creation might not be committed yet.StorageReferencegetCreatorUncommitted(StorageReference event)Yields the creator of the given event.Stream<UpdateOfField>getEagerFieldsUncommitted(StorageReference object)Yields the uncommitted eager fields of the given object, that is, their last updates, possibly still uncommitted.Optional<StorageReference>getGasStationUncommitted()Yields the gas station inside the manifest of the node, if the latter is already initialized.Optional<UpdateOfField>getLastUpdateToFieldUncommitted(StorageReference object, FieldSignature field)Yields the most recent update to the given field of the object with the given storage reference.Optional<UpdateOfField>getLastUpdateToFinalFieldUncommitted(StorageReference object, FieldSignature field)Yields the most recent update for the givenfinalfield of the object with the given storage reference.Optional<StorageReference>getManifestUncommitted()Yields the manifest of the node, if the latter is already initialized.BigIntegergetNonceUncommitted(StorageReference account)Yields the nonce of the given externally owned account (normal or red/green).StringgetPublicKeyUncommitted(StorageReference account)Yields the Base64-encoded public key of the given account.BigIntegergetRedBalanceUncommitted(StorageReference contract)Yields the red balance of the given red/green contract.Stream<Update>getStateCommitted(StorageReference object)Yields the committed state of the given object, that is, the last updates committed for its fields.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.BigIntegergetTotalBalanceUncommitted(StorageReference contract)Yields the total balance of the given contract (green plus red, if any).Optional<StorageReference>getValidatorsUncommitted()Yields the validators contract inside the manifest of the node, if the latter is already initialized.Optional<StorageReference>getVersionsUncommitted()Yields the versions contract inside the manifest of the node, if the latter is already initialized.booleannodeIsInitializedUncommitted()Determines if the node is initialized, that is, its manifest has been set, although possibly not yet committed.
-
-
-
Method Detail
-
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
-
getBalanceUncommitted
BigInteger getBalanceUncommitted(StorageReference contract)
Yields the (green) balance of the given (normal or red/green) contract.- Parameters:
contract- the contract- Returns:
- the balance
-
getRedBalanceUncommitted
BigInteger getRedBalanceUncommitted(StorageReference contract)
Yields the red balance of the given red/green contract.- Parameters:
contract- the contract- Returns:
- the red balance
-
getTotalBalanceUncommitted
BigInteger getTotalBalanceUncommitted(StorageReference contract)
Yields the total balance of the given contract (green plus red, if any).- Parameters:
contract- the contract- Returns:
- the total balance
-
getPublicKeyUncommitted
String getPublicKeyUncommitted(StorageReference account)
Yields the Base64-encoded public key of the given account.- Returns:
- the public key
-
getCreatorUncommitted
StorageReference getCreatorUncommitted(StorageReference event)
Yields the creator of the given event.- Parameters:
event- the event- Returns:
- the reference to the creator
-
getNonceUncommitted
BigInteger getNonceUncommitted(StorageReference account)
Yields the nonce of the given externally owned account (normal or red/green).- Parameters:
account- the account- Returns:
- the nonce
-
getClassNameUncommitted
String getClassNameUncommitted(StorageReference object)
Yields the class name of the given object, whose creation might not be committed yet.- Parameters:
object- the object- Returns:
- the class name
-
getClassTagUncommitted
ClassTag getClassTagUncommitted(StorageReference object)
Yields the class tag of the given object, whose creation might not be committed yet.- Parameters:
object- the object- Returns:
- the class tag
-
getEagerFieldsUncommitted
Stream<UpdateOfField> getEagerFieldsUncommitted(StorageReference object)
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
Stream<Update> getStateCommitted(StorageReference object)
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
-
-