mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-23 15:20:54 +00:00
chore: Enable clang-tidy v21 new checks (#7031)
This commit is contained in:
@@ -2228,7 +2228,7 @@ public:
|
||||
auto const f = env.current()->fees().base;
|
||||
|
||||
// To keep things simple all offers are 1 : 1 for XRP : USD.
|
||||
enum preTrustType { noPreTrust, gwPreTrust, acctPreTrust };
|
||||
enum class preTrustType { noPreTrust, gwPreTrust, acctPreTrust };
|
||||
struct TestData
|
||||
{
|
||||
std::string account; // Account operated on
|
||||
@@ -2246,45 +2246,45 @@ public:
|
||||
// clang-format off
|
||||
TestData const tests[]{
|
||||
// acct fundXrp bookAmt preTrust offerAmount tec spentXrp balanceUSD offers owners
|
||||
{.account="ann", .fundXrp=reserve(env, 0) + 0 * f, .bookAmount=1, .preTrust=noPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0}, // Account is at the reserve, and will dip below once fees are subtracted.
|
||||
{.account="bev", .fundXrp=reserve(env, 0) + 1 * f, .bookAmount=1, .preTrust=noPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0}, // Account has just enough for the reserve and the fee.
|
||||
{.account="cam", .fundXrp=reserve(env, 0) + 2 * f, .bookAmount=0, .preTrust=noPreTrust, .offerAmount=1000, .tec=tecINSUF_RESERVE_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0}, // Account has enough for the reserve, the fee and the offer, and a bit more, but not enough for the reserve after the offer is placed.
|
||||
{.account="deb", .fundXrp=drops(10) + reserve(env, 0) + 1 * f, .bookAmount=1, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=drops(10) + f, .balanceUsd=USD(0.00001), .offers=0, .owners=1}, // Account has enough to buy a little USD then the offer runs dry.
|
||||
{.account="eve", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=0, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=f, .balanceUsd=USD( 0), .offers=1, .owners=1}, // No offer to cross
|
||||
{.account="flo", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=1, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=0, .owners=1},
|
||||
{.account="gay", .fundXrp=reserve(env, 1) + 1 * f, .bookAmount=1000, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 50) + f, .balanceUsd=USD( 50), .offers=0, .owners=1},
|
||||
{.account="hye", .fundXrp=XRP(1000) + 1 * f, .bookAmount=1000, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 800) + f, .balanceUsd=USD( 800), .offers=0, .owners=1},
|
||||
{.account="ivy", .fundXrp=XRP( 1) + reserve(env, 1) + 1 * f, .bookAmount=1, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=0, .owners=1},
|
||||
{.account="joy", .fundXrp=XRP( 1) + reserve(env, 2) + 1 * f, .bookAmount=1, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=1, .owners=2},
|
||||
{.account="kim", .fundXrp=XRP( 900) + reserve(env, 2) + 1 * f, .bookAmount=999, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 999) + f, .balanceUsd=USD( 999), .offers=0, .owners=1},
|
||||
{.account="liz", .fundXrp=XRP( 998) + reserve(env, 0) + 1 * f, .bookAmount=999, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 998) + f, .balanceUsd=USD( 998), .offers=0, .owners=1},
|
||||
{.account="meg", .fundXrp=XRP( 998) + reserve(env, 1) + 1 * f, .bookAmount=999, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 999) + f, .balanceUsd=USD( 999), .offers=0, .owners=1},
|
||||
{.account="nia", .fundXrp=XRP( 998) + reserve(env, 2) + 1 * f, .bookAmount=999, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 999) + f, .balanceUsd=USD( 999), .offers=1, .owners=2},
|
||||
{.account="ova", .fundXrp=XRP( 999) + reserve(env, 0) + 1 * f, .bookAmount=1000, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 999) + f, .balanceUsd=USD( 999), .offers=0, .owners=1},
|
||||
{.account="pam", .fundXrp=XRP( 999) + reserve(env, 1) + 1 * f, .bookAmount=1000, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP(1000) + f, .balanceUsd=USD( 1000), .offers=0, .owners=1},
|
||||
{.account="rae", .fundXrp=XRP( 999) + reserve(env, 2) + 1 * f, .bookAmount=1000, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP(1000) + f, .balanceUsd=USD( 1000), .offers=0, .owners=1},
|
||||
{.account="sue", .fundXrp=XRP(1000) + reserve(env, 2) + 1 * f, .bookAmount=0, .preTrust=noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=f, .balanceUsd=USD( 0), .offers=1, .owners=1},
|
||||
{.account="ann", .fundXrp=reserve(env, 0) + 0 * f, .bookAmount=1, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0}, // Account is at the reserve, and will dip below once fees are subtracted.
|
||||
{.account="bev", .fundXrp=reserve(env, 0) + 1 * f, .bookAmount=1, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0}, // Account has just enough for the reserve and the fee.
|
||||
{.account="cam", .fundXrp=reserve(env, 0) + 2 * f, .bookAmount=0, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tecINSUF_RESERVE_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0}, // Account has enough for the reserve, the fee and the offer, and a bit more, but not enough for the reserve after the offer is placed.
|
||||
{.account="deb", .fundXrp=drops(10) + reserve(env, 0) + 1 * f, .bookAmount=1, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=drops(10) + f, .balanceUsd=USD(0.00001), .offers=0, .owners=1}, // Account has enough to buy a little USD then the offer runs dry.
|
||||
{.account="eve", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=0, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=f, .balanceUsd=USD( 0), .offers=1, .owners=1}, // No offer to cross
|
||||
{.account="flo", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=1, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=0, .owners=1},
|
||||
{.account="gay", .fundXrp=reserve(env, 1) + 1 * f, .bookAmount=1000, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 50) + f, .balanceUsd=USD( 50), .offers=0, .owners=1},
|
||||
{.account="hye", .fundXrp=XRP(1000) + 1 * f, .bookAmount=1000, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 800) + f, .balanceUsd=USD( 800), .offers=0, .owners=1},
|
||||
{.account="ivy", .fundXrp=XRP( 1) + reserve(env, 1) + 1 * f, .bookAmount=1, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=0, .owners=1},
|
||||
{.account="joy", .fundXrp=XRP( 1) + reserve(env, 2) + 1 * f, .bookAmount=1, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=1, .owners=2},
|
||||
{.account="kim", .fundXrp=XRP( 900) + reserve(env, 2) + 1 * f, .bookAmount=999, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 999) + f, .balanceUsd=USD( 999), .offers=0, .owners=1},
|
||||
{.account="liz", .fundXrp=XRP( 998) + reserve(env, 0) + 1 * f, .bookAmount=999, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 998) + f, .balanceUsd=USD( 998), .offers=0, .owners=1},
|
||||
{.account="meg", .fundXrp=XRP( 998) + reserve(env, 1) + 1 * f, .bookAmount=999, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 999) + f, .balanceUsd=USD( 999), .offers=0, .owners=1},
|
||||
{.account="nia", .fundXrp=XRP( 998) + reserve(env, 2) + 1 * f, .bookAmount=999, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 999) + f, .balanceUsd=USD( 999), .offers=1, .owners=2},
|
||||
{.account="ova", .fundXrp=XRP( 999) + reserve(env, 0) + 1 * f, .bookAmount=1000, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 999) + f, .balanceUsd=USD( 999), .offers=0, .owners=1},
|
||||
{.account="pam", .fundXrp=XRP( 999) + reserve(env, 1) + 1 * f, .bookAmount=1000, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP(1000) + f, .balanceUsd=USD( 1000), .offers=0, .owners=1},
|
||||
{.account="rae", .fundXrp=XRP( 999) + reserve(env, 2) + 1 * f, .bookAmount=1000, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP(1000) + f, .balanceUsd=USD( 1000), .offers=0, .owners=1},
|
||||
{.account="sue", .fundXrp=XRP(1000) + reserve(env, 2) + 1 * f, .bookAmount=0, .preTrust=preTrustType::noPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=f, .balanceUsd=USD( 0), .offers=1, .owners=1},
|
||||
//---------------- Pre-established trust lines ---------------------
|
||||
{.account="abe", .fundXrp=reserve(env, 0) + 0 * f, .bookAmount=1, .preTrust=gwPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0},
|
||||
{.account="bud", .fundXrp=reserve(env, 0) + 1 * f, .bookAmount=1, .preTrust=gwPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0},
|
||||
{.account="che", .fundXrp=reserve(env, 0) + 2 * f, .bookAmount=0, .preTrust=gwPreTrust, .offerAmount=1000, .tec=tecINSUF_RESERVE_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0},
|
||||
{.account="dan", .fundXrp=drops(10) + reserve(env, 0) + 1 * f, .bookAmount=1, .preTrust=gwPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=drops(10) + f, .balanceUsd=USD(0.00001), .offers=0, .owners=0},
|
||||
{.account="eli", .fundXrp=XRP( 20) + reserve(env, 0) + 1 * f, .bookAmount=1000, .preTrust=gwPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP(20) + 1 * f, .balanceUsd=USD( 20), .offers=0, .owners=0},
|
||||
{.account="fyn", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=0, .preTrust=gwPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=f, .balanceUsd=USD( 0), .offers=1, .owners=1},
|
||||
{.account="gar", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=1, .preTrust=gwPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=1, .owners=1},
|
||||
{.account="hal", .fundXrp=reserve(env, 1) + 1 * f, .bookAmount=1, .preTrust=gwPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=1, .owners=1},
|
||||
{.account="abe", .fundXrp=reserve(env, 0) + 0 * f, .bookAmount=1, .preTrust=preTrustType::gwPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0},
|
||||
{.account="bud", .fundXrp=reserve(env, 0) + 1 * f, .bookAmount=1, .preTrust=preTrustType::gwPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0},
|
||||
{.account="che", .fundXrp=reserve(env, 0) + 2 * f, .bookAmount=0, .preTrust=preTrustType::gwPreTrust, .offerAmount=1000, .tec=tecINSUF_RESERVE_OFFER, .spentXrp=f, .balanceUsd=USD( 0), .offers=0, .owners=0},
|
||||
{.account="dan", .fundXrp=drops(10) + reserve(env, 0) + 1 * f, .bookAmount=1, .preTrust=preTrustType::gwPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=drops(10) + f, .balanceUsd=USD(0.00001), .offers=0, .owners=0},
|
||||
{.account="eli", .fundXrp=XRP( 20) + reserve(env, 0) + 1 * f, .bookAmount=1000, .preTrust=preTrustType::gwPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP(20) + 1 * f, .balanceUsd=USD( 20), .offers=0, .owners=0},
|
||||
{.account="fyn", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=0, .preTrust=preTrustType::gwPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=f, .balanceUsd=USD( 0), .offers=1, .owners=1},
|
||||
{.account="gar", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=1, .preTrust=preTrustType::gwPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=1, .owners=1},
|
||||
{.account="hal", .fundXrp=reserve(env, 1) + 1 * f, .bookAmount=1, .preTrust=preTrustType::gwPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + f, .balanceUsd=USD( 1), .offers=1, .owners=1},
|
||||
|
||||
{.account="ned", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=1, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1},
|
||||
{.account="ole", .fundXrp=reserve(env, 1) + 1 * f, .bookAmount=1, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1},
|
||||
{.account="pat", .fundXrp=reserve(env, 1) + 2 * f, .bookAmount=0, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1},
|
||||
{.account="quy", .fundXrp=reserve(env, 1) + 2 * f, .bookAmount=1, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1},
|
||||
{.account="ron", .fundXrp=reserve(env, 1) + 3 * f, .bookAmount=0, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tecINSUF_RESERVE_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1},
|
||||
{.account="syd", .fundXrp=drops(10) + reserve(env, 1) + 2 * f, .bookAmount=1, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=drops(10) + 2 * f, .balanceUsd=USD(0.00001), .offers=0, .owners=1},
|
||||
{.account="ted", .fundXrp=XRP( 20) + reserve(env, 1) + 2 * f, .bookAmount=1000, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP(20) + 2 * f, .balanceUsd=USD( 20), .offers=0, .owners=1},
|
||||
{.account="uli", .fundXrp=reserve(env, 2) + 0 * f, .bookAmount=0, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tecINSUF_RESERVE_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1},
|
||||
{.account="vic", .fundXrp=reserve(env, 2) + 0 * f, .bookAmount=1, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + 2 * f, .balanceUsd=USD( 1), .offers=0, .owners=1},
|
||||
{.account="wes", .fundXrp=reserve(env, 2) + 1 * f, .bookAmount=0, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=1, .owners=2},
|
||||
{.account="xan", .fundXrp=reserve(env, 2) + 1 * f, .bookAmount=1, .preTrust=acctPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + 2 * f, .balanceUsd=USD( 1), .offers=1, .owners=2},
|
||||
{.account="ned", .fundXrp=reserve(env, 1) + 0 * f, .bookAmount=1, .preTrust=preTrustType::acctPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1},
|
||||
{.account="ole", .fundXrp=reserve(env, 1) + 1 * f, .bookAmount=1, .preTrust=preTrustType::acctPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1},
|
||||
{.account="pat", .fundXrp=reserve(env, 1) + 2 * f, .bookAmount=0, .preTrust=preTrustType::acctPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1},
|
||||
{.account="quy", .fundXrp=reserve(env, 1) + 2 * f, .bookAmount=1, .preTrust=preTrustType::acctPreTrust, .offerAmount=1000, .tec=tecUNFUNDED_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1},
|
||||
{.account="ron", .fundXrp=reserve(env, 1) + 3 * f, .bookAmount=0, .preTrust=preTrustType::acctPreTrust, .offerAmount=1000, .tec=tecINSUF_RESERVE_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1},
|
||||
{.account="syd", .fundXrp=drops(10) + reserve(env, 1) + 2 * f, .bookAmount=1, .preTrust=preTrustType::acctPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=drops(10) + 2 * f, .balanceUsd=USD(0.00001), .offers=0, .owners=1},
|
||||
{.account="ted", .fundXrp=XRP( 20) + reserve(env, 1) + 2 * f, .bookAmount=1000, .preTrust=preTrustType::acctPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP(20) + 2 * f, .balanceUsd=USD( 20), .offers=0, .owners=1},
|
||||
{.account="uli", .fundXrp=reserve(env, 2) + 0 * f, .bookAmount=0, .preTrust=preTrustType::acctPreTrust, .offerAmount=1000, .tec=tecINSUF_RESERVE_OFFER, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=0, .owners=1},
|
||||
{.account="vic", .fundXrp=reserve(env, 2) + 0 * f, .bookAmount=1, .preTrust=preTrustType::acctPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + 2 * f, .balanceUsd=USD( 1), .offers=0, .owners=1},
|
||||
{.account="wes", .fundXrp=reserve(env, 2) + 1 * f, .bookAmount=0, .preTrust=preTrustType::acctPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=2 * f, .balanceUsd=USD( 0), .offers=1, .owners=2},
|
||||
{.account="xan", .fundXrp=reserve(env, 2) + 1 * f, .bookAmount=1, .preTrust=preTrustType::acctPreTrust, .offerAmount=1000, .tec=tesSUCCESS, .spentXrp=XRP( 1) + 2 * f, .balanceUsd=USD( 1), .offers=1, .owners=2},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
@@ -2305,14 +2305,14 @@ public:
|
||||
std::uint32_t const gwOfferSeq = env.seq(gw) - 1;
|
||||
|
||||
// Optionally pre-establish a trustline between gw and acct.
|
||||
if (t.preTrust == gwPreTrust)
|
||||
if (t.preTrust == preTrustType::gwPreTrust)
|
||||
env(trust(gw, acct["USD"](1)));
|
||||
env.close();
|
||||
|
||||
// Optionally pre-establish a trustline between acct and gw.
|
||||
// Note this is not really part of the test, so we expect there
|
||||
// to be enough XRP reserve for acct to create the trust line.
|
||||
if (t.preTrust == acctPreTrust)
|
||||
if (t.preTrust == preTrustType::acctPreTrust)
|
||||
env(trust(acct, USD(1)));
|
||||
env.close();
|
||||
|
||||
@@ -2340,7 +2340,7 @@ public:
|
||||
BEAST_EXPECT(acctOffer[sfTakerPays] == USD(leftover));
|
||||
}
|
||||
|
||||
if (t.preTrust == noPreTrust)
|
||||
if (t.preTrust == preTrustType::noPreTrust)
|
||||
{
|
||||
if (t.balanceUsd.value().signum() != 0)
|
||||
{
|
||||
@@ -2675,7 +2675,7 @@ public:
|
||||
auto const f = env.current()->fees().base;
|
||||
|
||||
// To keep things simple all offers are 1 : 1 for XRP : USD.
|
||||
enum preTrustType { noPreTrust, gwPreTrust, acctPreTrust };
|
||||
enum class preTrustType { noPreTrust, gwPreTrust, acctPreTrust };
|
||||
struct TestData
|
||||
{
|
||||
std::string account; // Account operated on
|
||||
|
||||
Reference in New Issue
Block a user