src/primitives/parachain_host.hpp¶
Namespaces¶
| Name |
|---|
| sgns |
| sgns::primitives |
| sgns::primitives::parachain |
Classes¶
| Name | |
|---|---|
| struct | sgns::primitives::parachain::Relay Relay primitive is empty in supergenius for now. |
Types¶
| Name | |
|---|---|
| using base::Blob< 32 > | ValidatorId ValidatorId primitive is an ed25519 or sr25519 public key. |
| using uint32_t | ParaId ParachainId primitive is an uint32_t. |
| using ParaId | Parachain Parachain primitive. |
| using boost::variant< Relay, Parachain > | Chain Chain primitive. |
| using std::vector< Chain > | DutyRoster DutyRoster primitive. |
Functions¶
| Name | |
|---|---|
| template <class Stream ,typename =std::enable_if_t Stream & |
operator<<(Stream & s, const Relay & v) outputs Relay instance to stream |
| template <class Stream ,typename =std::enable_if_t Stream & |
operator>>(Stream & s, Relay & v) decodes Relay instance from stream |
Types Documentation¶
using ValidatorId¶
ValidatorId primitive is an ed25519 or sr25519 public key.
using ParaId¶
ParachainId primitive is an uint32_t.
using Parachain¶
Parachain primitive.
using Chain¶
Chain primitive.
using DutyRoster¶
DutyRoster primitive.
Functions Documentation¶
function operator<<¶
template <class Stream ,
typename =std::enable_if_t<Stream::is_encoder_stream>>
Stream & operator<<(
Stream & s,
const Relay & v
)
outputs Relay instance to stream
Parameters:
- s reference to stream
- v value to output
Template Parameters:
- Stream stream type
Return: reference to stream
function operator>>¶
template <class Stream ,
typename =std::enable_if_t<Stream::is_decoder_stream>>
Stream & operator>>(
Stream & s,
Relay & v
)
decodes Relay instance from stream
Parameters:
- s reference to stream
- v value to decode
Template Parameters:
- Stream input stream type
Return: reference to stream
Source code¶
#ifndef SUPERGENIUS_SRC_PRIMITIVES_PARACHAIN_HOST_HPP
#define SUPERGENIUS_SRC_PRIMITIVES_PARACHAIN_HOST_HPP
#include <cstdint>
#include <vector>
#include <boost/optional.hpp>
#include <boost/variant.hpp>
#include "base/blob.hpp"
namespace sgns::primitives::parachain {
using ValidatorId = base::Blob<32>;
using ParaId = uint32_t;
struct Relay {};
// TODO(yuraz): PRE-152 update Relay content when it updates in supergenius
using Parachain = ParaId;
using Chain = boost::variant<Relay, Parachain>;
using DutyRoster = std::vector<Chain>;
// TODO(yuraz): PRE-152 update Relay << and >> operators
// when Relay updates in supergenius
template <class Stream, typename = std::enable_if_t<Stream::is_encoder_stream>>
Stream &operator<<(Stream &s, const Relay &v) {
return s;
}
template <class Stream,
typename = std::enable_if_t<Stream::is_decoder_stream>>
Stream &operator>>(Stream &s, Relay &v) {
return s;
}
} // namespace sgns::primitives::parachain
#endif // SUPERGENIUS_SRC_PRIMITIVES_PARACHAIN_HOST_HPP
Updated on 2026-03-04 at 13:10:44 -0800