From 3b083eecaa56ce4f728535e29c8caee19b133a38 Mon Sep 17 00:00:00 2001 From: kennyzlei Date: Fri, 14 Jul 2023 01:04:56 +0000 Subject: [PATCH] deploy: 5ba1f984df57242aeb82f36f2afe1cfbeccbae83 --- AccountInfo_8cpp_source.html | 349 ++-- AccountInfo__test_8cpp_source.html | 92 +- AccountSet__test_8cpp_source.html | 8 +- Clawback_8cpp_source.html | 146 +- Clawback_8h_source.html | 2 +- Clawback__test_8cpp_source.html | 1714 ++++++++++---------- LedgerFormats_8h_source.html | 4 +- SetAccount_8cpp_source.html | 12 +- TxFlags_8h_source.html | 4 +- classripple_1_1Clawback.html | 2 +- classripple_1_1Clawback__test-members.html | 2 +- classripple_1_1Clawback__test.html | 32 +- flags_8h_source.html | 8 +- functions_func_t.html | 6 +- functions_t.html | 6 +- namespacemembers.html | 4 +- namespacemembers_eval_l.html | 4 +- namespacemembers_l.html | 4 +- namespacemembers_vars.html | 4 +- namespaceripple.html | 14 +- search/all_1.js | 2 +- search/all_14.js | 4 +- search/all_1b.js | 6 +- search/all_c.js | 2 +- search/enumvalues_b.js | 2 +- search/functions_14.js | 4 +- search/functions_1b.js | 6 +- search/variables_0.js | 2 +- 28 files changed, 1227 insertions(+), 1218 deletions(-) diff --git a/AccountInfo_8cpp_source.html b/AccountInfo_8cpp_source.html index 3bdd784240..a528bb832a 100644 --- a/AccountInfo_8cpp_source.html +++ b/AccountInfo_8cpp_source.html @@ -168,179 +168,180 @@ $(function() {
97  {"disallowIncomingTrustline", lsfDisallowIncomingTrustline}}};
98 
99  static constexpr std::pair<std::string_view, LedgerSpecificFlags>
-
100  allowClawbackFlag{"allowClawback", lsfAllowClawback};
-
101 
-
102  auto const sleAccepted = ledger->read(keylet::account(accountID));
-
103  if (sleAccepted)
-
104  {
-
105  auto const queue =
-
106  params.isMember(jss::queue) && params[jss::queue].asBool();
-
107 
-
108  if (queue && !ledger->open())
-
109  {
-
110  // It doesn't make sense to request the queue
-
111  // with any closed or validated ledger.
-
112  RPC::inject_error(rpcINVALID_PARAMS, result);
-
113  return result;
-
114  }
-
115 
-
116  Json::Value jvAccepted(Json::objectValue);
-
117  RPC::injectSLE(jvAccepted, *sleAccepted);
-
118  result[jss::account_data] = jvAccepted;
-
119 
-
120  Json::Value acctFlags{Json::objectValue};
-
121  for (auto const& lsf : lsFlags)
-
122  acctFlags[lsf.first.data()] = sleAccepted->isFlag(lsf.second);
-
123 
-
124  if (ledger->rules().enabled(featureDisallowIncoming))
-
125  {
-
126  for (auto const& lsf : disallowIncomingFlags)
-
127  acctFlags[lsf.first.data()] = sleAccepted->isFlag(lsf.second);
-
128  }
-
129 
-
130  if (ledger->rules().enabled(featureClawback))
-
131  acctFlags[allowClawbackFlag.first.data()] =
-
132  sleAccepted->isFlag(allowClawbackFlag.second);
-
133 
-
134  result[jss::account_flags] = std::move(acctFlags);
-
135 
-
136  // The document states that signer_lists is a bool, however
-
137  // assigning any string value works. Do not allow this.
-
138  // This check is for api Version 2 onwards only
-
139  if (!params[jss::signer_lists].isBool() && context.apiVersion > 1)
-
140  {
-
141  RPC::inject_error(rpcINVALID_PARAMS, result);
-
142  return result;
-
143  }
-
144 
-
145  // Return SignerList(s) if that is requested.
-
146  if (params.isMember(jss::signer_lists) &&
-
147  params[jss::signer_lists].asBool())
-
148  {
-
149  // We put the SignerList in an array because of an anticipated
-
150  // future when we support multiple signer lists on one account.
-
151  Json::Value jvSignerList = Json::arrayValue;
-
152 
-
153  // This code will need to be revisited if in the future we support
-
154  // multiple SignerLists on one account.
-
155  auto const sleSigners = ledger->read(keylet::signers(accountID));
-
156  if (sleSigners)
-
157  jvSignerList.append(sleSigners->getJson(JsonOptions::none));
-
158 
-
159  // Documentation states this is returned as part of the account_info
-
160  // response, but previously the code put it under account_data. We
-
161  // can move this to the documentated location from apiVersion 2
-
162  // onwards.
-
163  if (context.apiVersion == 1)
-
164  {
-
165  result[jss::account_data][jss::signer_lists] =
-
166  std::move(jvSignerList);
-
167  }
-
168  else
-
169  {
-
170  result[jss::signer_lists] = std::move(jvSignerList);
-
171  }
-
172  }
-
173  // Return queue info if that is requested
-
174  if (queue)
-
175  {
-
176  Json::Value jvQueueData = Json::objectValue;
-
177 
-
178  auto const txs = context.app.getTxQ().getAccountTxs(accountID);
-
179  if (!txs.empty())
-
180  {
-
181  jvQueueData[jss::txn_count] =
-
182  static_cast<Json::UInt>(txs.size());
-
183 
-
184  auto& jvQueueTx = jvQueueData[jss::transactions];
-
185  jvQueueTx = Json::arrayValue;
-
186 
-
187  std::uint32_t seqCount = 0;
-
188  std::uint32_t ticketCount = 0;
-
189  std::optional<std::uint32_t> lowestSeq;
-
190  std::optional<std::uint32_t> highestSeq;
-
191  std::optional<std::uint32_t> lowestTicket;
-
192  std::optional<std::uint32_t> highestTicket;
-
193  bool anyAuthChanged = false;
-
194  XRPAmount totalSpend(0);
-
195 
-
196  // We expect txs to be returned sorted by SeqProxy. Verify
-
197  // that with a couple of asserts.
-
198  SeqProxy prevSeqProxy = SeqProxy::sequence(0);
-
199  for (auto const& tx : txs)
-
200  {
-
201  Json::Value jvTx = Json::objectValue;
-
202 
-
203  if (tx.seqProxy.isSeq())
-
204  {
-
205  assert(prevSeqProxy < tx.seqProxy);
-
206  prevSeqProxy = tx.seqProxy;
-
207  jvTx[jss::seq] = tx.seqProxy.value();
-
208  ++seqCount;
-
209  if (!lowestSeq)
-
210  lowestSeq = tx.seqProxy.value();
-
211  highestSeq = tx.seqProxy.value();
-
212  }
-
213  else
-
214  {
-
215  assert(prevSeqProxy < tx.seqProxy);
-
216  prevSeqProxy = tx.seqProxy;
-
217  jvTx[jss::ticket] = tx.seqProxy.value();
-
218  ++ticketCount;
-
219  if (!lowestTicket)
-
220  lowestTicket = tx.seqProxy.value();
-
221  highestTicket = tx.seqProxy.value();
-
222  }
-
223 
-
224  jvTx[jss::fee_level] = to_string(tx.feeLevel);
-
225  if (tx.lastValid)
-
226  jvTx[jss::LastLedgerSequence] = *tx.lastValid;
-
227 
-
228  jvTx[jss::fee] = to_string(tx.consequences.fee());
-
229  auto const spend = tx.consequences.potentialSpend() +
-
230  tx.consequences.fee();
-
231  jvTx[jss::max_spend_drops] = to_string(spend);
-
232  totalSpend += spend;
-
233  bool const authChanged = tx.consequences.isBlocker();
-
234  if (authChanged)
-
235  anyAuthChanged = authChanged;
-
236  jvTx[jss::auth_change] = authChanged;
-
237 
-
238  jvQueueTx.append(std::move(jvTx));
-
239  }
-
240 
-
241  if (seqCount)
-
242  jvQueueData[jss::sequence_count] = seqCount;
-
243  if (ticketCount)
-
244  jvQueueData[jss::ticket_count] = ticketCount;
-
245  if (lowestSeq)
-
246  jvQueueData[jss::lowest_sequence] = *lowestSeq;
-
247  if (highestSeq)
-
248  jvQueueData[jss::highest_sequence] = *highestSeq;
-
249  if (lowestTicket)
-
250  jvQueueData[jss::lowest_ticket] = *lowestTicket;
-
251  if (highestTicket)
-
252  jvQueueData[jss::highest_ticket] = *highestTicket;
-
253 
-
254  jvQueueData[jss::auth_change_queued] = anyAuthChanged;
-
255  jvQueueData[jss::max_spend_drops_total] = to_string(totalSpend);
-
256  }
-
257  else
-
258  jvQueueData[jss::txn_count] = 0u;
-
259 
-
260  result[jss::queue_data] = std::move(jvQueueData);
-
261  }
-
262  }
-
263  else
-
264  {
-
265  result[jss::account] = toBase58(accountID);
-
266  RPC::inject_error(rpcACT_NOT_FOUND, result);
-
267  }
-
268 
-
269  return result;
-
270 }
-
271 
-
272 } // namespace ripple
+
100  allowTrustLineClawbackFlag{
+
101  "allowTrustLineClawback", lsfAllowTrustLineClawback};
+
102 
+
103  auto const sleAccepted = ledger->read(keylet::account(accountID));
+
104  if (sleAccepted)
+
105  {
+
106  auto const queue =
+
107  params.isMember(jss::queue) && params[jss::queue].asBool();
+
108 
+
109  if (queue && !ledger->open())
+
110  {
+
111  // It doesn't make sense to request the queue
+
112  // with any closed or validated ledger.
+
113  RPC::inject_error(rpcINVALID_PARAMS, result);
+
114  return result;
+
115  }
+
116 
+
117  Json::Value jvAccepted(Json::objectValue);
+
118  RPC::injectSLE(jvAccepted, *sleAccepted);
+
119  result[jss::account_data] = jvAccepted;
+
120 
+
121  Json::Value acctFlags{Json::objectValue};
+
122  for (auto const& lsf : lsFlags)
+
123  acctFlags[lsf.first.data()] = sleAccepted->isFlag(lsf.second);
+
124 
+
125  if (ledger->rules().enabled(featureDisallowIncoming))
+
126  {
+
127  for (auto const& lsf : disallowIncomingFlags)
+
128  acctFlags[lsf.first.data()] = sleAccepted->isFlag(lsf.second);
+
129  }
+
130 
+
131  if (ledger->rules().enabled(featureClawback))
+
132  acctFlags[allowTrustLineClawbackFlag.first.data()] =
+
133  sleAccepted->isFlag(allowTrustLineClawbackFlag.second);
+
134 
+
135  result[jss::account_flags] = std::move(acctFlags);
+
136 
+
137  // The document states that signer_lists is a bool, however
+
138  // assigning any string value works. Do not allow this.
+
139  // This check is for api Version 2 onwards only
+
140  if (!params[jss::signer_lists].isBool() && context.apiVersion > 1)
+
141  {
+
142  RPC::inject_error(rpcINVALID_PARAMS, result);
+
143  return result;
+
144  }
+
145 
+
146  // Return SignerList(s) if that is requested.
+
147  if (params.isMember(jss::signer_lists) &&
+
148  params[jss::signer_lists].asBool())
+
149  {
+
150  // We put the SignerList in an array because of an anticipated
+
151  // future when we support multiple signer lists on one account.
+
152  Json::Value jvSignerList = Json::arrayValue;
+
153 
+
154  // This code will need to be revisited if in the future we support
+
155  // multiple SignerLists on one account.
+
156  auto const sleSigners = ledger->read(keylet::signers(accountID));
+
157  if (sleSigners)
+
158  jvSignerList.append(sleSigners->getJson(JsonOptions::none));
+
159 
+
160  // Documentation states this is returned as part of the account_info
+
161  // response, but previously the code put it under account_data. We
+
162  // can move this to the documentated location from apiVersion 2
+
163  // onwards.
+
164  if (context.apiVersion == 1)
+
165  {
+
166  result[jss::account_data][jss::signer_lists] =
+
167  std::move(jvSignerList);
+
168  }
+
169  else
+
170  {
+
171  result[jss::signer_lists] = std::move(jvSignerList);
+
172  }
+
173  }
+
174  // Return queue info if that is requested
+
175  if (queue)
+
176  {
+
177  Json::Value jvQueueData = Json::objectValue;
+
178 
+
179  auto const txs = context.app.getTxQ().getAccountTxs(accountID);
+
180  if (!txs.empty())
+
181  {
+
182  jvQueueData[jss::txn_count] =
+
183  static_cast<Json::UInt>(txs.size());
+
184 
+
185  auto& jvQueueTx = jvQueueData[jss::transactions];
+
186  jvQueueTx = Json::arrayValue;
+
187 
+
188  std::uint32_t seqCount = 0;
+
189  std::uint32_t ticketCount = 0;
+
190  std::optional<std::uint32_t> lowestSeq;
+
191  std::optional<std::uint32_t> highestSeq;
+
192  std::optional<std::uint32_t> lowestTicket;
+
193  std::optional<std::uint32_t> highestTicket;
+
194  bool anyAuthChanged = false;
+
195  XRPAmount totalSpend(0);
+
196 
+
197  // We expect txs to be returned sorted by SeqProxy. Verify
+
198  // that with a couple of asserts.
+
199  SeqProxy prevSeqProxy = SeqProxy::sequence(0);
+
200  for (auto const& tx : txs)
+
201  {
+
202  Json::Value jvTx = Json::objectValue;
+
203 
+
204  if (tx.seqProxy.isSeq())
+
205  {
+
206  assert(prevSeqProxy < tx.seqProxy);
+
207  prevSeqProxy = tx.seqProxy;
+
208  jvTx[jss::seq] = tx.seqProxy.value();
+
209  ++seqCount;
+
210  if (!lowestSeq)
+
211  lowestSeq = tx.seqProxy.value();
+
212  highestSeq = tx.seqProxy.value();
+
213  }
+
214  else
+
215  {
+
216  assert(prevSeqProxy < tx.seqProxy);
+
217  prevSeqProxy = tx.seqProxy;
+
218  jvTx[jss::ticket] = tx.seqProxy.value();
+
219  ++ticketCount;
+
220  if (!lowestTicket)
+
221  lowestTicket = tx.seqProxy.value();
+
222  highestTicket = tx.seqProxy.value();
+
223  }
+
224 
+
225  jvTx[jss::fee_level] = to_string(tx.feeLevel);
+
226  if (tx.lastValid)
+
227  jvTx[jss::LastLedgerSequence] = *tx.lastValid;
+
228 
+
229  jvTx[jss::fee] = to_string(tx.consequences.fee());
+
230  auto const spend = tx.consequences.potentialSpend() +
+
231  tx.consequences.fee();
+
232  jvTx[jss::max_spend_drops] = to_string(spend);
+
233  totalSpend += spend;
+
234  bool const authChanged = tx.consequences.isBlocker();
+
235  if (authChanged)
+
236  anyAuthChanged = authChanged;
+
237  jvTx[jss::auth_change] = authChanged;
+
238 
+
239  jvQueueTx.append(std::move(jvTx));
+
240  }
+
241 
+
242  if (seqCount)
+
243  jvQueueData[jss::sequence_count] = seqCount;
+
244  if (ticketCount)
+
245  jvQueueData[jss::ticket_count] = ticketCount;
+
246  if (lowestSeq)
+
247  jvQueueData[jss::lowest_sequence] = *lowestSeq;
+
248  if (highestSeq)
+
249  jvQueueData[jss::highest_sequence] = *highestSeq;
+
250  if (lowestTicket)
+
251  jvQueueData[jss::lowest_ticket] = *lowestTicket;
+
252  if (highestTicket)
+
253  jvQueueData[jss::highest_ticket] = *highestTicket;
+
254 
+
255  jvQueueData[jss::auth_change_queued] = anyAuthChanged;
+
256  jvQueueData[jss::max_spend_drops_total] = to_string(totalSpend);
+
257  }
+
258  else
+
259  jvQueueData[jss::txn_count] = 0u;
+
260 
+
261  result[jss::queue_data] = std::move(jvQueueData);
+
262  }
+
263  }
+
264  else
+
265  {
+
266  result[jss::account] = toBase58(accountID);
+
267  RPC::inject_error(rpcACT_NOT_FOUND, result);
+
268  }
+
269 
+
270  return result;
+
271 }
+
272 
+
273 } // namespace ripple
Definition: Context.h:53
@ lsfPasswordSpent
@@ -358,6 +359,7 @@ $(function() {
unsigned int UInt
Definition: json_forwards.h:27
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
Definition: AccountID.cpp:104
static constexpr SeqProxy sequence(std::uint32_t v)
Factory function to return a sequence-based SeqProxy.
Definition: SeqProxy.h:76
+
@ lsfAllowTrustLineClawback
Status lookupLedger(std::shared_ptr< ReadView const > &ledger, JsonContext &context, Json::Value &result)
Look up a ledger from a request and fill a Json::Result with the data representing a ledger.
Definition: RPCHelpers.cpp:675
@ lsfDepositAuth
Json::Value missing_field_error(std::string const &name)
Definition: ErrorCodes.h:264
@@ -366,7 +368,6 @@ $(function() {
Value & append(const Value &value)
Append value to array at the end.
Definition: json_value.cpp:882
std::vector< TxDetails > getAccountTxs(AccountID const &account) const
Returns information about the transactions currently in the queue for the account.
Definition: TxQ.cpp:1794
@ objectValue
object value (collection of name/value pairs).
Definition: json_value.h:43
-
@ lsfAllowClawback
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition: Indexes.cpp:134
const uint256 featureDisallowIncoming
@ none
diff --git a/AccountInfo__test_8cpp_source.html b/AccountInfo__test_8cpp_source.html index d19cec20a5..ee8b25ad1a 100644 --- a/AccountInfo__test_8cpp_source.html +++ b/AccountInfo__test_8cpp_source.html @@ -680,49 +680,53 @@ $(function() {
609  }
610 
611  static constexpr std::pair<std::string_view, std::uint32_t>
-
612  allowClawbackFlag{"allowClawback", asfAllowClawback};
-
613 
-
614  if (features[featureClawback])
-
615  {
-
616  // must use bob's account because alice has noFreeze set
-
617  auto const f1 = getAccountFlag(allowClawbackFlag.first, bob);
-
618  BEAST_EXPECT(f1.has_value());
-
619  BEAST_EXPECT(!f1.value());
-
620 
-
621  // Set allowClawback
-
622  env(fset(bob, allowClawbackFlag.second));
-
623  env.close();
-
624  auto const f2 = getAccountFlag(allowClawbackFlag.first, bob);
-
625  BEAST_EXPECT(f2.has_value());
-
626  BEAST_EXPECT(f2.value());
-
627  }
-
628  else
-
629  {
-
630  BEAST_EXPECT(!getAccountFlag(allowClawbackFlag.first, bob));
-
631  }
-
632  }
-
633 
-
634  void
-
635  run() override
-
636  {
-
637  testErrors();
-
638  testSignerLists();
-
639  testSignerListsApiVersion2();
-
640  testSignerListsV2();
-
641 
-
642  FeatureBitset const allFeatures{
-
643  ripple::test::jtx::supported_amendments()};
-
644  testAccountFlags(allFeatures);
-
645  testAccountFlags(allFeatures - featureDisallowIncoming);
-
646  testAccountFlags(
-
647  allFeatures - featureDisallowIncoming - featureClawback);
-
648  }
-
649 };
-
650 
-
651 BEAST_DEFINE_TESTSUITE(AccountInfo, app, ripple);
-
652 
-
653 } // namespace test
-
654 } // namespace ripple
+
612  allowTrustLineClawbackFlag{
+
613  "allowTrustLineClawback", asfAllowTrustLineClawback};
+
614 
+
615  if (features[featureClawback])
+
616  {
+
617  // must use bob's account because alice has noFreeze set
+
618  auto const f1 =
+
619  getAccountFlag(allowTrustLineClawbackFlag.first, bob);
+
620  BEAST_EXPECT(f1.has_value());
+
621  BEAST_EXPECT(!f1.value());
+
622 
+
623  // Set allowTrustLineClawback
+
624  env(fset(bob, allowTrustLineClawbackFlag.second));
+
625  env.close();
+
626  auto const f2 =
+
627  getAccountFlag(allowTrustLineClawbackFlag.first, bob);
+
628  BEAST_EXPECT(f2.has_value());
+
629  BEAST_EXPECT(f2.value());
+
630  }
+
631  else
+
632  {
+
633  BEAST_EXPECT(
+
634  !getAccountFlag(allowTrustLineClawbackFlag.first, bob));
+
635  }
+
636  }
+
637 
+
638  void
+
639  run() override
+
640  {
+
641  testErrors();
+
642  testSignerLists();
+
643  testSignerListsApiVersion2();
+
644  testSignerListsV2();
+
645 
+
646  FeatureBitset const allFeatures{
+
647  ripple::test::jtx::supported_amendments()};
+
648  testAccountFlags(allFeatures);
+
649  testAccountFlags(allFeatures - featureDisallowIncoming);
+
650  testAccountFlags(
+
651  allFeatures - featureDisallowIncoming - featureClawback);
+
652  }
+
653 };
+
654 
+
655 BEAST_DEFINE_TESTSUITE(AccountInfo, app, ripple);
+
656 
+
657 } // namespace test
+
658 } // namespace ripple
const SF_UINT16 sfSignerWeight
const XRP_t XRP
Converts to XRP Issue or STAmount.
Definition: amount.cpp:105
@@ -734,7 +738,6 @@ $(function() {
STL class.
constexpr std::uint32_t asfNoFreeze
Definition: TxFlags.h:79
-
constexpr std::uint32_t asfAllowClawback
Definition: TxFlags.h:91
T emplace(T... args)
constexpr std::uint32_t asfDisallowIncomingPayChan
Definition: TxFlags.h:89
const Json::StaticString jsonName
Definition: SField.h:139
@@ -758,6 +761,7 @@ $(function() {
Immutable cryptographic account descriptor.
Definition: Account.h:37
const SF_ACCOUNT sfAccount
+
constexpr std::uint32_t asfAllowTrustLineClawback
Definition: TxFlags.h:91
T data(T... args)
void testErrors()
A transaction testing environment.
Definition: Env.h:116
diff --git a/AccountSet__test_8cpp_source.html b/AccountSet__test_8cpp_source.html index 03b0b0b9bc..8f1a649179 100644 --- a/AccountSet__test_8cpp_source.html +++ b/AccountSet__test_8cpp_source.html @@ -164,10 +164,10 @@ $(function() {
93  // and are tested elsewhere
94  continue;
95  }
-
96  if (flag == asfAllowClawback)
+
96  if (flag == asfAllowTrustLineClawback)
97  {
-
98  // The asfAllowClawback flag can't be cleared. It is tested
-
99  // elsewhere.
+
98  // The asfAllowTrustLineClawback flag can't be cleared. It
+
99  // is tested elsewhere.
100  continue;
101  }
102 
@@ -684,7 +684,6 @@ $(function() {
T find(T... args)
T length(T... args)
const std::string fieldName
Definition: SField.h:135
-
constexpr std::uint32_t asfAllowClawback
Definition: TxFlags.h:91
@ telBAD_DOMAIN
Definition: TER.h:52
const uint256 featureDepositAuth
constexpr std::uint32_t tfAllowXRP
Definition: TxFlags.h:68
@@ -737,6 +736,7 @@ $(function() {
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
std::string strHex(FwdIt begin, FwdIt end)
Definition: strHex.h:30
+
constexpr std::uint32_t asfAllowTrustLineClawback
Definition: TxFlags.h:91
void testMessageKey()
constexpr std::uint32_t tfOptionalDestTag
Definition: TxFlags.h:64
const SF_VL sfDomain
diff --git a/Clawback_8cpp_source.html b/Clawback_8cpp_source.html index 61b99f01bf..27bdb5a905 100644 --- a/Clawback_8cpp_source.html +++ b/Clawback_8cpp_source.html @@ -136,77 +136,79 @@ $(function() {
65 
66  std::uint32_t const issuerFlagsIn = sleIssuer->getFieldU32(sfFlags);
67 
-
68  // If AllowClawback is not set or NoFreeze is set, return no permission
-
69  if (!(issuerFlagsIn & lsfAllowClawback) || (issuerFlagsIn & lsfNoFreeze))
-
70  return tecNO_PERMISSION;
-
71 
-
72  auto const sleRippleState =
-
73  ctx.view.read(keylet::line(holder, issuer, clawAmount.getCurrency()));
-
74  if (!sleRippleState)
-
75  return tecNO_LINE;
-
76 
-
77  STAmount const balance = (*sleRippleState)[sfBalance];
+
68  // If AllowTrustLineClawback is not set or NoFreeze is set, return no
+
69  // permission
+
70  if (!(issuerFlagsIn & lsfAllowTrustLineClawback) ||
+
71  (issuerFlagsIn & lsfNoFreeze))
+
72  return tecNO_PERMISSION;
+
73 
+
74  auto const sleRippleState =
+
75  ctx.view.read(keylet::line(holder, issuer, clawAmount.getCurrency()));
+
76  if (!sleRippleState)
+
77  return tecNO_LINE;
78 
-
79  // If balance is positive, issuer must have higher address than holder
-
80  if (balance > beast::zero && issuer < holder)
-
81  return tecNO_PERMISSION;
-
82 
-
83  // If balance is negative, issuer must have lower address than holder
-
84  if (balance < beast::zero && issuer > holder)
-
85  return tecNO_PERMISSION;
-
86 
-
87  // At this point, we know that issuer and holder accounts
-
88  // are correct and a trustline exists between them.
-
89  //
-
90  // Must now explicitly check the balance to make sure
-
91  // available balance is non-zero.
-
92  //
-
93  // We can't directly check the balance of trustline because
-
94  // the available balance of a trustline is prone to new changes (eg.
-
95  // XLS-34). So we must use `accountHolds`.
-
96  if (accountHolds(
-
97  ctx.view,
-
98  holder,
-
99  clawAmount.getCurrency(),
-
100  issuer,
-
101  fhIGNORE_FREEZE,
-
102  ctx.j) <= beast::zero)
-
103  return tecINSUFFICIENT_FUNDS;
-
104 
-
105  return tesSUCCESS;
-
106 }
-
107 
-
108 TER
-
109 Clawback::doApply()
-
110 {
-
111  AccountID const& issuer = account_;
-
112  STAmount clawAmount = ctx_.tx[sfAmount];
-
113  AccountID const holder = clawAmount.getIssuer(); // cannot be reference
-
114 
-
115  // Replace the `issuer` field with issuer's account
-
116  clawAmount.setIssuer(issuer);
-
117  if (holder == issuer)
-
118  return tecINTERNAL;
-
119 
-
120  // Get the spendable balance. Must use `accountHolds`.
-
121  STAmount const spendableAmount = accountHolds(
-
122  view(),
-
123  holder,
-
124  clawAmount.getCurrency(),
-
125  clawAmount.getIssuer(),
-
126  fhIGNORE_FREEZE,
-
127  j_);
-
128 
-
129  return rippleCredit(
-
130  view(),
-
131  holder,
-
132  issuer,
-
133  std::min(spendableAmount, clawAmount),
-
134  true,
-
135  j_);
-
136 }
-
137 
-
138 } // namespace ripple
+
79  STAmount const balance = (*sleRippleState)[sfBalance];
+
80 
+
81  // If balance is positive, issuer must have higher address than holder
+
82  if (balance > beast::zero && issuer < holder)
+
83  return tecNO_PERMISSION;
+
84 
+
85  // If balance is negative, issuer must have lower address than holder
+
86  if (balance < beast::zero && issuer > holder)
+
87  return tecNO_PERMISSION;
+
88 
+
89  // At this point, we know that issuer and holder accounts
+
90  // are correct and a trustline exists between them.
+
91  //
+
92  // Must now explicitly check the balance to make sure
+
93  // available balance is non-zero.
+
94  //
+
95  // We can't directly check the balance of trustline because
+
96  // the available balance of a trustline is prone to new changes (eg.
+
97  // XLS-34). So we must use `accountHolds`.
+
98  if (accountHolds(
+
99  ctx.view,
+
100  holder,
+
101  clawAmount.getCurrency(),
+
102  issuer,
+
103  fhIGNORE_FREEZE,
+
104  ctx.j) <= beast::zero)
+
105  return tecINSUFFICIENT_FUNDS;
+
106 
+
107  return tesSUCCESS;
+
108 }
+
109 
+
110 TER
+
111 Clawback::doApply()
+
112 {
+
113  AccountID const& issuer = account_;
+
114  STAmount clawAmount = ctx_.tx[sfAmount];
+
115  AccountID const holder = clawAmount.getIssuer(); // cannot be reference
+
116 
+
117  // Replace the `issuer` field with issuer's account
+
118  clawAmount.setIssuer(issuer);
+
119  if (holder == issuer)
+
120  return tecINTERNAL;
+
121 
+
122  // Get the spendable balance. Must use `accountHolds`.
+
123  STAmount const spendableAmount = accountHolds(
+
124  view(),
+
125  holder,
+
126  clawAmount.getCurrency(),
+
127  clawAmount.getIssuer(),
+
128  fhIGNORE_FREEZE,
+
129  j_);
+
130 
+
131  return rippleCredit(
+
132  view(),
+
133  holder,
+
134  issuer,
+
135  std::min(spendableAmount, clawAmount),
+
136  true,
+
137  j_);
+
138 }
+
139 
+
140 } // namespace ripple
TER rippleCredit(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Definition: View.cpp:967
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
Definition: Transactor.cpp:130
@@ -221,12 +223,12 @@ $(function() {
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const &currency, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j)
Definition: View.cpp:243
constexpr const std::uint32_t tfClawbackMask
Definition: TxFlags.h:164
void setIssuer(AccountID const &uIssuer)
Definition: STAmount.h:433
+
@ lsfAllowTrustLineClawback
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:78
AccountID const & getIssuer() const
Definition: STAmount.h:359
@ temINVALID_FLAG
Definition: TER.h:109
static TER preclaim(PreclaimContext const &ctx)
Definition: Clawback.cpp:55
-
@ lsfAllowClawback
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition: Indexes.cpp:134
Definition: STAmount.h:45
@@ -252,7 +254,7 @@ $(function() {
@ fhIGNORE_FREEZE
Definition: View.h:78
ApplyContext & ctx_
Definition: Transactor.h:88
const SF_ACCOUNT sfAccount
-
TER doApply() override
Definition: Clawback.cpp:109
+
TER doApply() override
Definition: Clawback.cpp:111
STTx const & tx
Definition: Transactor.h:35
State information when preflighting a tx.
Definition: Transactor.h:31
const Rules rules
Definition: Transactor.h:36
diff --git a/Clawback_8h_source.html b/Clawback_8h_source.html index 27df0f013a..00aec6b338 100644 --- a/Clawback_8h_source.html +++ b/Clawback_8h_source.html @@ -129,7 +129,7 @@ $(function() {
@ Normal
Definition: Transactor.h:101
Definition: Clawback.h:27
static constexpr ConsequencesFactoryType ConsequencesFactory
Definition: Clawback.h:30
-
TER doApply() override
Definition: Clawback.cpp:109
+
TER doApply() override
Definition: Clawback.cpp:111
State information when preflighting a tx.
Definition: Transactor.h:31
static NotTEC preflight(PreflightContext const &ctx)
Definition: Clawback.cpp:31
diff --git a/Clawback__test_8cpp_source.html b/Clawback__test_8cpp_source.html index f90d157452..8c9c270d17 100644 --- a/Clawback__test_8cpp_source.html +++ b/Clawback__test_8cpp_source.html @@ -146,14 +146,14 @@ $(function() {
75  }
76 
77  void
-
78  testAllowClawbackFlag(FeatureBitset features)
+
78  testAllowTrustLineClawbackFlag(FeatureBitset features)
79  {
-
80  testcase("Enable AllowClawback flag");
+
80  testcase("Enable AllowTrustLineClawback flag");
81  using namespace test::jtx;
82 
-
83  // Test that one can successfully set asfAllowClawback flag.
+
83  // Test that one can successfully set asfAllowTrustLineClawback flag.
84  // If successful, asfNoFreeze can no longer be set.
-
85  // Also, asfAllowClawback cannot be cleared.
+
85  // Also, asfAllowTrustLineClawback cannot be cleared.
86  {
87  Env env(*this, features);
88  Account alice{"alice"};
@@ -161,23 +161,23 @@ $(function() {
90  env.fund(XRP(1000), alice);
91  env.close();
92 
-
93  // set asfAllowClawback
-
94  env(fset(alice, asfAllowClawback));
+
93  // set asfAllowTrustLineClawback
+
94  env(fset(alice, asfAllowTrustLineClawback));
95  env.close();
-
96  env.require(flags(alice, asfAllowClawback));
+
96  env.require(flags(alice, asfAllowTrustLineClawback));
97 
-
98  // clear asfAllowClawback does nothing
-
99  env(fclear(alice, asfAllowClawback));
+
98  // clear asfAllowTrustLineClawback does nothing
+
99  env(fclear(alice, asfAllowTrustLineClawback));
100  env.close();
-
101  env.require(flags(alice, asfAllowClawback));
+
101  env.require(flags(alice, asfAllowTrustLineClawback));
102 
-
103  // asfNoFreeze cannot be set when asfAllowClawback is set
+
103  // asfNoFreeze cannot be set when asfAllowTrustLineClawback is set
104  env.require(nflags(alice, asfNoFreeze));
105  env(fset(alice, asfNoFreeze), ter(tecNO_PERMISSION));
106  env.close();
107  }
108 
-
109  // Test that asfAllowClawback cannot be set when
+
109  // Test that asfAllowTrustLineClawback cannot be set when
110  // asfNoFreeze has been set
111  {
112  Env env(*this, features);
@@ -195,855 +195,857 @@ $(function() {
124  // NoFreeze is set
125  env.require(flags(alice, asfNoFreeze));
126 
-
127  // asfAllowClawback cannot be set if asfNoFreeze is set
-
128  env(fset(alice, asfAllowClawback), ter(tecNO_PERMISSION));
+
127  // asfAllowTrustLineClawback cannot be set if asfNoFreeze is set
+
128  env(fset(alice, asfAllowTrustLineClawback), ter(tecNO_PERMISSION));
129  env.close();
130 
-
131  env.require(nflags(alice, asfAllowClawback));
+
131  env.require(nflags(alice, asfAllowTrustLineClawback));
132  }
133 
-
134  // Test that asfAllowClawback is not allowed when owner dir is non-empty
-
135  {
-
136  Env env(*this, features);
-
137 
-
138  Account alice{"alice"};
-
139  Account bob{"bob"};
-
140 
-
141  env.fund(XRP(1000), alice, bob);
-
142  env.close();
-
143 
-
144  auto const USD = alice["USD"];
-
145  env.require(nflags(alice, asfAllowClawback));
-
146 
-
147  // alice issues 10 USD to bob
-
148  env.trust(USD(1000), bob);
-
149  env(pay(alice, bob, USD(10)));
-
150  env.close();
-
151 
-
152  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
153  BEAST_EXPECT(ownerCount(env, bob) == 1);
-
154 
-
155  // alice fails to enable clawback because she has trustline with bob
-
156  env(fset(alice, asfAllowClawback), ter(tecOWNERS));
-
157  env.close();
-
158 
-
159  // bob sets trustline to default limit and pays alice back to delete
-
160  // the trustline
-
161  env(trust(bob, USD(0), 0));
-
162  env(pay(bob, alice, USD(10)));
-
163 
-
164  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
165  BEAST_EXPECT(ownerCount(env, bob) == 0);
-
166 
-
167  // alice now is able to set asfAllowClawback
-
168  env(fset(alice, asfAllowClawback));
-
169  env.close();
-
170  env.require(flags(alice, asfAllowClawback));
-
171 
-
172  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
173  BEAST_EXPECT(ownerCount(env, bob) == 0);
-
174  }
-
175 
-
176  // Test that one cannot enable asfAllowClawback when
-
177  // featureClawback amendment is disabled
-
178  {
-
179  Env env(*this, features - featureClawback);
-
180 
-
181  Account alice{"alice"};
-
182 
-
183  env.fund(XRP(1000), alice);
-
184  env.close();
-
185 
-
186  env.require(nflags(alice, asfAllowClawback));
-
187 
-
188  // alice attempts to set asfAllowClawback flag while amendment is
-
189  // disabled. no error is returned, but the flag remains to be unset.
-
190  env(fset(alice, asfAllowClawback));
-
191  env.close();
-
192  env.require(nflags(alice, asfAllowClawback));
-
193 
-
194  // now enable clawback amendment
-
195  env.enableFeature(featureClawback);
-
196  env.close();
-
197 
-
198  // asfAllowClawback can be set
-
199  env(fset(alice, asfAllowClawback));
-
200  env.close();
-
201  env.require(flags(alice, asfAllowClawback));
-
202  }
-
203  }
-
204 
-
205  void
-
206  testValidation(FeatureBitset features)
-
207  {
-
208  testcase("Validation");
-
209  using namespace test::jtx;
-
210 
-
211  // Test that Clawback tx fails for the following:
-
212  // 1. when amendment is disabled
-
213  // 2. when asfAllowClawback flag has not been set
-
214  {
-
215  Env env(*this, features - featureClawback);
-
216 
-
217  Account alice{"alice"};
-
218  Account bob{"bob"};
-
219 
-
220  env.fund(XRP(1000), alice, bob);
-
221  env.close();
-
222 
-
223  env.require(nflags(alice, asfAllowClawback));
+
134  // Test that asfAllowTrustLineClawback is not allowed when owner dir is
+
135  // non-empty
+
136  {
+
137  Env env(*this, features);
+
138 
+
139  Account alice{"alice"};
+
140  Account bob{"bob"};
+
141 
+
142  env.fund(XRP(1000), alice, bob);
+
143  env.close();
+
144 
+
145  auto const USD = alice["USD"];
+
146  env.require(nflags(alice, asfAllowTrustLineClawback));
+
147 
+
148  // alice issues 10 USD to bob
+
149  env.trust(USD(1000), bob);
+
150  env(pay(alice, bob, USD(10)));
+
151  env.close();
+
152 
+
153  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
154  BEAST_EXPECT(ownerCount(env, bob) == 1);
+
155 
+
156  // alice fails to enable clawback because she has trustline with bob
+
157  env(fset(alice, asfAllowTrustLineClawback), ter(tecOWNERS));
+
158  env.close();
+
159 
+
160  // bob sets trustline to default limit and pays alice back to delete
+
161  // the trustline
+
162  env(trust(bob, USD(0), 0));
+
163  env(pay(bob, alice, USD(10)));
+
164 
+
165  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
166  BEAST_EXPECT(ownerCount(env, bob) == 0);
+
167 
+
168  // alice now is able to set asfAllowTrustLineClawback
+
169  env(fset(alice, asfAllowTrustLineClawback));
+
170  env.close();
+
171  env.require(flags(alice, asfAllowTrustLineClawback));
+
172 
+
173  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
174  BEAST_EXPECT(ownerCount(env, bob) == 0);
+
175  }
+
176 
+
177  // Test that one cannot enable asfAllowTrustLineClawback when
+
178  // featureClawback amendment is disabled
+
179  {
+
180  Env env(*this, features - featureClawback);
+
181 
+
182  Account alice{"alice"};
+
183 
+
184  env.fund(XRP(1000), alice);
+
185  env.close();
+
186 
+
187  env.require(nflags(alice, asfAllowTrustLineClawback));
+
188 
+
189  // alice attempts to set asfAllowTrustLineClawback flag while
+
190  // amendment is disabled. no error is returned, but the flag remains
+
191  // to be unset.
+
192  env(fset(alice, asfAllowTrustLineClawback));
+
193  env.close();
+
194  env.require(nflags(alice, asfAllowTrustLineClawback));
+
195 
+
196  // now enable clawback amendment
+
197  env.enableFeature(featureClawback);
+
198  env.close();
+
199 
+
200  // asfAllowTrustLineClawback can be set
+
201  env(fset(alice, asfAllowTrustLineClawback));
+
202  env.close();
+
203  env.require(flags(alice, asfAllowTrustLineClawback));
+
204  }
+
205  }
+
206 
+
207  void
+
208  testValidation(FeatureBitset features)
+
209  {
+
210  testcase("Validation");
+
211  using namespace test::jtx;
+
212 
+
213  // Test that Clawback tx fails for the following:
+
214  // 1. when amendment is disabled
+
215  // 2. when asfAllowTrustLineClawback flag has not been set
+
216  {
+
217  Env env(*this, features - featureClawback);
+
218 
+
219  Account alice{"alice"};
+
220  Account bob{"bob"};
+
221 
+
222  env.fund(XRP(1000), alice, bob);
+
223  env.close();
224 
-
225  auto const USD = alice["USD"];
+
225  env.require(nflags(alice, asfAllowTrustLineClawback));
226 
-
227  // alice issues 10 USD to bob
-
228  env.trust(USD(1000), bob);
-
229  env(pay(alice, bob, USD(10)));
-
230  env.close();
-
231 
-
232  env.require(balance(bob, alice["USD"](10)));
-
233  env.require(balance(alice, bob["USD"](-10)));
-
234 
-
235  // clawback fails because amendment is disabled
-
236  env(claw(alice, bob["USD"](5)), ter(temDISABLED));
-
237  env.close();
-
238 
-
239  // now enable clawback amendment
-
240  env.enableFeature(featureClawback);
-
241  env.close();
-
242 
-
243  // clawback fails because asfAllowClawback has not been set
-
244  env(claw(alice, bob["USD"](5)), ter(tecNO_PERMISSION));
-
245  env.close();
-
246 
-
247  env.require(balance(bob, alice["USD"](10)));
-
248  env.require(balance(alice, bob["USD"](-10)));
-
249  }
-
250 
-
251  // Test that Clawback tx fails for the following:
-
252  // 1. invalid flag
-
253  // 2. negative STAmount
-
254  // 3. zero STAmount
-
255  // 4. XRP amount
-
256  // 5. `account` and `issuer` fields are same account
-
257  // 6. trustline has a balance of 0
-
258  // 7. trustline does not exist
-
259  {
-
260  Env env(*this, features);
-
261 
-
262  Account alice{"alice"};
-
263  Account bob{"bob"};
-
264 
-
265  env.fund(XRP(1000), alice, bob);
-
266  env.close();
-
267 
-
268  // alice sets asfAllowClawback
-
269  env(fset(alice, asfAllowClawback));
-
270  env.close();
-
271  env.require(flags(alice, asfAllowClawback));
-
272 
-
273  auto const USD = alice["USD"];
+
227  auto const USD = alice["USD"];
+
228 
+
229  // alice issues 10 USD to bob
+
230  env.trust(USD(1000), bob);
+
231  env(pay(alice, bob, USD(10)));
+
232  env.close();
+
233 
+
234  env.require(balance(bob, alice["USD"](10)));
+
235  env.require(balance(alice, bob["USD"](-10)));
+
236 
+
237  // clawback fails because amendment is disabled
+
238  env(claw(alice, bob["USD"](5)), ter(temDISABLED));
+
239  env.close();
+
240 
+
241  // now enable clawback amendment
+
242  env.enableFeature(featureClawback);
+
243  env.close();
+
244 
+
245  // clawback fails because asfAllowTrustLineClawback has not been set
+
246  env(claw(alice, bob["USD"](5)), ter(tecNO_PERMISSION));
+
247  env.close();
+
248 
+
249  env.require(balance(bob, alice["USD"](10)));
+
250  env.require(balance(alice, bob["USD"](-10)));
+
251  }
+
252 
+
253  // Test that Clawback tx fails for the following:
+
254  // 1. invalid flag
+
255  // 2. negative STAmount
+
256  // 3. zero STAmount
+
257  // 4. XRP amount
+
258  // 5. `account` and `issuer` fields are same account
+
259  // 6. trustline has a balance of 0
+
260  // 7. trustline does not exist
+
261  {
+
262  Env env(*this, features);
+
263 
+
264  Account alice{"alice"};
+
265  Account bob{"bob"};
+
266 
+
267  env.fund(XRP(1000), alice, bob);
+
268  env.close();
+
269 
+
270  // alice sets asfAllowTrustLineClawback
+
271  env(fset(alice, asfAllowTrustLineClawback));
+
272  env.close();
+
273  env.require(flags(alice, asfAllowTrustLineClawback));
274 
-
275  // alice issues 10 USD to bob
-
276  env.trust(USD(1000), bob);
-
277  env(pay(alice, bob, USD(10)));
-
278  env.close();
-
279 
-
280  env.require(balance(bob, alice["USD"](10)));
-
281  env.require(balance(alice, bob["USD"](-10)));
-
282 
-
283  // fails due to invalid flag
-
284  env(claw(alice, bob["USD"](5)),
-
285  txflags(0x00008000),
-
286  ter(temINVALID_FLAG));
-
287  env.close();
-
288 
-
289  // fails due to negative amount
-
290  env(claw(alice, bob["USD"](-5)), ter(temBAD_AMOUNT));
-
291  env.close();
-
292 
-
293  // fails due to zero amount
-
294  env(claw(alice, bob["USD"](0)), ter(temBAD_AMOUNT));
-
295  env.close();
-
296 
-
297  // fails because amount is in XRP
-
298  env(claw(alice, XRP(10)), ter(temBAD_AMOUNT));
-
299  env.close();
-
300 
-
301  // fails when `issuer` field in `amount` is not token holder
-
302  // NOTE: we are using the `issuer` field for the token holder
-
303  env(claw(alice, alice["USD"](5)), ter(temBAD_AMOUNT));
-
304  env.close();
-
305 
-
306  // bob pays alice back, trustline has a balance of 0
-
307  env(pay(bob, alice, USD(10)));
-
308  env.close();
-
309 
-
310  // bob still owns the trustline that has 0 balance
-
311  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
312  BEAST_EXPECT(ownerCount(env, bob) == 1);
-
313  env.require(balance(bob, alice["USD"](0)));
-
314  env.require(balance(alice, bob["USD"](0)));
-
315 
-
316  // clawback fails because because balance is 0
-
317  env(claw(alice, bob["USD"](5)), ter(tecINSUFFICIENT_FUNDS));
-
318  env.close();
-
319 
-
320  // set the limit to default, which should delete the trustline
-
321  env(trust(bob, USD(0), 0));
-
322  env.close();
-
323 
-
324  // bob no longer owns the trustline
-
325  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
326  BEAST_EXPECT(ownerCount(env, bob) == 0);
-
327 
-
328  // clawback fails because trustline does not exist
-
329  env(claw(alice, bob["USD"](5)), ter(tecNO_LINE));
-
330  env.close();
-
331  }
-
332  }
-
333 
-
334  void
-
335  testPermission(FeatureBitset features)
-
336  {
-
337  // Checks the tx submitter has the permission to clawback.
-
338  // Exercises preclaim code
-
339  testcase("Permission");
-
340  using namespace test::jtx;
-
341 
-
342  // Clawing back from an non-existent account returns error
-
343  {
-
344  Env env(*this, features);
-
345 
-
346  Account alice{"alice"};
-
347  Account bob{"bob"};
-
348 
-
349  // bob's account is not funded and does not exist
-
350  env.fund(XRP(1000), alice);
-
351  env.close();
-
352 
-
353  // alice sets asfAllowClawback
-
354  env(fset(alice, asfAllowClawback));
-
355  env.close();
-
356  env.require(flags(alice, asfAllowClawback));
-
357 
-
358  // bob, the token holder, does not exist
-
359  env(claw(alice, bob["USD"](5)), ter(terNO_ACCOUNT));
-
360  env.close();
-
361  }
-
362 
-
363  // Test that trustline cannot be clawed by someone who is
-
364  // not the issuer of the currency
-
365  {
-
366  Env env(*this, features);
-
367 
-
368  Account alice{"alice"};
-
369  Account bob{"bob"};
-
370  Account cindy{"cindy"};
-
371 
-
372  env.fund(XRP(1000), alice, bob, cindy);
-
373  env.close();
-
374 
-
375  auto const USD = alice["USD"];
+
275  auto const USD = alice["USD"];
+
276 
+
277  // alice issues 10 USD to bob
+
278  env.trust(USD(1000), bob);
+
279  env(pay(alice, bob, USD(10)));
+
280  env.close();
+
281 
+
282  env.require(balance(bob, alice["USD"](10)));
+
283  env.require(balance(alice, bob["USD"](-10)));
+
284 
+
285  // fails due to invalid flag
+
286  env(claw(alice, bob["USD"](5)),
+
287  txflags(0x00008000),
+
288  ter(temINVALID_FLAG));
+
289  env.close();
+
290 
+
291  // fails due to negative amount
+
292  env(claw(alice, bob["USD"](-5)), ter(temBAD_AMOUNT));
+
293  env.close();
+
294 
+
295  // fails due to zero amount
+
296  env(claw(alice, bob["USD"](0)), ter(temBAD_AMOUNT));
+
297  env.close();
+
298 
+
299  // fails because amount is in XRP
+
300  env(claw(alice, XRP(10)), ter(temBAD_AMOUNT));
+
301  env.close();
+
302 
+
303  // fails when `issuer` field in `amount` is not token holder
+
304  // NOTE: we are using the `issuer` field for the token holder
+
305  env(claw(alice, alice["USD"](5)), ter(temBAD_AMOUNT));
+
306  env.close();
+
307 
+
308  // bob pays alice back, trustline has a balance of 0
+
309  env(pay(bob, alice, USD(10)));
+
310  env.close();
+
311 
+
312  // bob still owns the trustline that has 0 balance
+
313  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
314  BEAST_EXPECT(ownerCount(env, bob) == 1);
+
315  env.require(balance(bob, alice["USD"](0)));
+
316  env.require(balance(alice, bob["USD"](0)));
+
317 
+
318  // clawback fails because because balance is 0
+
319  env(claw(alice, bob["USD"](5)), ter(tecINSUFFICIENT_FUNDS));
+
320  env.close();
+
321 
+
322  // set the limit to default, which should delete the trustline
+
323  env(trust(bob, USD(0), 0));
+
324  env.close();
+
325 
+
326  // bob no longer owns the trustline
+
327  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
328  BEAST_EXPECT(ownerCount(env, bob) == 0);
+
329 
+
330  // clawback fails because trustline does not exist
+
331  env(claw(alice, bob["USD"](5)), ter(tecNO_LINE));
+
332  env.close();
+
333  }
+
334  }
+
335 
+
336  void
+
337  testPermission(FeatureBitset features)
+
338  {
+
339  // Checks the tx submitter has the permission to clawback.
+
340  // Exercises preclaim code
+
341  testcase("Permission");
+
342  using namespace test::jtx;
+
343 
+
344  // Clawing back from an non-existent account returns error
+
345  {
+
346  Env env(*this, features);
+
347 
+
348  Account alice{"alice"};
+
349  Account bob{"bob"};
+
350 
+
351  // bob's account is not funded and does not exist
+
352  env.fund(XRP(1000), alice);
+
353  env.close();
+
354 
+
355  // alice sets asfAllowTrustLineClawback
+
356  env(fset(alice, asfAllowTrustLineClawback));
+
357  env.close();
+
358  env.require(flags(alice, asfAllowTrustLineClawback));
+
359 
+
360  // bob, the token holder, does not exist
+
361  env(claw(alice, bob["USD"](5)), ter(terNO_ACCOUNT));
+
362  env.close();
+
363  }
+
364 
+
365  // Test that trustline cannot be clawed by someone who is
+
366  // not the issuer of the currency
+
367  {
+
368  Env env(*this, features);
+
369 
+
370  Account alice{"alice"};
+
371  Account bob{"bob"};
+
372  Account cindy{"cindy"};
+
373 
+
374  env.fund(XRP(1000), alice, bob, cindy);
+
375  env.close();
376 
-
377  // alice sets asfAllowClawback
-
378  env(fset(alice, asfAllowClawback));
-
379  env.close();
-
380  env.require(flags(alice, asfAllowClawback));
-
381 
-
382  // cindy sets asfAllowClawback
-
383  env(fset(cindy, asfAllowClawback));
-
384  env.close();
-
385  env.require(flags(cindy, asfAllowClawback));
-
386 
-
387  // alice issues 1000 USD to bob
-
388  env.trust(USD(1000), bob);
-
389  env(pay(alice, bob, USD(1000)));
-
390  env.close();
-
391 
-
392  env.require(balance(bob, alice["USD"](1000)));
-
393  env.require(balance(alice, bob["USD"](-1000)));
-
394 
-
395  // cindy tries to claw from bob, and fails because trustline does
-
396  // not exist
-
397  env(claw(cindy, bob["USD"](200)), ter(tecNO_LINE));
-
398  env.close();
-
399  }
-
400 
-
401  // When a trustline is created between issuer and holder,
-
402  // we must make sure the holder is unable to claw back from
-
403  // the issuer by impersonating the issuer account.
-
404  //
-
405  // This must be tested bidirectionally for both accounts because the
-
406  // issuer could be either the low or high account in the trustline
-
407  // object
-
408  {
-
409  Env env(*this, features);
-
410 
-
411  Account alice{"alice"};
-
412  Account bob{"bob"};
-
413 
-
414  env.fund(XRP(1000), alice, bob);
-
415  env.close();
-
416 
-
417  auto const USD = alice["USD"];
-
418  auto const CAD = bob["CAD"];
-
419 
-
420  // alice sets asfAllowClawback
-
421  env(fset(alice, asfAllowClawback));
-
422  env.close();
-
423  env.require(flags(alice, asfAllowClawback));
-
424 
-
425  // bob sets asfAllowClawback
-
426  env(fset(bob, asfAllowClawback));
-
427  env.close();
-
428  env.require(flags(bob, asfAllowClawback));
-
429 
-
430  // alice issues 10 USD to bob.
-
431  // bob then attempts to submit a clawback tx to claw USD from alice.
-
432  // this must FAIL, because bob is not the issuer for this
-
433  // trustline!!!
-
434  {
-
435  // bob creates a trustline with alice, and alice sends 10 USD to
-
436  // bob
-
437  env.trust(USD(1000), bob);
-
438  env(pay(alice, bob, USD(10)));
-
439  env.close();
-
440 
-
441  env.require(balance(bob, alice["USD"](10)));
-
442  env.require(balance(alice, bob["USD"](-10)));
-
443 
-
444  // bob cannot claw back USD from alice because he's not the
-
445  // issuer
-
446  env(claw(bob, alice["USD"](5)), ter(tecNO_PERMISSION));
-
447  env.close();
-
448  }
-
449 
-
450  // bob issues 10 CAD to alice.
-
451  // alice then attempts to submit a clawback tx to claw CAD from bob.
-
452  // this must FAIL, because alice is not the issuer for this
-
453  // trustline!!!
-
454  {
-
455  // alice creates a trustline with bob, and bob sends 10 CAD to
-
456  // alice
-
457  env.trust(CAD(1000), alice);
-
458  env(pay(bob, alice, CAD(10)));
-
459  env.close();
-
460 
-
461  env.require(balance(bob, alice["CAD"](-10)));
-
462  env.require(balance(alice, bob["CAD"](10)));
-
463 
-
464  // alice cannot claw back CAD from bob because she's not the
-
465  // issuer
-
466  env(claw(alice, bob["CAD"](5)), ter(tecNO_PERMISSION));
-
467  env.close();
-
468  }
-
469  }
-
470  }
-
471 
-
472  void
-
473  testEnabled(FeatureBitset features)
-
474  {
-
475  testcase("Enable clawback");
-
476  using namespace test::jtx;
-
477 
-
478  // Test that alice is able to successfully clawback tokens from bob
-
479  Env env(*this, features);
-
480 
-
481  Account alice{"alice"};
-
482  Account bob{"bob"};
-
483 
-
484  env.fund(XRP(1000), alice, bob);
-
485  env.close();
-
486 
-
487  auto const USD = alice["USD"];
+
377  auto const USD = alice["USD"];
+
378 
+
379  // alice sets asfAllowTrustLineClawback
+
380  env(fset(alice, asfAllowTrustLineClawback));
+
381  env.close();
+
382  env.require(flags(alice, asfAllowTrustLineClawback));
+
383 
+
384  // cindy sets asfAllowTrustLineClawback
+
385  env(fset(cindy, asfAllowTrustLineClawback));
+
386  env.close();
+
387  env.require(flags(cindy, asfAllowTrustLineClawback));
+
388 
+
389  // alice issues 1000 USD to bob
+
390  env.trust(USD(1000), bob);
+
391  env(pay(alice, bob, USD(1000)));
+
392  env.close();
+
393 
+
394  env.require(balance(bob, alice["USD"](1000)));
+
395  env.require(balance(alice, bob["USD"](-1000)));
+
396 
+
397  // cindy tries to claw from bob, and fails because trustline does
+
398  // not exist
+
399  env(claw(cindy, bob["USD"](200)), ter(tecNO_LINE));
+
400  env.close();
+
401  }
+
402 
+
403  // When a trustline is created between issuer and holder,
+
404  // we must make sure the holder is unable to claw back from
+
405  // the issuer by impersonating the issuer account.
+
406  //
+
407  // This must be tested bidirectionally for both accounts because the
+
408  // issuer could be either the low or high account in the trustline
+
409  // object
+
410  {
+
411  Env env(*this, features);
+
412 
+
413  Account alice{"alice"};
+
414  Account bob{"bob"};
+
415 
+
416  env.fund(XRP(1000), alice, bob);
+
417  env.close();
+
418 
+
419  auto const USD = alice["USD"];
+
420  auto const CAD = bob["CAD"];
+
421 
+
422  // alice sets asfAllowTrustLineClawback
+
423  env(fset(alice, asfAllowTrustLineClawback));
+
424  env.close();
+
425  env.require(flags(alice, asfAllowTrustLineClawback));
+
426 
+
427  // bob sets asfAllowTrustLineClawback
+
428  env(fset(bob, asfAllowTrustLineClawback));
+
429  env.close();
+
430  env.require(flags(bob, asfAllowTrustLineClawback));
+
431 
+
432  // alice issues 10 USD to bob.
+
433  // bob then attempts to submit a clawback tx to claw USD from alice.
+
434  // this must FAIL, because bob is not the issuer for this
+
435  // trustline!!!
+
436  {
+
437  // bob creates a trustline with alice, and alice sends 10 USD to
+
438  // bob
+
439  env.trust(USD(1000), bob);
+
440  env(pay(alice, bob, USD(10)));
+
441  env.close();
+
442 
+
443  env.require(balance(bob, alice["USD"](10)));
+
444  env.require(balance(alice, bob["USD"](-10)));
+
445 
+
446  // bob cannot claw back USD from alice because he's not the
+
447  // issuer
+
448  env(claw(bob, alice["USD"](5)), ter(tecNO_PERMISSION));
+
449  env.close();
+
450  }
+
451 
+
452  // bob issues 10 CAD to alice.
+
453  // alice then attempts to submit a clawback tx to claw CAD from bob.
+
454  // this must FAIL, because alice is not the issuer for this
+
455  // trustline!!!
+
456  {
+
457  // alice creates a trustline with bob, and bob sends 10 CAD to
+
458  // alice
+
459  env.trust(CAD(1000), alice);
+
460  env(pay(bob, alice, CAD(10)));
+
461  env.close();
+
462 
+
463  env.require(balance(bob, alice["CAD"](-10)));
+
464  env.require(balance(alice, bob["CAD"](10)));
+
465 
+
466  // alice cannot claw back CAD from bob because she's not the
+
467  // issuer
+
468  env(claw(alice, bob["CAD"](5)), ter(tecNO_PERMISSION));
+
469  env.close();
+
470  }
+
471  }
+
472  }
+
473 
+
474  void
+
475  testEnabled(FeatureBitset features)
+
476  {
+
477  testcase("Enable clawback");
+
478  using namespace test::jtx;
+
479 
+
480  // Test that alice is able to successfully clawback tokens from bob
+
481  Env env(*this, features);
+
482 
+
483  Account alice{"alice"};
+
484  Account bob{"bob"};
+
485 
+
486  env.fund(XRP(1000), alice, bob);
+
487  env.close();
488 
-
489  // alice sets asfAllowClawback
-
490  env(fset(alice, asfAllowClawback));
-
491  env.close();
-
492  env.require(flags(alice, asfAllowClawback));
-
493 
-
494  // alice issues 1000 USD to bob
-
495  env.trust(USD(1000), bob);
-
496  env(pay(alice, bob, USD(1000)));
-
497  env.close();
-
498 
-
499  env.require(balance(bob, alice["USD"](1000)));
-
500  env.require(balance(alice, bob["USD"](-1000)));
-
501 
-
502  // alice claws back 200 USD from bob
-
503  env(claw(alice, bob["USD"](200)));
-
504  env.close();
-
505 
-
506  // bob should have 800 USD left
-
507  env.require(balance(bob, alice["USD"](800)));
-
508  env.require(balance(alice, bob["USD"](-800)));
-
509 
-
510  // alice claws back 800 USD from bob again
-
511  env(claw(alice, bob["USD"](800)));
-
512  env.close();
-
513 
-
514  // trustline has a balance of 0
-
515  env.require(balance(bob, alice["USD"](0)));
-
516  env.require(balance(alice, bob["USD"](0)));
-
517  }
-
518 
-
519  void
-
520  testMultiLine(FeatureBitset features)
-
521  {
-
522  // Test scenarios where multiple trustlines are involved
-
523  testcase("Multi line");
-
524  using namespace test::jtx;
-
525 
-
526  // Both alice and bob issues their own "USD" to cindy.
-
527  // When alice and bob tries to claw back, they will only
-
528  // claw back from their respective trustline.
-
529  {
-
530  Env env(*this, features);
-
531 
-
532  Account alice{"alice"};
-
533  Account bob{"bob"};
-
534  Account cindy{"cindy"};
-
535 
-
536  env.fund(XRP(1000), alice, bob, cindy);
-
537  env.close();
-
538 
-
539  // alice sets asfAllowClawback
-
540  env(fset(alice, asfAllowClawback));
-
541  env.close();
-
542  env.require(flags(alice, asfAllowClawback));
-
543 
-
544  // bob sets asfAllowClawback
-
545  env(fset(bob, asfAllowClawback));
-
546  env.close();
-
547  env.require(flags(bob, asfAllowClawback));
-
548 
-
549  // alice sends 1000 USD to cindy
-
550  env.trust(alice["USD"](1000), cindy);
-
551  env(pay(alice, cindy, alice["USD"](1000)));
-
552  env.close();
-
553 
-
554  // bob sends 1000 USD to cindy
-
555  env.trust(bob["USD"](1000), cindy);
-
556  env(pay(bob, cindy, bob["USD"](1000)));
-
557  env.close();
-
558 
-
559  // alice claws back 200 USD from cindy
-
560  env(claw(alice, cindy["USD"](200)));
-
561  env.close();
-
562 
-
563  // cindy has 800 USD left in alice's trustline after clawed by alice
-
564  env.require(balance(cindy, alice["USD"](800)));
-
565  env.require(balance(alice, cindy["USD"](-800)));
-
566 
-
567  // cindy still has 1000 USD in bob's trustline
-
568  env.require(balance(cindy, bob["USD"](1000)));
-
569  env.require(balance(bob, cindy["USD"](-1000)));
-
570 
-
571  // bob claws back 600 USD from cindy
-
572  env(claw(bob, cindy["USD"](600)));
-
573  env.close();
-
574 
-
575  // cindy has 400 USD left in bob's trustline after clawed by bob
-
576  env.require(balance(cindy, bob["USD"](400)));
-
577  env.require(balance(bob, cindy["USD"](-400)));
-
578 
-
579  // cindy still has 800 USD in alice's trustline
-
580  env.require(balance(cindy, alice["USD"](800)));
-
581  env.require(balance(alice, cindy["USD"](-800)));
-
582  }
-
583 
-
584  // alice issues USD to both bob and cindy.
-
585  // when alice claws back from bob, only bob's USD balance is
-
586  // affected, and cindy's balance remains unchanged, and vice versa.
-
587  {
-
588  Env env(*this, features);
-
589 
-
590  Account alice{"alice"};
-
591  Account bob{"bob"};
-
592  Account cindy{"cindy"};
-
593 
-
594  env.fund(XRP(1000), alice, bob, cindy);
-
595  env.close();
-
596 
-
597  auto const USD = alice["USD"];
+
489  auto const USD = alice["USD"];
+
490 
+
491  // alice sets asfAllowTrustLineClawback
+
492  env(fset(alice, asfAllowTrustLineClawback));
+
493  env.close();
+
494  env.require(flags(alice, asfAllowTrustLineClawback));
+
495 
+
496  // alice issues 1000 USD to bob
+
497  env.trust(USD(1000), bob);
+
498  env(pay(alice, bob, USD(1000)));
+
499  env.close();
+
500 
+
501  env.require(balance(bob, alice["USD"](1000)));
+
502  env.require(balance(alice, bob["USD"](-1000)));
+
503 
+
504  // alice claws back 200 USD from bob
+
505  env(claw(alice, bob["USD"](200)));
+
506  env.close();
+
507 
+
508  // bob should have 800 USD left
+
509  env.require(balance(bob, alice["USD"](800)));
+
510  env.require(balance(alice, bob["USD"](-800)));
+
511 
+
512  // alice claws back 800 USD from bob again
+
513  env(claw(alice, bob["USD"](800)));
+
514  env.close();
+
515 
+
516  // trustline has a balance of 0
+
517  env.require(balance(bob, alice["USD"](0)));
+
518  env.require(balance(alice, bob["USD"](0)));
+
519  }
+
520 
+
521  void
+
522  testMultiLine(FeatureBitset features)
+
523  {
+
524  // Test scenarios where multiple trustlines are involved
+
525  testcase("Multi line");
+
526  using namespace test::jtx;
+
527 
+
528  // Both alice and bob issues their own "USD" to cindy.
+
529  // When alice and bob tries to claw back, they will only
+
530  // claw back from their respective trustline.
+
531  {
+
532  Env env(*this, features);
+
533 
+
534  Account alice{"alice"};
+
535  Account bob{"bob"};
+
536  Account cindy{"cindy"};
+
537 
+
538  env.fund(XRP(1000), alice, bob, cindy);
+
539  env.close();
+
540 
+
541  // alice sets asfAllowTrustLineClawback
+
542  env(fset(alice, asfAllowTrustLineClawback));
+
543  env.close();
+
544  env.require(flags(alice, asfAllowTrustLineClawback));
+
545 
+
546  // bob sets asfAllowTrustLineClawback
+
547  env(fset(bob, asfAllowTrustLineClawback));
+
548  env.close();
+
549  env.require(flags(bob, asfAllowTrustLineClawback));
+
550 
+
551  // alice sends 1000 USD to cindy
+
552  env.trust(alice["USD"](1000), cindy);
+
553  env(pay(alice, cindy, alice["USD"](1000)));
+
554  env.close();
+
555 
+
556  // bob sends 1000 USD to cindy
+
557  env.trust(bob["USD"](1000), cindy);
+
558  env(pay(bob, cindy, bob["USD"](1000)));
+
559  env.close();
+
560 
+
561  // alice claws back 200 USD from cindy
+
562  env(claw(alice, cindy["USD"](200)));
+
563  env.close();
+
564 
+
565  // cindy has 800 USD left in alice's trustline after clawed by alice
+
566  env.require(balance(cindy, alice["USD"](800)));
+
567  env.require(balance(alice, cindy["USD"](-800)));
+
568 
+
569  // cindy still has 1000 USD in bob's trustline
+
570  env.require(balance(cindy, bob["USD"](1000)));
+
571  env.require(balance(bob, cindy["USD"](-1000)));
+
572 
+
573  // bob claws back 600 USD from cindy
+
574  env(claw(bob, cindy["USD"](600)));
+
575  env.close();
+
576 
+
577  // cindy has 400 USD left in bob's trustline after clawed by bob
+
578  env.require(balance(cindy, bob["USD"](400)));
+
579  env.require(balance(bob, cindy["USD"](-400)));
+
580 
+
581  // cindy still has 800 USD in alice's trustline
+
582  env.require(balance(cindy, alice["USD"](800)));
+
583  env.require(balance(alice, cindy["USD"](-800)));
+
584  }
+
585 
+
586  // alice issues USD to both bob and cindy.
+
587  // when alice claws back from bob, only bob's USD balance is
+
588  // affected, and cindy's balance remains unchanged, and vice versa.
+
589  {
+
590  Env env(*this, features);
+
591 
+
592  Account alice{"alice"};
+
593  Account bob{"bob"};
+
594  Account cindy{"cindy"};
+
595 
+
596  env.fund(XRP(1000), alice, bob, cindy);
+
597  env.close();
598 
-
599  // alice sets asfAllowClawback
-
600  env(fset(alice, asfAllowClawback));
-
601  env.close();
-
602  env.require(flags(alice, asfAllowClawback));
-
603 
-
604  // alice sends 600 USD to bob
-
605  env.trust(USD(1000), bob);
-
606  env(pay(alice, bob, USD(600)));
-
607  env.close();
-
608 
-
609  env.require(balance(alice, bob["USD"](-600)));
-
610  env.require(balance(bob, alice["USD"](600)));
-
611 
-
612  // alice sends 1000 USD to cindy
-
613  env.trust(USD(1000), cindy);
-
614  env(pay(alice, cindy, USD(1000)));
-
615  env.close();
-
616 
-
617  env.require(balance(alice, cindy["USD"](-1000)));
-
618  env.require(balance(cindy, alice["USD"](1000)));
-
619 
-
620  // alice claws back 500 USD from bob
-
621  env(claw(alice, bob["USD"](500)));
-
622  env.close();
-
623 
-
624  // bob's balance is reduced
-
625  env.require(balance(alice, bob["USD"](-100)));
-
626  env.require(balance(bob, alice["USD"](100)));
-
627 
-
628  // cindy's balance is unchanged
-
629  env.require(balance(alice, cindy["USD"](-1000)));
-
630  env.require(balance(cindy, alice["USD"](1000)));
-
631 
-
632  // alice claws back 300 USD from cindy
-
633  env(claw(alice, cindy["USD"](300)));
-
634  env.close();
-
635 
-
636  // bob's balance is unchanged
-
637  env.require(balance(alice, bob["USD"](-100)));
-
638  env.require(balance(bob, alice["USD"](100)));
-
639 
-
640  // cindy's balance is reduced
-
641  env.require(balance(alice, cindy["USD"](-700)));
-
642  env.require(balance(cindy, alice["USD"](700)));
-
643  }
-
644  }
-
645 
-
646  void
-
647  testBidirectionalLine(FeatureBitset features)
-
648  {
-
649  testcase("Bidirectional line");
-
650  using namespace test::jtx;
-
651 
-
652  // Test when both alice and bob issues USD to each other.
-
653  // This scenario creates only one trustline.
-
654  // In this case, both alice and bob can be seen as the "issuer"
-
655  // and they can send however many USDs to each other.
-
656  // We test that only the person who has a negative balance from their
-
657  // perspective is allowed to clawback
-
658  Env env(*this, features);
-
659 
-
660  Account alice{"alice"};
-
661  Account bob{"bob"};
-
662 
-
663  env.fund(XRP(1000), alice, bob);
-
664  env.close();
-
665 
-
666  // alice sets asfAllowClawback
-
667  env(fset(alice, asfAllowClawback));
-
668  env.close();
-
669  env.require(flags(alice, asfAllowClawback));
-
670 
-
671  // bob sets asfAllowClawback
-
672  env(fset(bob, asfAllowClawback));
-
673  env.close();
-
674  env.require(flags(bob, asfAllowClawback));
-
675 
-
676  // alice issues 1000 USD to bob
-
677  env.trust(alice["USD"](1000), bob);
-
678  env(pay(alice, bob, alice["USD"](1000)));
-
679  env.close();
-
680 
-
681  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
682  BEAST_EXPECT(ownerCount(env, bob) == 1);
-
683 
-
684  // bob is the holder, and alice is the issuer
-
685  env.require(balance(bob, alice["USD"](1000)));
-
686  env.require(balance(alice, bob["USD"](-1000)));
-
687 
-
688  // bob issues 1500 USD to alice
-
689  env.trust(bob["USD"](1500), alice);
-
690  env(pay(bob, alice, bob["USD"](1500)));
-
691  env.close();
-
692 
-
693  BEAST_EXPECT(ownerCount(env, alice) == 1);
-
694  BEAST_EXPECT(ownerCount(env, bob) == 1);
-
695 
-
696  // bob has negative 500 USD because bob issued 500 USD more than alice
-
697  // bob can now been seen as the issuer, while alice is the holder
-
698  env.require(balance(bob, alice["USD"](-500)));
-
699  env.require(balance(alice, bob["USD"](500)));
-
700 
-
701  // At this point, both alice and bob are the issuers of USD
-
702  // and can send USD to each other through one trustline
-
703 
-
704  // alice fails to clawback. Even though she is also an issuer,
-
705  // the trustline balance is positive from her perspective
-
706  env(claw(alice, bob["USD"](200)), ter(tecNO_PERMISSION));
-
707  env.close();
-
708 
-
709  // bob is able to successfully clawback from alice because
-
710  // the trustline balance is negative from his perspective
-
711  env(claw(bob, alice["USD"](200)));
-
712  env.close();
-
713 
-
714  env.require(balance(bob, alice["USD"](-300)));
-
715  env.require(balance(alice, bob["USD"](300)));
-
716 
-
717  // alice pays bob 1000 USD
-
718  env(pay(alice, bob, alice["USD"](1000)));
-
719  env.close();
-
720 
-
721  // bob's balance becomes positive from his perspective because
-
722  // alice issued more USD than the balance
-
723  env.require(balance(bob, alice["USD"](700)));
-
724  env.require(balance(alice, bob["USD"](-700)));
-
725 
-
726  // bob is now the holder and fails to clawback
-
727  env(claw(bob, alice["USD"](200)), ter(tecNO_PERMISSION));
-
728  env.close();
-
729 
-
730  // alice successfully claws back
-
731  env(claw(alice, bob["USD"](200)));
-
732  env.close();
-
733 
-
734  env.require(balance(bob, alice["USD"](500)));
-
735  env.require(balance(alice, bob["USD"](-500)));
-
736  }
-
737 
-
738  void
-
739  testDeleteDefaultLine(FeatureBitset features)
-
740  {
-
741  testcase("Delete default trustline");
-
742  using namespace test::jtx;
-
743 
-
744  // If clawback results the trustline to be default,
-
745  // trustline should be automatically deleted
-
746  Env env(*this, features);
-
747  Account alice{"alice"};
-
748  Account bob{"bob"};
-
749 
-
750  env.fund(XRP(1000), alice, bob);
-
751  env.close();
-
752 
-
753  auto const USD = alice["USD"];
+
599  auto const USD = alice["USD"];
+
600 
+
601  // alice sets asfAllowTrustLineClawback
+
602  env(fset(alice, asfAllowTrustLineClawback));
+
603  env.close();
+
604  env.require(flags(alice, asfAllowTrustLineClawback));
+
605 
+
606  // alice sends 600 USD to bob
+
607  env.trust(USD(1000), bob);
+
608  env(pay(alice, bob, USD(600)));
+
609  env.close();
+
610 
+
611  env.require(balance(alice, bob["USD"](-600)));
+
612  env.require(balance(bob, alice["USD"](600)));
+
613 
+
614  // alice sends 1000 USD to cindy
+
615  env.trust(USD(1000), cindy);
+
616  env(pay(alice, cindy, USD(1000)));
+
617  env.close();
+
618 
+
619  env.require(balance(alice, cindy["USD"](-1000)));
+
620  env.require(balance(cindy, alice["USD"](1000)));
+
621 
+
622  // alice claws back 500 USD from bob
+
623  env(claw(alice, bob["USD"](500)));
+
624  env.close();
+
625 
+
626  // bob's balance is reduced
+
627  env.require(balance(alice, bob["USD"](-100)));
+
628  env.require(balance(bob, alice["USD"](100)));
+
629 
+
630  // cindy's balance is unchanged
+
631  env.require(balance(alice, cindy["USD"](-1000)));
+
632  env.require(balance(cindy, alice["USD"](1000)));
+
633 
+
634  // alice claws back 300 USD from cindy
+
635  env(claw(alice, cindy["USD"](300)));
+
636  env.close();
+
637 
+
638  // bob's balance is unchanged
+
639  env.require(balance(alice, bob["USD"](-100)));
+
640  env.require(balance(bob, alice["USD"](100)));
+
641 
+
642  // cindy's balance is reduced
+
643  env.require(balance(alice, cindy["USD"](-700)));
+
644  env.require(balance(cindy, alice["USD"](700)));
+
645  }
+
646  }
+
647 
+
648  void
+
649  testBidirectionalLine(FeatureBitset features)
+
650  {
+
651  testcase("Bidirectional line");
+
652  using namespace test::jtx;
+
653 
+
654  // Test when both alice and bob issues USD to each other.
+
655  // This scenario creates only one trustline.
+
656  // In this case, both alice and bob can be seen as the "issuer"
+
657  // and they can send however many USDs to each other.
+
658  // We test that only the person who has a negative balance from their
+
659  // perspective is allowed to clawback
+
660  Env env(*this, features);
+
661 
+
662  Account alice{"alice"};
+
663  Account bob{"bob"};
+
664 
+
665  env.fund(XRP(1000), alice, bob);
+
666  env.close();
+
667 
+
668  // alice sets asfAllowTrustLineClawback
+
669  env(fset(alice, asfAllowTrustLineClawback));
+
670  env.close();
+
671  env.require(flags(alice, asfAllowTrustLineClawback));
+
672 
+
673  // bob sets asfAllowTrustLineClawback
+
674  env(fset(bob, asfAllowTrustLineClawback));
+
675  env.close();
+
676  env.require(flags(bob, asfAllowTrustLineClawback));
+
677 
+
678  // alice issues 1000 USD to bob
+
679  env.trust(alice["USD"](1000), bob);
+
680  env(pay(alice, bob, alice["USD"](1000)));
+
681  env.close();
+
682 
+
683  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
684  BEAST_EXPECT(ownerCount(env, bob) == 1);
+
685 
+
686  // bob is the holder, and alice is the issuer
+
687  env.require(balance(bob, alice["USD"](1000)));
+
688  env.require(balance(alice, bob["USD"](-1000)));
+
689 
+
690  // bob issues 1500 USD to alice
+
691  env.trust(bob["USD"](1500), alice);
+
692  env(pay(bob, alice, bob["USD"](1500)));
+
693  env.close();
+
694 
+
695  BEAST_EXPECT(ownerCount(env, alice) == 1);
+
696  BEAST_EXPECT(ownerCount(env, bob) == 1);
+
697 
+
698  // bob has negative 500 USD because bob issued 500 USD more than alice
+
699  // bob can now been seen as the issuer, while alice is the holder
+
700  env.require(balance(bob, alice["USD"](-500)));
+
701  env.require(balance(alice, bob["USD"](500)));
+
702 
+
703  // At this point, both alice and bob are the issuers of USD
+
704  // and can send USD to each other through one trustline
+
705 
+
706  // alice fails to clawback. Even though she is also an issuer,
+
707  // the trustline balance is positive from her perspective
+
708  env(claw(alice, bob["USD"](200)), ter(tecNO_PERMISSION));
+
709  env.close();
+
710 
+
711  // bob is able to successfully clawback from alice because
+
712  // the trustline balance is negative from his perspective
+
713  env(claw(bob, alice["USD"](200)));
+
714  env.close();
+
715 
+
716  env.require(balance(bob, alice["USD"](-300)));
+
717  env.require(balance(alice, bob["USD"](300)));
+
718 
+
719  // alice pays bob 1000 USD
+
720  env(pay(alice, bob, alice["USD"](1000)));
+
721  env.close();
+
722 
+
723  // bob's balance becomes positive from his perspective because
+
724  // alice issued more USD than the balance
+
725  env.require(balance(bob, alice["USD"](700)));
+
726  env.require(balance(alice, bob["USD"](-700)));
+
727 
+
728  // bob is now the holder and fails to clawback
+
729  env(claw(bob, alice["USD"](200)), ter(tecNO_PERMISSION));
+
730  env.close();
+
731 
+
732  // alice successfully claws back
+
733  env(claw(alice, bob["USD"](200)));
+
734  env.close();
+
735 
+
736  env.require(balance(bob, alice["USD"](500)));
+
737  env.require(balance(alice, bob["USD"](-500)));
+
738  }
+
739 
+
740  void
+
741  testDeleteDefaultLine(FeatureBitset features)
+
742  {
+
743  testcase("Delete default trustline");
+
744  using namespace test::jtx;
+
745 
+
746  // If clawback results the trustline to be default,
+
747  // trustline should be automatically deleted
+
748  Env env(*this, features);
+
749  Account alice{"alice"};
+
750  Account bob{"bob"};
+
751 
+
752  env.fund(XRP(1000), alice, bob);
+
753  env.close();
754 
-
755  // alice sets asfAllowClawback
-
756  env(fset(alice, asfAllowClawback));
-
757  env.close();
-
758  env.require(flags(alice, asfAllowClawback));
-
759 
-
760  // alice issues 1000 USD to bob
-
761  env.trust(USD(1000), bob);
-
762  env(pay(alice, bob, USD(1000)));
-
763  env.close();
-
764 
-
765  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
766  BEAST_EXPECT(ownerCount(env, bob) == 1);
-
767 
-
768  env.require(balance(bob, alice["USD"](1000)));
-
769  env.require(balance(alice, bob["USD"](-1000)));
-
770 
-
771  // set limit to default,
-
772  env(trust(bob, USD(0), 0));
-
773  env.close();
-
774 
-
775  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
776  BEAST_EXPECT(ownerCount(env, bob) == 1);
-
777 
-
778  // alice claws back full amount from bob, and should also delete
-
779  // trustline
-
780  env(claw(alice, bob["USD"](1000)));
-
781  env.close();
-
782 
-
783  // bob no longer owns the trustline because it was deleted
-
784  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
785  BEAST_EXPECT(ownerCount(env, bob) == 0);
-
786  }
-
787 
-
788  void
-
789  testFrozenLine(FeatureBitset features)
-
790  {
-
791  testcase("Frozen trustline");
-
792  using namespace test::jtx;
-
793 
-
794  // Claws back from frozen trustline
-
795  // and the trustline should remain frozen
-
796  Env env(*this, features);
-
797  Account alice{"alice"};
-
798  Account bob{"bob"};
-
799 
-
800  env.fund(XRP(1000), alice, bob);
-
801  env.close();
-
802 
-
803  auto const USD = alice["USD"];
+
755  auto const USD = alice["USD"];
+
756 
+
757  // alice sets asfAllowTrustLineClawback
+
758  env(fset(alice, asfAllowTrustLineClawback));
+
759  env.close();
+
760  env.require(flags(alice, asfAllowTrustLineClawback));
+
761 
+
762  // alice issues 1000 USD to bob
+
763  env.trust(USD(1000), bob);
+
764  env(pay(alice, bob, USD(1000)));
+
765  env.close();
+
766 
+
767  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
768  BEAST_EXPECT(ownerCount(env, bob) == 1);
+
769 
+
770  env.require(balance(bob, alice["USD"](1000)));
+
771  env.require(balance(alice, bob["USD"](-1000)));
+
772 
+
773  // set limit to default,
+
774  env(trust(bob, USD(0), 0));
+
775  env.close();
+
776 
+
777  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
778  BEAST_EXPECT(ownerCount(env, bob) == 1);
+
779 
+
780  // alice claws back full amount from bob, and should also delete
+
781  // trustline
+
782  env(claw(alice, bob["USD"](1000)));
+
783  env.close();
+
784 
+
785  // bob no longer owns the trustline because it was deleted
+
786  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
787  BEAST_EXPECT(ownerCount(env, bob) == 0);
+
788  }
+
789 
+
790  void
+
791  testFrozenLine(FeatureBitset features)
+
792  {
+
793  testcase("Frozen trustline");
+
794  using namespace test::jtx;
+
795 
+
796  // Claws back from frozen trustline
+
797  // and the trustline should remain frozen
+
798  Env env(*this, features);
+
799  Account alice{"alice"};
+
800  Account bob{"bob"};
+
801 
+
802  env.fund(XRP(1000), alice, bob);
+
803  env.close();
804 
-
805  // alice sets asfAllowClawback
-
806  env(fset(alice, asfAllowClawback));
-
807  env.close();
-
808  env.require(flags(alice, asfAllowClawback));
-
809 
-
810  // alice issues 1000 USD to bob
-
811  env.trust(USD(1000), bob);
-
812  env(pay(alice, bob, USD(1000)));
-
813  env.close();
-
814 
-
815  env.require(balance(bob, alice["USD"](1000)));
-
816  env.require(balance(alice, bob["USD"](-1000)));
-
817 
-
818  // freeze trustline
-
819  env(trust(alice, bob["USD"](0), tfSetFreeze));
-
820  env.close();
-
821 
-
822  // alice claws back 200 USD from bob
-
823  env(claw(alice, bob["USD"](200)));
-
824  env.close();
-
825 
-
826  // bob should have 800 USD left
-
827  env.require(balance(bob, alice["USD"](800)));
-
828  env.require(balance(alice, bob["USD"](-800)));
-
829 
-
830  // trustline remains frozen
-
831  BEAST_EXPECT(getLineFreezeFlag(env, alice, bob, USD.currency));
-
832  }
-
833 
-
834  void
-
835  testAmountExceedsAvailable(FeatureBitset features)
-
836  {
-
837  testcase("Amount exceeds available");
-
838  using namespace test::jtx;
-
839 
-
840  // When alice tries to claw back an amount that is greater
-
841  // than what bob holds, only the max available balance is clawed
-
842  Env env(*this, features);
-
843  Account alice{"alice"};
-
844  Account bob{"bob"};
-
845 
-
846  env.fund(XRP(1000), alice, bob);
-
847  env.close();
-
848 
-
849  auto const USD = alice["USD"];
+
805  auto const USD = alice["USD"];
+
806 
+
807  // alice sets asfAllowTrustLineClawback
+
808  env(fset(alice, asfAllowTrustLineClawback));
+
809  env.close();
+
810  env.require(flags(alice, asfAllowTrustLineClawback));
+
811 
+
812  // alice issues 1000 USD to bob
+
813  env.trust(USD(1000), bob);
+
814  env(pay(alice, bob, USD(1000)));
+
815  env.close();
+
816 
+
817  env.require(balance(bob, alice["USD"](1000)));
+
818  env.require(balance(alice, bob["USD"](-1000)));
+
819 
+
820  // freeze trustline
+
821  env(trust(alice, bob["USD"](0), tfSetFreeze));
+
822  env.close();
+
823 
+
824  // alice claws back 200 USD from bob
+
825  env(claw(alice, bob["USD"](200)));
+
826  env.close();
+
827 
+
828  // bob should have 800 USD left
+
829  env.require(balance(bob, alice["USD"](800)));
+
830  env.require(balance(alice, bob["USD"](-800)));
+
831 
+
832  // trustline remains frozen
+
833  BEAST_EXPECT(getLineFreezeFlag(env, alice, bob, USD.currency));
+
834  }
+
835 
+
836  void
+
837  testAmountExceedsAvailable(FeatureBitset features)
+
838  {
+
839  testcase("Amount exceeds available");
+
840  using namespace test::jtx;
+
841 
+
842  // When alice tries to claw back an amount that is greater
+
843  // than what bob holds, only the max available balance is clawed
+
844  Env env(*this, features);
+
845  Account alice{"alice"};
+
846  Account bob{"bob"};
+
847 
+
848  env.fund(XRP(1000), alice, bob);
+
849  env.close();
850 
-
851  // alice sets asfAllowClawback
-
852  env(fset(alice, asfAllowClawback));
-
853  env.close();
-
854  env.require(flags(alice, asfAllowClawback));
-
855 
-
856  // alice issues 1000 USD to bob
-
857  env.trust(USD(1000), bob);
-
858  env(pay(alice, bob, USD(1000)));
-
859  env.close();
-
860 
-
861  env.require(balance(bob, alice["USD"](1000)));
-
862  env.require(balance(alice, bob["USD"](-1000)));
-
863 
-
864  // alice tries to claw back 2000 USD
-
865  env(claw(alice, bob["USD"](2000)));
-
866  env.close();
-
867 
-
868  // check alice and bob's balance.
-
869  // alice was only able to claw back 1000 USD at maximum
-
870  env.require(balance(bob, alice["USD"](0)));
-
871  env.require(balance(alice, bob["USD"](0)));
-
872 
-
873  // bob still owns the trustline because trustline is not in default
-
874  // state
-
875  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
876  BEAST_EXPECT(ownerCount(env, bob) == 1);
-
877 
-
878  // set limit to default,
-
879  env(trust(bob, USD(0), 0));
-
880  env.close();
-
881 
-
882  // verify that bob's trustline was deleted
-
883  BEAST_EXPECT(ownerCount(env, alice) == 0);
-
884  BEAST_EXPECT(ownerCount(env, bob) == 0);
-
885  }
-
886 
-
887  void
-
888  testTickets(FeatureBitset features)
-
889  {
-
890  testcase("Tickets");
-
891  using namespace test::jtx;
-
892 
-
893  // Tests clawback with tickets
-
894  Env env(*this, features);
-
895  Account alice{"alice"};
-
896  Account bob{"bob"};
-
897 
-
898  env.fund(XRP(1000), alice, bob);
-
899  env.close();
-
900 
-
901  auto const USD = alice["USD"];
+
851  auto const USD = alice["USD"];
+
852 
+
853  // alice sets asfAllowTrustLineClawback
+
854  env(fset(alice, asfAllowTrustLineClawback));
+
855  env.close();
+
856  env.require(flags(alice, asfAllowTrustLineClawback));
+
857 
+
858  // alice issues 1000 USD to bob
+
859  env.trust(USD(1000), bob);
+
860  env(pay(alice, bob, USD(1000)));
+
861  env.close();
+
862 
+
863  env.require(balance(bob, alice["USD"](1000)));
+
864  env.require(balance(alice, bob["USD"](-1000)));
+
865 
+
866  // alice tries to claw back 2000 USD
+
867  env(claw(alice, bob["USD"](2000)));
+
868  env.close();
+
869 
+
870  // check alice and bob's balance.
+
871  // alice was only able to claw back 1000 USD at maximum
+
872  env.require(balance(bob, alice["USD"](0)));
+
873  env.require(balance(alice, bob["USD"](0)));
+
874 
+
875  // bob still owns the trustline because trustline is not in default
+
876  // state
+
877  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
878  BEAST_EXPECT(ownerCount(env, bob) == 1);
+
879 
+
880  // set limit to default,
+
881  env(trust(bob, USD(0), 0));
+
882  env.close();
+
883 
+
884  // verify that bob's trustline was deleted
+
885  BEAST_EXPECT(ownerCount(env, alice) == 0);
+
886  BEAST_EXPECT(ownerCount(env, bob) == 0);
+
887  }
+
888 
+
889  void
+
890  testTickets(FeatureBitset features)
+
891  {
+
892  testcase("Tickets");
+
893  using namespace test::jtx;
+
894 
+
895  // Tests clawback with tickets
+
896  Env env(*this, features);
+
897  Account alice{"alice"};
+
898  Account bob{"bob"};
+
899 
+
900  env.fund(XRP(1000), alice, bob);
+
901  env.close();
902 
-
903  // alice sets asfAllowClawback
-
904  env(fset(alice, asfAllowClawback));
-
905  env.close();
-
906  env.require(flags(alice, asfAllowClawback));
-
907 
-
908  // alice issues 100 USD to bob
-
909  env.trust(USD(1000), bob);
-
910  env(pay(alice, bob, USD(100)));
-
911  env.close();
-
912 
-
913  env.require(balance(bob, alice["USD"](100)));
-
914  env.require(balance(alice, bob["USD"](-100)));
-
915 
-
916  // alice creates 10 tickets
-
917  std::uint32_t ticketCnt = 10;
-
918  std::uint32_t aliceTicketSeq{env.seq(alice) + 1};
-
919  env(ticket::create(alice, ticketCnt));
-
920  env.close();
-
921  std::uint32_t const aliceSeq{env.seq(alice)};
-
922  BEAST_EXPECT(ticketCount(env, alice) == ticketCnt);
-
923  BEAST_EXPECT(ownerCount(env, alice) == ticketCnt);
-
924 
-
925  while (ticketCnt > 0)
-
926  {
-
927  // alice claws back 5 USD using a ticket
-
928  env(claw(alice, bob["USD"](5)), ticket::use(aliceTicketSeq++));
-
929  env.close();
-
930 
-
931  ticketCnt--;
-
932  BEAST_EXPECT(ticketCount(env, alice) == ticketCnt);
-
933  BEAST_EXPECT(ownerCount(env, alice) == ticketCnt);
-
934  }
-
935 
-
936  // alice clawed back 50 USD total, trustline has 50 USD remaining
-
937  env.require(balance(bob, alice["USD"](50)));
-
938  env.require(balance(alice, bob["USD"](-50)));
-
939 
-
940  // Verify that the account sequence numbers did not advance.
-
941  BEAST_EXPECT(env.seq(alice) == aliceSeq);
-
942  }
-
943 
-
944  void
-
945  testWithFeats(FeatureBitset features)
-
946  {
-
947  testAllowClawbackFlag(features);
-
948  testValidation(features);
-
949  testPermission(features);
-
950  testEnabled(features);
-
951  testMultiLine(features);
-
952  testBidirectionalLine(features);
-
953  testDeleteDefaultLine(features);
-
954  testFrozenLine(features);
-
955  testAmountExceedsAvailable(features);
-
956  testTickets(features);
-
957  }
-
958 
-
959 public:
-
960  void
-
961  run() override
-
962  {
-
963  using namespace test::jtx;
-
964  FeatureBitset const all{supported_amendments()};
-
965 
-
966  testWithFeats(all);
-
967  }
-
968 };
-
969 
-
970 BEAST_DEFINE_TESTSUITE(Clawback, app, ripple);
-
971 } // namespace ripple
+
903  auto const USD = alice["USD"];
+
904 
+
905  // alice sets asfAllowTrustLineClawback
+
906  env(fset(alice, asfAllowTrustLineClawback));
+
907  env.close();
+
908  env.require(flags(alice, asfAllowTrustLineClawback));
+
909 
+
910  // alice issues 100 USD to bob
+
911  env.trust(USD(1000), bob);
+
912  env(pay(alice, bob, USD(100)));
+
913  env.close();
+
914 
+
915  env.require(balance(bob, alice["USD"](100)));
+
916  env.require(balance(alice, bob["USD"](-100)));
+
917 
+
918  // alice creates 10 tickets
+
919  std::uint32_t ticketCnt = 10;
+
920  std::uint32_t aliceTicketSeq{env.seq(alice) + 1};
+
921  env(ticket::create(alice, ticketCnt));
+
922  env.close();
+
923  std::uint32_t const aliceSeq{env.seq(alice)};
+
924  BEAST_EXPECT(ticketCount(env, alice) == ticketCnt);
+
925  BEAST_EXPECT(ownerCount(env, alice) == ticketCnt);
+
926 
+
927  while (ticketCnt > 0)
+
928  {
+
929  // alice claws back 5 USD using a ticket
+
930  env(claw(alice, bob["USD"](5)), ticket::use(aliceTicketSeq++));
+
931  env.close();
+
932 
+
933  ticketCnt--;
+
934  BEAST_EXPECT(ticketCount(env, alice) == ticketCnt);
+
935  BEAST_EXPECT(ownerCount(env, alice) == ticketCnt);
+
936  }
+
937 
+
938  // alice clawed back 50 USD total, trustline has 50 USD remaining
+
939  env.require(balance(bob, alice["USD"](50)));
+
940  env.require(balance(alice, bob["USD"](-50)));
+
941 
+
942  // Verify that the account sequence numbers did not advance.
+
943  BEAST_EXPECT(env.seq(alice) == aliceSeq);
+
944  }
+
945 
+
946  void
+
947  testWithFeats(FeatureBitset features)
+
948  {
+
949  testAllowTrustLineClawbackFlag(features);
+
950  testValidation(features);
+
951  testPermission(features);
+
952  testEnabled(features);
+
953  testMultiLine(features);
+
954  testBidirectionalLine(features);
+
955  testDeleteDefaultLine(features);
+
956  testFrozenLine(features);
+
957  testAmountExceedsAvailable(features);
+
958  testTickets(features);
+
959  }
+
960 
+
961 public:
+
962  void
+
963  run() override
+
964  {
+
965  using namespace test::jtx;
+
966  FeatureBitset const all{supported_amendments()};
+
967 
+
968  testWithFeats(all);
+
969  }
+
970 };
+
971 
+
972 BEAST_DEFINE_TESTSUITE(Clawback, app, ripple);
+
973 } // namespace ripple
const SF_UINT32 sfOwnerCount
-
void testTickets(FeatureBitset features)
-
void testEnabled(FeatureBitset features)
+
void testTickets(FeatureBitset features)
+
void testEnabled(FeatureBitset features)
STL class.
BEAST_DEFINE_TESTSUITE(AccountTxPaging, app, ripple)
const uint256 featureClawback
@@ -1052,26 +1054,25 @@ $(function() {
static bool getLineFreezeFlag(test::jtx::Env const &env, test::jtx::Account const &src, test::jtx::Account const &dst, Currency const &cur)
@ all
constexpr std::uint32_t asfNoFreeze
Definition: TxFlags.h:79
-
void testBidirectionalLine(FeatureBitset features)
-
constexpr std::uint32_t asfAllowClawback
Definition: TxFlags.h:91
+
void testBidirectionalLine(FeatureBitset features)
-
void testDeleteDefaultLine(FeatureBitset features)
+
void testDeleteDefaultLine(FeatureBitset features)
+
void testAllowTrustLineClawbackFlag(FeatureBitset features)
AccountID id() const
Returns the Account ID.
Definition: Account.h:106
@ temINVALID_FLAG
Definition: TER.h:109
-
void testPermission(FeatureBitset features)
+
void testPermission(FeatureBitset features)
static std::string to_string(T const &t)
-
void testFrozenLine(FeatureBitset features)
-
void testMultiLine(FeatureBitset features)
+
void testFrozenLine(FeatureBitset features)
+
void testMultiLine(FeatureBitset features)
const SF_UINT32 sfTicketCount
static std::uint32_t ownerCount(test::jtx::Env const &env, test::jtx::Account const &acct)
@ temBAD_AMOUNT
Definition: TER.h:87
Keylet line(AccountID const &id0, AccountID const &id1, Currency const &currency) noexcept
The index of a trust line for a given currency.
Definition: Indexes.cpp:194
-
void testAmountExceedsAvailable(FeatureBitset features)
-
void run() override
+
void testAmountExceedsAvailable(FeatureBitset features)
+
void run() override
@ terNO_ACCOUNT
Definition: TER.h:200
-
void testAllowClawbackFlag(FeatureBitset features)
@ lsfHighFreeze
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr std::uint32_t tfSetFreeze
Definition: TxFlags.h:112
@@ -1079,12 +1080,13 @@ $(function() {
@ tecNO_LINE
Definition: TER.h:271
@ temDISABLED
Definition: TER.h:112
std::shared_ptr< SLE const > le(Account const &account) const
Return an account root.
Definition: Env.cpp:216
-
void testValidation(FeatureBitset features)
+
void testValidation(FeatureBitset features)
@ tecNO_PERMISSION
Definition: TER.h:275
Definition: Feature.h:113
Immutable cryptographic account descriptor.
Definition: Account.h:37
@ lsfLowFreeze
-
void testWithFeats(FeatureBitset features)
+
constexpr std::uint32_t asfAllowTrustLineClawback
Definition: TxFlags.h:91
+
void testWithFeats(FeatureBitset features)
A transaction testing environment.
Definition: Env.h:116
diff --git a/LedgerFormats_8h_source.html b/LedgerFormats_8h_source.html index a4426cde52..38a880de74 100644 --- a/LedgerFormats_8h_source.html +++ b/LedgerFormats_8h_source.html @@ -172,7 +172,7 @@ $(function() {
250  lsfDisallowIncomingTrustline =
251  0x20000000, // True, reject new trustlines (only if no issued assets)
252  lsfAMM [[maybe_unused]] = 0x40000000, // True, AMM account
-
253  lsfAllowClawback =
+
253  lsfAllowTrustLineClawback =
254  0x80000000, // True, enable clawback
255 
256  // ltOFFER
@@ -231,6 +231,7 @@ $(function() {
@ ltSIGNER_LIST
A ledger object which contains a signer list for an account.
Definition: LedgerFormats.h:86
@ ltCHECK
A ledger object which describes a check.
@ ltFEE_SETTINGS
The ledger object which lists the network's fee settings.
+
@ lsfAllowTrustLineClawback
@ ltCHILD
A special type, matching any ledger type except directory nodes.
@ lsfDepositAuth
@ lsfHighAuth
@@ -242,7 +243,6 @@ $(function() {
@ lsfDefaultRipple
@ lsfAMMNode
@ lsfSell
-
@ lsfAllowClawback
Manages a list of known formats.
Definition: KnownFormats.h:40
@ ltESCROW
A ledger object describing a single escrow.
@ lsfDisallowIncomingPayChan
diff --git a/SetAccount_8cpp_source.html b/SetAccount_8cpp_source.html index 7d6412ab2a..d83aa01991 100644 --- a/SetAccount_8cpp_source.html +++ b/SetAccount_8cpp_source.html @@ -294,7 +294,7 @@ $(function() {
223  //
224  if (ctx.view.rules().enabled(featureClawback))
225  {
-
226  if (uSetFlag == asfAllowClawback)
+
226  if (uSetFlag == asfAllowTrustLineClawback)
227  {
228  if (uFlagsIn & lsfNoFreeze)
229  {
@@ -311,7 +311,7 @@ $(function() {
240  else if (uSetFlag == asfNoFreeze)
241  {
242  // Cannot set NoFreeze if clawback is enabled
-
243  if (uFlagsIn & lsfAllowClawback)
+
243  if (uFlagsIn & lsfAllowTrustLineClawback)
244  {
245  JLOG(ctx.j.trace())
246  << "Can't set NoFreeze if clawback is enabled";
@@ -666,10 +666,10 @@ $(function() {
595 
596  // Set flag for clawback
597  if (ctx_.view().rules().enabled(featureClawback) &&
-
598  uSetFlag == asfAllowClawback)
+
598  uSetFlag == asfAllowTrustLineClawback)
599  {
600  JLOG(j_.trace()) << "set allow clawback";
-
601  uFlagsOut |= lsfAllowClawback;
+
601  uFlagsOut |= lsfAllowTrustLineClawback;
602  }
603 
604  if (uFlagsIn != uFlagsOut)
@@ -701,12 +701,12 @@ $(function() {
const SF_ACCOUNT sfRegularKey
constexpr std::uint32_t asfNoFreeze
Definition: TxFlags.h:79
-
constexpr std::uint32_t asfAllowClawback
Definition: TxFlags.h:91
@ telBAD_DOMAIN
Definition: TER.h:52
const uint256 featureDepositAuth
constexpr std::uint32_t tfAllowXRP
Definition: TxFlags.h:68
const SF_UINT32 sfSetFlag
constexpr std::uint32_t asfDisallowIncomingPayChan
Definition: TxFlags.h:89
+
@ lsfAllowTrustLineClawback
@ temBAD_TRANSFER_RATE
Definition: TER.h:105
const beast::Journal j
Definition: Transactor.h:38
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Definition: Transactor.cpp:78
@@ -721,7 +721,6 @@ $(function() {
@ lsfDefaultRipple
constexpr std::uint32_t asfDisableMaster
Definition: TxFlags.h:77
@ tecNO_ALTERNATIVE_KEY
Definition: TER.h:266
-
@ lsfAllowClawback
A public key.
Definition: PublicKey.h:59
Keylet account(AccountID const &id) noexcept
AccountID root.
Definition: Indexes.cpp:134
const uint256 featureDisallowIncoming
@@ -783,6 +782,7 @@ $(function() {
@ temBAD_TICK_SIZE
Definition: TER.h:116
std::uint32_t getFieldU32(SField const &field) const
Definition: STObject.cpp:559
State information when preflighting a tx.
Definition: Transactor.h:31
+
constexpr std::uint32_t asfAllowTrustLineClawback
Definition: TxFlags.h:91
constexpr std::uint32_t tfOptionalDestTag
Definition: TxFlags.h:64
const SF_VL sfDomain
static Keylet signers(AccountID const &account, std::uint32_t page) noexcept
Definition: Indexes.cpp:269
diff --git a/TxFlags_8h_source.html b/TxFlags_8h_source.html index 7c5ff7368c..2e411715f6 100644 --- a/TxFlags_8h_source.html +++ b/TxFlags_8h_source.html @@ -132,7 +132,7 @@ $(function() {
88 constexpr std::uint32_t asfDisallowIncomingCheck = 13;
89 constexpr std::uint32_t asfDisallowIncomingPayChan = 14;
90 constexpr std::uint32_t asfDisallowIncomingTrustline = 15;
-
91 constexpr std::uint32_t asfAllowClawback = 16;
+
91 constexpr std::uint32_t asfAllowTrustLineClawback = 16;
92 
93 // OfferCreate flags:
94 constexpr std::uint32_t tfPassive = 0x00010000;
@@ -241,7 +241,6 @@ $(function() {
constexpr const std::uint32_t tfNFTokenMintOldMask
Definition: TxFlags.h:146
constexpr std::uint32_t asfNoFreeze
Definition: TxFlags.h:79
constexpr std::uint32_t tfSetNoRipple
Definition: TxFlags.h:110
-
constexpr std::uint32_t asfAllowClawback
Definition: TxFlags.h:91
constexpr std::uint32_t tfClose
Definition: TxFlags.h:124
constexpr std::uint32_t tfFullyCanonicalSig
Transaction flags.
Definition: TxFlags.h:58
constexpr const std::uint32_t tfClawbackMask
Definition: TxFlags.h:164
@@ -289,6 +288,7 @@ $(function() {
constexpr const std::uint32_t tfOnlyXRP
Definition: TxFlags.h:129
constexpr std::uint32_t tfPaymentMask
Definition: TxFlags.h:105
constexpr std::uint32_t tfRequireDestTag
Definition: TxFlags.h:63
+
constexpr std::uint32_t asfAllowTrustLineClawback
Definition: TxFlags.h:91
constexpr std::uint32_t tfOneAssetLPToken
Definition: TxFlags.h:172
constexpr std::uint32_t tfUniversal
Definition: TxFlags.h:59
constexpr std::uint32_t tfOptionalDestTag
Definition: TxFlags.h:64
diff --git a/classripple_1_1Clawback.html b/classripple_1_1Clawback.html index eaa2ed20cc..1d5998e55a 100644 --- a/classripple_1_1Clawback.html +++ b/classripple_1_1Clawback.html @@ -380,7 +380,7 @@ Static Private Member Functions

Implements ripple::Transactor.

-

Definition at line 109 of file Clawback.cpp.

+

Definition at line 111 of file Clawback.cpp.

diff --git a/classripple_1_1Clawback__test-members.html b/classripple_1_1Clawback__test-members.html index 6f3a08cd10..7d6b7e702a 100644 --- a/classripple_1_1Clawback__test-members.html +++ b/classripple_1_1Clawback__test-members.html @@ -75,7 +75,7 @@ $(function() { getLineFreezeFlag(test::jtx::Env const &env, test::jtx::Account const &src, test::jtx::Account const &dst, Currency const &cur)ripple::Clawback_testprivatestatic ownerCount(test::jtx::Env const &env, test::jtx::Account const &acct)ripple::Clawback_testprivatestatic run() overrideripple::Clawback_test - testAllowClawbackFlag(FeatureBitset features)ripple::Clawback_testprivate + testAllowTrustLineClawbackFlag(FeatureBitset features)ripple::Clawback_testprivate testAmountExceedsAvailable(FeatureBitset features)ripple::Clawback_testprivate testBidirectionalLine(FeatureBitset features)ripple::Clawback_testprivate testDeleteDefaultLine(FeatureBitset features)ripple::Clawback_testprivate diff --git a/classripple_1_1Clawback__test.html b/classripple_1_1Clawback__test.html index d6acc390c3..7d1240f5d7 100644 --- a/classripple_1_1Clawback__test.html +++ b/classripple_1_1Clawback__test.html @@ -100,8 +100,8 @@ Public Member Functions - - + + @@ -295,8 +295,8 @@ template<class T > - -

◆ testAllowClawbackFlag()

+ +

◆ testAllowTrustLineClawbackFlag()

@@ -305,7 +305,7 @@ template<class T >

Private Member Functions

void testAllowClawbackFlag (FeatureBitset features)
 
void testAllowTrustLineClawbackFlag (FeatureBitset features)
 
void testValidation (FeatureBitset features)
 
void testPermission (FeatureBitset features)
- + @@ -347,7 +347,7 @@ template<class T >
void ripple::Clawback_test::testAllowClawbackFlag void ripple::Clawback_test::testAllowTrustLineClawbackFlag ( FeatureBitset  features)
-

Definition at line 206 of file Clawback_test.cpp.

+

Definition at line 208 of file Clawback_test.cpp.

@@ -375,7 +375,7 @@ template<class T >
-

Definition at line 335 of file Clawback_test.cpp.

+

Definition at line 337 of file Clawback_test.cpp.

@@ -403,7 +403,7 @@ template<class T >
-

Definition at line 473 of file Clawback_test.cpp.

+

Definition at line 475 of file Clawback_test.cpp.

@@ -431,7 +431,7 @@ template<class T >
-

Definition at line 520 of file Clawback_test.cpp.

+

Definition at line 522 of file Clawback_test.cpp.

@@ -459,7 +459,7 @@ template<class T >
-

Definition at line 647 of file Clawback_test.cpp.

+

Definition at line 649 of file Clawback_test.cpp.

@@ -487,7 +487,7 @@ template<class T >
-

Definition at line 739 of file Clawback_test.cpp.

+

Definition at line 741 of file Clawback_test.cpp.

@@ -515,7 +515,7 @@ template<class T >
-

Definition at line 789 of file Clawback_test.cpp.

+

Definition at line 791 of file Clawback_test.cpp.

@@ -543,7 +543,7 @@ template<class T >
-

Definition at line 835 of file Clawback_test.cpp.

+

Definition at line 837 of file Clawback_test.cpp.

@@ -571,7 +571,7 @@ template<class T >
-

Definition at line 888 of file Clawback_test.cpp.

+

Definition at line 890 of file Clawback_test.cpp.

@@ -599,7 +599,7 @@ template<class T >
-

Definition at line 945 of file Clawback_test.cpp.

+

Definition at line 947 of file Clawback_test.cpp.

@@ -626,7 +626,7 @@ template<class T >
-

Definition at line 961 of file Clawback_test.cpp.

+

Definition at line 963 of file Clawback_test.cpp.

diff --git a/flags_8h_source.html b/flags_8h_source.html index 06436f307c..bcbc08052e 100644 --- a/flags_8h_source.html +++ b/flags_8h_source.html @@ -149,8 +149,8 @@ $(function() {
80  case asfDepositAuth:
81  mask_ |= lsfDepositAuth;
82  break;
-
83  case asfAllowClawback:
-
84  mask_ |= lsfAllowClawback;
+
83  case asfAllowTrustLineClawback:
+
84  mask_ |= lsfAllowTrustLineClawback;
85  break;
86  default:
87  Throw<std::runtime_error>("unknown flag");
@@ -224,8 +224,8 @@ $(function() {
@ lsfDisableMaster
std::uint32_t mask_
Definition: flags.h:50
constexpr std::uint32_t asfNoFreeze
Definition: TxFlags.h:79
-
constexpr std::uint32_t asfAllowClawback
Definition: TxFlags.h:91
void set_args(std::uint32_t flag, Args... args)
Definition: flags.h:93
+
@ lsfAllowTrustLineClawback
@ lsfDepositAuth
flags(Account const &account, Args... args)
Definition: flags.h:118
nflags(Account const &account, Args... args)
Definition: flags.h:135
@@ -233,7 +233,6 @@ $(function() {
@ lsfRequireAuth
@ lsfDefaultRipple
constexpr std::uint32_t asfDisableMaster
Definition: TxFlags.h:77
-
@ lsfAllowClawback
Json::Value fset(Account const &account, std::uint32_t on, std::uint32_t off=0)
Add and/or remove flag.
Definition: flags.cpp:28
Json::Value fclear(Account const &account, std::uint32_t off)
Remove account flag.
Definition: flags.h:40
@@ -250,6 +249,7 @@ $(function() {
constexpr std::uint32_t asfGlobalFreeze
Definition: TxFlags.h:80
Immutable cryptographic account descriptor.
Definition: Account.h:37
@ lsfDisallowXRP
+
constexpr std::uint32_t asfAllowTrustLineClawback
Definition: TxFlags.h:91
A transaction testing environment.
Definition: Env.h:116
Represents a JSON value.
Definition: json_value.h:145
diff --git a/functions_func_t.html b/functions_func_t.html index 2d435cffed..6613b73917 100644 --- a/functions_func_t.html +++ b/functions_func_t.html @@ -498,12 +498,12 @@ $(function() {
  • testAllLocal() : ripple::test::LedgerReplayer_test
  • -
  • testAllowClawbackFlag() -: ripple::Clawback_test -
  • testAllowed() : ripple::test::PseudoTx_test
  • +
  • testAllowTrustLineClawbackFlag() +: ripple::Clawback_test +
  • testAmendment() : ripple::Config_test , ripple::test::AMM_test diff --git a/functions_t.html b/functions_t.html index 520a1ce421..6526162a35 100644 --- a/functions_t.html +++ b/functions_t.html @@ -630,12 +630,12 @@ $(function() {
  • testAllLocal() : ripple::test::LedgerReplayer_test
  • -
  • testAllowClawbackFlag() -: ripple::Clawback_test -
  • testAllowed() : ripple::test::PseudoTx_test
  • +
  • testAllowTrustLineClawbackFlag() +: ripple::Clawback_test +
  • testAmendment() : ripple::Config_test , ripple::test::AMM_test diff --git a/namespacemembers.html b/namespacemembers.html index 5af36dad99..af98890d3a 100644 --- a/namespacemembers.html +++ b/namespacemembers.html @@ -382,8 +382,8 @@ $(function() {
  • asfAccountTxnID : ripple
  • -
  • asfAllowClawback -: ripple +
  • asfAllowTrustLineClawback +: ripple
  • asfAuthorizedNFTokenMinter : ripple diff --git a/namespacemembers_eval_l.html b/namespacemembers_eval_l.html index e0cfe445cb..ffb3cdb53d 100644 --- a/namespacemembers_eval_l.html +++ b/namespacemembers_eval_l.html @@ -76,8 +76,8 @@ $(function() {
  • lsERROR : ripple
  • -
  • lsfAllowClawback -: ripple +
  • lsfAllowTrustLineClawback +: ripple
  • lsfAMM : ripple diff --git a/namespacemembers_l.html b/namespacemembers_l.html index 7f15aaabd3..e5474dbc01 100644 --- a/namespacemembers_l.html +++ b/namespacemembers_l.html @@ -248,8 +248,8 @@ $(function() {
  • lsERROR : ripple
  • -
  • lsfAllowClawback -: ripple +
  • lsfAllowTrustLineClawback +: ripple
  • lsfAMM : ripple diff --git a/namespacemembers_vars.html b/namespacemembers_vars.html index 9c68bacfde..001476e60d 100644 --- a/namespacemembers_vars.html +++ b/namespacemembers_vars.html @@ -121,8 +121,8 @@ $(function() {
  • asfAccountTxnID : ripple
  • -
  • asfAllowClawback -: ripple +
  • asfAllowTrustLineClawback +: ripple
  • asfAuthorizedNFTokenMinter : ripple diff --git a/namespaceripple.html b/namespaceripple.html index 7acb246d54..08d0559374 100644 --- a/namespaceripple.html +++ b/namespaceripple.html @@ -2057,7 +2057,7 @@ Enumerations
      lsfDisallowIncomingTrustline, lsfAMM = 0x40000000, -lsfAllowClawback, +lsfAllowTrustLineClawback, lsfPassive = 0x00010000,
      lsfSell = 0x00020000, @@ -6048,8 +6048,8 @@ Variables   constexpr std::uint32_t asfDisallowIncomingTrustline = 15   -constexpr std::uint32_t asfAllowClawback = 16 -  +constexpr std::uint32_t asfAllowTrustLineClawback = 16 +  constexpr std::uint32_t tfPassive = 0x00010000   constexpr std::uint32_t tfImmediateOrCancel = 0x00020000 @@ -9104,7 +9104,7 @@ ledger. lsfDisallowIncomingPayChan  lsfDisallowIncomingTrustline  lsfAMM  -lsfAllowClawback  +lsfAllowTrustLineClawback  lsfPassive  lsfSell  lsfLowReserve  @@ -59496,8 +59496,8 @@ template<class Dest , class Src > - -

    ◆ asfAllowClawback

    + +

    ◆ asfAllowTrustLineClawback

    @@ -59506,7 +59506,7 @@ template<class Dest , class Src >
    - +
    constexpr std::uint32_t ripple::asfAllowClawback = 16constexpr std::uint32_t ripple::asfAllowTrustLineClawback = 16
    diff --git a/search/all_1.js b/search/all_1.js index 62458f29ae..f82127ff2b 100644 --- a/search/all_1.js +++ b/search/all_1.js @@ -532,7 +532,7 @@ var searchData= ['asduration_532',['asDuration',['../classripple_1_1test_1_1csf_1_1Submitter.html#ad45e386dba65c8dd05bd07acf639d6b6',1,'ripple::test::csf::Submitter::asDuration(SimDuration d)'],['../classripple_1_1test_1_1csf_1_1Submitter.html#ad9ef169cb59ef92790f04093211998b0',1,'ripple::test::csf::Submitter::asDuration(T t)']]], ['asexpected_533',['asExpected',['../classripple_1_1test_1_1LedgerReplayClient.html#a61e8d17eca1027a5143bdf419f64a43f',1,'ripple::test::LedgerReplayClient::asExpected(std::shared_ptr< LedgerReplayTask > const &task, TaskStatus taskExpect, TaskStatus skiplistExpect, std::vector< TaskStatus > const &deltaExpects)'],['../classripple_1_1test_1_1LedgerReplayClient.html#a2da8f3d27e2da922434b87af9ad76abc',1,'ripple::test::LedgerReplayClient::asExpected(uint256 const &hash, int totalReplay, TaskStatus taskExpect, TaskStatus skiplistExpect, std::vector< TaskStatus > const &deltaExpects)']]], ['asfaccounttxnid_534',['asfAccountTxnID',['../namespaceripple.html#a9236ad224cda331f55af0a09d9bd16ea',1,'ripple']]], - ['asfallowclawback_535',['asfAllowClawback',['../namespaceripple.html#a3ac502eaeebe1f069671eeb7b978a1a6',1,'ripple']]], + ['asfallowtrustlineclawback_535',['asfAllowTrustLineClawback',['../namespaceripple.html#acedcd08c62e1bb941e2f6c9e289c6582',1,'ripple']]], ['asfauthorizednftokenminter_536',['asfAuthorizedNFTokenMinter',['../namespaceripple.html#a4414987963e371e8bdbafd38bc5427fa',1,'ripple']]], ['asfdefaultripple_537',['asfDefaultRipple',['../namespaceripple.html#a92b26c4fb4288c04285666f316d24f9c',1,'ripple']]], ['asfdepositauth_538',['asfDepositAuth',['../namespaceripple.html#a1d8ec9af2fd805d04e032c52f6968211',1,'ripple']]], diff --git a/search/all_14.js b/search/all_14.js index 6a68aeb86f..8348473357 100644 --- a/search/all_14.js +++ b/search/all_14.js @@ -374,8 +374,8 @@ var searchData= ['testall_10427',['testAll',['../classripple_1_1test_1_1MultiSign__test.html#a81927fb02e7cbcd444d8598b3b584b49',1,'ripple::test::MultiSign_test::testAll()'],['../classripple_1_1test_1_1Offer__test.html#af43e4e5e01b6cb88bc75dc79370c4949',1,'ripple::test::Offer_test::testAll()']]], ['testallinboundledgers_10428',['testAllInboundLedgers',['../structripple_1_1test_1_1LedgerReplayer__test.html#ac313b58a2d0843ab4f8d46ece7fac907',1,'ripple::test::LedgerReplayer_test']]], ['testalllocal_10429',['testAllLocal',['../structripple_1_1test_1_1LedgerReplayer__test.html#aea0fc6be2d2f14294990ed7c265d614a',1,'ripple::test::LedgerReplayer_test']]], - ['testallowclawbackflag_10430',['testAllowClawbackFlag',['../classripple_1_1Clawback__test.html#a20e3fd3b7d7c9cdcfb72616e92f294d9',1,'ripple::Clawback_test']]], - ['testallowed_10431',['testAllowed',['../structripple_1_1test_1_1PseudoTx__test.html#a8e14aaafb8d152ee68813a887aaa9859',1,'ripple::test::PseudoTx_test']]], + ['testallowed_10430',['testAllowed',['../structripple_1_1test_1_1PseudoTx__test.html#a8e14aaafb8d152ee68813a887aaa9859',1,'ripple::test::PseudoTx_test']]], + ['testallowtrustlineclawbackflag_10431',['testAllowTrustLineClawbackFlag',['../classripple_1_1Clawback__test.html#af226b80de2c3314698bfb3ed81e1968c',1,'ripple::Clawback_test']]], ['testamendment_10432',['testAmendment',['../structripple_1_1test_1_1AMM__test.html#ada90443a8c166dc70a9a4a5a830e3ef1',1,'ripple::test::AMM_test::testAmendment()'],['../classripple_1_1Config__test.html#a48d485afe41f9ce7134ffe0c6fe84424',1,'ripple::Config_test::testAmendment()']]], ['testamendmentblock_10433',['testAmendmentBlock',['../classripple_1_1test_1_1ServerStatus__test.html#a0425b0d3605c18ceca5404b14a7a4278',1,'ripple::test::ServerStatus_test']]], ['testamendmentenable_10434',['testAmendmentEnable',['../classripple_1_1test_1_1AccountDelete__test.html#a9608a0aba27aea97c17205de5965d6cd',1,'ripple::test::AccountDelete_test']]], diff --git a/search/all_1b.js b/search/all_1b.js index ca270830a5..ea90508ae7 100644 --- a/search/all_1b.js +++ b/search/all_1b.js @@ -154,7 +154,7 @@ var searchData= ['_7emanager_12873',['~Manager',['../classripple_1_1NodeStore_1_1Manager.html#a8149442311a55be70b5c10b3986ac28f',1,'ripple::NodeStore::Manager::~Manager()'],['../classripple_1_1PeerFinder_1_1Manager.html#a6ca862e79c8e4d2883fb16c2bf95aa52',1,'ripple::PeerFinder::Manager::~Manager()'],['../classripple_1_1Resource_1_1Manager.html#aed175bd08f4c56dd79befd9479258b1c',1,'ripple::Resource::Manager::~Manager()']]], ['_7emanagerimp_12874',['~ManagerImp',['../classripple_1_1NodeStore_1_1ManagerImp.html#a87ab9968d73dcc1cc4bc802ae5b71d1b',1,'ripple::NodeStore::ManagerImp::~ManagerImp()'],['../classripple_1_1PeerFinder_1_1ManagerImp.html#a1a156a760dc9fa9ec5151ed7f1892092',1,'ripple::PeerFinder::ManagerImp::~ManagerImp()'],['../classripple_1_1Resource_1_1ManagerImp.html#ae163066df0e9bb7d81720f3ee52baf6c',1,'ripple::Resource::ManagerImp::~ManagerImp()']]], ['_7emanifest_5ftest_12875',['~Manifest_test',['../classripple_1_1test_1_1Manifest__test.html#a6bb0400ddd7a0e4aaa822d10bcf1e6a1',1,'ripple::test::Manifest_test']]], - ['_7emap_12876',['~map',['http://en.cppreference.com/w/cpp/container/map/~map.html',1,'std::map::~map()'],['http://en.cppreference.com/w/cpp/container/map/~map.html',1,'std::pmr::map::~map()'],['../classbeast_1_1PropertyStream_1_1Map.html#a29211573f2d1c5d94a798ef12d1538f6',1,'beast::PropertyStream::Map::~Map()']]], + ['_7emap_12876',['~Map',['../classbeast_1_1PropertyStream_1_1Map.html#a29211573f2d1c5d94a798ef12d1538f6',1,'beast::PropertyStream::Map::~Map()'],['http://en.cppreference.com/w/cpp/container/map/~map.html',1,'std::map::~map()'],['http://en.cppreference.com/w/cpp/container/map/~map.html',1,'std::pmr::map::~map()']]], ['_7ematch_5fresults_12877',['~match_results',['http://en.cppreference.com/w/cpp/regex/match_results/~match_results.html',1,'std::match_results']]], ['_7ememorybackend_12878',['~MemoryBackend',['../classripple_1_1NodeStore_1_1MemoryBackend.html#a7a3395d78b5b2cf470059c43e0d8817a',1,'ripple::NodeStore::MemoryBackend']]], ['_7ememoryfactory_12879',['~MemoryFactory',['../classripple_1_1NodeStore_1_1MemoryFactory.html#a6d3c6f7cf8d453e1a2457f75074e40e9',1,'ripple::NodeStore::MemoryFactory']]], @@ -245,7 +245,7 @@ var searchData= ['_7eserverhandler_12964',['~ServerHandler',['../classripple_1_1ServerHandler.html#a3b38204d2a41b7f3d6439e62b18cf711',1,'ripple::ServerHandler']]], ['_7eserverimpl_12965',['~ServerImpl',['../classripple_1_1ServerImpl.html#a7ac3729ff2586fa7fa6e534b6ef08cf7',1,'ripple::ServerImpl']]], ['_7esession_12966',['~Session',['../classripple_1_1Session.html#a7252e8f2b56377831ac8e391f3dc5bf9',1,'ripple::Session']]], - ['_7eset_12967',['~set',['http://en.cppreference.com/w/cpp/container/set/~set.html',1,'std::pmr::set::~set()'],['http://en.cppreference.com/w/cpp/container/set/~set.html',1,'std::set::~set()'],['../classbeast_1_1PropertyStream_1_1Set.html#a48130b297aa75065d3d07cc4c6d696a2',1,'beast::PropertyStream::Set::~Set()']]], + ['_7eset_12967',['~Set',['../classbeast_1_1PropertyStream_1_1Set.html#a48130b297aa75065d3d07cc4c6d696a2',1,'beast::PropertyStream::Set::~Set()'],['http://en.cppreference.com/w/cpp/container/set/~set.html',1,'std::pmr::set::~set()'],['http://en.cppreference.com/w/cpp/container/set/~set.html',1,'std::set::~set()']]], ['_7eshamap_12968',['~SHAMap',['../classripple_1_1SHAMap.html#a93552723ee0f47af4d6bb78115308fb1',1,'ripple::SHAMap']]], ['_7eshamapinnernode_12969',['~SHAMapInnerNode',['../classripple_1_1SHAMapInnerNode.html#aa36ffe7811690d0c57b52c792a634dee',1,'ripple::SHAMapInnerNode']]], ['_7eshamapstore_12970',['~SHAMapStore',['../classripple_1_1SHAMapStore.html#a89c36a56b7b199b87049a1089463c619',1,'ripple::SHAMapStore']]], @@ -340,7 +340,7 @@ var searchData= ['_7ewfilebuf_13059',['~wfilebuf',['http://en.cppreference.com/w/cpp/io/basic_filebuf/~basic_filebuf.html',1,'std::wfilebuf']]], ['_7ewiostream_13060',['~wiostream',['http://en.cppreference.com/w/cpp/io/basic_iostream/~basic_iostream.html',1,'std::wiostream']]], ['_7ewistream_13061',['~wistream',['http://en.cppreference.com/w/cpp/io/basic_istream/~basic_istream.html',1,'std::wistream']]], - ['_7ework_13062',['~work',['../classripple_1_1io__list_1_1work.html#aa831e509b3e85300654d054c29ab1a30',1,'ripple::io_list::work::~work()'],['../classripple_1_1detail_1_1Work.html#a9a030009a5e1b80afc95774d504a397a',1,'ripple::detail::Work::~Work()']]], + ['_7ework_13062',['~Work',['../classripple_1_1detail_1_1Work.html#a9a030009a5e1b80afc95774d504a397a',1,'ripple::detail::Work::~Work()'],['../classripple_1_1io__list_1_1work.html#aa831e509b3e85300654d054c29ab1a30',1,'ripple::io_list::work::~work()']]], ['_7eworkbase_13063',['~WorkBase',['../classripple_1_1detail_1_1WorkBase.html#a735ddebc31fd24fd34e9923e9bc3e6a2',1,'ripple::detail::WorkBase']]], ['_7eworker_13064',['~Worker',['../classripple_1_1Workers_1_1Worker.html#a5ff8ef7855ae89cc306ebb5a04665615',1,'ripple::Workers::Worker']]], ['_7eworkers_13065',['~Workers',['../classripple_1_1Workers.html#a780ec448fd8944839c8baec628db5560',1,'ripple::Workers']]], diff --git a/search/all_c.js b/search/all_c.js index 2f31a1e115..9d3aca813b 100644 --- a/search/all_c.js +++ b/search/all_c.js @@ -414,7 +414,7 @@ var searchData= ['lround_5501',['lround',['http://en.cppreference.com/w/cpp/numeric/math/round.html',1,'std']]], ['lsdebug_5502',['lsDEBUG',['../namespaceripple.html#afc7159a6877417e38472fbbd425f2244a031699c2a2c25288caf7c5c512da58eb',1,'ripple']]], ['lserror_5503',['lsERROR',['../namespaceripple.html#afc7159a6877417e38472fbbd425f2244a2aa4cf81dadaf26c72546ae13129feea',1,'ripple']]], - ['lsfallowclawback_5504',['lsfAllowClawback',['../namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5ac08d95c566e316346e73a5b1d3fbf40e',1,'ripple']]], + ['lsfallowtrustlineclawback_5504',['lsfAllowTrustLineClawback',['../namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a4dc02270bf68939f8033c9a985fb2dfb',1,'ripple']]], ['lsfamm_5505',['lsfAMM',['../namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5aa92bc301276504f22d869a02806c0a1f',1,'ripple']]], ['lsfammnode_5506',['lsfAMMNode',['../namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a8cd829998dcb0143ec2153b20fc14d33',1,'ripple']]], ['lsfatal_5507',['lsFATAL',['../namespaceripple.html#afc7159a6877417e38472fbbd425f2244acb980b97f93585b5b1f20725a2256c23',1,'ripple']]], diff --git a/search/enumvalues_b.js b/search/enumvalues_b.js index 5b47a7507f..fed22b64d8 100644 --- a/search/enumvalues_b.js +++ b/search/enumvalues_b.js @@ -28,7 +28,7 @@ var searchData= ['long_5ftag_27229',['long_tag',['../namespaceripple_1_1cryptoconditions.html#ae0bee5541ce10d52809660ad2d100a23ab7fcc29f8f7ba2bb28f56437232e011e',1,'ripple::cryptoconditions']]], ['lsdebug_27230',['lsDEBUG',['../namespaceripple.html#afc7159a6877417e38472fbbd425f2244a031699c2a2c25288caf7c5c512da58eb',1,'ripple']]], ['lserror_27231',['lsERROR',['../namespaceripple.html#afc7159a6877417e38472fbbd425f2244a2aa4cf81dadaf26c72546ae13129feea',1,'ripple']]], - ['lsfallowclawback_27232',['lsfAllowClawback',['../namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5ac08d95c566e316346e73a5b1d3fbf40e',1,'ripple']]], + ['lsfallowtrustlineclawback_27232',['lsfAllowTrustLineClawback',['../namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a4dc02270bf68939f8033c9a985fb2dfb',1,'ripple']]], ['lsfamm_27233',['lsfAMM',['../namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5aa92bc301276504f22d869a02806c0a1f',1,'ripple']]], ['lsfammnode_27234',['lsfAMMNode',['../namespaceripple.html#a4a9c7b33fef9015d6406302ef80b63c5a8cd829998dcb0143ec2153b20fc14d33',1,'ripple']]], ['lsfatal_27235',['lsFATAL',['../namespaceripple.html#afc7159a6877417e38472fbbd425f2244acb980b97f93585b5b1f20725a2256c23',1,'ripple']]], diff --git a/search/functions_14.js b/search/functions_14.js index bfa6e91d8d..f17ea08098 100644 --- a/search/functions_14.js +++ b/search/functions_14.js @@ -153,8 +153,8 @@ var searchData= ['testall_21426',['testAll',['../classripple_1_1test_1_1MultiSign__test.html#a81927fb02e7cbcd444d8598b3b584b49',1,'ripple::test::MultiSign_test::testAll()'],['../classripple_1_1test_1_1Offer__test.html#af43e4e5e01b6cb88bc75dc79370c4949',1,'ripple::test::Offer_test::testAll()']]], ['testallinboundledgers_21427',['testAllInboundLedgers',['../structripple_1_1test_1_1LedgerReplayer__test.html#ac313b58a2d0843ab4f8d46ece7fac907',1,'ripple::test::LedgerReplayer_test']]], ['testalllocal_21428',['testAllLocal',['../structripple_1_1test_1_1LedgerReplayer__test.html#aea0fc6be2d2f14294990ed7c265d614a',1,'ripple::test::LedgerReplayer_test']]], - ['testallowclawbackflag_21429',['testAllowClawbackFlag',['../classripple_1_1Clawback__test.html#a20e3fd3b7d7c9cdcfb72616e92f294d9',1,'ripple::Clawback_test']]], - ['testallowed_21430',['testAllowed',['../structripple_1_1test_1_1PseudoTx__test.html#a8e14aaafb8d152ee68813a887aaa9859',1,'ripple::test::PseudoTx_test']]], + ['testallowed_21429',['testAllowed',['../structripple_1_1test_1_1PseudoTx__test.html#a8e14aaafb8d152ee68813a887aaa9859',1,'ripple::test::PseudoTx_test']]], + ['testallowtrustlineclawbackflag_21430',['testAllowTrustLineClawbackFlag',['../classripple_1_1Clawback__test.html#af226b80de2c3314698bfb3ed81e1968c',1,'ripple::Clawback_test']]], ['testamendment_21431',['testAmendment',['../structripple_1_1test_1_1AMM__test.html#ada90443a8c166dc70a9a4a5a830e3ef1',1,'ripple::test::AMM_test::testAmendment()'],['../classripple_1_1Config__test.html#a48d485afe41f9ce7134ffe0c6fe84424',1,'ripple::Config_test::testAmendment()']]], ['testamendmentblock_21432',['testAmendmentBlock',['../classripple_1_1test_1_1ServerStatus__test.html#a0425b0d3605c18ceca5404b14a7a4278',1,'ripple::test::ServerStatus_test']]], ['testamendmentenable_21433',['testAmendmentEnable',['../classripple_1_1test_1_1AccountDelete__test.html#a9608a0aba27aea97c17205de5965d6cd',1,'ripple::test::AccountDelete_test']]], diff --git a/search/functions_1b.js b/search/functions_1b.js index c01df3b8e1..b901a54bb5 100644 --- a/search/functions_1b.js +++ b/search/functions_1b.js @@ -154,7 +154,7 @@ var searchData= ['_7emanager_23014',['~Manager',['../classripple_1_1NodeStore_1_1Manager.html#a8149442311a55be70b5c10b3986ac28f',1,'ripple::NodeStore::Manager::~Manager()'],['../classripple_1_1PeerFinder_1_1Manager.html#a6ca862e79c8e4d2883fb16c2bf95aa52',1,'ripple::PeerFinder::Manager::~Manager()'],['../classripple_1_1Resource_1_1Manager.html#aed175bd08f4c56dd79befd9479258b1c',1,'ripple::Resource::Manager::~Manager()']]], ['_7emanagerimp_23015',['~ManagerImp',['../classripple_1_1NodeStore_1_1ManagerImp.html#a87ab9968d73dcc1cc4bc802ae5b71d1b',1,'ripple::NodeStore::ManagerImp::~ManagerImp()'],['../classripple_1_1PeerFinder_1_1ManagerImp.html#a1a156a760dc9fa9ec5151ed7f1892092',1,'ripple::PeerFinder::ManagerImp::~ManagerImp()'],['../classripple_1_1Resource_1_1ManagerImp.html#ae163066df0e9bb7d81720f3ee52baf6c',1,'ripple::Resource::ManagerImp::~ManagerImp()']]], ['_7emanifest_5ftest_23016',['~Manifest_test',['../classripple_1_1test_1_1Manifest__test.html#a6bb0400ddd7a0e4aaa822d10bcf1e6a1',1,'ripple::test::Manifest_test']]], - ['_7emap_23017',['~map',['http://en.cppreference.com/w/cpp/container/map/~map.html',1,'std::map::~map()'],['http://en.cppreference.com/w/cpp/container/map/~map.html',1,'std::pmr::map::~map()'],['../classbeast_1_1PropertyStream_1_1Map.html#a29211573f2d1c5d94a798ef12d1538f6',1,'beast::PropertyStream::Map::~Map()']]], + ['_7emap_23017',['~Map',['../classbeast_1_1PropertyStream_1_1Map.html#a29211573f2d1c5d94a798ef12d1538f6',1,'beast::PropertyStream::Map::~Map()'],['http://en.cppreference.com/w/cpp/container/map/~map.html',1,'std::map::~map()'],['http://en.cppreference.com/w/cpp/container/map/~map.html',1,'std::pmr::map::~map()']]], ['_7ematch_5fresults_23018',['~match_results',['http://en.cppreference.com/w/cpp/regex/match_results/~match_results.html',1,'std::match_results']]], ['_7ememorybackend_23019',['~MemoryBackend',['../classripple_1_1NodeStore_1_1MemoryBackend.html#a7a3395d78b5b2cf470059c43e0d8817a',1,'ripple::NodeStore::MemoryBackend']]], ['_7ememoryfactory_23020',['~MemoryFactory',['../classripple_1_1NodeStore_1_1MemoryFactory.html#a6d3c6f7cf8d453e1a2457f75074e40e9',1,'ripple::NodeStore::MemoryFactory']]], @@ -245,7 +245,7 @@ var searchData= ['_7eserverhandler_23105',['~ServerHandler',['../classripple_1_1ServerHandler.html#a3b38204d2a41b7f3d6439e62b18cf711',1,'ripple::ServerHandler']]], ['_7eserverimpl_23106',['~ServerImpl',['../classripple_1_1ServerImpl.html#a7ac3729ff2586fa7fa6e534b6ef08cf7',1,'ripple::ServerImpl']]], ['_7esession_23107',['~Session',['../classripple_1_1Session.html#a7252e8f2b56377831ac8e391f3dc5bf9',1,'ripple::Session']]], - ['_7eset_23108',['~set',['http://en.cppreference.com/w/cpp/container/set/~set.html',1,'std::pmr::set::~set()'],['http://en.cppreference.com/w/cpp/container/set/~set.html',1,'std::set::~set()'],['../classbeast_1_1PropertyStream_1_1Set.html#a48130b297aa75065d3d07cc4c6d696a2',1,'beast::PropertyStream::Set::~Set()']]], + ['_7eset_23108',['~Set',['../classbeast_1_1PropertyStream_1_1Set.html#a48130b297aa75065d3d07cc4c6d696a2',1,'beast::PropertyStream::Set::~Set()'],['http://en.cppreference.com/w/cpp/container/set/~set.html',1,'std::pmr::set::~set()'],['http://en.cppreference.com/w/cpp/container/set/~set.html',1,'std::set::~set()']]], ['_7eshamap_23109',['~SHAMap',['../classripple_1_1SHAMap.html#a93552723ee0f47af4d6bb78115308fb1',1,'ripple::SHAMap']]], ['_7eshamapinnernode_23110',['~SHAMapInnerNode',['../classripple_1_1SHAMapInnerNode.html#aa36ffe7811690d0c57b52c792a634dee',1,'ripple::SHAMapInnerNode']]], ['_7eshamapstore_23111',['~SHAMapStore',['../classripple_1_1SHAMapStore.html#a89c36a56b7b199b87049a1089463c619',1,'ripple::SHAMapStore']]], @@ -340,7 +340,7 @@ var searchData= ['_7ewfilebuf_23200',['~wfilebuf',['http://en.cppreference.com/w/cpp/io/basic_filebuf/~basic_filebuf.html',1,'std::wfilebuf']]], ['_7ewiostream_23201',['~wiostream',['http://en.cppreference.com/w/cpp/io/basic_iostream/~basic_iostream.html',1,'std::wiostream']]], ['_7ewistream_23202',['~wistream',['http://en.cppreference.com/w/cpp/io/basic_istream/~basic_istream.html',1,'std::wistream']]], - ['_7ework_23203',['~work',['../classripple_1_1io__list_1_1work.html#aa831e509b3e85300654d054c29ab1a30',1,'ripple::io_list::work::~work()'],['../classripple_1_1detail_1_1Work.html#a9a030009a5e1b80afc95774d504a397a',1,'ripple::detail::Work::~Work()']]], + ['_7ework_23203',['~Work',['../classripple_1_1detail_1_1Work.html#a9a030009a5e1b80afc95774d504a397a',1,'ripple::detail::Work::~Work()'],['../classripple_1_1io__list_1_1work.html#aa831e509b3e85300654d054c29ab1a30',1,'ripple::io_list::work::~work()']]], ['_7eworkbase_23204',['~WorkBase',['../classripple_1_1detail_1_1WorkBase.html#a735ddebc31fd24fd34e9923e9bc3e6a2',1,'ripple::detail::WorkBase']]], ['_7eworker_23205',['~Worker',['../classripple_1_1Workers_1_1Worker.html#a5ff8ef7855ae89cc306ebb5a04665615',1,'ripple::Workers::Worker']]], ['_7eworkers_23206',['~Workers',['../classripple_1_1Workers.html#a780ec448fd8944839c8baec628db5560',1,'ripple::Workers']]], diff --git a/search/variables_0.js b/search/variables_0.js index 06596888c5..69b7dcb2af 100644 --- a/search/variables_0.js +++ b/search/variables_0.js @@ -149,7 +149,7 @@ var searchData= ['armed_5f_23369',['armed_',['../classripple_1_1LoadManager.html#a69963f56530f2f03699a131faa019feb',1,'ripple::LoadManager']]], ['array_23370',['array',['../classripple_1_1STParsedJSONArray.html#a15bd4b112bb54d2906b610523f800eab',1,'ripple::STParsedJSONArray']]], ['asfaccounttxnid_23371',['asfAccountTxnID',['../namespaceripple.html#a9236ad224cda331f55af0a09d9bd16ea',1,'ripple']]], - ['asfallowclawback_23372',['asfAllowClawback',['../namespaceripple.html#a3ac502eaeebe1f069671eeb7b978a1a6',1,'ripple']]], + ['asfallowtrustlineclawback_23372',['asfAllowTrustLineClawback',['../namespaceripple.html#acedcd08c62e1bb941e2f6c9e289c6582',1,'ripple']]], ['asfauthorizednftokenminter_23373',['asfAuthorizedNFTokenMinter',['../namespaceripple.html#a4414987963e371e8bdbafd38bc5427fa',1,'ripple']]], ['asfdefaultripple_23374',['asfDefaultRipple',['../namespaceripple.html#a92b26c4fb4288c04285666f316d24f9c',1,'ripple']]], ['asfdepositauth_23375',['asfDepositAuth',['../namespaceripple.html#a1d8ec9af2fd805d04e032c52f6968211',1,'ripple']]],