Interface ConsensualState

  • All Implemented Interfaces:

    
    public interface ConsensualState
    
                        

    Defines a consensual state.

    A consensual state (or just "state") contains opaque data used by a consensual ledger. It can be thought of as a disk file that the program can use to persist data across transactions. They are immutable, and can never be consumed. Once created, they are never updated, instead, any changes must generate a new successor state.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract List<PublicKey> getParticipants() Gets a list of the current consensual state's participants.
      abstract void verify(@NotNull() ConsensualLedgerTransaction transaction) Verifies the current consensual state.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getParticipants

        @NotNull() abstract List<PublicKey> getParticipants()

        Gets a list of the current consensual state's participants.

        A participant is any party whose consent is needed to make a consensual state valid and final. Participants are the main and only verification points for consensual state since they do not have contract code. Every participant has to be involved and approve the transaction so that they receive the updated state, and don't end up in a situation where they can no longer use a state they possess.

        The participants list should normally be derived from the contents of the state.

      • verify

         abstract void verify(@NotNull() ConsensualLedgerTransaction transaction)

        Verifies the current consensual state.

        Implementations of this function should: - verify that the state is well-formed. - verify compatibility or cohesion with other states in the specified transaction. - check for required signing keys. - check the transaction's timestamp.

        TODO : CORE-5995 - Make services injectable (e.g. crypto, etc...)

        Parameters:
        transaction - The transaction in which the current consensual state will be created.