Skip to content

Commit

Permalink
Fix static_assert in STVar and other changes
Browse files Browse the repository at this point in the history
* Update flags check in Payment
* Check sendMax bad amount in Payment
* Refactor MPT payment unit-test - order by preflight/preclaim/apply validation
  • Loading branch information
gregtatcam committed Oct 7, 2024
1 parent 3b7861d commit 93c545d
Show file tree
Hide file tree
Showing 4 changed files with 277 additions and 225 deletions.
10 changes: 9 additions & 1 deletion src/libxrpl/protocol/STVar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,21 @@ STVar::constructST(SerializedTypeID id, int depth, Args&&... args)
if constexpr (std::is_same_v<
std::tuple<std::remove_cvref_t<Args>...>,
std::tuple<SField>>)
{
construct<T>(std::forward<Args>(args)...);
}
else if constexpr (std::is_same_v<
std::tuple<std::remove_cvref_t<Args>...>,
std::tuple<SerialIter, SField>>)
{
construct<T>(std::forward<Args>(args)..., depth);
}
else
static_assert(false, "Invalid STVar constructor arguments");
{
constexpr bool alwaysFalse =
!std::is_same_v<std::tuple<Args...>, std::tuple<Args...>>;
static_assert(alwaysFalse, "Invalid STVar constructor arguments");
}
};

switch (id)
Expand Down
Loading

0 comments on commit 93c545d

Please sign in to comment.