-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update asn1 files #17
base: master
Are you sure you want to change the base?
Conversation
@@ -7,7 +7,7 @@ | |||
#pragma once | |||
|
|||
#include <qtils/bytes.hpp> | |||
#include <qtils/bytestr.hpp> | |||
#include <qtils/byte_utils.hpp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert after qdrvm/qtils#7 is merged.
Doesn't build on macos (#include <print>
, std::format_string
, ...) must fix qtils
inline constexpr bool operator==(const Empty &) const { | ||
return true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline constexpr bool operator==(const Empty &) const { | |
return true; | |
} | |
constexpr bool operator==(const Empty &) const = default; |
|
||
namespace jam { | ||
|
||
template <typename T, typename = std::enable_if<std::is_scalar_v<T>>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use Foo = Tagged<T>
instead of struct Foo { T v }
?
Why inherit Tagged<T> : T {}
instead of Tagged<T> { T v }
?
/// Special zero-size-type for some things | ||
/// (e.g., dummy types of variant, unsupported or experimental). | ||
template <size_t N> | ||
using Unused = Tagged<Empty, NumTag<N>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate struct, not related to Empty
(encode/decode)
using Unused = Tagged<Empty, NumTag<N>>; | |
struct Unused {}; |
#include <test-vectors/vectors.hpp> | ||
|
||
namespace jam::test_vectors_disputes { | ||
namespace jam::test_vectors::disputes { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace test_vectors_disputes
was intentional, to avoid
"no type/function foo
in namespace disputes
, did you mean jam::disputes::foo
or jam::test_vectors::disputes::foo
" error
.tau = tau_tick, | ||
.eta = {eta_tick_0, eta_tick_1, eta_tick_2, eta_tick_3}, | ||
.lambda = lambda_tick, | ||
.kappa = kappa_tick, | ||
.gamma_k = gamma_tick_k, | ||
// TODO(turuslan): #3, wait for test vectors | ||
.iota = iota, | ||
.gamma_a = gamma_tick_a, | ||
.gamma_a = {gamma_tick_a.begin(), gamma_tick_a.end()}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.gamma_a = {gamma_tick_a.begin(), gamma_tick_a.end()}, | |
.gamma_a = asVec(gamma_tick_a), |
#include <unordered_map> | ||
|
||
#include <unordered_map> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate
#include <unordered_map> |
std::ranges::find(post_offenders, validator.ed25519) | ||
!= post_offenders.end() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::ranges::find(post_offenders, validator.ed25519) | |
!= post_offenders.end() | |
not qtils::cxx23::ranges::contains(post_offenders, validator.ed25519) |
std::ranges::for_each(gamma_tick_a, [&](const auto &t) { | ||
fmt::println("old: {}-{}", t.id[0], t.attempt); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug log
std::ranges::for_each(gamma_tick_a, [&](const auto &t) { | |
fmt::println("old: {}-{}", t.id[0], t.attempt); | |
}); |
@@ -146,24 +149,23 @@ namespace jam::disputes { | |||
// Signature related judgment offenders. | |||
const auto &faults = ext.faults; | |||
|
|||
types::EpochIndex current_epoch = state.tau / config.epoch_length; | |||
auto current_epoch = state.tau / config.epoch_length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Operations may change type, so types::EpochIndex
was specified
auto current_epoch = state.tau / config.epoch_length; | |
types::EpochIndex current_epoch = state.tau / config.epoch_length; |
Update code of parsing asn1 files in according with changes of jam-test-vectors.
Fix safrol test.