mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-05 17:56:49 +00:00
Merge branch 'pratik/otel-phase8-log-correlation' into pratik/otel-phase9-metric-gap-fill
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
This commit is contained in:
@@ -8,9 +8,12 @@ add_custom_target(xrpl.tests)
|
||||
|
||||
# Test helpers
|
||||
add_library(xrpl.helpers.test STATIC)
|
||||
target_sources(xrpl.helpers.test PRIVATE helpers/TestSink.cpp)
|
||||
target_sources(
|
||||
xrpl.helpers.test
|
||||
PRIVATE helpers/Account.cpp helpers/TestSink.cpp helpers/TxTest.cpp
|
||||
)
|
||||
target_include_directories(xrpl.helpers.test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(xrpl.helpers.test PRIVATE xrpl.libxrpl)
|
||||
target_link_libraries(xrpl.helpers.test PUBLIC xrpl.libxrpl gtest::gtest)
|
||||
|
||||
# Common library dependencies for the rest of the tests.
|
||||
add_library(xrpl.imports.test INTERFACE)
|
||||
@@ -32,6 +35,10 @@ xrpl_add_test(json)
|
||||
target_link_libraries(xrpl.test.json PRIVATE xrpl.imports.test)
|
||||
add_dependencies(xrpl.tests xrpl.test.json)
|
||||
|
||||
xrpl_add_test(tx)
|
||||
target_link_libraries(xrpl.test.tx PRIVATE xrpl.imports.test)
|
||||
add_dependencies(xrpl.tests xrpl.test.tx)
|
||||
|
||||
xrpl_add_test(protocol_autogen)
|
||||
target_link_libraries(xrpl.test.protocol_autogen PRIVATE xrpl.imports.test)
|
||||
add_dependencies(xrpl.tests xrpl.test.protocol_autogen)
|
||||
|
||||
@@ -161,15 +161,15 @@ TEST(mallocTrim, with_debug_logging)
|
||||
{
|
||||
struct DebugSink : public beast::Journal::Sink
|
||||
{
|
||||
DebugSink() : Sink(beast::severities::kDebug, false)
|
||||
DebugSink() : Sink(beast::Severity::Debug, false)
|
||||
{
|
||||
}
|
||||
void
|
||||
write(beast::severities::Severity, std::string const&) override
|
||||
write(beast::Severity, std::string const&) override
|
||||
{
|
||||
}
|
||||
void
|
||||
writeAlways(beast::severities::Severity, std::string const&) override
|
||||
writeAlways(beast::Severity, std::string const&) override
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
@@ -186,8 +186,8 @@ TEST_F(MutexConstCorrectnessTest, non_const_allows_modification)
|
||||
TEST_F(MutexConstCorrectnessTest, const_reference_provides_const_access)
|
||||
{
|
||||
Mutex<std::vector<int>> const m({1, 2, 3, 4, 5, 6});
|
||||
Mutex<std::vector<int>> const& const_ref = m;
|
||||
auto lock = const_ref.lock();
|
||||
Mutex<std::vector<int>> const& constRef = m;
|
||||
auto lock = constRef.lock();
|
||||
static_assert(std::is_const_v<std::remove_reference_t<decltype(*lock)>>);
|
||||
EXPECT_EQ(lock->size(), 6);
|
||||
EXPECT_EQ(lock->at(5), 6);
|
||||
@@ -197,7 +197,7 @@ struct MutexDifferentLockTypesTest : ::testing::Test
|
||||
{
|
||||
};
|
||||
|
||||
TEST_F(MutexDifferentLockTypesTest, lock_guard)
|
||||
TEST_F(MutexDifferentLockTypesTest, scoped_lock)
|
||||
{
|
||||
Mutex<int> m(0);
|
||||
{
|
||||
@@ -228,8 +228,8 @@ struct MutexSharedMutexTest : ::testing::Test
|
||||
TEST_F(MutexSharedMutexTest, shared_lock_for_const_access)
|
||||
{
|
||||
Mutex<int, std::shared_mutex> const m(100);
|
||||
Mutex<int, std::shared_mutex> const& const_ref = m;
|
||||
auto lock = const_ref.lock<std::shared_lock>();
|
||||
Mutex<int, std::shared_mutex> const& constRef = m;
|
||||
auto lock = constRef.lock<std::shared_lock>();
|
||||
EXPECT_EQ(*lock, 100);
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ struct MutexComplexTypeTest : ::testing::Test
|
||||
int x;
|
||||
std::string y;
|
||||
|
||||
Data(int x_, std::string y_) : x(x_), y(std::move(y_))
|
||||
Data(int x, std::string y) : x(x), y(std::move(y))
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
@@ -58,34 +58,34 @@ TEST(RangeSet, fromString)
|
||||
{
|
||||
RangeSet<std::uint32_t> set;
|
||||
|
||||
EXPECT_FALSE(from_string(set, ""));
|
||||
EXPECT_FALSE(fromString(set, ""));
|
||||
EXPECT_EQ(boost::icl::length(set), 0);
|
||||
|
||||
EXPECT_FALSE(from_string(set, "#"));
|
||||
EXPECT_FALSE(fromString(set, "#"));
|
||||
EXPECT_EQ(boost::icl::length(set), 0);
|
||||
|
||||
EXPECT_FALSE(from_string(set, ","));
|
||||
EXPECT_FALSE(fromString(set, ","));
|
||||
EXPECT_EQ(boost::icl::length(set), 0);
|
||||
|
||||
EXPECT_FALSE(from_string(set, ",-"));
|
||||
EXPECT_FALSE(fromString(set, ",-"));
|
||||
EXPECT_EQ(boost::icl::length(set), 0);
|
||||
|
||||
EXPECT_FALSE(from_string(set, "1,,2"));
|
||||
EXPECT_FALSE(fromString(set, "1,,2"));
|
||||
EXPECT_EQ(boost::icl::length(set), 0);
|
||||
|
||||
EXPECT_TRUE(from_string(set, "1"));
|
||||
EXPECT_TRUE(fromString(set, "1"));
|
||||
EXPECT_EQ(boost::icl::length(set), 1);
|
||||
EXPECT_EQ(boost::icl::first(set), 1);
|
||||
|
||||
EXPECT_TRUE(from_string(set, "1,1"));
|
||||
EXPECT_TRUE(fromString(set, "1,1"));
|
||||
EXPECT_EQ(boost::icl::length(set), 1);
|
||||
EXPECT_EQ(boost::icl::first(set), 1);
|
||||
|
||||
EXPECT_TRUE(from_string(set, "1-1"));
|
||||
EXPECT_TRUE(fromString(set, "1-1"));
|
||||
EXPECT_EQ(boost::icl::length(set), 1);
|
||||
EXPECT_EQ(boost::icl::first(set), 1);
|
||||
|
||||
EXPECT_TRUE(from_string(set, "1,4-6"));
|
||||
EXPECT_TRUE(fromString(set, "1,4-6"));
|
||||
EXPECT_EQ(boost::icl::length(set), 4);
|
||||
EXPECT_EQ(boost::icl::first(set), 1);
|
||||
EXPECT_FALSE(boost::icl::contains(set, 2));
|
||||
@@ -94,14 +94,14 @@ TEST(RangeSet, fromString)
|
||||
EXPECT_TRUE(boost::icl::contains(set, 5));
|
||||
EXPECT_EQ(boost::icl::last(set), 6);
|
||||
|
||||
EXPECT_TRUE(from_string(set, "1-2,4-6"));
|
||||
EXPECT_TRUE(fromString(set, "1-2,4-6"));
|
||||
EXPECT_EQ(boost::icl::length(set), 5);
|
||||
EXPECT_EQ(boost::icl::first(set), 1);
|
||||
EXPECT_TRUE(boost::icl::contains(set, 2));
|
||||
EXPECT_TRUE(boost::icl::contains(set, 4));
|
||||
EXPECT_EQ(boost::icl::last(set), 6);
|
||||
|
||||
EXPECT_TRUE(from_string(set, "1-2,6"));
|
||||
EXPECT_TRUE(fromString(set, "1-2,6"));
|
||||
EXPECT_EQ(boost::icl::length(set), 3);
|
||||
EXPECT_EQ(boost::icl::first(set), 1);
|
||||
EXPECT_TRUE(boost::icl::contains(set, 2));
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
using namespace xrpl;
|
||||
|
||||
static std::uint8_t const data[] = {
|
||||
static std::uint8_t const kData[] = {
|
||||
0xa8, 0xa1, 0x38, 0x45, 0x23, 0xec, 0xe4, 0x23, 0x71, 0x6d, 0x2a, 0x18, 0xb4, 0x70, 0xcb, 0xf5,
|
||||
0xac, 0x2d, 0x89, 0x4d, 0x19, 0x9c, 0xf0, 0x2c, 0x15, 0xd1, 0xf9, 0x9b, 0x66, 0xd2, 0x30, 0xd3};
|
||||
|
||||
@@ -21,9 +21,9 @@ TEST(Slice, equality_and_inequality)
|
||||
EXPECT_EQ(s0, s0);
|
||||
|
||||
// Test slices of equal and unequal size pointing to same data:
|
||||
for (std::size_t i = 0; i != sizeof(data); ++i)
|
||||
for (std::size_t i = 0; i != sizeof(kData); ++i)
|
||||
{
|
||||
Slice const s1{data, i};
|
||||
Slice const s1{kData, i};
|
||||
|
||||
EXPECT_EQ(s1.size(), i);
|
||||
EXPECT_NE(s1.data(), nullptr);
|
||||
@@ -37,9 +37,9 @@ TEST(Slice, equality_and_inequality)
|
||||
EXPECT_NE(s1, s0);
|
||||
}
|
||||
|
||||
for (std::size_t j = 0; j != sizeof(data); ++j)
|
||||
for (std::size_t j = 0; j != sizeof(kData); ++j)
|
||||
{
|
||||
Slice const s2{data, j};
|
||||
Slice const s2{kData, j};
|
||||
|
||||
if (i == j)
|
||||
{
|
||||
@@ -53,11 +53,11 @@ TEST(Slice, equality_and_inequality)
|
||||
}
|
||||
|
||||
// Test slices of equal size but pointing to different data:
|
||||
std::array<std::uint8_t, sizeof(data)> a{};
|
||||
std::array<std::uint8_t, sizeof(data)> b{};
|
||||
std::array<std::uint8_t, sizeof(kData)> a{};
|
||||
std::array<std::uint8_t, sizeof(kData)> b{};
|
||||
|
||||
for (std::size_t i = 0; i != sizeof(data); ++i)
|
||||
a[i] = b[i] = data[i];
|
||||
for (std::size_t i = 0; i != sizeof(kData); ++i)
|
||||
a[i] = b[i] = kData[i];
|
||||
|
||||
EXPECT_EQ(makeSlice(a), makeSlice(b));
|
||||
b[7]++;
|
||||
@@ -68,23 +68,23 @@ TEST(Slice, equality_and_inequality)
|
||||
|
||||
TEST(Slice, indexing)
|
||||
{
|
||||
Slice const s{data, sizeof(data)};
|
||||
Slice const s{kData, sizeof(kData)};
|
||||
|
||||
for (std::size_t i = 0; i != sizeof(data); ++i)
|
||||
EXPECT_EQ(s[i], data[i]);
|
||||
for (std::size_t i = 0; i != sizeof(kData); ++i)
|
||||
EXPECT_EQ(s[i], kData[i]);
|
||||
}
|
||||
|
||||
TEST(Slice, advancing)
|
||||
{
|
||||
for (std::size_t i = 0; i < sizeof(data); ++i)
|
||||
for (std::size_t i = 0; i < sizeof(kData); ++i)
|
||||
{
|
||||
for (std::size_t j = 0; i + j < sizeof(data); ++j)
|
||||
for (std::size_t j = 0; i + j < sizeof(kData); ++j)
|
||||
{
|
||||
Slice s(data + i, sizeof(data) - i);
|
||||
Slice s(kData + i, sizeof(kData) - i);
|
||||
s += j;
|
||||
|
||||
EXPECT_EQ(s.data(), data + i + j);
|
||||
EXPECT_EQ(s.size(), sizeof(data) - i - j);
|
||||
EXPECT_EQ(s.data(), kData + i + j);
|
||||
EXPECT_EQ(s.size(), sizeof(kData) - i - j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@ using namespace xrpl;
|
||||
static void
|
||||
check(std::string const& in, std::string const& out)
|
||||
{
|
||||
auto const encoded = base64_encode(in);
|
||||
auto const encoded = base64Encode(in);
|
||||
EXPECT_EQ(encoded, out);
|
||||
EXPECT_EQ(base64_decode(encoded), in);
|
||||
EXPECT_EQ(base64Decode(encoded), in);
|
||||
}
|
||||
|
||||
TEST(base64, base64)
|
||||
@@ -46,5 +46,5 @@ TEST(base64, base64)
|
||||
|
||||
std::string const notBase64 = "not_base64!!";
|
||||
std::string const truncated = "not";
|
||||
EXPECT_EQ(base64_decode(notBase64), base64_decode(truncated));
|
||||
EXPECT_EQ(base64Decode(notBase64), base64Decode(truncated));
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ TEST(contract, contract)
|
||||
|
||||
try
|
||||
{
|
||||
Rethrow();
|
||||
rethrow();
|
||||
}
|
||||
catch (std::runtime_error const& e2)
|
||||
{
|
||||
|
||||
@@ -6,27 +6,27 @@
|
||||
|
||||
using namespace xrpl;
|
||||
|
||||
TEST(scope, scope_exit)
|
||||
TEST(scope, ScopeExit)
|
||||
{
|
||||
// scope_exit always executes the functor on destruction,
|
||||
// ScopeExit always executes the functor on destruction,
|
||||
// unless release() is called
|
||||
int i = 0;
|
||||
{
|
||||
scope_exit const x{[&i]() { i = 1; }};
|
||||
ScopeExit const x{[&i]() { i = 1; }};
|
||||
}
|
||||
EXPECT_EQ(i, 1);
|
||||
{
|
||||
scope_exit x{[&i]() { i = 2; }};
|
||||
ScopeExit x{[&i]() { i = 2; }};
|
||||
x.release();
|
||||
}
|
||||
EXPECT_EQ(i, 1);
|
||||
{
|
||||
scope_exit x{[&i]() { i += 2; }};
|
||||
ScopeExit x{[&i]() { i += 2; }};
|
||||
auto x2 = std::move(x);
|
||||
}
|
||||
EXPECT_EQ(i, 3);
|
||||
{
|
||||
scope_exit x{[&i]() { i = 4; }};
|
||||
ScopeExit x{[&i]() { i = 4; }};
|
||||
x.release();
|
||||
auto x2 = std::move(x);
|
||||
}
|
||||
@@ -34,7 +34,7 @@ TEST(scope, scope_exit)
|
||||
{
|
||||
try
|
||||
{
|
||||
scope_exit const x{[&i]() { i = 5; }};
|
||||
ScopeExit const x{[&i]() { i = 5; }};
|
||||
throw 1;
|
||||
}
|
||||
catch (...) // NOLINT(bugprone-empty-catch)
|
||||
@@ -45,7 +45,7 @@ TEST(scope, scope_exit)
|
||||
{
|
||||
try
|
||||
{
|
||||
scope_exit x{[&i]() { i = 6; }};
|
||||
ScopeExit x{[&i]() { i = 6; }};
|
||||
x.release();
|
||||
throw 1;
|
||||
}
|
||||
@@ -56,27 +56,27 @@ TEST(scope, scope_exit)
|
||||
EXPECT_EQ(i, 5);
|
||||
}
|
||||
|
||||
TEST(scope, scope_fail)
|
||||
TEST(scope, ScopeFail)
|
||||
{
|
||||
// scope_fail executes the functor on destruction only
|
||||
// ScopeFail executes the functor on destruction only
|
||||
// if an exception is unwinding, unless release() is called
|
||||
int i = 0;
|
||||
{
|
||||
scope_fail const x{[&i]() { i = 1; }};
|
||||
ScopeFail const x{[&i]() { i = 1; }};
|
||||
}
|
||||
EXPECT_EQ(i, 0);
|
||||
{
|
||||
scope_fail x{[&i]() { i = 2; }};
|
||||
ScopeFail x{[&i]() { i = 2; }};
|
||||
x.release();
|
||||
}
|
||||
EXPECT_EQ(i, 0);
|
||||
{
|
||||
scope_fail x{[&i]() { i = 3; }};
|
||||
ScopeFail x{[&i]() { i = 3; }};
|
||||
auto x2 = std::move(x);
|
||||
}
|
||||
EXPECT_EQ(i, 0);
|
||||
{
|
||||
scope_fail x{[&i]() { i = 4; }};
|
||||
ScopeFail x{[&i]() { i = 4; }};
|
||||
x.release();
|
||||
auto x2 = std::move(x);
|
||||
}
|
||||
@@ -84,7 +84,7 @@ TEST(scope, scope_fail)
|
||||
{
|
||||
try
|
||||
{
|
||||
scope_fail const x{[&i]() { i = 5; }};
|
||||
ScopeFail const x{[&i]() { i = 5; }};
|
||||
throw 1;
|
||||
}
|
||||
catch (...) // NOLINT(bugprone-empty-catch)
|
||||
@@ -95,7 +95,7 @@ TEST(scope, scope_fail)
|
||||
{
|
||||
try
|
||||
{
|
||||
scope_fail x{[&i]() { i = 6; }};
|
||||
ScopeFail x{[&i]() { i = 6; }};
|
||||
x.release();
|
||||
throw 1;
|
||||
}
|
||||
@@ -106,27 +106,27 @@ TEST(scope, scope_fail)
|
||||
EXPECT_EQ(i, 5);
|
||||
}
|
||||
|
||||
TEST(scope, scope_success)
|
||||
TEST(scope, ScopeSuccess)
|
||||
{
|
||||
// scope_success executes the functor on destruction only
|
||||
// ScopeSuccess executes the functor on destruction only
|
||||
// if an exception is not unwinding, unless release() is called
|
||||
int i = 0;
|
||||
{
|
||||
scope_success const x{[&i]() { i = 1; }};
|
||||
ScopeSuccess const x{[&i]() { i = 1; }};
|
||||
}
|
||||
EXPECT_EQ(i, 1);
|
||||
{
|
||||
scope_success x{[&i]() { i = 2; }};
|
||||
ScopeSuccess x{[&i]() { i = 2; }};
|
||||
x.release();
|
||||
}
|
||||
EXPECT_EQ(i, 1);
|
||||
{
|
||||
scope_success x{[&i]() { i += 2; }};
|
||||
ScopeSuccess x{[&i]() { i += 2; }};
|
||||
auto x2 = std::move(x);
|
||||
}
|
||||
EXPECT_EQ(i, 3);
|
||||
{
|
||||
scope_success x{[&i]() { i = 4; }};
|
||||
ScopeSuccess x{[&i]() { i = 4; }};
|
||||
x.release();
|
||||
auto x2 = std::move(x);
|
||||
}
|
||||
@@ -134,7 +134,7 @@ TEST(scope, scope_success)
|
||||
{
|
||||
try
|
||||
{
|
||||
scope_success const x{[&i]() { i = 5; }};
|
||||
ScopeSuccess const x{[&i]() { i = 5; }};
|
||||
throw 1;
|
||||
}
|
||||
catch (...) // NOLINT(bugprone-empty-catch)
|
||||
@@ -145,7 +145,7 @@ TEST(scope, scope_success)
|
||||
{
|
||||
try
|
||||
{
|
||||
scope_success x{[&i]() { i = 6; }};
|
||||
ScopeSuccess x{[&i]() { i = 6; }};
|
||||
x.release();
|
||||
throw 1;
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ struct Tag2
|
||||
|
||||
// Static checks that types are not interoperable
|
||||
|
||||
using TagUInt1 = tagged_integer<std::uint32_t, Tag1>;
|
||||
using TagUInt2 = tagged_integer<std::uint32_t, Tag2>;
|
||||
using TagUInt3 = tagged_integer<std::uint64_t, Tag1>;
|
||||
using TagUInt1 = TaggedInteger<std::uint32_t, Tag1>;
|
||||
using TagUInt2 = TaggedInteger<std::uint32_t, Tag2>;
|
||||
using TagUInt3 = TaggedInteger<std::uint64_t, Tag1>;
|
||||
|
||||
// Check construction of tagged_integers
|
||||
static_assert(
|
||||
@@ -103,7 +103,7 @@ static_assert(
|
||||
!std::is_convertible_v<TagUInt2, TagUInt3>,
|
||||
"TagUInt2 should not be convertible to a TagUInt3");
|
||||
|
||||
using TagInt = tagged_integer<std::int32_t, Tag1>;
|
||||
using TagInt = TaggedInteger<std::int32_t, Tag1>;
|
||||
|
||||
TEST(tagged_integer, comparison_operators)
|
||||
{
|
||||
|
||||
@@ -8,10 +8,10 @@ using namespace xrpl;
|
||||
|
||||
TEST(csprng, get_values)
|
||||
{
|
||||
auto& engine = crypto_prng();
|
||||
auto rand_val = engine();
|
||||
EXPECT_GE(rand_val, engine.min());
|
||||
EXPECT_LE(rand_val, engine.max());
|
||||
auto& engine = cryptoPrng();
|
||||
auto randVal = engine();
|
||||
EXPECT_GE(randVal, engine.min());
|
||||
EXPECT_LE(randVal, engine.max());
|
||||
uint16_t twoByte{0};
|
||||
engine(&twoByte, sizeof(uint16_t));
|
||||
}
|
||||
|
||||
19
src/tests/libxrpl/helpers/Account.cpp
Normal file
19
src/tests/libxrpl/helpers/Account.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <helpers/Account.h>
|
||||
|
||||
#include <xrpl/protocol/KeyType.h>
|
||||
#include <xrpl/protocol/PublicKey.h>
|
||||
#include <xrpl/protocol/SecretKey.h>
|
||||
#include <xrpl/protocol/Seed.h>
|
||||
|
||||
namespace xrpl::test {
|
||||
|
||||
Account const Account::kMaster{"masterpassphrase"};
|
||||
|
||||
Account::Account(std::string_view name, KeyType type)
|
||||
: name_(name)
|
||||
, keyPair_(generateKeyPair(type, generateSeed(name_)))
|
||||
, id_(calcAccountID(keyPair_.first))
|
||||
{
|
||||
}
|
||||
|
||||
} // namespace xrpl::test
|
||||
81
src/tests/libxrpl/helpers/Account.h
Normal file
81
src/tests/libxrpl/helpers/Account.h
Normal file
@@ -0,0 +1,81 @@
|
||||
#pragma once
|
||||
|
||||
#include <xrpl/protocol/AccountID.h>
|
||||
#include <xrpl/protocol/KeyType.h>
|
||||
#include <xrpl/protocol/PublicKey.h>
|
||||
#include <xrpl/protocol/SecretKey.h>
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
namespace xrpl::test {
|
||||
|
||||
/**
|
||||
* @brief A test account with cryptographic keys.
|
||||
*
|
||||
* Generates keys deterministically from a name, making tests reproducible.
|
||||
* The same name always produces the same AccountID and keys.
|
||||
*/
|
||||
class Account
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief The master account that holds all XRP in genesis.
|
||||
*
|
||||
* This account is created in the genesis ledger with all 100 billion XRP.
|
||||
* It uses the well-known seed "masterpassphrase".
|
||||
*/
|
||||
static Account const kMaster;
|
||||
|
||||
/**
|
||||
* @brief Create an account from a name.
|
||||
*
|
||||
* Keys are derived deterministically from the name.
|
||||
*
|
||||
* @param name Human-readable name for the account.
|
||||
* @param type Key type to use (defaults to secp256k1).
|
||||
*/
|
||||
explicit Account(std::string_view name, KeyType type = KeyType::Secp256k1);
|
||||
|
||||
/** @brief Return the human-readable name. */
|
||||
[[nodiscard]] std::string const&
|
||||
name() const noexcept
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
/** @brief Return the AccountID. */
|
||||
[[nodiscard]] AccountID const&
|
||||
id() const noexcept
|
||||
{
|
||||
return id_;
|
||||
}
|
||||
|
||||
/** @brief Return the public key. */
|
||||
[[nodiscard]] PublicKey const&
|
||||
pk() const noexcept
|
||||
{
|
||||
return keyPair_.first;
|
||||
}
|
||||
|
||||
/** @brief Return the secret key. */
|
||||
[[nodiscard]] SecretKey const&
|
||||
sk() const noexcept
|
||||
{
|
||||
return keyPair_.second;
|
||||
}
|
||||
|
||||
/** @brief Implicit conversion to AccountID. */
|
||||
operator AccountID const&() const noexcept
|
||||
{
|
||||
return id_;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string name_;
|
||||
std::pair<PublicKey, SecretKey> keyPair_;
|
||||
AccountID id_;
|
||||
};
|
||||
|
||||
} // namespace xrpl::test
|
||||
131
src/tests/libxrpl/helpers/IOU.h
Normal file
131
src/tests/libxrpl/helpers/IOU.h
Normal file
@@ -0,0 +1,131 @@
|
||||
#pragma once
|
||||
|
||||
#include <xrpl/basics/Number.h>
|
||||
#include <xrpl/protocol/Asset.h>
|
||||
#include <xrpl/protocol/Issue.h>
|
||||
#include <xrpl/protocol/STAmount.h>
|
||||
#include <xrpl/protocol/UintTypes.h>
|
||||
|
||||
#include <helpers/Account.h>
|
||||
|
||||
#include <concepts>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
|
||||
namespace xrpl::test {
|
||||
|
||||
/**
|
||||
* @brief Represents an IOU (issued currency) for testing.
|
||||
*
|
||||
* Provides a clear, explicit API for creating currencies issued by an account.
|
||||
* This replaces the cryptic `Account::operator[]` from the jtx framework.
|
||||
*
|
||||
* @code
|
||||
* Account gw("gateway");
|
||||
* IOU USD("USD", gw);
|
||||
*
|
||||
* auto issue = USD.issue(); // Get the Issue
|
||||
* auto asset = USD.asset(); // Get the Asset
|
||||
* auto amt = USD.amount(100); // Get STAmount of 100 USD
|
||||
* @endcode
|
||||
*/
|
||||
class IOU
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct an IOU from a currency code and issuing account.
|
||||
* @param currencyCode A 3-character ISO currency code (e.g., "USD").
|
||||
* @param issuer The account that issues this currency.
|
||||
*/
|
||||
IOU(std::string_view currencyCode, Account const& issuer)
|
||||
: currency_(toCurrency(std::string(currencyCode))), issuer_(issuer.id())
|
||||
{
|
||||
XRPL_ASSERT(!isXRP(currency_), "IOU: currency code must not resolve to XRP");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Construct an IOU from a Currency and issuing account.
|
||||
* @param currency The Currency object.
|
||||
* @param issuer The account that issues this currency.
|
||||
*/
|
||||
IOU(Currency currency, Account const& issuer) : currency_(currency), issuer_(issuer.id())
|
||||
{
|
||||
XRPL_ASSERT(!isXRP(currency_), "IOU: currency code must not resolve to XRP");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the Issue (currency + issuer pair).
|
||||
* @return An Issue object representing this IOU.
|
||||
*/
|
||||
[[nodiscard]] Issue
|
||||
issue() const
|
||||
{
|
||||
return Issue{currency_, issuer_};
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the Asset.
|
||||
* @return An Asset object representing this IOU.
|
||||
*/
|
||||
[[nodiscard]] Asset
|
||||
asset() const
|
||||
{
|
||||
return Asset{issue()};
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Create an STAmount of this IOU.
|
||||
*
|
||||
* Works with any arithmetic type (int, double, etc.) by converting
|
||||
* to string and parsing. This matches the jtx IOU behaviour.
|
||||
*
|
||||
* @tparam T An arithmetic type.
|
||||
* @param value The amount as any arithmetic type.
|
||||
* @return An STAmount representing value units of this IOU.
|
||||
*/
|
||||
template <typename T>
|
||||
requires std::is_arithmetic_v<T>
|
||||
[[nodiscard]] STAmount
|
||||
amount(T value) const
|
||||
{
|
||||
return amountFromString(issue(), to_string(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Create an STAmount of this IOU from a Number.
|
||||
* @param value The amount as a Number.
|
||||
* @return An STAmount representing value units of this IOU.
|
||||
*/
|
||||
[[nodiscard]] STAmount
|
||||
amount(Number const& value) const
|
||||
{
|
||||
return STAmount{issue(), value};
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the currency.
|
||||
* @return The currency.
|
||||
*/
|
||||
[[nodiscard]] Currency const&
|
||||
currency() const
|
||||
{
|
||||
return currency_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the issuer account ID.
|
||||
* @return The issuer's AccountID.
|
||||
*/
|
||||
[[nodiscard]] AccountID const&
|
||||
issuer() const
|
||||
{
|
||||
return issuer_;
|
||||
}
|
||||
|
||||
private:
|
||||
Currency currency_;
|
||||
AccountID issuer_;
|
||||
};
|
||||
|
||||
} // namespace xrpl::test
|
||||
109
src/tests/libxrpl/helpers/TestFamily.h
Normal file
109
src/tests/libxrpl/helpers/TestFamily.h
Normal file
@@ -0,0 +1,109 @@
|
||||
#pragma once
|
||||
|
||||
#include <xrpl/basics/chrono.h>
|
||||
#include <xrpl/nodestore/DummyScheduler.h>
|
||||
#include <xrpl/nodestore/Manager.h>
|
||||
#include <xrpl/shamap/Family.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace xrpl::test {
|
||||
|
||||
/** Test implementation of Family for unit tests.
|
||||
|
||||
Uses an in-memory NodeStore database and simple caches.
|
||||
The missingNode methods throw since tests shouldn't encounter missing nodes.
|
||||
*/
|
||||
class TestFamily : public Family
|
||||
{
|
||||
private:
|
||||
std::unique_ptr<NodeStore::Database> db_;
|
||||
TestStopwatch clock_;
|
||||
std::shared_ptr<FullBelowCache> fbCache_;
|
||||
std::shared_ptr<TreeNodeCache> tnCache_;
|
||||
NodeStore::DummyScheduler scheduler_;
|
||||
beast::Journal j_;
|
||||
|
||||
public:
|
||||
explicit TestFamily(beast::Journal j)
|
||||
: fbCache_(std::make_shared<FullBelowCache>("TestFamily full below cache", clock_, j))
|
||||
, tnCache_(
|
||||
std::make_shared<TreeNodeCache>(
|
||||
"TestFamily tree node cache",
|
||||
65536,
|
||||
std::chrono::minutes{1},
|
||||
clock_,
|
||||
j))
|
||||
, j_(j)
|
||||
{
|
||||
Section config;
|
||||
config.set("type", "memory");
|
||||
config.set("path", "TestFamily");
|
||||
db_ = NodeStore::Manager::instance().makeDatabase(megabytes(4), scheduler_, 1, config, j);
|
||||
}
|
||||
|
||||
NodeStore::Database&
|
||||
db() override
|
||||
{
|
||||
return *db_;
|
||||
}
|
||||
|
||||
[[nodiscard]] NodeStore::Database const&
|
||||
db() const override
|
||||
{
|
||||
return *db_;
|
||||
}
|
||||
|
||||
beast::Journal const&
|
||||
journal() override
|
||||
{
|
||||
return j_;
|
||||
}
|
||||
|
||||
std::shared_ptr<FullBelowCache>
|
||||
getFullBelowCache() override
|
||||
{
|
||||
return fbCache_;
|
||||
}
|
||||
|
||||
std::shared_ptr<TreeNodeCache>
|
||||
getTreeNodeCache() override
|
||||
{
|
||||
return tnCache_;
|
||||
}
|
||||
|
||||
void
|
||||
sweep() override
|
||||
{
|
||||
fbCache_->sweep();
|
||||
tnCache_->sweep();
|
||||
}
|
||||
|
||||
void
|
||||
missingNodeAcquireBySeq(std::uint32_t refNum, uint256 const& nodeHash) override
|
||||
{
|
||||
Throw<std::runtime_error>("TestFamily: missing node (by seq)");
|
||||
}
|
||||
|
||||
void
|
||||
missingNodeAcquireByHash(uint256 const& refHash, std::uint32_t refNum) override
|
||||
{
|
||||
Throw<std::runtime_error>("TestFamily: missing node (by hash)");
|
||||
}
|
||||
|
||||
void
|
||||
reset() override
|
||||
{
|
||||
(*fbCache_).reset();
|
||||
(*tnCache_).reset();
|
||||
}
|
||||
|
||||
/** Access the test clock for time manipulation in tests. */
|
||||
TestStopwatch&
|
||||
clock()
|
||||
{
|
||||
return clock_;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace xrpl::test
|
||||
383
src/tests/libxrpl/helpers/TestServiceRegistry.h
Normal file
383
src/tests/libxrpl/helpers/TestServiceRegistry.h
Normal file
@@ -0,0 +1,383 @@
|
||||
#pragma once
|
||||
|
||||
#include <xrpl/basics/Log.h>
|
||||
#include <xrpl/basics/chrono.h>
|
||||
#include <xrpl/core/HashRouter.h>
|
||||
#include <xrpl/core/NetworkIDService.h>
|
||||
#include <xrpl/core/ServiceRegistry.h>
|
||||
#include <xrpl/ledger/PendingSaves.h>
|
||||
#include <xrpl/server/LoadFeeTrack.h>
|
||||
#include <xrpl/telemetry/Telemetry.h>
|
||||
|
||||
#include <boost/asio/io_context.hpp>
|
||||
|
||||
#include <helpers/TestFamily.h>
|
||||
#include <helpers/TestSink.h>
|
||||
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
|
||||
namespace xrpl::test {
|
||||
|
||||
/** Logs implementation that creates TestSink instances. */
|
||||
class TestLogs : public Logs
|
||||
{
|
||||
public:
|
||||
explicit TestLogs(beast::Severity level = beast::Severity::Warning) : Logs(level)
|
||||
{
|
||||
}
|
||||
|
||||
std::unique_ptr<beast::Journal::Sink>
|
||||
makeSink(std::string const&, beast::Severity threshold) override
|
||||
{
|
||||
return std::make_unique<TestSink>(threshold);
|
||||
}
|
||||
};
|
||||
|
||||
/** Simple NetworkIDService implementation for tests. */
|
||||
class TestNetworkIDService final : public NetworkIDService
|
||||
{
|
||||
public:
|
||||
explicit TestNetworkIDService(std::uint32_t networkID = 0) : networkID_(networkID)
|
||||
{
|
||||
}
|
||||
|
||||
[[nodiscard]] std::uint32_t
|
||||
getNetworkID() const noexcept override
|
||||
{
|
||||
return networkID_;
|
||||
}
|
||||
|
||||
private:
|
||||
std::uint32_t networkID_;
|
||||
};
|
||||
|
||||
/** Test implementation of ServiceRegistry for unit tests.
|
||||
|
||||
This class provides real implementations for services that can be
|
||||
instantiated from libxrpl (such as Logs, io_context, caches), and
|
||||
throws std::logic_error for services that require the full Application.
|
||||
|
||||
Tests can subclass this to provide additional services they need.
|
||||
*/
|
||||
class TestServiceRegistry : public ServiceRegistry
|
||||
{
|
||||
TestLogs logs_{beast::Severity::Warning};
|
||||
boost::asio::io_context ioContext_;
|
||||
TestFamily family_{logs_.journal("TestFamily")};
|
||||
LoadFeeTrack feeTrack_{logs_.journal("LoadFeeTrack")};
|
||||
TestNetworkIDService networkIDService_;
|
||||
HashRouter hashRouter_{HashRouter::Setup{}, stopwatch()};
|
||||
NodeCache tempNodeCache_{
|
||||
"TempNodeCache",
|
||||
16384,
|
||||
std::chrono::minutes{1},
|
||||
stopwatch(),
|
||||
logs_.journal("TaggedCache")};
|
||||
CachedSLEs cachedSLEs_{
|
||||
"CachedSLEs",
|
||||
16384,
|
||||
std::chrono::minutes{1},
|
||||
stopwatch(),
|
||||
logs_.journal("TaggedCache")};
|
||||
PendingSaves pendingSaves_;
|
||||
std::optional<uint256> trapTxID_;
|
||||
|
||||
public:
|
||||
TestServiceRegistry() = default;
|
||||
~TestServiceRegistry() override = default;
|
||||
|
||||
// Core infrastructure services
|
||||
CollectorManager&
|
||||
getCollectorManager() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getCollectorManager() not implemented");
|
||||
}
|
||||
|
||||
Family&
|
||||
getNodeFamily() override
|
||||
{
|
||||
return family_;
|
||||
}
|
||||
|
||||
TimeKeeper&
|
||||
getTimeKeeper() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::timeKeeper() not implemented");
|
||||
}
|
||||
|
||||
JobQueue&
|
||||
getJobQueue() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getJobQueue() not implemented");
|
||||
}
|
||||
|
||||
NodeCache&
|
||||
getTempNodeCache() override
|
||||
{
|
||||
return tempNodeCache_;
|
||||
}
|
||||
|
||||
CachedSLEs&
|
||||
getCachedSLEs() override
|
||||
{
|
||||
return cachedSLEs_;
|
||||
}
|
||||
|
||||
NetworkIDService&
|
||||
getNetworkIDService() override
|
||||
{
|
||||
return networkIDService_;
|
||||
}
|
||||
|
||||
// Protocol and validation services
|
||||
AmendmentTable&
|
||||
getAmendmentTable() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getAmendmentTable() not implemented");
|
||||
}
|
||||
|
||||
HashRouter&
|
||||
getHashRouter() override
|
||||
{
|
||||
return hashRouter_;
|
||||
}
|
||||
|
||||
LoadFeeTrack&
|
||||
getFeeTrack() override
|
||||
{
|
||||
return feeTrack_;
|
||||
}
|
||||
|
||||
LoadManager&
|
||||
getLoadManager() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getLoadManager() not implemented");
|
||||
}
|
||||
|
||||
RCLValidations&
|
||||
getValidations() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getValidations() not implemented");
|
||||
}
|
||||
|
||||
ValidatorList&
|
||||
getValidators() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::validators() not implemented");
|
||||
}
|
||||
|
||||
ValidatorSite&
|
||||
getValidatorSites() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::validatorSites() not implemented");
|
||||
}
|
||||
|
||||
ManifestCache&
|
||||
getValidatorManifests() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::validatorManifests() not implemented");
|
||||
}
|
||||
|
||||
ManifestCache&
|
||||
getPublisherManifests() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::publisherManifests() not implemented");
|
||||
}
|
||||
|
||||
// Network services
|
||||
Overlay&
|
||||
getOverlay() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::overlay() not implemented");
|
||||
}
|
||||
|
||||
Cluster&
|
||||
getCluster() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::cluster() not implemented");
|
||||
}
|
||||
|
||||
PeerReservationTable&
|
||||
getPeerReservations() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::peerReservations() not implemented");
|
||||
}
|
||||
|
||||
Resource::Manager&
|
||||
getResourceManager() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getResourceManager() not implemented");
|
||||
}
|
||||
|
||||
// Storage services
|
||||
NodeStore::Database&
|
||||
getNodeStore() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getNodeStore() not implemented");
|
||||
}
|
||||
|
||||
SHAMapStore&
|
||||
getSHAMapStore() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getSHAMapStore() not implemented");
|
||||
}
|
||||
|
||||
RelationalDatabase&
|
||||
getRelationalDatabase() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getRelationalDatabase() not implemented");
|
||||
}
|
||||
|
||||
// Ledger services
|
||||
InboundLedgers&
|
||||
getInboundLedgers() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getInboundLedgers() not implemented");
|
||||
}
|
||||
|
||||
InboundTransactions&
|
||||
getInboundTransactions() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getInboundTransactions() not implemented");
|
||||
}
|
||||
|
||||
TaggedCache<uint256, AcceptedLedger>&
|
||||
getAcceptedLedgerCache() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getAcceptedLedgerCache() not implemented");
|
||||
}
|
||||
|
||||
LedgerMaster&
|
||||
getLedgerMaster() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getLedgerMaster() not implemented");
|
||||
}
|
||||
|
||||
LedgerCleaner&
|
||||
getLedgerCleaner() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getLedgerCleaner() not implemented");
|
||||
}
|
||||
|
||||
LedgerReplayer&
|
||||
getLedgerReplayer() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getLedgerReplayer() not implemented");
|
||||
}
|
||||
|
||||
PendingSaves&
|
||||
getPendingSaves() override
|
||||
{
|
||||
return pendingSaves_;
|
||||
}
|
||||
|
||||
OpenLedger&
|
||||
getOpenLedger() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::openLedger() not implemented");
|
||||
}
|
||||
|
||||
OpenLedger const&
|
||||
getOpenLedger() const override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::openLedger() const not implemented");
|
||||
}
|
||||
|
||||
// Transaction and operation services
|
||||
NetworkOPs&
|
||||
getOPs() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getOPs() not implemented");
|
||||
}
|
||||
|
||||
OrderBookDB&
|
||||
getOrderBookDB() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getOrderBookDB() not implemented");
|
||||
}
|
||||
|
||||
TransactionMaster&
|
||||
getMasterTransaction() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getMasterTransaction() not implemented");
|
||||
}
|
||||
|
||||
TxQ&
|
||||
getTxQ() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getTxQ() not implemented");
|
||||
}
|
||||
|
||||
PathRequestManager&
|
||||
getPathRequestManager() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getPathRequestManager() not implemented");
|
||||
}
|
||||
|
||||
// Server services
|
||||
ServerHandler&
|
||||
getServerHandler() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getServerHandler() not implemented");
|
||||
}
|
||||
|
||||
perf::PerfLog&
|
||||
getPerfLog() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getPerfLog() not implemented");
|
||||
}
|
||||
|
||||
telemetry::Telemetry&
|
||||
getTelemetry() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getTelemetry() not implemented");
|
||||
}
|
||||
|
||||
// Configuration and state
|
||||
bool
|
||||
isStopping() const override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
beast::Journal
|
||||
getJournal(std::string const& name) override
|
||||
{
|
||||
return logs_.journal(name);
|
||||
}
|
||||
|
||||
boost::asio::io_context&
|
||||
getIOContext() override
|
||||
{
|
||||
return ioContext_;
|
||||
}
|
||||
|
||||
Logs&
|
||||
getLogs() override
|
||||
{
|
||||
return logs_;
|
||||
}
|
||||
|
||||
std::optional<uint256> const&
|
||||
getTrapTxID() const override
|
||||
{
|
||||
return trapTxID_;
|
||||
}
|
||||
|
||||
DatabaseCon&
|
||||
getWalletDB() override
|
||||
{
|
||||
throw std::logic_error("TestServiceRegistry::getWalletDB() not implemented");
|
||||
}
|
||||
|
||||
// Temporary: Get the underlying Application
|
||||
Application&
|
||||
getApp() override
|
||||
{
|
||||
throw std::logic_error(
|
||||
"TestServiceRegistry::app() not implemented - no Application available in tests");
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace xrpl::test
|
||||
@@ -18,12 +18,12 @@
|
||||
|
||||
namespace xrpl {
|
||||
|
||||
TestSink::TestSink(beast::severities::Severity threshold) : Sink(threshold, false)
|
||||
TestSink::TestSink(beast::Severity threshold) : Sink(threshold, false)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
TestSink::write(beast::severities::Severity level, std::string const& text)
|
||||
TestSink::write(beast::Severity level, std::string const& text)
|
||||
{
|
||||
if (level < threshold())
|
||||
return;
|
||||
@@ -31,7 +31,7 @@ TestSink::write(beast::severities::Severity level, std::string const& text)
|
||||
}
|
||||
|
||||
void
|
||||
TestSink::writeAlways(beast::severities::Severity level, std::string const& text)
|
||||
TestSink::writeAlways(beast::Severity level, std::string const& text)
|
||||
{
|
||||
auto supportsColor = [] {
|
||||
// 1. Check for "NO_COLOR" environment variable (Standard convention)
|
||||
@@ -64,17 +64,17 @@ TestSink::writeAlways(beast::severities::Severity level, std::string const& text
|
||||
auto color = [level]() {
|
||||
switch (level)
|
||||
{
|
||||
case beast::severities::kTrace:
|
||||
case beast::Severity::Trace:
|
||||
return "\033[34m"; // blue
|
||||
case beast::severities::kDebug:
|
||||
case beast::Severity::Debug:
|
||||
return "\033[32m"; // green
|
||||
case beast::severities::kInfo:
|
||||
case beast::Severity::Info:
|
||||
return "\033[36m"; // cyan
|
||||
case beast::severities::kWarning:
|
||||
case beast::Severity::Warning:
|
||||
return "\033[33m"; // yellow
|
||||
case beast::severities::kError:
|
||||
case beast::Severity::Error:
|
||||
return "\033[31m"; // red
|
||||
case beast::severities::kFatal:
|
||||
case beast::Severity::Fatal:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -84,17 +84,17 @@ TestSink::writeAlways(beast::severities::Severity level, std::string const& text
|
||||
auto prefix = [level]() {
|
||||
switch (level)
|
||||
{
|
||||
case beast::severities::kTrace:
|
||||
case beast::Severity::Trace:
|
||||
return "TRC:";
|
||||
case beast::severities::kDebug:
|
||||
case beast::Severity::Debug:
|
||||
return "DBG:";
|
||||
case beast::severities::kInfo:
|
||||
case beast::Severity::Info:
|
||||
return "INF:";
|
||||
case beast::severities::kWarning:
|
||||
case beast::Severity::Warning:
|
||||
return "WRN:";
|
||||
case beast::severities::kError:
|
||||
case beast::Severity::Error:
|
||||
return "ERR:";
|
||||
case beast::severities::kFatal:
|
||||
case beast::Severity::Fatal:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -104,19 +104,19 @@ TestSink::writeAlways(beast::severities::Severity level, std::string const& text
|
||||
auto& stream = [level]() -> std::ostream& {
|
||||
switch (level)
|
||||
{
|
||||
case beast::severities::kError:
|
||||
case beast::severities::kFatal:
|
||||
case beast::Severity::Error:
|
||||
case beast::Severity::Fatal:
|
||||
return std::cerr;
|
||||
default:
|
||||
return std::cout;
|
||||
}
|
||||
}();
|
||||
|
||||
constexpr auto reset = "\033[0m";
|
||||
static constexpr auto kReset = "\033[0m";
|
||||
|
||||
if (supportsColor)
|
||||
{
|
||||
stream << color << prefix << " " << text << reset << std::endl;
|
||||
stream << color << prefix << " " << text << kReset << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -13,12 +13,12 @@ public:
|
||||
return sink;
|
||||
}
|
||||
|
||||
TestSink(beast::severities::Severity threshold = beast::severities::kDebug);
|
||||
TestSink(beast::Severity threshold = beast::Severity::Debug);
|
||||
|
||||
void
|
||||
write(beast::severities::Severity level, std::string const& text) override;
|
||||
write(beast::Severity level, std::string const& text) override;
|
||||
|
||||
void
|
||||
writeAlways(beast::severities::Severity level, std::string const& text) override;
|
||||
writeAlways(beast::Severity level, std::string const& text) override;
|
||||
};
|
||||
} // namespace xrpl
|
||||
|
||||
252
src/tests/libxrpl/helpers/TxTest.cpp
Normal file
252
src/tests/libxrpl/helpers/TxTest.cpp
Normal file
@@ -0,0 +1,252 @@
|
||||
#include <helpers/TxTest.h>
|
||||
|
||||
#include <xrpl/basics/base_uint.h>
|
||||
#include <xrpl/basics/chrono.h>
|
||||
#include <xrpl/basics/contract.h>
|
||||
#include <xrpl/ledger/ApplyView.h>
|
||||
#include <xrpl/ledger/CanonicalTXSet.h>
|
||||
#include <xrpl/ledger/Ledger.h>
|
||||
#include <xrpl/ledger/OpenView.h>
|
||||
#include <xrpl/ledger/ReadView.h>
|
||||
#include <xrpl/protocol/AccountID.h>
|
||||
#include <xrpl/protocol/Feature.h>
|
||||
#include <xrpl/protocol/Fees.h>
|
||||
#include <xrpl/protocol/Indexes.h>
|
||||
#include <xrpl/protocol/SField.h>
|
||||
#include <xrpl/protocol/STLedgerEntry.h>
|
||||
#include <xrpl/protocol/STTx.h>
|
||||
#include <xrpl/protocol/TER.h>
|
||||
#include <xrpl/protocol_autogen/ledger_entries/AccountRoot.h>
|
||||
#include <xrpl/protocol_autogen/ledger_entries/RippleState.h>
|
||||
#include <xrpl/protocol_autogen/transactions/AccountSet.h>
|
||||
#include <xrpl/protocol_autogen/transactions/Payment.h>
|
||||
#include <xrpl/tx/apply.h>
|
||||
|
||||
#include <helpers/Account.h>
|
||||
#include <helpers/IOU.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace xrpl::test {
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Feature helpers
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
FeatureBitset
|
||||
allFeatures()
|
||||
{
|
||||
static FeatureBitset const kFeatures = [] {
|
||||
auto const& sa = allAmendments();
|
||||
std::vector<uint256> feats;
|
||||
feats.reserve(sa.size());
|
||||
for ([[maybe_unused]] auto const& [name, _] : sa)
|
||||
{
|
||||
if (auto const f = getRegisteredFeature(name); f.has_value())
|
||||
feats.push_back(*f);
|
||||
}
|
||||
return FeatureBitset(feats);
|
||||
}();
|
||||
return kFeatures;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// TxTest
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
TxTest::TxTest(std::optional<FeatureBitset> features)
|
||||
{
|
||||
// Convert FeatureBitset to unordered_set for Rules constructor
|
||||
auto const featureBits = features.value_or(allFeatures());
|
||||
foreachFeature(featureBits, [&](uint256 const& f) { featureSet_.insert(f); });
|
||||
|
||||
// Create rules with the specified features
|
||||
rules_.emplace(featureSet_);
|
||||
|
||||
// Default fees for testing
|
||||
Fees const fees{XRPAmount{10}, XRPAmount{10000000}, XRPAmount{2000000}};
|
||||
|
||||
// Create a genesis ledger as the base
|
||||
closedLedger_ = std::make_shared<Ledger>(
|
||||
kCreateGenesis,
|
||||
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
|
||||
*rules_,
|
||||
fees,
|
||||
std::vector<uint256>{featureSet_.begin(), featureSet_.end()},
|
||||
registry_.getNodeFamily());
|
||||
|
||||
// Initialize time from the genesis ledger
|
||||
now_ = closedLedger_->header().closeTime;
|
||||
|
||||
// Create an open view on top of the genesis ledger
|
||||
openLedger_ =
|
||||
std::make_shared<OpenView>(kOpenLedger, closedLedger_.get(), *rules_, closedLedger_);
|
||||
}
|
||||
|
||||
bool
|
||||
TxTest::isEnabled(uint256 const& feature) const
|
||||
{
|
||||
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
|
||||
return rules_->enabled(feature);
|
||||
}
|
||||
|
||||
Rules const&
|
||||
TxTest::getRules() const
|
||||
{
|
||||
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
|
||||
return *rules_;
|
||||
}
|
||||
|
||||
[[nodiscard]] TxResult
|
||||
TxTest::submit(std::shared_ptr<STTx const> stx)
|
||||
{
|
||||
auto result = apply(registry_, *openLedger_, *stx, TapNone, registry_.getJournal("apply"));
|
||||
|
||||
// Track successfully applied transactions for canonical reordering on close
|
||||
// We make a copy since the TransactionBase doesn't own the STTx
|
||||
if (result.applied)
|
||||
pendingTxs_.push_back(stx);
|
||||
|
||||
return TxResult{
|
||||
.ter = result.ter,
|
||||
.applied = result.applied,
|
||||
.metadata = std::move(result).metadata,
|
||||
.tx = std::move(stx)};
|
||||
}
|
||||
|
||||
void
|
||||
TxTest::createAccount(Account const& account, XRPAmount xrp, uint32_t accountFlags)
|
||||
{
|
||||
auto const paymentTer =
|
||||
submit(transactions::PaymentBuilder{Account::kMaster, account, xrp}, Account::kMaster).ter;
|
||||
|
||||
if (paymentTer != tesSUCCESS)
|
||||
{
|
||||
throw std::runtime_error("TxTest::createAccount: failed to create account");
|
||||
}
|
||||
|
||||
close();
|
||||
|
||||
if (accountFlags != 0)
|
||||
{
|
||||
auto const accountSetTer =
|
||||
submit(transactions::AccountSetBuilder{account}.setSetFlag(accountFlags), account).ter;
|
||||
if (accountSetTer != tesSUCCESS)
|
||||
{
|
||||
throw std::runtime_error("TxTest::createAccount: failed to set account flags");
|
||||
}
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
ledger_entries::AccountRoot
|
||||
TxTest::getAccountRoot(AccountID const& id) const
|
||||
{
|
||||
auto const sle = getOpenLedger().read(keylet::account(id));
|
||||
if (!sle)
|
||||
Throw<std::runtime_error>("TxTest::getAccountRoot: account not found");
|
||||
return ledger_entries::AccountRoot{std::const_pointer_cast<SLE const>(sle)};
|
||||
}
|
||||
|
||||
OpenView&
|
||||
TxTest::getOpenLedger()
|
||||
{
|
||||
return *openLedger_;
|
||||
}
|
||||
|
||||
OpenView const&
|
||||
TxTest::getOpenLedger() const
|
||||
{
|
||||
return *openLedger_;
|
||||
}
|
||||
|
||||
ReadView const&
|
||||
TxTest::getClosedLedger() const
|
||||
{
|
||||
return *closedLedger_;
|
||||
}
|
||||
|
||||
void
|
||||
TxTest::close()
|
||||
{
|
||||
// Build a new closed ledger from the previous closed ledger,
|
||||
// similar to how buildLedgerImpl works:
|
||||
// 1. Create a new Ledger from the previous closed ledger
|
||||
// 2. Re-apply transactions in canonical order
|
||||
// 3. Mark it as accepted/immutable
|
||||
|
||||
auto const& prevLedger = *closedLedger_;
|
||||
|
||||
auto const ledgerCloseTime = now_ + prevLedger.header().closeTimeResolution;
|
||||
|
||||
now_ = ledgerCloseTime;
|
||||
|
||||
auto newLedger = std::make_shared<Ledger>(prevLedger, ledgerCloseTime);
|
||||
|
||||
CanonicalTXSet txSet(prevLedger.header().hash);
|
||||
for (auto const& tx : pendingTxs_)
|
||||
txSet.insert(tx);
|
||||
|
||||
{
|
||||
OpenView accum(&*newLedger);
|
||||
for (auto const& [key, tx] : txSet)
|
||||
{
|
||||
auto result = apply(registry_, accum, *tx, TapNone, registry_.getJournal("apply"));
|
||||
if (!result.applied)
|
||||
{
|
||||
throw std::runtime_error("TxTest::close: failed to apply transaction");
|
||||
}
|
||||
}
|
||||
accum.apply(*newLedger);
|
||||
}
|
||||
|
||||
newLedger->setAccepted(ledgerCloseTime, newLedger->header().closeTimeResolution, true);
|
||||
|
||||
closedLedger_ = newLedger;
|
||||
|
||||
pendingTxs_.clear();
|
||||
|
||||
openLedger_ =
|
||||
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
|
||||
std::make_shared<OpenView>(kOpenLedger, closedLedger_.get(), *rules_, closedLedger_);
|
||||
}
|
||||
|
||||
void
|
||||
TxTest::advanceTime(NetClock::duration duration)
|
||||
{
|
||||
now_ += duration;
|
||||
}
|
||||
|
||||
NetClock::time_point
|
||||
TxTest::getCloseTime() const
|
||||
{
|
||||
return now_;
|
||||
}
|
||||
|
||||
STAmount
|
||||
TxTest::getBalance(AccountID const& account, IOU const& iou) const
|
||||
{
|
||||
auto const sle = openLedger_->read(keylet::line(account, iou.issue()));
|
||||
if (!sle)
|
||||
return STAmount{iou.issue(), 0};
|
||||
|
||||
auto const rippleState = ledger_entries::RippleState{sle};
|
||||
|
||||
auto balance = rippleState.getBalance();
|
||||
if (iou.issue().account == account)
|
||||
{
|
||||
throw std::logic_error("TxTest::getBalance: account is issuer");
|
||||
}
|
||||
|
||||
balance.get<Issue>().account = iou.issue().account;
|
||||
if (account > iou.issue().account)
|
||||
balance.negate();
|
||||
return balance;
|
||||
}
|
||||
|
||||
} // namespace xrpl::test
|
||||
364
src/tests/libxrpl/helpers/TxTest.h
Normal file
364
src/tests/libxrpl/helpers/TxTest.h
Normal file
@@ -0,0 +1,364 @@
|
||||
#pragma once
|
||||
|
||||
#include <xrpl/basics/Number.h>
|
||||
#include <xrpl/basics/chrono.h>
|
||||
#include <xrpl/beast/utility/Journal.h>
|
||||
#include <xrpl/core/ServiceRegistry.h>
|
||||
#include <xrpl/ledger/ApplyViewImpl.h>
|
||||
#include <xrpl/ledger/Ledger.h>
|
||||
#include <xrpl/ledger/OpenView.h>
|
||||
#include <xrpl/protocol/Feature.h>
|
||||
#include <xrpl/protocol/LedgerFormats.h>
|
||||
#include <xrpl/protocol/Rules.h>
|
||||
#include <xrpl/protocol/STTx.h>
|
||||
#include <xrpl/protocol/TER.h>
|
||||
#include <xrpl/protocol/TxFlags.h>
|
||||
#include <xrpl/protocol/XRPAmount.h>
|
||||
#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
|
||||
#include <xrpl/protocol_autogen/ledger_entries/AccountRoot.h>
|
||||
#include <xrpl/tx/applySteps.h>
|
||||
|
||||
#include <helpers/Account.h>
|
||||
#include <helpers/IOU.h>
|
||||
#include <helpers/TestServiceRegistry.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <concepts>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
#include <type_traits>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
namespace xrpl::test {
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Amount helpers
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Convert XRP to drops (integral types).
|
||||
* @param xrp The amount in XRP.
|
||||
* @return The equivalent amount in drops as XRPAmount.
|
||||
*/
|
||||
template <std::integral T>
|
||||
constexpr XRPAmount
|
||||
XRP(T xrp) // NOLINT(readability-identifier-naming)
|
||||
{
|
||||
return XRPAmount{static_cast<std::int64_t>(xrp) * kDropsPerXrp.drops()};
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Convert XRP to drops (floating point types).
|
||||
* @param xrp The amount in XRP (may be fractional).
|
||||
* @return The equivalent amount in drops as XRPAmount.
|
||||
*/
|
||||
template <std::floating_point T>
|
||||
XRPAmount
|
||||
XRP(T xrp)
|
||||
{
|
||||
return XRPAmount{static_cast<std::int64_t>(std::round(xrp * kDropsPerXrp.drops()))};
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Convert XRP to drops (Number type).
|
||||
* @param xrp The amount in XRP as a Number.
|
||||
* @return The equivalent amount in drops as XRPAmount.
|
||||
*/
|
||||
inline XRPAmount
|
||||
XRP(Number const& xrp)
|
||||
{
|
||||
return XRPAmount{static_cast<std::int64_t>(xrp * kDropsPerXrp.drops())};
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Flag helpers
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Convert AccountSet flag (asf) to LedgerState flag (lsf).
|
||||
* @param asf The AccountSet flag value.
|
||||
* @return The corresponding LedgerState flag.
|
||||
* @throws std::runtime_error if the flag is not supported.
|
||||
*
|
||||
* Supported flags:
|
||||
* asfRequireDest, asfRequireAuth, asfDisallowXRP, asfDisableMaster,
|
||||
* asfNoFreeze, asfGlobalFreeze, asfDefaultRipple, asfDepositAuth,
|
||||
* asfAllowTrustLineClawback, asfDisallowIncomingCheck,
|
||||
* asfDisallowIncomingNFTokenOffer, asfDisallowIncomingPayChan,
|
||||
* asfDisallowIncomingTrustline, asfAllowTrustLineLocking
|
||||
*/
|
||||
constexpr std::uint32_t
|
||||
asfToLsf(std::uint32_t asf)
|
||||
{
|
||||
switch (asf)
|
||||
{
|
||||
case asfRequireDest:
|
||||
return lsfRequireDestTag;
|
||||
case asfRequireAuth:
|
||||
return lsfRequireAuth;
|
||||
case asfDisallowXRP:
|
||||
return lsfDisallowXRP;
|
||||
case asfDisableMaster:
|
||||
return lsfDisableMaster;
|
||||
case asfNoFreeze:
|
||||
return lsfNoFreeze;
|
||||
case asfGlobalFreeze:
|
||||
return lsfGlobalFreeze;
|
||||
case asfDefaultRipple:
|
||||
return lsfDefaultRipple;
|
||||
case asfDepositAuth:
|
||||
return lsfDepositAuth;
|
||||
case asfAllowTrustLineClawback:
|
||||
return lsfAllowTrustLineClawback;
|
||||
case asfDisallowIncomingCheck:
|
||||
return lsfDisallowIncomingCheck;
|
||||
case asfDisallowIncomingNFTokenOffer:
|
||||
return lsfDisallowIncomingNFTokenOffer;
|
||||
case asfDisallowIncomingPayChan:
|
||||
return lsfDisallowIncomingPayChan;
|
||||
case asfDisallowIncomingTrustline:
|
||||
return lsfDisallowIncomingTrustline;
|
||||
case asfAllowTrustLineLocking:
|
||||
return lsfAllowTrustLineLocking;
|
||||
default:
|
||||
throw std::runtime_error("Unknown asf flag");
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Feature helpers
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Returns all testable amendments.
|
||||
* @note This is similar to jtx::testable_amendments() but for the TxTest framework.
|
||||
*/
|
||||
FeatureBitset
|
||||
allFeatures();
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// TxResult
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Result of a transaction submission in TxTest.
|
||||
*
|
||||
* Contains the TER code, whether the transaction was applied,
|
||||
* optional metadata, and a reference to the submitted transaction.
|
||||
* Use standard gtest macros (EXPECT_EQ, EXPECT_TRUE, etc.) to verify results.
|
||||
*/
|
||||
struct TxResult
|
||||
{
|
||||
TER ter; /**< The transaction engine result code. */
|
||||
bool applied; /**< Whether the transaction was applied to the ledger. */
|
||||
std::optional<TxMeta> metadata; /**< Transaction metadata, if available. */
|
||||
std::shared_ptr<STTx const> tx; /**< Pointer to the submitted transaction. */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief A lightweight transaction testing harness.
|
||||
*
|
||||
* Unlike the JTx framework which requires a full Application and RPC layer,
|
||||
* TxTest applies transactions directly to an OpenView using the transactor
|
||||
* pipeline (preflight -> preclaim -> doApply).
|
||||
*
|
||||
* This makes it suitable for:
|
||||
* - Unit testing individual transactors
|
||||
* - Testing transaction validation logic
|
||||
* - Fast, focused tests without full server infrastructure
|
||||
*
|
||||
* @code
|
||||
* TxTest env;
|
||||
* env.submit(paymentTx).expectSuccess();
|
||||
* env.submit(badTx).expectTer(tecNO_ENTRY);
|
||||
* @endcode
|
||||
*/
|
||||
class TxTest
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a TxTest environment.
|
||||
*
|
||||
* Creates a genesis ledger and an open view on top of it.
|
||||
*
|
||||
* @param features Optional set of features to enable. If not specified,
|
||||
* uses all testable amendments.
|
||||
*/
|
||||
explicit TxTest(std::optional<FeatureBitset> features = std::nullopt);
|
||||
|
||||
/**
|
||||
* @brief Check if a feature is enabled.
|
||||
* @param feature The feature to check.
|
||||
* @return True if the feature is enabled.
|
||||
*/
|
||||
[[nodiscard]] bool
|
||||
isEnabled(uint256 const& feature) const;
|
||||
|
||||
/**
|
||||
* @brief Get the current rules.
|
||||
* @return The current consensus rules.
|
||||
*/
|
||||
[[nodiscard]] Rules const&
|
||||
getRules() const;
|
||||
|
||||
/**
|
||||
* @brief Submit a transaction from a builder.
|
||||
*
|
||||
* Convenience overload that accepts transaction builders.
|
||||
* Automatically sets sequence and fee before submission.
|
||||
*
|
||||
* @tparam T A type derived from TransactionBuilderBase.
|
||||
* @param builder The transaction builder.
|
||||
* @param signer The account to sign with.
|
||||
* @return TxResult containing the result code, applied status, and metadata.
|
||||
*/
|
||||
template <typename T>
|
||||
requires std::
|
||||
derived_from<std::decay_t<T>, transactions::TransactionBuilderBase<std::decay_t<T>>>
|
||||
[[nodiscard]] TxResult
|
||||
submit(T&& builder, Account const& signer)
|
||||
{
|
||||
auto const& obj = builder.getSTObject();
|
||||
auto accountId = obj[sfAccount];
|
||||
// Only set sequence if not using a ticket (ticket sets sequence to 0)
|
||||
if (!obj.isFieldPresent(sfTicketSequence))
|
||||
{
|
||||
builder.setSequence(getAccountRoot(accountId).getSequence());
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.setSequence(0);
|
||||
}
|
||||
builder.setFee(XRPAmount(10));
|
||||
return submit(builder.build(signer.pk(), signer.sk()).getSTTx());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Submit a transaction to the open ledger.
|
||||
*
|
||||
* Applies the transaction through the full transactor pipeline:
|
||||
* preflight -> preclaim -> doApply -> invariant checks
|
||||
*
|
||||
* Invariant checks are automatically run after doApply. If any
|
||||
* invariant fails, the result will be tecINVARIANT_FAILED.
|
||||
*
|
||||
* @param stx The transaction to submit.
|
||||
* @return TxResult containing the result code, applied status, and metadata.
|
||||
*/
|
||||
[[nodiscard]] TxResult
|
||||
submit(std::shared_ptr<STTx const> stx);
|
||||
|
||||
/**
|
||||
* @brief Create a new account in the ledger.
|
||||
*
|
||||
* Sends a Payment from the master account to create and fund the account.
|
||||
* Closes the ledger after creation. If accountFlags is non-zero, submits
|
||||
* an AccountSet transaction and closes again.
|
||||
*
|
||||
* @param account The account to create.
|
||||
* @param xrp The initial XRP balance.
|
||||
* @param accountFlags Optional account flags to set. Defaults to 0
|
||||
* (no flags).
|
||||
*/
|
||||
void
|
||||
createAccount(Account const& account, XRPAmount xrp, uint32_t accountFlags = 0);
|
||||
|
||||
/**
|
||||
* @brief Get the account root object from the current open ledger.
|
||||
* @param id The account ID.
|
||||
* @return The AccountRoot ledger entry.
|
||||
* @throws std::runtime_error if the account does not exist.
|
||||
* @todo Once we make keylet strongly typed, we can ditch this method.
|
||||
*/
|
||||
[[nodiscard]] ledger_entries::AccountRoot
|
||||
getAccountRoot(AccountID const& id) const;
|
||||
|
||||
/**
|
||||
* @brief Get the current open ledger view.
|
||||
* @return A mutable reference to the open ledger.
|
||||
*/
|
||||
[[nodiscard]] OpenView&
|
||||
getOpenLedger();
|
||||
|
||||
/**
|
||||
* @brief Get the current open ledger view (const).
|
||||
* @return A const reference to the open ledger.
|
||||
*/
|
||||
[[nodiscard]] OpenView const&
|
||||
getOpenLedger() const;
|
||||
|
||||
/**
|
||||
* @brief Get the closed (base) ledger view.
|
||||
* @return A const reference to the closed ledger.
|
||||
*/
|
||||
[[nodiscard]] ReadView const&
|
||||
getClosedLedger() const;
|
||||
|
||||
/**
|
||||
* @brief Close the current ledger.
|
||||
*
|
||||
* Creates a new closed ledger from the current open ledger.
|
||||
* All pending transactions are re-applied in canonical order.
|
||||
*/
|
||||
void
|
||||
close();
|
||||
|
||||
/**
|
||||
* @brief Advance time without closing the ledger.
|
||||
*
|
||||
* Useful for testing time-dependent features like escrow release
|
||||
* times or offer expirations.
|
||||
*
|
||||
* @param duration The amount of time to advance.
|
||||
*/
|
||||
void
|
||||
advanceTime(NetClock::duration duration);
|
||||
|
||||
/**
|
||||
* @brief Get the current ledger close time.
|
||||
* @return The current close time.
|
||||
*/
|
||||
[[nodiscard]] NetClock::time_point
|
||||
getCloseTime() const;
|
||||
|
||||
/**
|
||||
* @brief Get the balance of an IOU for an account.
|
||||
*
|
||||
* Returns the balance from the perspective of the specified account.
|
||||
* If the trust line doesn't exist, returns zero.
|
||||
*
|
||||
* @param account The account to check.
|
||||
* @param iou The IOU to check the balance for.
|
||||
* @return The balance as an STAmount.
|
||||
* @todo Once we make keylet strongly typed, we can ditch this method.
|
||||
*/
|
||||
[[nodiscard]] STAmount
|
||||
getBalance(AccountID const& account, IOU const& iou) const;
|
||||
|
||||
/**
|
||||
* @brief Get the service registry.
|
||||
* @return A reference to the service registry.
|
||||
*/
|
||||
ServiceRegistry&
|
||||
getServiceRegistry()
|
||||
{
|
||||
return registry_;
|
||||
}
|
||||
|
||||
private:
|
||||
TestServiceRegistry registry_;
|
||||
std::unordered_set<uint256, beast::Uhash<>> featureSet_;
|
||||
std::optional<Rules> rules_;
|
||||
std::shared_ptr<Ledger const> closedLedger_;
|
||||
std::shared_ptr<OpenView> openLedger_;
|
||||
|
||||
/** Transactions submitted to the open ledger, for canonical reordering on close. */
|
||||
std::vector<std::shared_ptr<STTx const>> pendingTxs_;
|
||||
|
||||
/** Current time (can be advanced arbitrarily for testing). */
|
||||
NetClock::time_point now_;
|
||||
};
|
||||
|
||||
} // namespace xrpl::test
|
||||
@@ -8,18 +8,18 @@
|
||||
#include <string>
|
||||
|
||||
using namespace xrpl;
|
||||
using namespace Json;
|
||||
using namespace json;
|
||||
|
||||
static void
|
||||
checkOutput(std::string const& valueDesc)
|
||||
{
|
||||
std::string output;
|
||||
Json::Value value;
|
||||
ASSERT_TRUE(Json::Reader().parse(valueDesc, value));
|
||||
json::Value value;
|
||||
ASSERT_TRUE(json::Reader().parse(valueDesc, value));
|
||||
auto out = stringOutput(output);
|
||||
outputJson(value, out);
|
||||
|
||||
auto expected = Json::FastWriter().write(value);
|
||||
auto expected = json::FastWriter().write(value);
|
||||
EXPECT_EQ(output, expected);
|
||||
EXPECT_EQ(output, valueDesc);
|
||||
EXPECT_EQ(output, jsonAsString(value));
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,31 +9,31 @@
|
||||
#include <string>
|
||||
|
||||
using namespace xrpl;
|
||||
using namespace Json;
|
||||
using namespace json;
|
||||
|
||||
class WriterFixture : public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
std::string output;
|
||||
std::unique_ptr<Writer> writer;
|
||||
std::string output_;
|
||||
std::unique_ptr<Writer> writer_;
|
||||
|
||||
void
|
||||
SetUp() override
|
||||
{
|
||||
writer = std::make_unique<Writer>(stringOutput(output));
|
||||
writer_ = std::make_unique<Writer>(stringOutput(output_));
|
||||
}
|
||||
|
||||
void
|
||||
reset()
|
||||
{
|
||||
output.clear();
|
||||
writer = std::make_unique<Writer>(stringOutput(output));
|
||||
output_.clear();
|
||||
writer_ = std::make_unique<Writer>(stringOutput(output_));
|
||||
}
|
||||
|
||||
void
|
||||
expectOutput(std::string const& expected) const
|
||||
{
|
||||
EXPECT_EQ(output, expected);
|
||||
EXPECT_EQ(output_, expected);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -46,128 +46,128 @@ protected:
|
||||
|
||||
TEST_F(WriterFixture, trivial)
|
||||
{
|
||||
EXPECT_TRUE(output.empty());
|
||||
EXPECT_TRUE(output_.empty());
|
||||
checkOutputAndReset("");
|
||||
}
|
||||
|
||||
TEST_F(WriterFixture, near_trivial)
|
||||
{
|
||||
EXPECT_TRUE(output.empty());
|
||||
writer->output(0);
|
||||
EXPECT_TRUE(output_.empty());
|
||||
writer_->output(0);
|
||||
checkOutputAndReset("0");
|
||||
}
|
||||
|
||||
TEST_F(WriterFixture, primitives)
|
||||
{
|
||||
writer->output(true);
|
||||
writer_->output(true);
|
||||
checkOutputAndReset("true");
|
||||
|
||||
writer->output(false);
|
||||
writer_->output(false);
|
||||
checkOutputAndReset("false");
|
||||
|
||||
writer->output(23);
|
||||
writer_->output(23);
|
||||
checkOutputAndReset("23");
|
||||
|
||||
writer->output(23.0);
|
||||
writer_->output(23.0);
|
||||
checkOutputAndReset("23.0");
|
||||
|
||||
writer->output(23.5);
|
||||
writer_->output(23.5);
|
||||
checkOutputAndReset("23.5");
|
||||
|
||||
writer->output("a string");
|
||||
writer_->output("a string");
|
||||
checkOutputAndReset(R"("a string")");
|
||||
|
||||
writer->output(nullptr);
|
||||
writer_->output(nullptr);
|
||||
checkOutputAndReset("null");
|
||||
}
|
||||
|
||||
TEST_F(WriterFixture, empty)
|
||||
{
|
||||
writer->startRoot(Writer::array);
|
||||
writer->finish();
|
||||
writer_->startRoot(Writer::CollectionType::Array);
|
||||
writer_->finish();
|
||||
checkOutputAndReset("[]");
|
||||
|
||||
writer->startRoot(Writer::object);
|
||||
writer->finish();
|
||||
writer_->startRoot(Writer::CollectionType::Object);
|
||||
writer_->finish();
|
||||
checkOutputAndReset("{}");
|
||||
}
|
||||
|
||||
TEST_F(WriterFixture, escaping)
|
||||
{
|
||||
writer->output("\\");
|
||||
writer_->output("\\");
|
||||
checkOutputAndReset(R"("\\")");
|
||||
|
||||
writer->output("\"");
|
||||
writer_->output("\"");
|
||||
checkOutputAndReset(R"("\"")");
|
||||
|
||||
writer->output("\\\"");
|
||||
writer_->output("\\\"");
|
||||
checkOutputAndReset(R"("\\\"")");
|
||||
|
||||
writer->output("this contains a \\ in the middle of it.");
|
||||
writer_->output("this contains a \\ in the middle of it.");
|
||||
checkOutputAndReset(R"("this contains a \\ in the middle of it.")");
|
||||
|
||||
writer->output("\b\f\n\r\t");
|
||||
writer_->output("\b\f\n\r\t");
|
||||
checkOutputAndReset(R"("\b\f\n\r\t")");
|
||||
}
|
||||
|
||||
TEST_F(WriterFixture, array)
|
||||
{
|
||||
writer->startRoot(Writer::array);
|
||||
writer->append(12);
|
||||
writer->finish();
|
||||
writer_->startRoot(Writer::CollectionType::Array);
|
||||
writer_->append(12);
|
||||
writer_->finish();
|
||||
checkOutputAndReset("[12]");
|
||||
}
|
||||
|
||||
TEST_F(WriterFixture, long_array)
|
||||
{
|
||||
writer->startRoot(Writer::array);
|
||||
writer->append(12);
|
||||
writer->append(true);
|
||||
writer->append("hello");
|
||||
writer->finish();
|
||||
writer_->startRoot(Writer::CollectionType::Array);
|
||||
writer_->append(12);
|
||||
writer_->append(true);
|
||||
writer_->append("hello");
|
||||
writer_->finish();
|
||||
checkOutputAndReset(R"([12,true,"hello"])");
|
||||
}
|
||||
|
||||
TEST_F(WriterFixture, embedded_array_simple)
|
||||
{
|
||||
writer->startRoot(Writer::array);
|
||||
writer->startAppend(Writer::array);
|
||||
writer->finish();
|
||||
writer->finish();
|
||||
writer_->startRoot(Writer::CollectionType::Array);
|
||||
writer_->startAppend(Writer::CollectionType::Array);
|
||||
writer_->finish();
|
||||
writer_->finish();
|
||||
checkOutputAndReset("[[]]");
|
||||
}
|
||||
|
||||
TEST_F(WriterFixture, object)
|
||||
{
|
||||
writer->startRoot(Writer::object);
|
||||
writer->set("hello", "world");
|
||||
writer->finish();
|
||||
writer_->startRoot(Writer::CollectionType::Object);
|
||||
writer_->set("hello", "world");
|
||||
writer_->finish();
|
||||
checkOutputAndReset(R"({"hello":"world"})");
|
||||
}
|
||||
|
||||
TEST_F(WriterFixture, complex_object)
|
||||
{
|
||||
writer->startRoot(Writer::object);
|
||||
writer->set("hello", "world");
|
||||
writer->startSet(Writer::array, "array");
|
||||
writer->append(true);
|
||||
writer->append(12);
|
||||
writer->startAppend(Writer::array);
|
||||
writer->startAppend(Writer::object);
|
||||
writer->set("goodbye", "cruel world.");
|
||||
writer->startSet(Writer::array, "subarray");
|
||||
writer->append(23.5);
|
||||
writer->finishAll();
|
||||
writer_->startRoot(Writer::CollectionType::Object);
|
||||
writer_->set("hello", "world");
|
||||
writer_->startSet(Writer::CollectionType::Array, "array");
|
||||
writer_->append(true);
|
||||
writer_->append(12);
|
||||
writer_->startAppend(Writer::CollectionType::Array);
|
||||
writer_->startAppend(Writer::CollectionType::Object);
|
||||
writer_->set("goodbye", "cruel world.");
|
||||
writer_->startSet(Writer::CollectionType::Array, "subarray");
|
||||
writer_->append(23.5);
|
||||
writer_->finishAll();
|
||||
checkOutputAndReset(
|
||||
R"({"hello":"world","array":[true,12,[{"goodbye":"cruel world.","subarray":[23.5]}]]})");
|
||||
}
|
||||
|
||||
TEST_F(WriterFixture, json_value)
|
||||
{
|
||||
Json::Value value(Json::objectValue);
|
||||
json::Value value(json::ValueType::Object);
|
||||
value["foo"] = 23;
|
||||
writer->startRoot(Writer::object);
|
||||
writer->set("hello", value);
|
||||
writer->finish();
|
||||
writer_->startRoot(Writer::CollectionType::Object);
|
||||
writer_->set("hello", value);
|
||||
writer_->finish();
|
||||
checkOutputAndReset(R"({"hello":{"foo":23}})");
|
||||
}
|
||||
|
||||
@@ -28,60 +28,60 @@ namespace xrpl {
|
||||
|
||||
// Typed field canonical values
|
||||
|
||||
using Uint8Value = std::decay_t<typename SF_UINT8::type::value_type>;
|
||||
inline Uint8Value
|
||||
using UInt8Value = std::decay_t<typename SF_UINT8::type::value_type>;
|
||||
inline UInt8Value
|
||||
canonical_UINT8()
|
||||
{
|
||||
return Uint8Value{1};
|
||||
return UInt8Value{1};
|
||||
}
|
||||
|
||||
using Uint16Value = std::decay_t<typename SF_UINT16::type::value_type>;
|
||||
inline Uint16Value
|
||||
using UInt16Value = std::decay_t<typename SF_UINT16::type::value_type>;
|
||||
inline UInt16Value
|
||||
canonical_UINT16()
|
||||
{
|
||||
return Uint16Value{1};
|
||||
return UInt16Value{1};
|
||||
}
|
||||
|
||||
using Uint32Value = std::decay_t<typename SF_UINT32::type::value_type>;
|
||||
inline Uint32Value
|
||||
using UInt32Value = std::decay_t<typename SF_UINT32::type::value_type>;
|
||||
inline UInt32Value
|
||||
canonical_UINT32()
|
||||
{
|
||||
return Uint32Value{1};
|
||||
return UInt32Value{1};
|
||||
}
|
||||
|
||||
using Uint64Value = std::decay_t<typename SF_UINT64::type::value_type>;
|
||||
inline Uint64Value
|
||||
using UInt64Value = std::decay_t<typename SF_UINT64::type::value_type>;
|
||||
inline UInt64Value
|
||||
canonical_UINT64()
|
||||
{
|
||||
return Uint64Value{1};
|
||||
return UInt64Value{1};
|
||||
}
|
||||
|
||||
using Uint128Value = std::decay_t<typename SF_UINT128::type::value_type>;
|
||||
inline Uint128Value
|
||||
using UInt128Value = std::decay_t<typename SF_UINT128::type::value_type>;
|
||||
inline UInt128Value
|
||||
canonical_UINT128()
|
||||
{
|
||||
return Uint128Value{1};
|
||||
return UInt128Value{1};
|
||||
}
|
||||
|
||||
using Uint160Value = std::decay_t<typename SF_UINT160::type::value_type>;
|
||||
inline Uint160Value
|
||||
using UInt160Value = std::decay_t<typename SF_UINT160::type::value_type>;
|
||||
inline UInt160Value
|
||||
canonical_UINT160()
|
||||
{
|
||||
return Uint160Value{1};
|
||||
return UInt160Value{1};
|
||||
}
|
||||
|
||||
using Uint192Value = std::decay_t<typename SF_UINT192::type::value_type>;
|
||||
inline Uint192Value
|
||||
using UInt192Value = std::decay_t<typename SF_UINT192::type::value_type>;
|
||||
inline UInt192Value
|
||||
canonical_UINT192()
|
||||
{
|
||||
return Uint192Value{1};
|
||||
return UInt192Value{1};
|
||||
}
|
||||
|
||||
using Uint256Value = std::decay_t<typename SF_UINT256::type::value_type>;
|
||||
inline Uint256Value
|
||||
using UInt256Value = std::decay_t<typename SF_UINT256::type::value_type>;
|
||||
inline UInt256Value
|
||||
canonical_UINT256()
|
||||
{
|
||||
return Uint256Value{1};
|
||||
return UInt256Value{1};
|
||||
}
|
||||
|
||||
using Int32Value = std::decay_t<typename SF_INT32::type::value_type>;
|
||||
@@ -166,7 +166,7 @@ inline STPathSet
|
||||
canonical_PATHSET()
|
||||
{
|
||||
STPathSet result{};
|
||||
result.push_back(STPath{});
|
||||
result.pushBack(STPath{});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ TEST(DelegateTests, BuilderSettersRoundTrip)
|
||||
auto const authorizeValue = canonical_ACCOUNT();
|
||||
auto const permissionsValue = canonical_ARRAY();
|
||||
auto const ownerNodeValue = canonical_UINT64();
|
||||
auto const destinationNodeValue = canonical_UINT64();
|
||||
auto const previousTxnIDValue = canonical_UINT256();
|
||||
auto const previousTxnLgrSeqValue = canonical_UINT32();
|
||||
|
||||
@@ -36,6 +37,7 @@ TEST(DelegateTests, BuilderSettersRoundTrip)
|
||||
previousTxnLgrSeqValue
|
||||
};
|
||||
|
||||
builder.setDestinationNode(destinationNodeValue);
|
||||
|
||||
builder.setLedgerIndex(index);
|
||||
builder.setFlags(0x1u);
|
||||
@@ -82,6 +84,14 @@ TEST(DelegateTests, BuilderSettersRoundTrip)
|
||||
expectEqualField(expected, actual, "sfPreviousTxnLgrSeq");
|
||||
}
|
||||
|
||||
{
|
||||
auto const& expected = destinationNodeValue;
|
||||
auto const actualOpt = entry.getDestinationNode();
|
||||
ASSERT_TRUE(actualOpt.has_value());
|
||||
expectEqualField(expected, *actualOpt, "sfDestinationNode");
|
||||
EXPECT_TRUE(entry.hasDestinationNode());
|
||||
}
|
||||
|
||||
EXPECT_TRUE(entry.hasLedgerIndex());
|
||||
auto const ledgerIndex = entry.getLedgerIndex();
|
||||
ASSERT_TRUE(ledgerIndex.has_value());
|
||||
@@ -99,6 +109,7 @@ TEST(DelegateTests, BuilderFromSleRoundTrip)
|
||||
auto const authorizeValue = canonical_ACCOUNT();
|
||||
auto const permissionsValue = canonical_ARRAY();
|
||||
auto const ownerNodeValue = canonical_UINT64();
|
||||
auto const destinationNodeValue = canonical_UINT64();
|
||||
auto const previousTxnIDValue = canonical_UINT256();
|
||||
auto const previousTxnLgrSeqValue = canonical_UINT32();
|
||||
|
||||
@@ -108,6 +119,7 @@ TEST(DelegateTests, BuilderFromSleRoundTrip)
|
||||
sle->at(sfAuthorize) = authorizeValue;
|
||||
sle->setFieldArray(sfPermissions, permissionsValue);
|
||||
sle->at(sfOwnerNode) = ownerNodeValue;
|
||||
sle->at(sfDestinationNode) = destinationNodeValue;
|
||||
sle->at(sfPreviousTxnID) = previousTxnIDValue;
|
||||
sle->at(sfPreviousTxnLgrSeq) = previousTxnLgrSeqValue;
|
||||
|
||||
@@ -180,6 +192,19 @@ TEST(DelegateTests, BuilderFromSleRoundTrip)
|
||||
expectEqualField(expected, fromBuilder, "sfPreviousTxnLgrSeq");
|
||||
}
|
||||
|
||||
{
|
||||
auto const& expected = destinationNodeValue;
|
||||
|
||||
auto const fromSleOpt = entryFromSle.getDestinationNode();
|
||||
auto const fromBuilderOpt = entryFromBuilder.getDestinationNode();
|
||||
|
||||
ASSERT_TRUE(fromSleOpt.has_value());
|
||||
ASSERT_TRUE(fromBuilderOpt.has_value());
|
||||
|
||||
expectEqualField(expected, *fromSleOpt, "sfDestinationNode");
|
||||
expectEqualField(expected, *fromBuilderOpt, "sfDestinationNode");
|
||||
}
|
||||
|
||||
EXPECT_EQ(entryFromSle.getKey(), index);
|
||||
EXPECT_EQ(entryFromBuilder.getKey(), index);
|
||||
}
|
||||
@@ -220,4 +245,31 @@ TEST(DelegateTests, BuilderThrowsOnWrongEntryType)
|
||||
EXPECT_THROW(DelegateBuilder{wrongEntry.getSle()}, std::runtime_error);
|
||||
}
|
||||
|
||||
// 5) Build with only required fields and verify optional fields return nullopt.
|
||||
TEST(DelegateTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
uint256 const index{3u};
|
||||
|
||||
auto const accountValue = canonical_ACCOUNT();
|
||||
auto const authorizeValue = canonical_ACCOUNT();
|
||||
auto const permissionsValue = canonical_ARRAY();
|
||||
auto const ownerNodeValue = canonical_UINT64();
|
||||
auto const previousTxnIDValue = canonical_UINT256();
|
||||
auto const previousTxnLgrSeqValue = canonical_UINT32();
|
||||
|
||||
DelegateBuilder builder{
|
||||
accountValue,
|
||||
authorizeValue,
|
||||
permissionsValue,
|
||||
ownerNodeValue,
|
||||
previousTxnIDValue,
|
||||
previousTxnLgrSeqValue
|
||||
};
|
||||
|
||||
auto const entry = builder.build(index);
|
||||
|
||||
// Verify optional fields are not present
|
||||
EXPECT_FALSE(entry.hasDestinationNode());
|
||||
EXPECT_FALSE(entry.getDestinationNode().has_value());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ TEST(MPTokenIssuanceTests, BuilderSettersRoundTrip)
|
||||
auto const previousTxnLgrSeqValue = canonical_UINT32();
|
||||
auto const domainIDValue = canonical_UINT256();
|
||||
auto const mutableFlagsValue = canonical_UINT32();
|
||||
auto const referenceHoldingValue = canonical_UINT256();
|
||||
|
||||
MPTokenIssuanceBuilder builder{
|
||||
issuerValue,
|
||||
@@ -50,6 +51,7 @@ TEST(MPTokenIssuanceTests, BuilderSettersRoundTrip)
|
||||
builder.setMPTokenMetadata(mPTokenMetadataValue);
|
||||
builder.setDomainID(domainIDValue);
|
||||
builder.setMutableFlags(mutableFlagsValue);
|
||||
builder.setReferenceHolding(referenceHoldingValue);
|
||||
|
||||
builder.setLedgerIndex(index);
|
||||
builder.setFlags(0x1u);
|
||||
@@ -152,6 +154,14 @@ TEST(MPTokenIssuanceTests, BuilderSettersRoundTrip)
|
||||
EXPECT_TRUE(entry.hasMutableFlags());
|
||||
}
|
||||
|
||||
{
|
||||
auto const& expected = referenceHoldingValue;
|
||||
auto const actualOpt = entry.getReferenceHolding();
|
||||
ASSERT_TRUE(actualOpt.has_value());
|
||||
expectEqualField(expected, *actualOpt, "sfReferenceHolding");
|
||||
EXPECT_TRUE(entry.hasReferenceHolding());
|
||||
}
|
||||
|
||||
EXPECT_TRUE(entry.hasLedgerIndex());
|
||||
auto const ledgerIndex = entry.getLedgerIndex();
|
||||
ASSERT_TRUE(ledgerIndex.has_value());
|
||||
@@ -178,6 +188,7 @@ TEST(MPTokenIssuanceTests, BuilderFromSleRoundTrip)
|
||||
auto const previousTxnLgrSeqValue = canonical_UINT32();
|
||||
auto const domainIDValue = canonical_UINT256();
|
||||
auto const mutableFlagsValue = canonical_UINT32();
|
||||
auto const referenceHoldingValue = canonical_UINT256();
|
||||
|
||||
auto sle = std::make_shared<SLE>(MPTokenIssuance::entryType, index);
|
||||
|
||||
@@ -194,6 +205,7 @@ TEST(MPTokenIssuanceTests, BuilderFromSleRoundTrip)
|
||||
sle->at(sfPreviousTxnLgrSeq) = previousTxnLgrSeqValue;
|
||||
sle->at(sfDomainID) = domainIDValue;
|
||||
sle->at(sfMutableFlags) = mutableFlagsValue;
|
||||
sle->at(sfReferenceHolding) = referenceHoldingValue;
|
||||
|
||||
MPTokenIssuanceBuilder builderFromSle{sle};
|
||||
EXPECT_TRUE(builderFromSle.validate());
|
||||
@@ -355,6 +367,19 @@ TEST(MPTokenIssuanceTests, BuilderFromSleRoundTrip)
|
||||
expectEqualField(expected, *fromBuilderOpt, "sfMutableFlags");
|
||||
}
|
||||
|
||||
{
|
||||
auto const& expected = referenceHoldingValue;
|
||||
|
||||
auto const fromSleOpt = entryFromSle.getReferenceHolding();
|
||||
auto const fromBuilderOpt = entryFromBuilder.getReferenceHolding();
|
||||
|
||||
ASSERT_TRUE(fromSleOpt.has_value());
|
||||
ASSERT_TRUE(fromBuilderOpt.has_value());
|
||||
|
||||
expectEqualField(expected, *fromSleOpt, "sfReferenceHolding");
|
||||
expectEqualField(expected, *fromBuilderOpt, "sfReferenceHolding");
|
||||
}
|
||||
|
||||
EXPECT_EQ(entryFromSle.getKey(), index);
|
||||
EXPECT_EQ(entryFromBuilder.getKey(), index);
|
||||
}
|
||||
@@ -433,5 +458,7 @@ TEST(MPTokenIssuanceTests, OptionalFieldsReturnNullopt)
|
||||
EXPECT_FALSE(entry.getDomainID().has_value());
|
||||
EXPECT_FALSE(entry.hasMutableFlags());
|
||||
EXPECT_FALSE(entry.getMutableFlags().has_value());
|
||||
EXPECT_FALSE(entry.hasReferenceHolding());
|
||||
EXPECT_FALSE(entry.getReferenceHolding().has_value());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsAMMBidTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMBid"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMBid"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -108,7 +108,7 @@ TEST(TransactionsAMMBidTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMBidFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMBidFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -192,7 +192,7 @@ TEST(TransactionsAMMBidTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -206,7 +206,7 @@ TEST(TransactionsAMMBidTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -220,7 +220,7 @@ TEST(TransactionsAMMBidTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMBidNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMBidNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsAMMClawbackTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMClawback"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMClawback"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -96,7 +96,7 @@ TEST(TransactionsAMMClawbackTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMClawbackFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMClawbackFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -170,7 +170,7 @@ TEST(TransactionsAMMClawbackTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -184,7 +184,7 @@ TEST(TransactionsAMMClawbackTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -198,7 +198,7 @@ TEST(TransactionsAMMClawbackTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMClawbackNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMClawbackNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsAMMCreateTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMCreate"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMCreate"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -86,7 +86,7 @@ TEST(TransactionsAMMCreateTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMCreateFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMCreateFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -151,7 +151,7 @@ TEST(TransactionsAMMCreateTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -165,7 +165,7 @@ TEST(TransactionsAMMCreateTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsAMMDeleteTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMDelete"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMDelete"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -78,7 +78,7 @@ TEST(TransactionsAMMDeleteTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMDeleteFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMDeleteFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -135,7 +135,7 @@ TEST(TransactionsAMMDeleteTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -149,7 +149,7 @@ TEST(TransactionsAMMDeleteTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsAMMDepositTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMDeposit"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMDeposit"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -128,7 +128,7 @@ TEST(TransactionsAMMDepositTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMDepositFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMDepositFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -230,7 +230,7 @@ TEST(TransactionsAMMDepositTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -244,7 +244,7 @@ TEST(TransactionsAMMDepositTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -258,7 +258,7 @@ TEST(TransactionsAMMDepositTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMDepositNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMDepositNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsAMMVoteTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMVote"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMVote"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -86,7 +86,7 @@ TEST(TransactionsAMMVoteTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMVoteFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMVoteFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -151,7 +151,7 @@ TEST(TransactionsAMMVoteTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -165,7 +165,7 @@ TEST(TransactionsAMMVoteTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsAMMWithdrawTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMWithdraw"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMWithdraw"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -118,7 +118,7 @@ TEST(TransactionsAMMWithdrawTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMWithdrawFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMWithdrawFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -211,7 +211,7 @@ TEST(TransactionsAMMWithdrawTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -225,7 +225,7 @@ TEST(TransactionsAMMWithdrawTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -239,7 +239,7 @@ TEST(TransactionsAMMWithdrawTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAMMWithdrawNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAMMWithdrawNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsAccountDeleteTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAccountDelete"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAccountDelete"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -90,7 +90,7 @@ TEST(TransactionsAccountDeleteTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAccountDeleteFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAccountDeleteFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -157,7 +157,7 @@ TEST(TransactionsAccountDeleteTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -171,7 +171,7 @@ TEST(TransactionsAccountDeleteTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -185,7 +185,7 @@ TEST(TransactionsAccountDeleteTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAccountDeleteNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAccountDeleteNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsAccountSetTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAccountSet"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAccountSet"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -162,7 +162,7 @@ TEST(TransactionsAccountSetTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAccountSetFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAccountSetFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -293,7 +293,7 @@ TEST(TransactionsAccountSetTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
OfferCancelBuilder wrongBuilder{account, canonical_UINT32(), 1, canonical_AMOUNT()};
|
||||
@@ -307,7 +307,7 @@ TEST(TransactionsAccountSetTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
OfferCancelBuilder wrongBuilder{account, canonical_UINT32(), 1, canonical_AMOUNT()};
|
||||
@@ -321,7 +321,7 @@ TEST(TransactionsAccountSetTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testAccountSetNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testAccountSetNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsBatchTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testBatch"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testBatch"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -80,7 +80,7 @@ TEST(TransactionsBatchTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testBatchFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testBatchFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -138,7 +138,7 @@ TEST(TransactionsBatchTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -152,7 +152,7 @@ TEST(TransactionsBatchTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -166,7 +166,7 @@ TEST(TransactionsBatchTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testBatchNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testBatchNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsCheckCancelTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testCheckCancel"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testCheckCancel"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -70,7 +70,7 @@ TEST(TransactionsCheckCancelTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testCheckCancelFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testCheckCancelFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -119,7 +119,7 @@ TEST(TransactionsCheckCancelTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -133,7 +133,7 @@ TEST(TransactionsCheckCancelTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsCheckCashTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testCheckCash"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testCheckCash"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -90,7 +90,7 @@ TEST(TransactionsCheckCashTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testCheckCashFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testCheckCashFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -157,7 +157,7 @@ TEST(TransactionsCheckCashTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -171,7 +171,7 @@ TEST(TransactionsCheckCashTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -185,7 +185,7 @@ TEST(TransactionsCheckCashTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testCheckCashNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testCheckCashNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsCheckCreateTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testCheckCreate"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testCheckCreate"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -108,7 +108,7 @@ TEST(TransactionsCheckCreateTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testCheckCreateFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testCheckCreateFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -192,7 +192,7 @@ TEST(TransactionsCheckCreateTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -206,7 +206,7 @@ TEST(TransactionsCheckCreateTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -220,7 +220,7 @@ TEST(TransactionsCheckCreateTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testCheckCreateNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testCheckCreateNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsClawbackTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testClawback"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testClawback"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -80,7 +80,7 @@ TEST(TransactionsClawbackTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testClawbackFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testClawbackFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -138,7 +138,7 @@ TEST(TransactionsClawbackTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -152,7 +152,7 @@ TEST(TransactionsClawbackTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -166,7 +166,7 @@ TEST(TransactionsClawbackTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testClawbackNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testClawbackNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsCredentialAcceptTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testCredentialAccept"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testCredentialAccept"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -78,7 +78,7 @@ TEST(TransactionsCredentialAcceptTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testCredentialAcceptFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testCredentialAcceptFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -135,7 +135,7 @@ TEST(TransactionsCredentialAcceptTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -149,7 +149,7 @@ TEST(TransactionsCredentialAcceptTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsCredentialCreateTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testCredentialCreate"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testCredentialCreate"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -98,7 +98,7 @@ TEST(TransactionsCredentialCreateTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testCredentialCreateFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testCredentialCreateFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -173,7 +173,7 @@ TEST(TransactionsCredentialCreateTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -187,7 +187,7 @@ TEST(TransactionsCredentialCreateTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -201,7 +201,7 @@ TEST(TransactionsCredentialCreateTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testCredentialCreateNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testCredentialCreateNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsCredentialDeleteTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testCredentialDelete"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testCredentialDelete"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -90,7 +90,7 @@ TEST(TransactionsCredentialDeleteTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testCredentialDeleteFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testCredentialDeleteFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -157,7 +157,7 @@ TEST(TransactionsCredentialDeleteTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -171,7 +171,7 @@ TEST(TransactionsCredentialDeleteTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -185,7 +185,7 @@ TEST(TransactionsCredentialDeleteTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testCredentialDeleteNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testCredentialDeleteNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsDIDDeleteTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testDIDDelete"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testDIDDelete"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -62,7 +62,7 @@ TEST(TransactionsDIDDeleteTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testDIDDeleteFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testDIDDeleteFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -103,7 +103,7 @@ TEST(TransactionsDIDDeleteTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -117,7 +117,7 @@ TEST(TransactionsDIDDeleteTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsDIDSetTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testDIDSet"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testDIDSet"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -92,7 +92,7 @@ TEST(TransactionsDIDSetTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testDIDSetFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testDIDSetFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -160,7 +160,7 @@ TEST(TransactionsDIDSetTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -174,7 +174,7 @@ TEST(TransactionsDIDSetTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -188,7 +188,7 @@ TEST(TransactionsDIDSetTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testDIDSetNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testDIDSetNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsDelegateSetTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testDelegateSet"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testDelegateSet"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -78,7 +78,7 @@ TEST(TransactionsDelegateSetTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testDelegateSetFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testDelegateSetFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -135,7 +135,7 @@ TEST(TransactionsDelegateSetTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -149,7 +149,7 @@ TEST(TransactionsDelegateSetTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsDepositPreauthTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testDepositPreauth"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testDepositPreauth"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -102,7 +102,7 @@ TEST(TransactionsDepositPreauthTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testDepositPreauthFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testDepositPreauthFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -179,7 +179,7 @@ TEST(TransactionsDepositPreauthTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -193,7 +193,7 @@ TEST(TransactionsDepositPreauthTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -207,7 +207,7 @@ TEST(TransactionsDepositPreauthTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testDepositPreauthNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testDepositPreauthNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsEnableAmendmentTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testEnableAmendment"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testEnableAmendment"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -78,7 +78,7 @@ TEST(TransactionsEnableAmendmentTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testEnableAmendmentFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testEnableAmendmentFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -135,7 +135,7 @@ TEST(TransactionsEnableAmendmentTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -149,7 +149,7 @@ TEST(TransactionsEnableAmendmentTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsEscrowCancelTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testEscrowCancel"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testEscrowCancel"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -78,7 +78,7 @@ TEST(TransactionsEscrowCancelTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testEscrowCancelFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testEscrowCancelFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -135,7 +135,7 @@ TEST(TransactionsEscrowCancelTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -149,7 +149,7 @@ TEST(TransactionsEscrowCancelTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsEscrowCreateTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testEscrowCreate"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testEscrowCreate"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -118,7 +118,7 @@ TEST(TransactionsEscrowCreateTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testEscrowCreateFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testEscrowCreateFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -211,7 +211,7 @@ TEST(TransactionsEscrowCreateTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -225,7 +225,7 @@ TEST(TransactionsEscrowCreateTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -239,7 +239,7 @@ TEST(TransactionsEscrowCreateTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testEscrowCreateNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testEscrowCreateNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsEscrowFinishTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testEscrowFinish"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testEscrowFinish"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -108,7 +108,7 @@ TEST(TransactionsEscrowFinishTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testEscrowFinishFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testEscrowFinishFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -192,7 +192,7 @@ TEST(TransactionsEscrowFinishTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -206,7 +206,7 @@ TEST(TransactionsEscrowFinishTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -220,7 +220,7 @@ TEST(TransactionsEscrowFinishTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testEscrowFinishNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testEscrowFinishNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsLedgerStateFixTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLedgerStateFix"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLedgerStateFix"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -31,6 +31,7 @@ TEST(TransactionsLedgerStateFixTests, BuilderSettersRoundTrip)
|
||||
// Transaction-specific field values
|
||||
auto const ledgerFixTypeValue = canonical_UINT16();
|
||||
auto const ownerValue = canonical_ACCOUNT();
|
||||
auto const bookDirectoryValue = canonical_UINT256();
|
||||
|
||||
LedgerStateFixBuilder builder{
|
||||
accountValue,
|
||||
@@ -41,6 +42,7 @@ TEST(TransactionsLedgerStateFixTests, BuilderSettersRoundTrip)
|
||||
|
||||
// Set optional fields
|
||||
builder.setOwner(ownerValue);
|
||||
builder.setBookDirectory(bookDirectoryValue);
|
||||
|
||||
auto tx = builder.build(publicKey, secretKey);
|
||||
|
||||
@@ -72,6 +74,14 @@ TEST(TransactionsLedgerStateFixTests, BuilderSettersRoundTrip)
|
||||
EXPECT_TRUE(tx.hasOwner());
|
||||
}
|
||||
|
||||
{
|
||||
auto const& expected = bookDirectoryValue;
|
||||
auto const actualOpt = tx.getBookDirectory();
|
||||
ASSERT_TRUE(actualOpt.has_value()) << "Optional field sfBookDirectory should be present";
|
||||
expectEqualField(expected, *actualOpt, "sfBookDirectory");
|
||||
EXPECT_TRUE(tx.hasBookDirectory());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 2 & 4) Start from an STTx, construct a builder from it, build a new wrapper,
|
||||
@@ -80,7 +90,7 @@ TEST(TransactionsLedgerStateFixTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLedgerStateFixFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLedgerStateFixFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -90,6 +100,7 @@ TEST(TransactionsLedgerStateFixTests, BuilderFromStTxRoundTrip)
|
||||
// Transaction-specific field values
|
||||
auto const ledgerFixTypeValue = canonical_UINT16();
|
||||
auto const ownerValue = canonical_ACCOUNT();
|
||||
auto const bookDirectoryValue = canonical_UINT256();
|
||||
|
||||
// Build an initial transaction
|
||||
LedgerStateFixBuilder initialBuilder{
|
||||
@@ -100,6 +111,7 @@ TEST(TransactionsLedgerStateFixTests, BuilderFromStTxRoundTrip)
|
||||
};
|
||||
|
||||
initialBuilder.setOwner(ownerValue);
|
||||
initialBuilder.setBookDirectory(bookDirectoryValue);
|
||||
|
||||
auto initialTx = initialBuilder.build(publicKey, secretKey);
|
||||
|
||||
@@ -131,6 +143,13 @@ TEST(TransactionsLedgerStateFixTests, BuilderFromStTxRoundTrip)
|
||||
expectEqualField(expected, *actualOpt, "sfOwner");
|
||||
}
|
||||
|
||||
{
|
||||
auto const& expected = bookDirectoryValue;
|
||||
auto const actualOpt = rebuiltTx.getBookDirectory();
|
||||
ASSERT_TRUE(actualOpt.has_value()) << "Optional field sfBookDirectory should be present";
|
||||
expectEqualField(expected, *actualOpt, "sfBookDirectory");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 3) Verify wrapper throws when constructed from wrong transaction type.
|
||||
@@ -138,7 +157,7 @@ TEST(TransactionsLedgerStateFixTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -152,7 +171,7 @@ TEST(TransactionsLedgerStateFixTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -166,7 +185,7 @@ TEST(TransactionsLedgerStateFixTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLedgerStateFixNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLedgerStateFixNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -190,6 +209,8 @@ TEST(TransactionsLedgerStateFixTests, OptionalFieldsReturnNullopt)
|
||||
// Verify optional fields are not present
|
||||
EXPECT_FALSE(tx.hasOwner());
|
||||
EXPECT_FALSE(tx.getOwner().has_value());
|
||||
EXPECT_FALSE(tx.hasBookDirectory());
|
||||
EXPECT_FALSE(tx.getBookDirectory().has_value());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsLoanBrokerCoverClawbackTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanBrokerCoverClawback"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanBrokerCoverClawback"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -82,7 +82,7 @@ TEST(TransactionsLoanBrokerCoverClawbackTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanBrokerCoverClawbackFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanBrokerCoverClawbackFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -141,7 +141,7 @@ TEST(TransactionsLoanBrokerCoverClawbackTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -155,7 +155,7 @@ TEST(TransactionsLoanBrokerCoverClawbackTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -169,7 +169,7 @@ TEST(TransactionsLoanBrokerCoverClawbackTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanBrokerCoverClawbackNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanBrokerCoverClawbackNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsLoanBrokerCoverDepositTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanBrokerCoverDeposit"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanBrokerCoverDeposit"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -78,7 +78,7 @@ TEST(TransactionsLoanBrokerCoverDepositTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanBrokerCoverDepositFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanBrokerCoverDepositFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -135,7 +135,7 @@ TEST(TransactionsLoanBrokerCoverDepositTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -149,7 +149,7 @@ TEST(TransactionsLoanBrokerCoverDepositTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsLoanBrokerCoverWithdrawTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanBrokerCoverWithdraw"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanBrokerCoverWithdraw"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -98,7 +98,7 @@ TEST(TransactionsLoanBrokerCoverWithdrawTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanBrokerCoverWithdrawFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanBrokerCoverWithdrawFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -173,7 +173,7 @@ TEST(TransactionsLoanBrokerCoverWithdrawTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -187,7 +187,7 @@ TEST(TransactionsLoanBrokerCoverWithdrawTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -201,7 +201,7 @@ TEST(TransactionsLoanBrokerCoverWithdrawTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanBrokerCoverWithdrawNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanBrokerCoverWithdrawNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsLoanBrokerDeleteTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanBrokerDelete"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanBrokerDelete"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -70,7 +70,7 @@ TEST(TransactionsLoanBrokerDeleteTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanBrokerDeleteFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanBrokerDeleteFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -119,7 +119,7 @@ TEST(TransactionsLoanBrokerDeleteTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -133,7 +133,7 @@ TEST(TransactionsLoanBrokerDeleteTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsLoanBrokerSetTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanBrokerSet"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanBrokerSet"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -130,7 +130,7 @@ TEST(TransactionsLoanBrokerSetTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanBrokerSetFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanBrokerSetFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -233,7 +233,7 @@ TEST(TransactionsLoanBrokerSetTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -247,7 +247,7 @@ TEST(TransactionsLoanBrokerSetTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -261,7 +261,7 @@ TEST(TransactionsLoanBrokerSetTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanBrokerSetNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanBrokerSetNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsLoanDeleteTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanDelete"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanDelete"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -70,7 +70,7 @@ TEST(TransactionsLoanDeleteTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanDeleteFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanDeleteFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -119,7 +119,7 @@ TEST(TransactionsLoanDeleteTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -133,7 +133,7 @@ TEST(TransactionsLoanDeleteTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsLoanManageTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanManage"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanManage"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -70,7 +70,7 @@ TEST(TransactionsLoanManageTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanManageFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanManageFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -119,7 +119,7 @@ TEST(TransactionsLoanManageTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -133,7 +133,7 @@ TEST(TransactionsLoanManageTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsLoanPayTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanPay"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanPay"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -78,7 +78,7 @@ TEST(TransactionsLoanPayTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanPayFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanPayFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -135,7 +135,7 @@ TEST(TransactionsLoanPayTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -149,7 +149,7 @@ TEST(TransactionsLoanPayTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsLoanSetTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanSet"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanSet"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -228,7 +228,7 @@ TEST(TransactionsLoanSetTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanSetFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanSetFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -420,7 +420,7 @@ TEST(TransactionsLoanSetTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -434,7 +434,7 @@ TEST(TransactionsLoanSetTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -448,7 +448,7 @@ TEST(TransactionsLoanSetTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testLoanSetNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testLoanSetNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsMPTokenAuthorizeTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testMPTokenAuthorize"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testMPTokenAuthorize"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -80,7 +80,7 @@ TEST(TransactionsMPTokenAuthorizeTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testMPTokenAuthorizeFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testMPTokenAuthorizeFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -138,7 +138,7 @@ TEST(TransactionsMPTokenAuthorizeTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -152,7 +152,7 @@ TEST(TransactionsMPTokenAuthorizeTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -166,7 +166,7 @@ TEST(TransactionsMPTokenAuthorizeTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testMPTokenAuthorizeNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testMPTokenAuthorizeNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsMPTokenIssuanceCreateTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testMPTokenIssuanceCreate"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testMPTokenIssuanceCreate"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -122,7 +122,7 @@ TEST(TransactionsMPTokenIssuanceCreateTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testMPTokenIssuanceCreateFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testMPTokenIssuanceCreateFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -217,7 +217,7 @@ TEST(TransactionsMPTokenIssuanceCreateTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -231,7 +231,7 @@ TEST(TransactionsMPTokenIssuanceCreateTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -245,7 +245,7 @@ TEST(TransactionsMPTokenIssuanceCreateTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testMPTokenIssuanceCreateNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testMPTokenIssuanceCreateNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsMPTokenIssuanceDestroyTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testMPTokenIssuanceDestroy"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testMPTokenIssuanceDestroy"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -70,7 +70,7 @@ TEST(TransactionsMPTokenIssuanceDestroyTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testMPTokenIssuanceDestroyFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testMPTokenIssuanceDestroyFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -119,7 +119,7 @@ TEST(TransactionsMPTokenIssuanceDestroyTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -133,7 +133,7 @@ TEST(TransactionsMPTokenIssuanceDestroyTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsMPTokenIssuanceSetTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testMPTokenIssuanceSet"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testMPTokenIssuanceSet"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -120,7 +120,7 @@ TEST(TransactionsMPTokenIssuanceSetTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testMPTokenIssuanceSetFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testMPTokenIssuanceSetFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -214,7 +214,7 @@ TEST(TransactionsMPTokenIssuanceSetTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -228,7 +228,7 @@ TEST(TransactionsMPTokenIssuanceSetTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -242,7 +242,7 @@ TEST(TransactionsMPTokenIssuanceSetTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testMPTokenIssuanceSetNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testMPTokenIssuanceSetNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsNFTokenAcceptOfferTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenAcceptOffer"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenAcceptOffer"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -92,7 +92,7 @@ TEST(TransactionsNFTokenAcceptOfferTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenAcceptOfferFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenAcceptOfferFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -160,7 +160,7 @@ TEST(TransactionsNFTokenAcceptOfferTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -174,7 +174,7 @@ TEST(TransactionsNFTokenAcceptOfferTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -188,7 +188,7 @@ TEST(TransactionsNFTokenAcceptOfferTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenAcceptOfferNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenAcceptOfferNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsNFTokenBurnTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenBurn"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenBurn"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -80,7 +80,7 @@ TEST(TransactionsNFTokenBurnTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenBurnFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenBurnFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -138,7 +138,7 @@ TEST(TransactionsNFTokenBurnTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -152,7 +152,7 @@ TEST(TransactionsNFTokenBurnTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -166,7 +166,7 @@ TEST(TransactionsNFTokenBurnTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenBurnNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenBurnNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsNFTokenCancelOfferTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenCancelOffer"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenCancelOffer"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -70,7 +70,7 @@ TEST(TransactionsNFTokenCancelOfferTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenCancelOfferFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenCancelOfferFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -119,7 +119,7 @@ TEST(TransactionsNFTokenCancelOfferTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -133,7 +133,7 @@ TEST(TransactionsNFTokenCancelOfferTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsNFTokenCreateOfferTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenCreateOffer"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenCreateOffer"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -108,7 +108,7 @@ TEST(TransactionsNFTokenCreateOfferTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenCreateOfferFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenCreateOfferFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -192,7 +192,7 @@ TEST(TransactionsNFTokenCreateOfferTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -206,7 +206,7 @@ TEST(TransactionsNFTokenCreateOfferTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -220,7 +220,7 @@ TEST(TransactionsNFTokenCreateOfferTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenCreateOfferNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenCreateOfferNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsNFTokenMintTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenMint"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenMint"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -130,7 +130,7 @@ TEST(TransactionsNFTokenMintTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenMintFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenMintFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -233,7 +233,7 @@ TEST(TransactionsNFTokenMintTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -247,7 +247,7 @@ TEST(TransactionsNFTokenMintTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -261,7 +261,7 @@ TEST(TransactionsNFTokenMintTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenMintNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenMintNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsNFTokenModifyTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenModify"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenModify"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -90,7 +90,7 @@ TEST(TransactionsNFTokenModifyTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenModifyFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenModifyFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -157,7 +157,7 @@ TEST(TransactionsNFTokenModifyTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -171,7 +171,7 @@ TEST(TransactionsNFTokenModifyTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -185,7 +185,7 @@ TEST(TransactionsNFTokenModifyTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testNFTokenModifyNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testNFTokenModifyNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsOfferCancelTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testOfferCancel"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testOfferCancel"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -70,7 +70,7 @@ TEST(TransactionsOfferCancelTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testOfferCancelFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testOfferCancelFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -119,7 +119,7 @@ TEST(TransactionsOfferCancelTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -133,7 +133,7 @@ TEST(TransactionsOfferCancelTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsOfferCreateTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testOfferCreate"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testOfferCreate"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -108,7 +108,7 @@ TEST(TransactionsOfferCreateTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testOfferCreateFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testOfferCreateFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -192,7 +192,7 @@ TEST(TransactionsOfferCreateTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -206,7 +206,7 @@ TEST(TransactionsOfferCreateTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -220,7 +220,7 @@ TEST(TransactionsOfferCreateTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testOfferCreateNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testOfferCreateNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsOracleDeleteTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testOracleDelete"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testOracleDelete"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -70,7 +70,7 @@ TEST(TransactionsOracleDeleteTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testOracleDeleteFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testOracleDeleteFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -119,7 +119,7 @@ TEST(TransactionsOracleDeleteTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -133,7 +133,7 @@ TEST(TransactionsOracleDeleteTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsOracleSetTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testOracleSet"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testOracleSet"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -116,7 +116,7 @@ TEST(TransactionsOracleSetTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testOracleSetFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testOracleSetFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -208,7 +208,7 @@ TEST(TransactionsOracleSetTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -222,7 +222,7 @@ TEST(TransactionsOracleSetTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -236,7 +236,7 @@ TEST(TransactionsOracleSetTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testOracleSetNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testOracleSetNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsPaymentChannelClaimTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPaymentChannelClaim"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPaymentChannelClaim"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -120,7 +120,7 @@ TEST(TransactionsPaymentChannelClaimTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPaymentChannelClaimFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPaymentChannelClaimFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -214,7 +214,7 @@ TEST(TransactionsPaymentChannelClaimTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -228,7 +228,7 @@ TEST(TransactionsPaymentChannelClaimTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -242,7 +242,7 @@ TEST(TransactionsPaymentChannelClaimTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPaymentChannelClaimNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPaymentChannelClaimNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsPaymentChannelCreateTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPaymentChannelCreate"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPaymentChannelCreate"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -114,7 +114,7 @@ TEST(TransactionsPaymentChannelCreateTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPaymentChannelCreateFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPaymentChannelCreateFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -205,7 +205,7 @@ TEST(TransactionsPaymentChannelCreateTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -219,7 +219,7 @@ TEST(TransactionsPaymentChannelCreateTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -233,7 +233,7 @@ TEST(TransactionsPaymentChannelCreateTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPaymentChannelCreateNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPaymentChannelCreateNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsPaymentChannelFundTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPaymentChannelFund"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPaymentChannelFund"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -88,7 +88,7 @@ TEST(TransactionsPaymentChannelFundTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPaymentChannelFundFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPaymentChannelFundFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -154,7 +154,7 @@ TEST(TransactionsPaymentChannelFundTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -168,7 +168,7 @@ TEST(TransactionsPaymentChannelFundTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -182,7 +182,7 @@ TEST(TransactionsPaymentChannelFundTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPaymentChannelFundNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPaymentChannelFundNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsPaymentTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPayment"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPayment"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -148,7 +148,7 @@ TEST(TransactionsPaymentTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPaymentFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPaymentFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -268,7 +268,7 @@ TEST(TransactionsPaymentTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -282,7 +282,7 @@ TEST(TransactionsPaymentTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -296,7 +296,7 @@ TEST(TransactionsPaymentTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPaymentNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPaymentNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsPermissionedDomainDeleteTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPermissionedDomainDelete"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPermissionedDomainDelete"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -70,7 +70,7 @@ TEST(TransactionsPermissionedDomainDeleteTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPermissionedDomainDeleteFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPermissionedDomainDeleteFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -119,7 +119,7 @@ TEST(TransactionsPermissionedDomainDeleteTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -133,7 +133,7 @@ TEST(TransactionsPermissionedDomainDeleteTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsPermissionedDomainSetTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPermissionedDomainSet"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPermissionedDomainSet"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -80,7 +80,7 @@ TEST(TransactionsPermissionedDomainSetTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPermissionedDomainSetFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPermissionedDomainSetFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -138,7 +138,7 @@ TEST(TransactionsPermissionedDomainSetTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -152,7 +152,7 @@ TEST(TransactionsPermissionedDomainSetTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -166,7 +166,7 @@ TEST(TransactionsPermissionedDomainSetTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testPermissionedDomainSetNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testPermissionedDomainSetNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsSetFeeTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testSetFee"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testSetFee"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -142,7 +142,7 @@ TEST(TransactionsSetFeeTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testSetFeeFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testSetFeeFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -255,7 +255,7 @@ TEST(TransactionsSetFeeTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -269,7 +269,7 @@ TEST(TransactionsSetFeeTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -283,7 +283,7 @@ TEST(TransactionsSetFeeTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testSetFeeNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testSetFeeNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsSetRegularKeyTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testSetRegularKey"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testSetRegularKey"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -72,7 +72,7 @@ TEST(TransactionsSetRegularKeyTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testSetRegularKeyFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testSetRegularKeyFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -122,7 +122,7 @@ TEST(TransactionsSetRegularKeyTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -136,7 +136,7 @@ TEST(TransactionsSetRegularKeyTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -150,7 +150,7 @@ TEST(TransactionsSetRegularKeyTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testSetRegularKeyNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testSetRegularKeyNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsSignerListSetTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testSignerListSet"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testSignerListSet"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -80,7 +80,7 @@ TEST(TransactionsSignerListSetTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testSignerListSetFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testSignerListSetFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -138,7 +138,7 @@ TEST(TransactionsSignerListSetTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -152,7 +152,7 @@ TEST(TransactionsSignerListSetTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -166,7 +166,7 @@ TEST(TransactionsSignerListSetTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testSignerListSetNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testSignerListSetNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsTicketCreateTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testTicketCreate"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testTicketCreate"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -70,7 +70,7 @@ TEST(TransactionsTicketCreateTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testTicketCreateFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testTicketCreateFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -119,7 +119,7 @@ TEST(TransactionsTicketCreateTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -133,7 +133,7 @@ TEST(TransactionsTicketCreateTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsTrustSetTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testTrustSet"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testTrustSet"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -92,7 +92,7 @@ TEST(TransactionsTrustSetTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testTrustSetFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testTrustSetFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -160,7 +160,7 @@ TEST(TransactionsTrustSetTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -174,7 +174,7 @@ TEST(TransactionsTrustSetTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -188,7 +188,7 @@ TEST(TransactionsTrustSetTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testTrustSetNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testTrustSetNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsUNLModifyTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testUNLModify"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testUNLModify"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -86,7 +86,7 @@ TEST(TransactionsUNLModifyTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testUNLModifyFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testUNLModifyFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -151,7 +151,7 @@ TEST(TransactionsUNLModifyTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -165,7 +165,7 @@ TEST(TransactionsUNLModifyTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsVaultClawbackTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testVaultClawback"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultClawback"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -88,7 +88,7 @@ TEST(TransactionsVaultClawbackTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testVaultClawbackFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultClawbackFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -154,7 +154,7 @@ TEST(TransactionsVaultClawbackTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -168,7 +168,7 @@ TEST(TransactionsVaultClawbackTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -182,7 +182,7 @@ TEST(TransactionsVaultClawbackTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testVaultClawbackNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultClawbackNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsVaultCreateTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testVaultCreate"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultCreate"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -130,7 +130,7 @@ TEST(TransactionsVaultCreateTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testVaultCreateFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultCreateFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -233,7 +233,7 @@ TEST(TransactionsVaultCreateTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -247,7 +247,7 @@ TEST(TransactionsVaultCreateTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -261,7 +261,7 @@ TEST(TransactionsVaultCreateTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testVaultCreateNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultCreateNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsVaultDeleteTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testVaultDelete"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultDelete"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -70,7 +70,7 @@ TEST(TransactionsVaultDeleteTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testVaultDeleteFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultDeleteFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -119,7 +119,7 @@ TEST(TransactionsVaultDeleteTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -133,7 +133,7 @@ TEST(TransactionsVaultDeleteTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsVaultDepositTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testVaultDeposit"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultDeposit"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -78,7 +78,7 @@ TEST(TransactionsVaultDepositTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testVaultDepositFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultDepositFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -135,7 +135,7 @@ TEST(TransactionsVaultDepositTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -149,7 +149,7 @@ TEST(TransactionsVaultDepositTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsVaultSetTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testVaultSet"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultSet"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -100,7 +100,7 @@ TEST(TransactionsVaultSetTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testVaultSetFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultSetFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -176,7 +176,7 @@ TEST(TransactionsVaultSetTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -190,7 +190,7 @@ TEST(TransactionsVaultSetTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -204,7 +204,7 @@ TEST(TransactionsVaultSetTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testVaultSetNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultSetNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsVaultWithdrawTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testVaultWithdraw"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultWithdraw"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -98,7 +98,7 @@ TEST(TransactionsVaultWithdrawTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testVaultWithdrawFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultWithdrawFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -173,7 +173,7 @@ TEST(TransactionsVaultWithdrawTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -187,7 +187,7 @@ TEST(TransactionsVaultWithdrawTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -201,7 +201,7 @@ TEST(TransactionsVaultWithdrawTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testVaultWithdrawNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testVaultWithdrawNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsXChainAccountCreateCommitTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainAccountCreateCommit"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainAccountCreateCommit"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -94,7 +94,7 @@ TEST(TransactionsXChainAccountCreateCommitTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainAccountCreateCommitFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainAccountCreateCommitFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -167,7 +167,7 @@ TEST(TransactionsXChainAccountCreateCommitTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -181,7 +181,7 @@ TEST(TransactionsXChainAccountCreateCommitTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsXChainAddAccountCreateAttestationTests, BuilderSettersRoundTrip
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainAddAccountCreateAttestation"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainAddAccountCreateAttestation"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -150,7 +150,7 @@ TEST(TransactionsXChainAddAccountCreateAttestationTests, BuilderFromStTxRoundTri
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainAddAccountCreateAttestationFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainAddAccountCreateAttestationFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -279,7 +279,7 @@ TEST(TransactionsXChainAddAccountCreateAttestationTests, WrapperThrowsOnWrongTxT
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -293,7 +293,7 @@ TEST(TransactionsXChainAddAccountCreateAttestationTests, BuilderThrowsOnWrongTxT
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsXChainAddClaimAttestationTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainAddClaimAttestation"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainAddClaimAttestation"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -144,7 +144,7 @@ TEST(TransactionsXChainAddClaimAttestationTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainAddClaimAttestationFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainAddClaimAttestationFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -266,7 +266,7 @@ TEST(TransactionsXChainAddClaimAttestationTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -280,7 +280,7 @@ TEST(TransactionsXChainAddClaimAttestationTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -294,7 +294,7 @@ TEST(TransactionsXChainAddClaimAttestationTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainAddClaimAttestationNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainAddClaimAttestationNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsXChainClaimTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainClaim"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainClaim"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -104,7 +104,7 @@ TEST(TransactionsXChainClaimTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainClaimFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainClaimFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -186,7 +186,7 @@ TEST(TransactionsXChainClaimTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -200,7 +200,7 @@ TEST(TransactionsXChainClaimTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -214,7 +214,7 @@ TEST(TransactionsXChainClaimTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainClaimNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainClaimNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsXChainCommitTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainCommit"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainCommit"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -96,7 +96,7 @@ TEST(TransactionsXChainCommitTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainCommitFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainCommitFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -170,7 +170,7 @@ TEST(TransactionsXChainCommitTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -184,7 +184,7 @@ TEST(TransactionsXChainCommitTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -198,7 +198,7 @@ TEST(TransactionsXChainCommitTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainCommitNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainCommitNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsXChainCreateBridgeTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainCreateBridge"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainCreateBridge"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -88,7 +88,7 @@ TEST(TransactionsXChainCreateBridgeTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainCreateBridgeFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainCreateBridgeFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -154,7 +154,7 @@ TEST(TransactionsXChainCreateBridgeTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -168,7 +168,7 @@ TEST(TransactionsXChainCreateBridgeTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -182,7 +182,7 @@ TEST(TransactionsXChainCreateBridgeTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainCreateBridgeNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainCreateBridgeNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsXChainCreateClaimIDTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainCreateClaimID"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainCreateClaimID"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -86,7 +86,7 @@ TEST(TransactionsXChainCreateClaimIDTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainCreateClaimIDFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainCreateClaimIDFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -151,7 +151,7 @@ TEST(TransactionsXChainCreateClaimIDTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -165,7 +165,7 @@ TEST(TransactionsXChainCreateClaimIDTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
|
||||
@@ -21,7 +21,7 @@ TEST(TransactionsXChainModifyBridgeTests, BuilderSettersRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainModifyBridge"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainModifyBridge"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -90,7 +90,7 @@ TEST(TransactionsXChainModifyBridgeTests, BuilderFromStTxRoundTrip)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainModifyBridgeFromTx"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainModifyBridgeFromTx"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
@@ -157,7 +157,7 @@ TEST(TransactionsXChainModifyBridgeTests, WrapperThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongType"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongType"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -171,7 +171,7 @@ TEST(TransactionsXChainModifyBridgeTests, BuilderThrowsOnWrongTxType)
|
||||
{
|
||||
// Build a valid transaction of a different type
|
||||
auto const [pk, sk] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testWrongTypeBuilder"));
|
||||
auto const account = calcAccountID(pk);
|
||||
|
||||
AccountSetBuilder wrongBuilder{account, 1, canonical_AMOUNT()};
|
||||
@@ -185,7 +185,7 @@ TEST(TransactionsXChainModifyBridgeTests, OptionalFieldsReturnNullopt)
|
||||
{
|
||||
// Generate a deterministic keypair for signing
|
||||
auto const [publicKey, secretKey] =
|
||||
generateKeyPair(KeyType::secp256k1, generateSeed("testXChainModifyBridgeNullopt"));
|
||||
generateKeyPair(KeyType::Secp256k1, generateSeed("testXChainModifyBridgeNullopt"));
|
||||
|
||||
// Common transaction fields
|
||||
auto const accountValue = calcAccountID(publicKey);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user