merkle-trie / net.consensys.cava.trie.experimental / AsyncMerkleStorage

AsyncMerkleStorage

abstract class AsyncMerkleStorage : MerkleStorage (source)

Storage for use in a StoredMerklePatriciaTrie.

This abstract implementation of MerkleStorage provides variations of get/put methods that use AsyncResult and AsyncCompletion rather than kotlin coroutines, making it possible to implement in Java.

Constructors

<init>

AsyncMerkleStorage()

Storage for use in a StoredMerklePatriciaTrie.

Functions

get

open suspend fun get(hash: Bytes32): Bytes?

Get the stored content under the given hash.

getAsync

abstract fun getAsync(hash: Bytes32): AsyncResult<Optional<Bytes>>

Get the stored content under the given hash.

put

open suspend fun put(hash: Bytes32, content: Bytes): Unit

Store content with a given hash.

putAsync

abstract fun putAsync(hash: Bytes32, content: Bytes): AsyncCompletion

Store content with a given hash.