mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Add test for path with offer that changes issuer only
This commit is contained in:
@@ -150,6 +150,14 @@ struct Flow_test : public beast::unit_test::suite
|
|||||||
xrpAccount (), iss.currency, iss.account);
|
xrpAccount (), iss.currency, iss.account);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Issuer path element
|
||||||
|
static auto IAPE(AccountID const& account)
|
||||||
|
{
|
||||||
|
return STPathElement (
|
||||||
|
STPathElement::typeIssuer,
|
||||||
|
xrpAccount (), xrpCurrency (), account);
|
||||||
|
};
|
||||||
|
|
||||||
// Currency path element
|
// Currency path element
|
||||||
static auto CPE(Currency const& c)
|
static auto CPE(Currency const& c)
|
||||||
{
|
{
|
||||||
@@ -214,6 +222,12 @@ struct Flow_test : public beast::unit_test::suite
|
|||||||
test (env, EUR, USD.issue (), STPath ({IPE (EUR)}),
|
test (env, EUR, USD.issue (), STPath ({IPE (EUR)}),
|
||||||
tesSUCCESS, D{alice, gw, usdC}, B{USD, EUR}, D{gw, bob, eurC});
|
tesSUCCESS, D{alice, gw, usdC}, B{USD, EUR}, D{gw, bob, eurC});
|
||||||
|
|
||||||
|
// Path with offer that changes issuer only
|
||||||
|
env.trust (carol["USD"] (1000), bob);
|
||||||
|
test (env, carol["USD"], USD.issue (), STPath ({IAPE (carol)}),
|
||||||
|
tesSUCCESS,
|
||||||
|
D{alice, gw, usdC}, B{USD, carol["USD"]}, D{carol, bob, usdC});
|
||||||
|
|
||||||
// Path with XRP src currency
|
// Path with XRP src currency
|
||||||
test (env, USD, xrpIssue (), STPath ({IPE (USD)}), tesSUCCESS,
|
test (env, USD, xrpIssue (), STPath ({IPE (USD)}), tesSUCCESS,
|
||||||
XRPS{alice}, B{XRP, USD}, D{gw, bob, usdC});
|
XRPS{alice}, B{XRP, USD}, D{gw, bob, usdC});
|
||||||
|
|||||||
Reference in New Issue
Block a user