Kagome
Polkadot Runtime Engine in C++17
store.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_PARACHAIN_AVAILABILITY_STORE_STORE_HPP
7 #define KAGOME_PARACHAIN_AVAILABILITY_STORE_STORE_HPP
8 
9 #include <optional>
10 
13 
14 namespace kagome::parachain {
17  public:
23 
24  virtual ~AvailabilityStore() = default;
25 
27  virtual bool hasChunk(const CandidateHash &candidate_hash,
28  ValidatorIndex index) = 0;
30  virtual bool hasPov(const CandidateHash &candidate_hash) = 0;
32  virtual bool hasData(const CandidateHash &candidate_hash) = 0;
34  virtual std::optional<ErasureChunk> getChunk(
35  const CandidateHash &candidate_hash, ValidatorIndex index) = 0;
37  virtual std::optional<ParachainBlock> getPov(
38  const CandidateHash &candidate_hash) = 0;
40  virtual void putChunk(const CandidateHash &candidate_hash,
41  const ErasureChunk &chunk) = 0;
43  virtual void putPov(const CandidateHash &candidate_hash,
44  const ParachainBlock &pov) = 0;
46  virtual void putData(const CandidateHash &candidate_hash,
47  const PersistedValidationData &data) = 0;
48  };
49 } // namespace kagome::parachain
50 
51 #endif // KAGOME_PARACHAIN_AVAILABILITY_STORE_STORE_HPP
virtual bool hasData(const CandidateHash &candidate_hash)=0
Has PersistedValidationData.
network::ValidatorIndex ValidatorIndex
Definition: store.hpp:19
primitives::BlockHash CandidateHash
virtual std::optional< ErasureChunk > getChunk(const CandidateHash &candidate_hash, ValidatorIndex index)=0
Get ErasureChunk.
virtual void putChunk(const CandidateHash &candidate_hash, const ErasureChunk &chunk)=0
Store ErasureChunk.
virtual bool hasChunk(const CandidateHash &candidate_hash, ValidatorIndex index)=0
Has ErasureChunk.
virtual bool hasPov(const CandidateHash &candidate_hash)=0
Has PoV.
virtual std::optional< ParachainBlock > getPov(const CandidateHash &candidate_hash)=0
Get PoV.
virtual void putData(const CandidateHash &candidate_hash, const PersistedValidationData &data)=0
Store PersistedValidationData.
virtual void putPov(const CandidateHash &candidate_hash, const ParachainBlock &pov)=0
Store PoV.
Stores ErasureChunk, PoV and PersistedValidationData.
Definition: store.hpp:16
A chunk of erasure-encoded block data.