xrpld
Loading...
Searching...
No Matches
escrow.h
1#pragma once
2
3#include <test/jtx/Account.h>
4#include <test/jtx/Env.h>
5#include <test/jtx/TestHelpers.h>
6#include <test/jtx/owners.h>
7#include <test/jtx/rate.h>
8
9#include <xrpl/protocol/Indexes.h>
10
13
15create(AccountID const& account, AccountID const& to, STAmount const& amount);
16
17inline json::Value
18create(Account const& account, Account const& to, STAmount const& amount)
19{
20 return create(account.id(), to.id(), amount);
21}
22
24finish(AccountID const& account, AccountID const& from, std::uint32_t seq);
25
26inline json::Value
27finish(Account const& account, Account const& from, std::uint32_t seq)
28{
29 return finish(account.id(), from.id(), seq);
30}
31
33cancel(AccountID const& account, Account const& from, std::uint32_t seq);
34
35inline json::Value
36cancel(Account const& account, Account const& from, std::uint32_t seq)
37{
38 return cancel(account.id(), from, seq);
39}
40
41Rate
42rate(Env& env, Account const& account, std::uint32_t const& seq);
43
44// A PreimageSha256 fulfillments and its associated kCondition.
45std::array<std::uint8_t, 4> const kFb1 = {{0xA0, 0x02, 0x80, 0x00}};
46
48 {0xA0, 0x25, 0x80, 0x20, 0xE3, 0xB0, 0xC4, 0x42, 0x98, 0xFC, 0x1C, 0x14, 0x9A,
49 0xFB, 0xF4, 0xC8, 0x99, 0x6F, 0xB9, 0x24, 0x27, 0xAE, 0x41, 0xE4, 0x64, 0x9B,
50 0x93, 0x4C, 0xA4, 0x95, 0x99, 0x1B, 0x78, 0x52, 0xB8, 0x55, 0x81, 0x01, 0x00}};
51
52// Another PreimageSha256 fulfillments and its associated kCondition.
53std::array<std::uint8_t, 7> const kFb2 = {{0xA0, 0x05, 0x80, 0x03, 0x61, 0x61, 0x61}};
54
56 {0xA0, 0x25, 0x80, 0x20, 0x98, 0x34, 0x87, 0x6D, 0xCF, 0xB0, 0x5C, 0xB1, 0x67,
57 0xA5, 0xC2, 0x49, 0x53, 0xEB, 0xA5, 0x8C, 0x4A, 0xC8, 0x9B, 0x1A, 0xDF, 0x57,
58 0xF2, 0x8F, 0x2F, 0x9D, 0x09, 0xAF, 0x10, 0x7E, 0xE8, 0xF0, 0x81, 0x01, 0x03}};
59
60// Another PreimageSha256 kFulfillment and its associated kCondition.
61std::array<std::uint8_t, 8> const kFb3 = {{0xA0, 0x06, 0x80, 0x04, 0x6E, 0x69, 0x6B, 0x62}};
62
64 {0xA0, 0x25, 0x80, 0x20, 0x6E, 0x4C, 0x71, 0x45, 0x30, 0xC0, 0xA4, 0x26, 0x8B,
65 0x3F, 0xA6, 0x3B, 0x1B, 0x60, 0x6F, 0x2D, 0x26, 0x4A, 0x2D, 0x85, 0x7B, 0xE8,
66 0xA0, 0x9C, 0x1D, 0xFD, 0x57, 0x0D, 0x15, 0x85, 0x8B, 0xD4, 0x81, 0x01, 0x04}};
67
69auto const kFinishTime = JTxFieldWrapper<TimePointField>(sfFinishAfter);
70
72auto const kCancelTime = JTxFieldWrapper<TimePointField>(sfCancelAfter);
73
74auto const kCondition = JTxFieldWrapper<BlobField>(sfCondition);
75
76auto const kFulfillment = JTxFieldWrapper<BlobField>(sfFulfillment);
77
78} // namespace xrpl::test::jtx::escrow
Represents a JSON value.
Definition json_value.h:130
Immutable cryptographic account descriptor.
Definition jtx/Account.h:17
AccountID id() const
Returns the Account ID.
Definition jtx/Account.h:85
A transaction testing environment.
Definition Env.h:143
Escrow operations.
Definition escrow.h:12
json::Value create(AccountID const &account, AccountID const &to, STAmount const &amount)
Definition escrow.cpp:21
json::Value cancel(AccountID const &account, Account const &from, std::uint32_t seq)
Definition escrow.cpp:45
auto const kCondition
Definition escrow.h:74
auto const kCancelTime
Set the "CancelAfter" time tag on a JTx.
Definition escrow.h:72
Rate rate(Env &env, Account const &account, std::uint32_t const &seq)
Definition escrow.cpp:57
auto const kFinishTime
Set the "FinishAfter" time tag on a JTx.
Definition escrow.h:69
std::array< std::uint8_t, 8 > const kFb3
Definition escrow.h:61
std::array< std::uint8_t, 7 > const kFb2
Definition escrow.h:53
std::array< std::uint8_t, 39 > const kCb2
Definition escrow.h:55
auto const kFulfillment
Definition escrow.h:76
json::Value finish(AccountID const &account, AccountID const &from, std::uint32_t seq)
Definition escrow.cpp:33
std::array< std::uint8_t, 4 > const kFb1
Definition escrow.h:45
std::array< std::uint8_t, 39 > const kCb1
Definition escrow.h:47
std::array< std::uint8_t, 39 > const kCb3
Definition escrow.h:63
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:28
Represents a transfer rate.
Definition Rate.h:20