Typeberry by Fluffy Labs - v0.4.0
    Preparing search index...

    Interface StatesDb<T>

    Interface for accessing states stored in the database.

    NOTE that the design of this interface is heavily influenced by the LMDB implementation, so that we can implement it efficiently.

    See the documentation there for more detailed reasoning.

    interface StatesDb<T extends State = State> {
        close(): Promise<void>;
        getState(header: OpaqueHash & pvm.WithOpaque<"HeaderHash">): T | null;
        getStateRoot(
            state: T,
        ): Promise<OpaqueHash & pvm.WithOpaque<"StateRootHash">>;
        updateAndSetState(
            header: OpaqueHash & pvm.WithOpaque<"HeaderHash">,
            state: T,
            update: Partial<State & ServicesUpdate>,
        ): Promise<pvm.Result<typeof pvm.OK, StateUpdateError>>;
    }

    Type Parameters

    Implemented by

    Index

    Methods