mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
refactor: Add paychan namespace and update related tests (#5840)
This change adds a paychan namespace to the TestHelpers and implementation files, improving organization and clarity. Additionally, it updates the AMM test to use the new `paychan::create` function for payment channel creation. Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
This commit is contained in:
@@ -3666,7 +3666,7 @@ private:
|
|||||||
auto const settleDelay = 100s;
|
auto const settleDelay = 100s;
|
||||||
NetClock::time_point const cancelAfter =
|
NetClock::time_point const cancelAfter =
|
||||||
env.current()->info().parentCloseTime + 200s;
|
env.current()->info().parentCloseTime + 200s;
|
||||||
env(create(
|
env(paychan::create(
|
||||||
carol,
|
carol,
|
||||||
ammAlice.ammAccount(),
|
ammAlice.ammAccount(),
|
||||||
XRP(1'000),
|
XRP(1'000),
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
using namespace jtx::paychan;
|
||||||
|
|
||||||
struct PayChan_test : public beast::unit_test::suite
|
struct PayChan_test : public beast::unit_test::suite
|
||||||
{
|
{
|
||||||
FeatureBitset const disallowIncoming{featureDisallowIncoming};
|
FeatureBitset const disallowIncoming{featureDisallowIncoming};
|
||||||
|
|||||||
@@ -502,6 +502,7 @@ expectLedgerEntryRoot(
|
|||||||
|
|
||||||
/* Payment Channel */
|
/* Payment Channel */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
namespace paychan {
|
||||||
|
|
||||||
Json::Value
|
Json::Value
|
||||||
create(
|
create(
|
||||||
@@ -561,6 +562,8 @@ channelBalance(ReadView const& view, uint256 const& chan);
|
|||||||
bool
|
bool
|
||||||
channelExists(ReadView const& view, uint256 const& chan);
|
channelExists(ReadView const& view, uint256 const& chan);
|
||||||
|
|
||||||
|
} // namespace paychan
|
||||||
|
|
||||||
/* Crossing Limits */
|
/* Crossing Limits */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -237,6 +237,8 @@ expectLedgerEntryRoot(
|
|||||||
|
|
||||||
/* Payment Channel */
|
/* Payment Channel */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
namespace paychan {
|
||||||
|
|
||||||
Json::Value
|
Json::Value
|
||||||
create(
|
create(
|
||||||
AccountID const& account,
|
AccountID const& account,
|
||||||
@@ -328,6 +330,8 @@ channelExists(ReadView const& view, uint256 const& chan)
|
|||||||
return bool(slep);
|
return bool(slep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace paychan
|
||||||
|
|
||||||
/* Crossing Limits */
|
/* Crossing Limits */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user