mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 08:46:46 +00:00
refactor: Enable clang-tidy readability-identifier-naming check (#6571)
This commit is contained in:
@@ -19,10 +19,10 @@
|
||||
|
||||
namespace xrpl {
|
||||
|
||||
class STValidation_test : public beast::unit_test::suite
|
||||
class STValidation_test : public beast::unit_test::Suite
|
||||
{
|
||||
// No public key:
|
||||
static constexpr std::uint8_t payload1[] = {
|
||||
static constexpr std::uint8_t kPAYLOAD1[] = {
|
||||
0x22, 0x80, 0x00, 0x00, 0x01, 0x26, 0x03, 0x4B, 0xEA, 0x97, 0x29, 0x26, 0x47, 0x31, 0x1A,
|
||||
0x3A, 0x4E, 0x69, 0x6B, 0x2B, 0x54, 0x69, 0x66, 0x66, 0x51, 0x53, 0x1F, 0x1A, 0x4E, 0xBB,
|
||||
0x43, 0x19, 0x69, 0x16, 0xF8, 0x3E, 0xEA, 0x5C, 0x77, 0x94, 0x08, 0x19, 0x0B, 0x4B, 0x40,
|
||||
@@ -36,7 +36,7 @@ class STValidation_test : public beast::unit_test::suite
|
||||
0x8E, 0x09, 0x11, 0x52, 0x28, 0x5A, 0x48, 0x8F, 0x98, 0x7A, 0x5A, 0x10, 0x74, 0xCC};
|
||||
|
||||
// Short public key:
|
||||
static constexpr std::uint8_t payload2[] = {
|
||||
static constexpr std::uint8_t kPAYLOAD2[] = {
|
||||
0x22, 0x80, 0x00, 0x00, 0x01, 0x26, 0x03, 0x4B, 0xEA, 0x97, 0x29, 0x26, 0x47, 0x31, 0x1A,
|
||||
0x51, 0x53, 0x1F, 0x1A, 0x4E, 0xBB, 0x43, 0x19, 0x69, 0x16, 0xF8, 0x3E, 0xEA, 0x5C, 0x77,
|
||||
0x94, 0x08, 0x19, 0x0B, 0x4B, 0x40, 0x8C, 0xDE, 0xB8, 0x79, 0x39, 0xF3, 0x9D, 0x66, 0x7B,
|
||||
@@ -52,7 +52,7 @@ class STValidation_test : public beast::unit_test::suite
|
||||
0xD7, 0xFF, 0x83, 0x9D, 0xEF, 0x7D, 0xF7, 0x6A};
|
||||
|
||||
// Long public key:
|
||||
static constexpr std::uint8_t payload3[] = {
|
||||
static constexpr std::uint8_t kPAYLOAD3[] = {
|
||||
0x22, 0x80, 0x00, 0x00, 0x01, 0x26, 0x03, 0x4B, 0xEA, 0x97, 0x29, 0x26, 0x47, 0x31, 0x1A,
|
||||
0x51, 0x53, 0x1F, 0x1A, 0x4E, 0xBB, 0x43, 0x19, 0x69, 0x16, 0xF8, 0x3E, 0xEA, 0x5C, 0x77,
|
||||
0x94, 0x08, 0x19, 0x0B, 0x4B, 0x40, 0x8C, 0xDE, 0xB8, 0x79, 0x39, 0xF3, 0x9D, 0x66, 0x7B,
|
||||
@@ -68,7 +68,7 @@ class STValidation_test : public beast::unit_test::suite
|
||||
0xEF, 0x4C, 0x73, 0xB3, 0xFF, 0xFE, 0xA9, 0x8E, 0x92, 0xE8};
|
||||
|
||||
// Ed25519 public key:
|
||||
static constexpr std::uint8_t payload4[] = {
|
||||
static constexpr std::uint8_t kPAYLOAD4[] = {
|
||||
0x22, 0x80, 0x00, 0x00, 0x01, 0x26, 0x03, 0x4B, 0xEA, 0x97, 0x29, 0x26, 0x47, 0x31, 0x1A,
|
||||
0x51, 0x53, 0x1F, 0x1A, 0x4E, 0xBB, 0x43, 0x19, 0x69, 0x16, 0xF8, 0x3E, 0xEA, 0x5C, 0x77,
|
||||
0x94, 0x08, 0x19, 0x0B, 0x4B, 0x40, 0x8C, 0xDE, 0xB8, 0x79, 0x39, 0xF3, 0x9D, 0x66, 0x7B,
|
||||
@@ -84,7 +84,7 @@ class STValidation_test : public beast::unit_test::suite
|
||||
0x7E, 0x84, 0x09};
|
||||
|
||||
// No ledger sequence:
|
||||
static constexpr std::uint8_t payload5[] = {
|
||||
static constexpr std::uint8_t kPAYLOAD5[] = {
|
||||
0x22, 0x80, 0x00, 0x00, 0x01, 0x29, 0x26, 0x47, 0x31, 0x1A, 0x51, 0x53, 0x1F, 0x1A, 0x4E,
|
||||
0xBB, 0x43, 0x19, 0x69, 0x16, 0xF8, 0x3E, 0xEA, 0x5C, 0x77, 0x94, 0x08, 0x19, 0x0B, 0x4B,
|
||||
0x40, 0x8C, 0xDE, 0xB8, 0x79, 0x39, 0xF3, 0x9D, 0x66, 0x7B, 0x12, 0xCA, 0x97, 0x50, 0x17,
|
||||
@@ -100,7 +100,7 @@ class STValidation_test : public beast::unit_test::suite
|
||||
0xEA, 0x5F, 0xD9, 0xC7, 0xAA};
|
||||
|
||||
// No sign time:
|
||||
static constexpr std::uint8_t payload6[] = {
|
||||
static constexpr std::uint8_t kPAYLOAD6[] = {
|
||||
0x22, 0x80, 0x00, 0x00, 0x01, 0x26, 0x03, 0x4B, 0xEA, 0x97, 0x51, 0x53, 0x1F, 0x1A, 0x4E,
|
||||
0xBB, 0x43, 0x19, 0x69, 0x16, 0xF8, 0x3E, 0xEA, 0x5C, 0x77, 0x94, 0x08, 0x19, 0x0B, 0x4B,
|
||||
0x40, 0x8C, 0xDE, 0xB8, 0x79, 0x39, 0xF3, 0x9D, 0x66, 0x7B, 0x12, 0xCA, 0x97, 0x50, 0x17,
|
||||
@@ -116,7 +116,7 @@ class STValidation_test : public beast::unit_test::suite
|
||||
0x23, 0xE2, 0x14, 0x80, 0x54};
|
||||
|
||||
// No signature field:
|
||||
static constexpr std::uint8_t payload7[] = {
|
||||
static constexpr std::uint8_t kPAYLOAD7[] = {
|
||||
0x22, 0x80, 0x00, 0x00, 0x01, 0x26, 0x03, 0x4B, 0xEA, 0x97, 0x29, 0x26, 0x47, 0x31, 0x1A,
|
||||
0x51, 0x53, 0x1F, 0x1A, 0x4E, 0xBB, 0x43, 0x19, 0x69, 0x16, 0xF8, 0x3E, 0xEA, 0x5C, 0x77,
|
||||
0x94, 0x08, 0x19, 0x0B, 0x4B, 0x40, 0x8C, 0xDE, 0xB8, 0x79, 0x39, 0xF3, 0x9D, 0x66, 0x7B,
|
||||
@@ -127,7 +127,7 @@ class STValidation_test : public beast::unit_test::suite
|
||||
0xA5, 0xC3, 0x3E, 0x92, 0x8C, 0x27, 0x51, 0xFC, 0x1B, 0x31, 0xEB, 0x32};
|
||||
|
||||
// Good:
|
||||
static constexpr std::uint8_t payload8[] = {
|
||||
static constexpr std::uint8_t kPAYLOAD8[] = {
|
||||
0x22, 0x80, 0x00, 0x00, 0x01, 0x26, 0x03, 0x4B, 0xEA, 0x97, 0x29, 0x26, 0x47, 0x31, 0x1A,
|
||||
0x51, 0x53, 0x1F, 0x1A, 0x4E, 0xBB, 0x43, 0x19, 0x69, 0x16, 0xF8, 0x3E, 0xEA, 0x5C, 0x77,
|
||||
0x94, 0x08, 0x19, 0x0B, 0x4B, 0x40, 0x8C, 0xDE, 0xB8, 0x79, 0x39, 0xF3, 0x9D, 0x66, 0x7B,
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
|
||||
try
|
||||
{
|
||||
SerialIter sit{payload8};
|
||||
SerialIter sit{kPAYLOAD8};
|
||||
|
||||
auto val = std::make_shared<STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, true);
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
|
||||
try
|
||||
{
|
||||
SerialIter sit{payload1};
|
||||
SerialIter sit{kPAYLOAD1};
|
||||
auto val = std::make_shared<xrpl::STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false);
|
||||
fail("An exception should have been thrown");
|
||||
@@ -184,7 +184,7 @@ public:
|
||||
|
||||
try
|
||||
{
|
||||
SerialIter sit{payload2};
|
||||
SerialIter sit{kPAYLOAD2};
|
||||
auto val = std::make_shared<xrpl::STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false);
|
||||
fail("An exception should have been thrown");
|
||||
@@ -196,7 +196,7 @@ public:
|
||||
|
||||
try
|
||||
{
|
||||
SerialIter sit{payload3};
|
||||
SerialIter sit{kPAYLOAD3};
|
||||
auto val = std::make_shared<xrpl::STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false);
|
||||
fail("An exception should have been thrown");
|
||||
@@ -208,7 +208,7 @@ public:
|
||||
|
||||
try
|
||||
{
|
||||
SerialIter sit{payload4};
|
||||
SerialIter sit{kPAYLOAD4};
|
||||
auto val = std::make_shared<xrpl::STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false);
|
||||
fail("An exception should have been thrown");
|
||||
@@ -222,7 +222,7 @@ public:
|
||||
|
||||
try
|
||||
{
|
||||
SerialIter sit{payload5};
|
||||
SerialIter sit{kPAYLOAD5};
|
||||
auto val = std::make_shared<STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false);
|
||||
fail("Expected exception not thrown from validation");
|
||||
@@ -234,7 +234,7 @@ public:
|
||||
|
||||
try
|
||||
{
|
||||
SerialIter sit{payload6};
|
||||
SerialIter sit{kPAYLOAD6};
|
||||
auto val = std::make_shared<STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false);
|
||||
fail("Expected exception not thrown from validation");
|
||||
@@ -246,7 +246,7 @@ public:
|
||||
|
||||
try
|
||||
{
|
||||
SerialIter sit{payload7};
|
||||
SerialIter sit{kPAYLOAD7};
|
||||
|
||||
auto val = std::make_shared<STValidation>(
|
||||
sit, [](PublicKey const& pk) { return calcNodeID(pk); }, false);
|
||||
@@ -262,7 +262,7 @@ public:
|
||||
|
||||
// Mutate a known-good validation and expect it to fail:
|
||||
std::vector<std::uint8_t> v;
|
||||
for (auto c : payload8)
|
||||
for (auto c : kPAYLOAD8)
|
||||
v.push_back(c);
|
||||
|
||||
beast::xor_shift_engine g(148979842);
|
||||
@@ -272,7 +272,7 @@ public:
|
||||
auto v2 = v;
|
||||
|
||||
while (v2[i] == v[i])
|
||||
v2[i] = rand_byte<std::uint8_t>(g);
|
||||
v2[i] = randByte<std::uint8_t>(g);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user