Updated Tari gRPC proto files

This commit is contained in:
sech1
2025-09-10 21:11:43 +02:00
parent 9b5a43580e
commit e2008578da
10 changed files with 1746 additions and 834 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+6 -2
View File
@@ -262,8 +262,9 @@ message NetworkDifficultyResponse {
uint64 sha3x_estimated_hash_rate = 6;
uint64 monero_randomx_estimated_hash_rate = 7;
uint64 tari_randomx_estimated_hash_rate = 10;
UDecimalValue cuckaroo_estimated_hash_rate = 11;
uint64 num_coinbases = 8;
repeated bytes coinbase_extras = 9;
repeated bytes coinbase_extras = 9;
}
// A generic single value response for a specific height
@@ -626,9 +627,12 @@ message GetNetworkStateResponse {
uint64 reward = 5;
// estimate sha3x hash rate
uint64 sha3x_estimated_hash_rate = 6;
// estimate randomx hash rate
// estimate monero randomx hash rate
uint64 monero_randomx_estimated_hash_rate = 7;
// estimate tari randomx hash rate
uint64 tari_randomx_estimated_hash_rate = 10;
// estimate cuckaroo hash rate
UDecimalValue cuckaroo_estimated_hash_rate = 12;
// number of connections
uint64 num_connections = 8;
//liveness results
+18 -17
View File
@@ -384,22 +384,23 @@ const char descriptor_table_protodef_block_2eproto[] ABSL_ATTRIBUTE_SECTION_VARI
"tal_script_offset\030\017 \001(\014\022\031\n\021validator_nod"
"e_mr\030\020 \001(\014\022\033\n\023validator_node_size\030\021 \001(\004\""
"1\n\013ProofOfWork\022\020\n\010pow_algo\030\001 \001(\004\022\020\n\010pow_"
"data\030\004 \001(\014\"\210\001\n\007PowAlgo\022,\n\010pow_algo\030\001 \001(\016"
"2\032.tari.rpc.PowAlgo.PowAlgos\"O\n\010PowAlgos"
"data\030\004 \001(\014\"\240\001\n\007PowAlgo\022,\n\010pow_algo\030\001 \001(\016"
"2\032.tari.rpc.PowAlgo.PowAlgos\"g\n\010PowAlgos"
"\022\026\n\022POW_ALGOS_RANDOMXM\020\000\022\023\n\017POW_ALGOS_SH"
"A3X\020\001\022\026\n\022POW_ALGOS_RANDOMXT\020\002\"U\n\005Block\022%"
"\n\006header\030\001 \001(\0132\025.tari.rpc.BlockHeader\022%\n"
"\004body\030\002 \001(\0132\027.tari.rpc.AggregateBody\"H\n\017"
"HistoricalBlock\022\025\n\rconfirmations\030\001 \001(\004\022\036"
"\n\005block\030\002 \001(\0132\017.tari.rpc.Block\"\252\001\n\026NewBl"
"ockHeaderTemplate\022\017\n\007version\030\001 \001(\r\022\016\n\006he"
"ight\030\002 \001(\004\022\021\n\tprev_hash\030\003 \001(\014\022\033\n\023total_k"
"ernel_offset\030\004 \001(\014\022\"\n\003pow\030\005 \001(\0132\025.tari.r"
"pc.ProofOfWork\022\033\n\023total_script_offset\030\007 "
"\001(\014\"\207\001\n\020NewBlockTemplate\0220\n\006header\030\001 \001(\013"
"2 .tari.rpc.NewBlockHeaderTemplate\022%\n\004bo"
"dy\030\002 \001(\0132\027.tari.rpc.AggregateBody\022\032\n\022is_"
"mempool_in_sync\030\003 \001(\010b\006proto3"
"A3X\020\001\022\026\n\022POW_ALGOS_RANDOMXT\020\002\022\026\n\022POW_ALG"
"OS_CUCKAROO\020\003\"U\n\005Block\022%\n\006header\030\001 \001(\0132\025"
".tari.rpc.BlockHeader\022%\n\004body\030\002 \001(\0132\027.ta"
"ri.rpc.AggregateBody\"H\n\017HistoricalBlock\022"
"\025\n\rconfirmations\030\001 \001(\004\022\036\n\005block\030\002 \001(\0132\017."
"tari.rpc.Block\"\252\001\n\026NewBlockHeaderTemplat"
"e\022\017\n\007version\030\001 \001(\r\022\016\n\006height\030\002 \001(\004\022\021\n\tpr"
"ev_hash\030\003 \001(\014\022\033\n\023total_kernel_offset\030\004 \001"
"(\014\022\"\n\003pow\030\005 \001(\0132\025.tari.rpc.ProofOfWork\022\033"
"\n\023total_script_offset\030\007 \001(\014\"\207\001\n\020NewBlock"
"Template\0220\n\006header\030\001 \001(\0132 .tari.rpc.NewB"
"lockHeaderTemplate\022%\n\004body\030\002 \001(\0132\027.tari."
"rpc.AggregateBody\022\032\n\022is_mempool_in_sync\030"
"\003 \001(\010b\006proto3"
};
static const ::_pbi::DescriptorTable* PROTOBUF_NONNULL const
descriptor_table_block_2eproto_deps[1] = {
@@ -409,7 +410,7 @@ static ::absl::once_flag descriptor_table_block_2eproto_once;
PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_block_2eproto = {
false,
false,
1109,
1133,
descriptor_table_protodef_block_2eproto,
"block.proto",
&descriptor_table_block_2eproto_once,
@@ -429,7 +430,7 @@ const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL PowAlgo_PowAlgos_desc
return file_level_enum_descriptors_block_2eproto[0];
}
PROTOBUF_CONSTINIT const uint32_t PowAlgo_PowAlgos_internal_data_[] = {
196608u, 0u, };
262144u, 0u, };
// ===================================================================
class BlockHeader::_Internal {
+6 -4
View File
@@ -102,6 +102,7 @@ enum PowAlgo_PowAlgos : int {
PowAlgo_PowAlgos_POW_ALGOS_RANDOMXM = 0,
PowAlgo_PowAlgos_POW_ALGOS_SHA3X = 1,
PowAlgo_PowAlgos_POW_ALGOS_RANDOMXT = 2,
PowAlgo_PowAlgos_POW_ALGOS_CUCKAROO = 3,
PowAlgo_PowAlgos_PowAlgo_PowAlgos_INT_MIN_SENTINEL_DO_NOT_USE_ =
::std::numeric_limits<::int32_t>::min(),
PowAlgo_PowAlgos_PowAlgo_PowAlgos_INT_MAX_SENTINEL_DO_NOT_USE_ =
@@ -112,11 +113,11 @@ extern const uint32_t PowAlgo_PowAlgos_internal_data_[];
inline constexpr PowAlgo_PowAlgos PowAlgo_PowAlgos_PowAlgos_MIN =
static_cast<PowAlgo_PowAlgos>(0);
inline constexpr PowAlgo_PowAlgos PowAlgo_PowAlgos_PowAlgos_MAX =
static_cast<PowAlgo_PowAlgos>(2);
static_cast<PowAlgo_PowAlgos>(3);
inline bool PowAlgo_PowAlgos_IsValid(int value) {
return 0 <= value && value <= 2;
return 0 <= value && value <= 3;
}
inline constexpr int PowAlgo_PowAlgos_PowAlgos_ARRAYSIZE = 2 + 1;
inline constexpr int PowAlgo_PowAlgos_PowAlgos_ARRAYSIZE = 3 + 1;
const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL PowAlgo_PowAlgos_descriptor();
template <typename T>
const ::std::string& PowAlgo_PowAlgos_Name(T value) {
@@ -127,7 +128,7 @@ const ::std::string& PowAlgo_PowAlgos_Name(T value) {
}
template <>
inline const ::std::string& PowAlgo_PowAlgos_Name(PowAlgo_PowAlgos value) {
return ::google::protobuf::internal::NameOfDenseEnum<PowAlgo_PowAlgos_descriptor, 0, 2>(
return ::google::protobuf::internal::NameOfDenseEnum<PowAlgo_PowAlgos_descriptor, 0, 3>(
static_cast<int>(value));
}
inline bool PowAlgo_PowAlgos_Parse(
@@ -493,6 +494,7 @@ class PowAlgo final : public ::google::protobuf::Message
static constexpr PowAlgos POW_ALGOS_RANDOMXM = PowAlgo_PowAlgos_POW_ALGOS_RANDOMXM;
static constexpr PowAlgos POW_ALGOS_SHA3X = PowAlgo_PowAlgos_POW_ALGOS_SHA3X;
static constexpr PowAlgos POW_ALGOS_RANDOMXT = PowAlgo_PowAlgos_POW_ALGOS_RANDOMXT;
static constexpr PowAlgos POW_ALGOS_CUCKAROO = PowAlgo_PowAlgos_POW_ALGOS_CUCKAROO;
static inline bool PowAlgos_IsValid(int value) {
return PowAlgo_PowAlgos_IsValid(value);
}
+6 -3
View File
@@ -68,8 +68,10 @@ message BlockHeader {
// The proof of work data structure that is included in the block header.
message ProofOfWork {
// The algorithm used to mine this block
// 0 = Monero
// 0 = Monero RandomX
// 1 = Sha3X
// 2 = Tari RandomX
// 3 = Cuckaroo
uint64 pow_algo = 1;
// Supplemental proof of work data. For example for Sha3x, this would be empty (only the block header is
// required), but for Monero merge mining we need the Monero block header and RandomX seed hash.
@@ -80,9 +82,10 @@ message ProofOfWork {
message PowAlgo {
// The permitted pow algorithms
enum PowAlgos {
POW_ALGOS_RANDOMXM = 0; // Accessible as `grpc::pow_algo::PowAlgos::RandomxM`
POW_ALGOS_RANDOMXM = 0; // Accessible as `grpc::pow_algo::PowAlgos::RandomxM`
POW_ALGOS_SHA3X = 1; // Accessible as `grpc::pow_algo::PowAlgos::Sha3x`
POW_ALGOS_RANDOMXT = 2; // Accessible as `grpc::pow_algo::PowAlgos::RandomxT`
POW_ALGOS_RANDOMXT = 2; // Accessible as `grpc::pow_algo::PowAlgos::RandomxT`
POW_ALGOS_CUCKAROO = 3; // Accessible as `grpc::pow_algo::PowAlgos::Cuckaroo`
}
// The pow algo to use
PowAlgos pow_algo = 1;
+1 -1
View File
@@ -66,7 +66,7 @@ message NetworkStatusResponse {
uint32 num_node_connections = 3;
}
message Address{
message Address {
bytes address =1;
string last_seen = 2;
uint32 connection_attempts = 3;
+323 -8
View File
@@ -55,6 +55,32 @@ struct WeightParamsDefaultTypeInternal {
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WeightParamsDefaultTypeInternal _WeightParams_default_instance_;
inline constexpr UDecimalValue::Impl_::Impl_(
::_pbi::ConstantInitialized) noexcept
: _cached_size_{0},
units_{::uint64_t{0u}},
nanos_{0u} {}
template <typename>
PROTOBUF_CONSTEXPR UDecimalValue::UDecimalValue(::_pbi::ConstantInitialized)
#if defined(PROTOBUF_CUSTOM_VTABLE)
: ::google::protobuf::Message(UDecimalValue_class_data_.base()),
#else // PROTOBUF_CUSTOM_VTABLE
: ::google::protobuf::Message(),
#endif // PROTOBUF_CUSTOM_VTABLE
_impl_(::_pbi::ConstantInitialized()) {
}
struct UDecimalValueDefaultTypeInternal {
PROTOBUF_CONSTEXPR UDecimalValueDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~UDecimalValueDefaultTypeInternal() {}
union {
UDecimalValue _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UDecimalValueDefaultTypeInternal _UDecimalValue_default_instance_;
inline constexpr Signature::Impl_::Impl_(
::_pbi::ConstantInitialized) noexcept
: _cached_size_{0},
@@ -581,6 +607,13 @@ const ::uint32_t
29,
21,
30,
0x081, // bitmap
PROTOBUF_FIELD_OFFSET(::tari::rpc::UDecimalValue, _impl_._has_bits_),
5, // hasbit index offset
PROTOBUF_FIELD_OFFSET(::tari::rpc::UDecimalValue, _impl_.units_),
PROTOBUF_FIELD_OFFSET(::tari::rpc::UDecimalValue, _impl_.nanos_),
0,
1,
};
static const ::_pbi::MigrationSchema
@@ -598,6 +631,7 @@ static const ::_pbi::MigrationSchema
{76, sizeof(::tari::rpc::RangeProof)},
{81, sizeof(::tari::rpc::ConsensusConstants_ProofOfWorkEntry_DoNotUse)},
{88, sizeof(::tari::rpc::ConsensusConstants)},
{161, sizeof(::tari::rpc::UDecimalValue)},
};
static const ::_pb::Message* PROTOBUF_NONNULL const file_default_instances[] = {
&::tari::rpc::_Range_default_instance_._instance,
@@ -613,6 +647,7 @@ static const ::_pb::Message* PROTOBUF_NONNULL const file_default_instances[] = {
&::tari::rpc::_RangeProof_default_instance_._instance,
&::tari::rpc::_ConsensusConstants_ProofOfWorkEntry_DoNotUse_default_instance_._instance,
&::tari::rpc::_ConsensusConstants_default_instance_._instance,
&::tari::rpc::_UDecimalValue_default_instance_._instance,
};
const char descriptor_table_protodef_types_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE(
protodesc_cold) = {
@@ -672,24 +707,25 @@ const char descriptor_table_protodef_types_2eproto[] ABSL_ATTRIBUTE_SECTION_VARI
"ial_epoch\030& \001(\r\022)\n!vn_registration_max_v"
"ns_per_epoch\030\' \001(\r\032S\n\020ProofOfWorkEntry\022\013"
"\n\003key\030\001 \001(\r\022.\n\005value\030\002 \001(\0132\037.tari.rpc.Po"
"wAlgorithmConstants:\0028\001*s\n\nOutputType\022\014\n"
"\010STANDARD\020\000\022\014\n\010COINBASE\020\001\022\010\n\004BURN\020\002\022\037\n\033V"
"ALIDATOR_NODE_REGISTRATION\020\003\022\036\n\032CODE_TEM"
"PLATE_REGISTRATION\020\004*:\n\016RangeProofType\022\024"
"\n\020BULLETPROOF_PLUS\020\000\022\022\n\016REVEALED_VALUE\020\001"
"b\006proto3"
"wAlgorithmConstants:\0028\001\"-\n\rUDecimalValue"
"\022\r\n\005units\030\001 \001(\004\022\r\n\005nanos\030\002 \001(\007*s\n\nOutput"
"Type\022\014\n\010STANDARD\020\000\022\014\n\010COINBASE\020\001\022\010\n\004BURN"
"\020\002\022\037\n\033VALIDATOR_NODE_REGISTRATION\020\003\022\036\n\032C"
"ODE_TEMPLATE_REGISTRATION\020\004*:\n\016RangeProo"
"fType\022\024\n\020BULLETPROOF_PLUS\020\000\022\022\n\016REVEALED_"
"VALUE\020\001b\006proto3"
};
static ::absl::once_flag descriptor_table_types_2eproto_once;
PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_types_2eproto = {
false,
false,
2448,
2495,
descriptor_table_protodef_types_2eproto,
"types.proto",
&descriptor_table_types_2eproto_once,
nullptr,
0,
13,
14,
schemas,
file_default_instances,
TableStruct_types_2eproto::offsets,
@@ -5280,6 +5316,285 @@ void ConsensusConstants::InternalSwap(ConsensusConstants* PROTOBUF_RESTRICT PROT
::google::protobuf::Metadata ConsensusConstants::GetMetadata() const {
return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full());
}
// ===================================================================
class UDecimalValue::_Internal {
public:
using HasBits =
decltype(::std::declval<UDecimalValue>()._impl_._has_bits_);
static constexpr ::int32_t kHasBitsOffset =
8 * PROTOBUF_FIELD_OFFSET(UDecimalValue, _impl_._has_bits_);
};
UDecimalValue::UDecimalValue(::google::protobuf::Arena* PROTOBUF_NULLABLE arena)
#if defined(PROTOBUF_CUSTOM_VTABLE)
: ::google::protobuf::Message(arena, UDecimalValue_class_data_.base()) {
#else // PROTOBUF_CUSTOM_VTABLE
: ::google::protobuf::Message(arena) {
#endif // PROTOBUF_CUSTOM_VTABLE
SharedCtor(arena);
// @@protoc_insertion_point(arena_constructor:tari.rpc.UDecimalValue)
}
UDecimalValue::UDecimalValue(
::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const UDecimalValue& from)
#if defined(PROTOBUF_CUSTOM_VTABLE)
: ::google::protobuf::Message(arena, UDecimalValue_class_data_.base()),
#else // PROTOBUF_CUSTOM_VTABLE
: ::google::protobuf::Message(arena),
#endif // PROTOBUF_CUSTOM_VTABLE
_impl_(from._impl_) {
_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
from._internal_metadata_);
}
PROTOBUF_NDEBUG_INLINE UDecimalValue::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* PROTOBUF_NULLABLE arena)
: _cached_size_{0} {}
inline void UDecimalValue::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) {
new (&_impl_) Impl_(internal_visibility(), arena);
::memset(reinterpret_cast<char *>(&_impl_) +
offsetof(Impl_, units_),
0,
offsetof(Impl_, nanos_) -
offsetof(Impl_, units_) +
sizeof(Impl_::nanos_));
}
UDecimalValue::~UDecimalValue() {
// @@protoc_insertion_point(destructor:tari.rpc.UDecimalValue)
SharedDtor(*this);
}
inline void UDecimalValue::SharedDtor(MessageLite& self) {
UDecimalValue& this_ = static_cast<UDecimalValue&>(self);
this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>();
ABSL_DCHECK(this_.GetArena() == nullptr);
this_._impl_.~Impl_();
}
inline void* PROTOBUF_NONNULL UDecimalValue::PlacementNew_(
const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem,
::google::protobuf::Arena* PROTOBUF_NULLABLE arena) {
return ::new (mem) UDecimalValue(arena);
}
constexpr auto UDecimalValue::InternalNewImpl_() {
return ::google::protobuf::internal::MessageCreator::ZeroInit(sizeof(UDecimalValue),
alignof(UDecimalValue));
}
constexpr auto UDecimalValue::InternalGenerateClassData_() {
return ::google::protobuf::internal::ClassDataFull{
::google::protobuf::internal::ClassData{
&_UDecimalValue_default_instance_._instance,
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
nullptr, // IsInitialized
&UDecimalValue::MergeImpl,
::google::protobuf::Message::GetNewImpl<UDecimalValue>(),
#if defined(PROTOBUF_CUSTOM_VTABLE)
&UDecimalValue::SharedDtor,
::google::protobuf::Message::GetClearImpl<UDecimalValue>(), &UDecimalValue::ByteSizeLong,
&UDecimalValue::_InternalSerialize,
#endif // PROTOBUF_CUSTOM_VTABLE
PROTOBUF_FIELD_OFFSET(UDecimalValue, _impl_._cached_size_),
false,
},
&UDecimalValue::kDescriptorMethods,
&descriptor_table_types_2eproto,
nullptr, // tracker
};
}
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const
::google::protobuf::internal::ClassDataFull UDecimalValue_class_data_ =
UDecimalValue::InternalGenerateClassData_();
PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
UDecimalValue::GetClassData() const {
::google::protobuf::internal::PrefetchToLocalCache(&UDecimalValue_class_data_);
::google::protobuf::internal::PrefetchToLocalCache(UDecimalValue_class_data_.tc_table);
return UDecimalValue_class_data_.base();
}
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<1, 2, 0, 0, 2>
UDecimalValue::_table_ = {
{
PROTOBUF_FIELD_OFFSET(UDecimalValue, _impl_._has_bits_),
0, // no _extensions_
2, 8, // max_field_number, fast_idx_mask
offsetof(decltype(_table_), field_lookup_table),
4294967292, // skipmap
offsetof(decltype(_table_), field_entries),
2, // num_field_entries
0, // num_aux_entries
offsetof(decltype(_table_), field_names), // no aux_entries
UDecimalValue_class_data_.base(),
nullptr, // post_loop_handler
::_pbi::TcParser::GenericFallback, // fallback
#ifdef PROTOBUF_PREFETCH_PARSE_TABLE
::_pbi::TcParser::GetTable<::tari::rpc::UDecimalValue>(), // to_prefetch
#endif // PROTOBUF_PREFETCH_PARSE_TABLE
}, {{
// fixed32 nanos = 2;
{::_pbi::TcParser::FastF32S1,
{21, 1, 0, PROTOBUF_FIELD_OFFSET(UDecimalValue, _impl_.nanos_)}},
// uint64 units = 1;
{::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(UDecimalValue, _impl_.units_), 0>(),
{8, 0, 0, PROTOBUF_FIELD_OFFSET(UDecimalValue, _impl_.units_)}},
}}, {{
65535, 65535
}}, {{
// uint64 units = 1;
{PROTOBUF_FIELD_OFFSET(UDecimalValue, _impl_.units_), _Internal::kHasBitsOffset + 0, 0,
(0 | ::_fl::kFcOptional | ::_fl::kUInt64)},
// fixed32 nanos = 2;
{PROTOBUF_FIELD_OFFSET(UDecimalValue, _impl_.nanos_), _Internal::kHasBitsOffset + 1, 0,
(0 | ::_fl::kFcOptional | ::_fl::kFixed32)},
}},
// no aux_entries
{{
}},
};
PROTOBUF_NOINLINE void UDecimalValue::Clear() {
// @@protoc_insertion_point(message_clear_start:tari.rpc.UDecimalValue)
::google::protobuf::internal::TSanWrite(&_impl_);
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _impl_._has_bits_[0];
if ((cached_has_bits & 0x00000003u) != 0) {
::memset(&_impl_.units_, 0, static_cast<::size_t>(
reinterpret_cast<char*>(&_impl_.nanos_) -
reinterpret_cast<char*>(&_impl_.units_)) + sizeof(_impl_.nanos_));
}
_impl_._has_bits_.Clear();
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
}
#if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* PROTOBUF_NONNULL UDecimalValue::_InternalSerialize(
const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target,
::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) {
const UDecimalValue& this_ = static_cast<const UDecimalValue&>(base);
#else // PROTOBUF_CUSTOM_VTABLE
::uint8_t* PROTOBUF_NONNULL UDecimalValue::_InternalSerialize(
::uint8_t* PROTOBUF_NONNULL target,
::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const {
const UDecimalValue& this_ = *this;
#endif // PROTOBUF_CUSTOM_VTABLE
// @@protoc_insertion_point(serialize_to_array_start:tari.rpc.UDecimalValue)
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
// uint64 units = 1;
if ((this_._impl_._has_bits_[0] & 0x00000001u) != 0) {
if (this_._internal_units() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt64ToArray(
1, this_._internal_units(), target);
}
}
// fixed32 nanos = 2;
if ((this_._impl_._has_bits_[0] & 0x00000002u) != 0) {
if (this_._internal_nanos() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteFixed32ToArray(
2, this_._internal_nanos(), target);
}
}
if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
target =
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:tari.rpc.UDecimalValue)
return target;
}
#if defined(PROTOBUF_CUSTOM_VTABLE)
::size_t UDecimalValue::ByteSizeLong(const MessageLite& base) {
const UDecimalValue& this_ = static_cast<const UDecimalValue&>(base);
#else // PROTOBUF_CUSTOM_VTABLE
::size_t UDecimalValue::ByteSizeLong() const {
const UDecimalValue& this_ = *this;
#endif // PROTOBUF_CUSTOM_VTABLE
// @@protoc_insertion_point(message_byte_size_start:tari.rpc.UDecimalValue)
::size_t total_size = 0;
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void)cached_has_bits;
::_pbi::Prefetch5LinesFrom7Lines(&this_);
cached_has_bits = this_._impl_._has_bits_[0];
if ((cached_has_bits & 0x00000003u) != 0) {
// uint64 units = 1;
if ((cached_has_bits & 0x00000001u) != 0) {
if (this_._internal_units() != 0) {
total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(
this_._internal_units());
}
}
// fixed32 nanos = 2;
if ((cached_has_bits & 0x00000002u) != 0) {
if (this_._internal_nanos() != 0) {
total_size += 5;
}
}
}
return this_.MaybeComputeUnknownFieldsSize(total_size,
&this_._impl_._cached_size_);
}
void UDecimalValue::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) {
auto* const _this = static_cast<UDecimalValue*>(&to_msg);
auto& from = static_cast<const UDecimalValue&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:tari.rpc.UDecimalValue)
ABSL_DCHECK_NE(&from, _this);
::uint32_t cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._impl_._has_bits_[0];
if ((cached_has_bits & 0x00000003u) != 0) {
if ((cached_has_bits & 0x00000001u) != 0) {
if (from._internal_units() != 0) {
_this->_impl_.units_ = from._impl_.units_;
}
}
if ((cached_has_bits & 0x00000002u) != 0) {
if (from._internal_nanos() != 0) {
_this->_impl_.nanos_ = from._impl_.nanos_;
}
}
}
_this->_impl_._has_bits_[0] |= cached_has_bits;
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
}
void UDecimalValue::CopyFrom(const UDecimalValue& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:tari.rpc.UDecimalValue)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void UDecimalValue::InternalSwap(UDecimalValue* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) {
using ::std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
::google::protobuf::internal::memswap<
PROTOBUF_FIELD_OFFSET(UDecimalValue, _impl_.nanos_)
+ sizeof(UDecimalValue::_impl_.nanos_)
- PROTOBUF_FIELD_OFFSET(UDecimalValue, _impl_.units_)>(
reinterpret_cast<char*>(&_impl_.units_),
reinterpret_cast<char*>(&other->_impl_.units_));
}
::google::protobuf::Metadata UDecimalValue::GetMetadata() const {
return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full());
}
// @@protoc_insertion_point(namespace_scope)
} // namespace rpc
} // namespace tari
+259
View File
@@ -112,6 +112,10 @@ class Signature;
struct SignatureDefaultTypeInternal;
extern SignatureDefaultTypeInternal _Signature_default_instance_;
extern const ::google::protobuf::internal::ClassDataFull Signature_class_data_;
class UDecimalValue;
struct UDecimalValueDefaultTypeInternal;
extern UDecimalValueDefaultTypeInternal _UDecimalValue_default_instance_;
extern const ::google::protobuf::internal::ClassDataFull UDecimalValue_class_data_;
class WeightParams;
struct WeightParamsDefaultTypeInternal;
extern WeightParamsDefaultTypeInternal _WeightParams_default_instance_;
@@ -439,6 +443,209 @@ class WeightParams final : public ::google::protobuf::Message
extern const ::google::protobuf::internal::ClassDataFull WeightParams_class_data_;
// -------------------------------------------------------------------
class UDecimalValue final : public ::google::protobuf::Message
/* @@protoc_insertion_point(class_definition:tari.rpc.UDecimalValue) */ {
public:
inline UDecimalValue() : UDecimalValue(nullptr) {}
~UDecimalValue() PROTOBUF_FINAL;
#if defined(PROTOBUF_CUSTOM_VTABLE)
void operator delete(UDecimalValue* PROTOBUF_NONNULL msg, std::destroying_delete_t) {
SharedDtor(*msg);
::google::protobuf::internal::SizedDelete(msg, sizeof(UDecimalValue));
}
#endif
template <typename = void>
explicit PROTOBUF_CONSTEXPR UDecimalValue(::google::protobuf::internal::ConstantInitialized);
inline UDecimalValue(const UDecimalValue& from) : UDecimalValue(nullptr, from) {}
inline UDecimalValue(UDecimalValue&& from) noexcept
: UDecimalValue(nullptr, ::std::move(from)) {}
inline UDecimalValue& operator=(const UDecimalValue& from) {
CopyFrom(from);
return *this;
}
inline UDecimalValue& operator=(UDecimalValue&& from) noexcept {
if (this == &from) return *this;
if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) {
InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance);
}
inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields()
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>();
}
static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() {
return GetDescriptor();
}
static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const UDecimalValue& default_instance() {
return *reinterpret_cast<const UDecimalValue*>(
&_UDecimalValue_default_instance_);
}
static constexpr int kIndexInFileMessages = 13;
friend void swap(UDecimalValue& a, UDecimalValue& b) { a.Swap(&b); }
inline void Swap(UDecimalValue* PROTOBUF_NONNULL other) {
if (other == this) return;
if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) {
InternalSwap(other);
} else {
::google::protobuf::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(UDecimalValue* PROTOBUF_NONNULL other) {
if (other == this) return;
ABSL_DCHECK(GetArena() == other->GetArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
UDecimalValue* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const {
return ::google::protobuf::Message::DefaultConstruct<UDecimalValue>(arena);
}
using ::google::protobuf::Message::CopyFrom;
void CopyFrom(const UDecimalValue& from);
using ::google::protobuf::Message::MergeFrom;
void MergeFrom(const UDecimalValue& from) { UDecimalValue::MergeImpl(*this, from); }
private:
static void MergeImpl(::google::protobuf::MessageLite& to_msg,
const ::google::protobuf::MessageLite& from_msg);
public:
bool IsInitialized() const {
return true;
}
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL;
#if defined(PROTOBUF_CUSTOM_VTABLE)
private:
static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg);
static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize(
const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target,
::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream);
public:
::size_t ByteSizeLong() const { return ByteSizeLong(*this); }
::uint8_t* PROTOBUF_NONNULL _InternalSerialize(
::uint8_t* PROTOBUF_NONNULL target,
::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const {
return _InternalSerialize(*this, target, stream);
}
#else // PROTOBUF_CUSTOM_VTABLE
::size_t ByteSizeLong() const final;
::uint8_t* PROTOBUF_NONNULL _InternalSerialize(
::uint8_t* PROTOBUF_NONNULL target,
::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final;
#endif // PROTOBUF_CUSTOM_VTABLE
int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena);
static void SharedDtor(MessageLite& self);
void InternalSwap(UDecimalValue* PROTOBUF_NONNULL other);
private:
template <typename T>
friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)();
static ::absl::string_view FullMessageName() { return "tari.rpc.UDecimalValue"; }
protected:
explicit UDecimalValue(::google::protobuf::Arena* PROTOBUF_NULLABLE arena);
UDecimalValue(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const UDecimalValue& from);
UDecimalValue(
::google::protobuf::Arena* PROTOBUF_NULLABLE arena, UDecimalValue&& from) noexcept
: UDecimalValue(arena) {
*this = ::std::move(from);
}
const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL;
static void* PROTOBUF_NONNULL PlacementNew_(
const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem,
::google::protobuf::Arena* PROTOBUF_NULLABLE arena);
static constexpr auto InternalNewImpl_();
public:
static constexpr auto InternalGenerateClassData_();
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kUnitsFieldNumber = 1,
kNanosFieldNumber = 2,
};
// uint64 units = 1;
void clear_units() ;
::uint64_t units() const;
void set_units(::uint64_t value);
private:
::uint64_t _internal_units() const;
void _internal_set_units(::uint64_t value);
public:
// fixed32 nanos = 2;
void clear_nanos() ;
::uint32_t nanos() const;
void set_nanos(::uint32_t value);
private:
::uint32_t _internal_nanos() const;
void _internal_set_nanos(::uint32_t value);
public:
// @@protoc_insertion_point(class_scope:tari.rpc.UDecimalValue)
private:
class _Internal;
friend class ::google::protobuf::internal::TcParser;
static const ::google::protobuf::internal::TcParseTable<1, 2,
0, 0,
2>
_table_;
friend class ::google::protobuf::MessageLite;
friend class ::google::protobuf::Arena;
template <typename T>
friend class ::google::protobuf::Arena::InternalHelper;
using InternalArenaConstructable_ = void;
using DestructorSkippable_ = void;
struct Impl_ {
inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept;
inline explicit Impl_(
::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* PROTOBUF_NULLABLE arena);
inline explicit Impl_(
::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from,
const UDecimalValue& from_msg);
::google::protobuf::internal::HasBits<1> _has_bits_;
::google::protobuf::internal::CachedSize _cached_size_;
::uint64_t units_;
::uint32_t nanos_;
PROTOBUF_TSAN_DECLARE_MEMBER
};
union { Impl_ _impl_; };
friend struct ::TableStruct_types_2eproto;
};
extern const ::google::protobuf::internal::ClassDataFull UDecimalValue_class_data_;
// -------------------------------------------------------------------
class Signature final : public ::google::protobuf::Message
/* @@protoc_insertion_point(class_definition:tari.rpc.Signature) */ {
public:
@@ -5787,6 +5994,58 @@ inline void ConsensusConstants::_internal_set_vn_registration_max_vns_per_epoch(
_impl_.vn_registration_max_vns_per_epoch_ = value;
}
// -------------------------------------------------------------------
// UDecimalValue
// uint64 units = 1;
inline void UDecimalValue::clear_units() {
::google::protobuf::internal::TSanWrite(&_impl_);
_impl_.units_ = ::uint64_t{0u};
_impl_._has_bits_[0] &= ~0x00000001u;
}
inline ::uint64_t UDecimalValue::units() const {
// @@protoc_insertion_point(field_get:tari.rpc.UDecimalValue.units)
return _internal_units();
}
inline void UDecimalValue::set_units(::uint64_t value) {
_internal_set_units(value);
_impl_._has_bits_[0] |= 0x00000001u;
// @@protoc_insertion_point(field_set:tari.rpc.UDecimalValue.units)
}
inline ::uint64_t UDecimalValue::_internal_units() const {
::google::protobuf::internal::TSanRead(&_impl_);
return _impl_.units_;
}
inline void UDecimalValue::_internal_set_units(::uint64_t value) {
::google::protobuf::internal::TSanWrite(&_impl_);
_impl_.units_ = value;
}
// fixed32 nanos = 2;
inline void UDecimalValue::clear_nanos() {
::google::protobuf::internal::TSanWrite(&_impl_);
_impl_.nanos_ = 0u;
_impl_._has_bits_[0] &= ~0x00000002u;
}
inline ::uint32_t UDecimalValue::nanos() const {
// @@protoc_insertion_point(field_get:tari.rpc.UDecimalValue.nanos)
return _internal_nanos();
}
inline void UDecimalValue::set_nanos(::uint32_t value) {
_internal_set_nanos(value);
_impl_._has_bits_[0] |= 0x00000002u;
// @@protoc_insertion_point(field_set:tari.rpc.UDecimalValue.nanos)
}
inline ::uint32_t UDecimalValue::_internal_nanos() const {
::google::protobuf::internal::TSanRead(&_impl_);
return _impl_.nanos_;
}
inline void UDecimalValue::_internal_set_nanos(::uint32_t value) {
::google::protobuf::internal::TSanWrite(&_impl_);
_impl_.nanos_ = value;
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
+10
View File
@@ -146,3 +146,13 @@ message ConsensusConstants {
uint32 vn_registration_max_vns_initial_epoch = 38;
uint32 vn_registration_max_vns_per_epoch = 39;
}
// Unsigned decimal value, examples:
// 12345.6789 -> { units = 12345, nanos = 678900000 }
// 12345.0006789 -> { units = 12345, nanos = 678900 }
message UDecimalValue {
// Whole units part of the amount
uint64 units = 1;
// Nano units of the amount (10^-9)
fixed32 nanos = 2;
}