Interface StoreUtilities


  • 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 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 object
        field - 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 given final field 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 of getLastUpdateToFieldUncommitted(StorageReference, FieldSignature), or instead exploit the fact that the field is final, for an optimized look-up.
        Parameters:
        object - the storage reference
        field - the field whose update is being looked for
        Returns:
        the update, if any