xrpld
Loading...
Searching...
No Matches
EscrowTests.cpp
1// Auto-generated unit tests for ledger entry Escrow
2
3
4#include <gtest/gtest.h>
5
6#include <protocol_autogen/TestHelpers.h>
7
8#include <xrpl/protocol/STLedgerEntry.h>
9#include <xrpl/protocol_autogen/ledger_entries/Escrow.h>
10#include <xrpl/protocol_autogen/ledger_entries/Ticket.h>
11
12#include <string>
13
14namespace xrpl::ledger_entries {
15
16// 1 & 4) Set fields via builder setters, build, then read them back via
17// wrapper getters. After build(), validate() should succeed for both the
18// builder's STObject and the wrapper's SLE.
19TEST(EscrowTests, BuilderSettersRoundTrip)
20{
21 UInt256 const index{1u};
22
23 auto const accountValue = canonical_ACCOUNT();
24 auto const sequenceValue = canonical_UINT32();
25 auto const destinationValue = canonical_ACCOUNT();
26 auto const amountValue = canonical_AMOUNT();
27 auto const conditionValue = canonical_VL();
28 auto const cancelAfterValue = canonical_UINT32();
29 auto const finishAfterValue = canonical_UINT32();
30 auto const bytecodeValue = canonical_VL();
31 auto const dataValue = canonical_VL();
32 auto const sourceTagValue = canonical_UINT32();
33 auto const destinationTagValue = canonical_UINT32();
34 auto const ownerNodeValue = canonical_UINT64();
35 auto const previousTxnIDValue = canonical_UINT256();
36 auto const previousTxnLgrSeqValue = canonical_UINT32();
37 auto const destinationNodeValue = canonical_UINT64();
38 auto const transferRateValue = canonical_UINT32();
39 auto const issuerNodeValue = canonical_UINT64();
40
41 EscrowBuilder builder{
42 accountValue,
43 destinationValue,
44 amountValue,
45 ownerNodeValue,
46 previousTxnIDValue,
47 previousTxnLgrSeqValue
48 };
49
50 builder.setSequence(sequenceValue);
51 builder.setCondition(conditionValue);
52 builder.setCancelAfter(cancelAfterValue);
53 builder.setFinishAfter(finishAfterValue);
54 builder.setBytecode(bytecodeValue);
55 builder.setData(dataValue);
56 builder.setSourceTag(sourceTagValue);
57 builder.setDestinationTag(destinationTagValue);
58 builder.setDestinationNode(destinationNodeValue);
59 builder.setTransferRate(transferRateValue);
60 builder.setIssuerNode(issuerNodeValue);
61
62 builder.setLedgerIndex(index);
63 builder.setFlags(0x1u);
64
65 EXPECT_TRUE(builder.validate());
66
67 auto const entry = builder.build(index);
68
69 EXPECT_TRUE(entry.validate());
70
71 {
72 auto const& expected = accountValue;
73 auto const actual = entry.getAccount();
74 expectEqualField(expected, actual, "sfAccount");
75 }
76
77 {
78 auto const& expected = destinationValue;
79 auto const actual = entry.getDestination();
80 expectEqualField(expected, actual, "sfDestination");
81 }
82
83 {
84 auto const& expected = amountValue;
85 auto const actual = entry.getAmount();
86 expectEqualField(expected, actual, "sfAmount");
87 }
88
89 {
90 auto const& expected = ownerNodeValue;
91 auto const actual = entry.getOwnerNode();
92 expectEqualField(expected, actual, "sfOwnerNode");
93 }
94
95 {
96 auto const& expected = previousTxnIDValue;
97 auto const actual = entry.getPreviousTxnID();
98 expectEqualField(expected, actual, "sfPreviousTxnID");
99 }
100
101 {
102 auto const& expected = previousTxnLgrSeqValue;
103 auto const actual = entry.getPreviousTxnLgrSeq();
104 expectEqualField(expected, actual, "sfPreviousTxnLgrSeq");
105 }
106
107 {
108 auto const& expected = sequenceValue;
109 auto const actualOpt = entry.getSequence();
110 ASSERT_TRUE(actualOpt.has_value());
111 expectEqualField(expected, *actualOpt, "sfSequence");
112 EXPECT_TRUE(entry.hasSequence());
113 }
114
115 {
116 auto const& expected = conditionValue;
117 auto const actualOpt = entry.getCondition();
118 ASSERT_TRUE(actualOpt.has_value());
119 expectEqualField(expected, *actualOpt, "sfCondition");
120 EXPECT_TRUE(entry.hasCondition());
121 }
122
123 {
124 auto const& expected = cancelAfterValue;
125 auto const actualOpt = entry.getCancelAfter();
126 ASSERT_TRUE(actualOpt.has_value());
127 expectEqualField(expected, *actualOpt, "sfCancelAfter");
128 EXPECT_TRUE(entry.hasCancelAfter());
129 }
130
131 {
132 auto const& expected = finishAfterValue;
133 auto const actualOpt = entry.getFinishAfter();
134 ASSERT_TRUE(actualOpt.has_value());
135 expectEqualField(expected, *actualOpt, "sfFinishAfter");
136 EXPECT_TRUE(entry.hasFinishAfter());
137 }
138
139 {
140 auto const& expected = bytecodeValue;
141 auto const actualOpt = entry.getBytecode();
142 ASSERT_TRUE(actualOpt.has_value());
143 expectEqualField(expected, *actualOpt, "sfBytecode");
144 EXPECT_TRUE(entry.hasBytecode());
145 }
146
147 {
148 auto const& expected = dataValue;
149 auto const actualOpt = entry.getData();
150 ASSERT_TRUE(actualOpt.has_value());
151 expectEqualField(expected, *actualOpt, "sfData");
152 EXPECT_TRUE(entry.hasData());
153 }
154
155 {
156 auto const& expected = sourceTagValue;
157 auto const actualOpt = entry.getSourceTag();
158 ASSERT_TRUE(actualOpt.has_value());
159 expectEqualField(expected, *actualOpt, "sfSourceTag");
160 EXPECT_TRUE(entry.hasSourceTag());
161 }
162
163 {
164 auto const& expected = destinationTagValue;
165 auto const actualOpt = entry.getDestinationTag();
166 ASSERT_TRUE(actualOpt.has_value());
167 expectEqualField(expected, *actualOpt, "sfDestinationTag");
168 EXPECT_TRUE(entry.hasDestinationTag());
169 }
170
171 {
172 auto const& expected = destinationNodeValue;
173 auto const actualOpt = entry.getDestinationNode();
174 ASSERT_TRUE(actualOpt.has_value());
175 expectEqualField(expected, *actualOpt, "sfDestinationNode");
176 EXPECT_TRUE(entry.hasDestinationNode());
177 }
178
179 {
180 auto const& expected = transferRateValue;
181 auto const actualOpt = entry.getTransferRate();
182 ASSERT_TRUE(actualOpt.has_value());
183 expectEqualField(expected, *actualOpt, "sfTransferRate");
184 EXPECT_TRUE(entry.hasTransferRate());
185 }
186
187 {
188 auto const& expected = issuerNodeValue;
189 auto const actualOpt = entry.getIssuerNode();
190 ASSERT_TRUE(actualOpt.has_value());
191 expectEqualField(expected, *actualOpt, "sfIssuerNode");
192 EXPECT_TRUE(entry.hasIssuerNode());
193 }
194
195 EXPECT_TRUE(entry.hasLedgerIndex());
196 auto const ledgerIndex = entry.getLedgerIndex();
197 ASSERT_TRUE(ledgerIndex.has_value());
198 EXPECT_EQ(*ledgerIndex, index);
199 EXPECT_EQ(entry.getKey(), index);
200}
201
202// 2 & 4) Start from an SLE, set fields directly on it, construct a builder
203// from that SLE, build a new wrapper, and verify all fields (and validate()).
204TEST(EscrowTests, BuilderFromSleRoundTrip)
205{
206 UInt256 const index{2u};
207
208 auto const accountValue = canonical_ACCOUNT();
209 auto const sequenceValue = canonical_UINT32();
210 auto const destinationValue = canonical_ACCOUNT();
211 auto const amountValue = canonical_AMOUNT();
212 auto const conditionValue = canonical_VL();
213 auto const cancelAfterValue = canonical_UINT32();
214 auto const finishAfterValue = canonical_UINT32();
215 auto const bytecodeValue = canonical_VL();
216 auto const dataValue = canonical_VL();
217 auto const sourceTagValue = canonical_UINT32();
218 auto const destinationTagValue = canonical_UINT32();
219 auto const ownerNodeValue = canonical_UINT64();
220 auto const previousTxnIDValue = canonical_UINT256();
221 auto const previousTxnLgrSeqValue = canonical_UINT32();
222 auto const destinationNodeValue = canonical_UINT64();
223 auto const transferRateValue = canonical_UINT32();
224 auto const issuerNodeValue = canonical_UINT64();
225
226 auto sle = std::make_shared<SLE>(Escrow::entryType, index);
227
228 sle->at(sfAccount) = accountValue;
229 sle->at(sfSequence) = sequenceValue;
230 sle->at(sfDestination) = destinationValue;
231 sle->at(sfAmount) = amountValue;
232 sle->at(sfCondition) = conditionValue;
233 sle->at(sfCancelAfter) = cancelAfterValue;
234 sle->at(sfFinishAfter) = finishAfterValue;
235 sle->at(sfBytecode) = bytecodeValue;
236 sle->at(sfData) = dataValue;
237 sle->at(sfSourceTag) = sourceTagValue;
238 sle->at(sfDestinationTag) = destinationTagValue;
239 sle->at(sfOwnerNode) = ownerNodeValue;
240 sle->at(sfPreviousTxnID) = previousTxnIDValue;
241 sle->at(sfPreviousTxnLgrSeq) = previousTxnLgrSeqValue;
242 sle->at(sfDestinationNode) = destinationNodeValue;
243 sle->at(sfTransferRate) = transferRateValue;
244 sle->at(sfIssuerNode) = issuerNodeValue;
245
246 EscrowBuilder builderFromSle{sle};
247 EXPECT_TRUE(builderFromSle.validate());
248
249 auto const entryFromBuilder = builderFromSle.build(index);
250
251 Escrow entryFromSle{sle};
252 EXPECT_TRUE(entryFromBuilder.validate());
253 EXPECT_TRUE(entryFromSle.validate());
254
255 {
256 auto const& expected = accountValue;
257
258 auto const fromSle = entryFromSle.getAccount();
259 auto const fromBuilder = entryFromBuilder.getAccount();
260
261 expectEqualField(expected, fromSle, "sfAccount");
262 expectEqualField(expected, fromBuilder, "sfAccount");
263 }
264
265 {
266 auto const& expected = destinationValue;
267
268 auto const fromSle = entryFromSle.getDestination();
269 auto const fromBuilder = entryFromBuilder.getDestination();
270
271 expectEqualField(expected, fromSle, "sfDestination");
272 expectEqualField(expected, fromBuilder, "sfDestination");
273 }
274
275 {
276 auto const& expected = amountValue;
277
278 auto const fromSle = entryFromSle.getAmount();
279 auto const fromBuilder = entryFromBuilder.getAmount();
280
281 expectEqualField(expected, fromSle, "sfAmount");
282 expectEqualField(expected, fromBuilder, "sfAmount");
283 }
284
285 {
286 auto const& expected = ownerNodeValue;
287
288 auto const fromSle = entryFromSle.getOwnerNode();
289 auto const fromBuilder = entryFromBuilder.getOwnerNode();
290
291 expectEqualField(expected, fromSle, "sfOwnerNode");
292 expectEqualField(expected, fromBuilder, "sfOwnerNode");
293 }
294
295 {
296 auto const& expected = previousTxnIDValue;
297
298 auto const fromSle = entryFromSle.getPreviousTxnID();
299 auto const fromBuilder = entryFromBuilder.getPreviousTxnID();
300
301 expectEqualField(expected, fromSle, "sfPreviousTxnID");
302 expectEqualField(expected, fromBuilder, "sfPreviousTxnID");
303 }
304
305 {
306 auto const& expected = previousTxnLgrSeqValue;
307
308 auto const fromSle = entryFromSle.getPreviousTxnLgrSeq();
309 auto const fromBuilder = entryFromBuilder.getPreviousTxnLgrSeq();
310
311 expectEqualField(expected, fromSle, "sfPreviousTxnLgrSeq");
312 expectEqualField(expected, fromBuilder, "sfPreviousTxnLgrSeq");
313 }
314
315 {
316 auto const& expected = sequenceValue;
317
318 auto const fromSleOpt = entryFromSle.getSequence();
319 auto const fromBuilderOpt = entryFromBuilder.getSequence();
320
321 ASSERT_TRUE(fromSleOpt.has_value());
322 ASSERT_TRUE(fromBuilderOpt.has_value());
323
324 expectEqualField(expected, *fromSleOpt, "sfSequence");
325 expectEqualField(expected, *fromBuilderOpt, "sfSequence");
326 }
327
328 {
329 auto const& expected = conditionValue;
330
331 auto const fromSleOpt = entryFromSle.getCondition();
332 auto const fromBuilderOpt = entryFromBuilder.getCondition();
333
334 ASSERT_TRUE(fromSleOpt.has_value());
335 ASSERT_TRUE(fromBuilderOpt.has_value());
336
337 expectEqualField(expected, *fromSleOpt, "sfCondition");
338 expectEqualField(expected, *fromBuilderOpt, "sfCondition");
339 }
340
341 {
342 auto const& expected = cancelAfterValue;
343
344 auto const fromSleOpt = entryFromSle.getCancelAfter();
345 auto const fromBuilderOpt = entryFromBuilder.getCancelAfter();
346
347 ASSERT_TRUE(fromSleOpt.has_value());
348 ASSERT_TRUE(fromBuilderOpt.has_value());
349
350 expectEqualField(expected, *fromSleOpt, "sfCancelAfter");
351 expectEqualField(expected, *fromBuilderOpt, "sfCancelAfter");
352 }
353
354 {
355 auto const& expected = finishAfterValue;
356
357 auto const fromSleOpt = entryFromSle.getFinishAfter();
358 auto const fromBuilderOpt = entryFromBuilder.getFinishAfter();
359
360 ASSERT_TRUE(fromSleOpt.has_value());
361 ASSERT_TRUE(fromBuilderOpt.has_value());
362
363 expectEqualField(expected, *fromSleOpt, "sfFinishAfter");
364 expectEqualField(expected, *fromBuilderOpt, "sfFinishAfter");
365 }
366
367 {
368 auto const& expected = bytecodeValue;
369
370 auto const fromSleOpt = entryFromSle.getBytecode();
371 auto const fromBuilderOpt = entryFromBuilder.getBytecode();
372
373 ASSERT_TRUE(fromSleOpt.has_value());
374 ASSERT_TRUE(fromBuilderOpt.has_value());
375
376 expectEqualField(expected, *fromSleOpt, "sfBytecode");
377 expectEqualField(expected, *fromBuilderOpt, "sfBytecode");
378 }
379
380 {
381 auto const& expected = dataValue;
382
383 auto const fromSleOpt = entryFromSle.getData();
384 auto const fromBuilderOpt = entryFromBuilder.getData();
385
386 ASSERT_TRUE(fromSleOpt.has_value());
387 ASSERT_TRUE(fromBuilderOpt.has_value());
388
389 expectEqualField(expected, *fromSleOpt, "sfData");
390 expectEqualField(expected, *fromBuilderOpt, "sfData");
391 }
392
393 {
394 auto const& expected = sourceTagValue;
395
396 auto const fromSleOpt = entryFromSle.getSourceTag();
397 auto const fromBuilderOpt = entryFromBuilder.getSourceTag();
398
399 ASSERT_TRUE(fromSleOpt.has_value());
400 ASSERT_TRUE(fromBuilderOpt.has_value());
401
402 expectEqualField(expected, *fromSleOpt, "sfSourceTag");
403 expectEqualField(expected, *fromBuilderOpt, "sfSourceTag");
404 }
405
406 {
407 auto const& expected = destinationTagValue;
408
409 auto const fromSleOpt = entryFromSle.getDestinationTag();
410 auto const fromBuilderOpt = entryFromBuilder.getDestinationTag();
411
412 ASSERT_TRUE(fromSleOpt.has_value());
413 ASSERT_TRUE(fromBuilderOpt.has_value());
414
415 expectEqualField(expected, *fromSleOpt, "sfDestinationTag");
416 expectEqualField(expected, *fromBuilderOpt, "sfDestinationTag");
417 }
418
419 {
420 auto const& expected = destinationNodeValue;
421
422 auto const fromSleOpt = entryFromSle.getDestinationNode();
423 auto const fromBuilderOpt = entryFromBuilder.getDestinationNode();
424
425 ASSERT_TRUE(fromSleOpt.has_value());
426 ASSERT_TRUE(fromBuilderOpt.has_value());
427
428 expectEqualField(expected, *fromSleOpt, "sfDestinationNode");
429 expectEqualField(expected, *fromBuilderOpt, "sfDestinationNode");
430 }
431
432 {
433 auto const& expected = transferRateValue;
434
435 auto const fromSleOpt = entryFromSle.getTransferRate();
436 auto const fromBuilderOpt = entryFromBuilder.getTransferRate();
437
438 ASSERT_TRUE(fromSleOpt.has_value());
439 ASSERT_TRUE(fromBuilderOpt.has_value());
440
441 expectEqualField(expected, *fromSleOpt, "sfTransferRate");
442 expectEqualField(expected, *fromBuilderOpt, "sfTransferRate");
443 }
444
445 {
446 auto const& expected = issuerNodeValue;
447
448 auto const fromSleOpt = entryFromSle.getIssuerNode();
449 auto const fromBuilderOpt = entryFromBuilder.getIssuerNode();
450
451 ASSERT_TRUE(fromSleOpt.has_value());
452 ASSERT_TRUE(fromBuilderOpt.has_value());
453
454 expectEqualField(expected, *fromSleOpt, "sfIssuerNode");
455 expectEqualField(expected, *fromBuilderOpt, "sfIssuerNode");
456 }
457
458 EXPECT_EQ(entryFromSle.getKey(), index);
459 EXPECT_EQ(entryFromBuilder.getKey(), index);
460}
461
462// 3) Verify wrapper throws when constructed from wrong ledger entry type.
463TEST(EscrowTests, WrapperThrowsOnWrongEntryType)
464{
465 UInt256 const index{3u};
466
467 // Build a valid ledger entry of a different type
468 // Ticket requires: Account, OwnerNode, TicketSequence, PreviousTxnID, PreviousTxnLgrSeq
469 // Check requires: Account, Destination, SendMax, Sequence, OwnerNode, DestinationNode, PreviousTxnID, PreviousTxnLgrSeq
470 TicketBuilder wrongBuilder{
476 auto wrongEntry = wrongBuilder.build(index);
477
478 EXPECT_THROW(Escrow{wrongEntry.getSle()}, std::runtime_error);
479}
480
481// 4) Verify builder throws when constructed from wrong ledger entry type.
482TEST(EscrowTests, BuilderThrowsOnWrongEntryType)
483{
484 UInt256 const index{4u};
485
486 // Build a valid ledger entry of a different type
487 TicketBuilder wrongBuilder{
493 auto wrongEntry = wrongBuilder.build(index);
494
495 EXPECT_THROW(EscrowBuilder{wrongEntry.getSle()}, std::runtime_error);
496}
497
498// 5) Build with only required fields and verify optional fields return nullopt.
499TEST(EscrowTests, OptionalFieldsReturnNullopt)
500{
501 UInt256 const index{3u};
502
503 auto const accountValue = canonical_ACCOUNT();
504 auto const destinationValue = canonical_ACCOUNT();
505 auto const amountValue = canonical_AMOUNT();
506 auto const ownerNodeValue = canonical_UINT64();
507 auto const previousTxnIDValue = canonical_UINT256();
508 auto const previousTxnLgrSeqValue = canonical_UINT32();
509
510 EscrowBuilder builder{
511 accountValue,
512 destinationValue,
513 amountValue,
514 ownerNodeValue,
515 previousTxnIDValue,
516 previousTxnLgrSeqValue
517 };
518
519 auto const entry = builder.build(index);
520
521 // Verify optional fields are not present
522 EXPECT_FALSE(entry.hasSequence());
523 EXPECT_FALSE(entry.getSequence().has_value());
524 EXPECT_FALSE(entry.hasCondition());
525 EXPECT_FALSE(entry.getCondition().has_value());
526 EXPECT_FALSE(entry.hasCancelAfter());
527 EXPECT_FALSE(entry.getCancelAfter().has_value());
528 EXPECT_FALSE(entry.hasFinishAfter());
529 EXPECT_FALSE(entry.getFinishAfter().has_value());
530 EXPECT_FALSE(entry.hasBytecode());
531 EXPECT_FALSE(entry.getBytecode().has_value());
532 EXPECT_FALSE(entry.hasData());
533 EXPECT_FALSE(entry.getData().has_value());
534 EXPECT_FALSE(entry.hasSourceTag());
535 EXPECT_FALSE(entry.getSourceTag().has_value());
536 EXPECT_FALSE(entry.hasDestinationTag());
537 EXPECT_FALSE(entry.getDestinationTag().has_value());
538 EXPECT_FALSE(entry.hasDestinationNode());
539 EXPECT_FALSE(entry.getDestinationNode().has_value());
540 EXPECT_FALSE(entry.hasTransferRate());
541 EXPECT_FALSE(entry.getTransferRate().has_value());
542 EXPECT_FALSE(entry.hasIssuerNode());
543 EXPECT_FALSE(entry.getIssuerNode().has_value());
544}
545}
Builder for Escrow ledger entries.
Definition Escrow.h:387
EscrowBuilder & setSourceTag(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfSourceTag (SoeOptional).
Definition Escrow.h:531
EscrowBuilder & setDestinationNode(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfDestinationNode (SoeOptional).
Definition Escrow.h:586
EscrowBuilder & setCancelAfter(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfCancelAfter (SoeOptional).
Definition Escrow.h:487
EscrowBuilder & setFinishAfter(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfFinishAfter (SoeOptional).
Definition Escrow.h:498
EscrowBuilder & setCondition(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfCondition (SoeOptional).
Definition Escrow.h:476
Escrow build(UInt256 const &index)
Build and return the completed Escrow wrapper.
Definition Escrow.h:620
EscrowBuilder & setBytecode(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfBytecode (SoeOptional).
Definition Escrow.h:509
EscrowBuilder & setSequence(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfSequence (SoeOptional).
Definition Escrow.h:443
EscrowBuilder & setTransferRate(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfTransferRate (SoeOptional).
Definition Escrow.h:597
EscrowBuilder & setData(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfData (SoeOptional).
Definition Escrow.h:520
EscrowBuilder & setIssuerNode(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfIssuerNode (SoeOptional).
Definition Escrow.h:608
EscrowBuilder & setDestinationTag(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfDestinationTag (SoeOptional).
Definition Escrow.h:542
Ledger Entry: Escrow.
Definition Escrow.h:28
SF_UINT64::type::value_type getOwnerNode() const
Get sfOwnerNode (SoeRequired).
Definition Escrow.h:279
protocol_autogen::Optional< SF_UINT32::type::value_type > getDestinationTag() const
Get sfDestinationTag (SoeOptional).
Definition Escrow.h:255
protocol_autogen::Optional< SF_UINT32::type::value_type > getCancelAfter() const
Get sfCancelAfter (SoeOptional).
Definition Escrow.h:135
protocol_autogen::Optional< SF_UINT32::type::value_type > getSequence() const
Get sfSequence (SoeOptional).
Definition Escrow.h:65
protocol_autogen::Optional< SF_UINT64::type::value_type > getIssuerNode() const
Get sfIssuerNode (SoeOptional).
Definition Escrow.h:360
protocol_autogen::Optional< SF_VL::type::value_type > getCondition() const
Get sfCondition (SoeOptional).
Definition Escrow.h:111
SF_UINT32::type::value_type getPreviousTxnLgrSeq() const
Get sfPreviousTxnLgrSeq (SoeRequired).
Definition Escrow.h:301
protocol_autogen::Optional< SF_UINT32::type::value_type > getFinishAfter() const
Get sfFinishAfter (SoeOptional).
Definition Escrow.h:159
SF_AMOUNT::type::value_type getAmount() const
Get sfAmount (SoeRequired).
Definition Escrow.h:100
protocol_autogen::Optional< SF_VL::type::value_type > getData() const
Get sfData (SoeOptional).
Definition Escrow.h:207
SF_ACCOUNT::type::value_type getAccount() const
Get sfAccount (SoeRequired).
Definition Escrow.h:54
protocol_autogen::Optional< SF_UINT32::type::value_type > getSourceTag() const
Get sfSourceTag (SoeOptional).
Definition Escrow.h:231
static constexpr LedgerEntryType entryType
Definition Escrow.h:30
protocol_autogen::Optional< SF_UINT32::type::value_type > getTransferRate() const
Get sfTransferRate (SoeOptional).
Definition Escrow.h:336
SF_UINT256::type::value_type getPreviousTxnID() const
Get sfPreviousTxnID (SoeRequired).
Definition Escrow.h:290
SF_ACCOUNT::type::value_type getDestination() const
Get sfDestination (SoeRequired).
Definition Escrow.h:89
protocol_autogen::Optional< SF_UINT64::type::value_type > getDestinationNode() const
Get sfDestinationNode (SoeOptional).
Definition Escrow.h:312
protocol_autogen::Optional< SF_VL::type::value_type > getBytecode() const
Get sfBytecode (SoeOptional).
Definition Escrow.h:183
UInt256 const & getKey() const
Get the key (index) of this ledger entry.
bool validate() const
Validate the ledger entry.
Derived & setLedgerIndex(UInt256 const &value)
Set the ledger index.
Derived & setFlags(uint32_t value)
Set the flags.
bool validate() const
Validate the ledger entry.
Builder for Ticket ledger entries.
Definition Ticket.h:112
Ticket build(UInt256 const &index)
Build and return the completed Ticket wrapper.
Definition Ticket.h:211
T make_shared(T... args)
TEST(AccountRootTests, BuilderSettersRoundTrip)
BaseUInt< 256 > UInt256
Definition base_uint.h:580
void expectEqualField(T const &expected, T const &actual, char const *fieldName)