refactor: Rename static constants (#7120)

Co-authored-by: Bart <bthomee@users.noreply.github.com>
This commit is contained in:
Alex Kremer
2026-05-15 16:32:19 +01:00
committed by GitHub
parent 028f0cb5da
commit 5b6e8b6f93
648 changed files with 6582 additions and 6686 deletions

View File

@@ -22,7 +22,7 @@ namespace xrpl {
class STValidation_test : public beast::unit_test::Suite
{
// No public key:
static constexpr std::uint8_t kPAYLOAD1[] = {
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 kPAYLOAD2[] = {
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 kPAYLOAD3[] = {
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 kPAYLOAD4[] = {
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 kPAYLOAD5[] = {
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 kPAYLOAD6[] = {
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 kPAYLOAD7[] = {
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 kPAYLOAD8[] = {
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{kPAYLOAD8};
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{kPAYLOAD1};
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{kPAYLOAD2};
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{kPAYLOAD3};
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{kPAYLOAD4};
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{kPAYLOAD5};
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{kPAYLOAD6};
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{kPAYLOAD7};
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 : kPAYLOAD8)
for (auto c : kPayload8)
v.push_back(c);
beast::xor_shift_engine g(148979842);