xrpld
Loading...
Searching...
No Matches
BridgeEntry.cpp
1#include <xrpl/ledger/entries/BridgeEntry.h>
2
3#include <xrpl/protocol/Indexes.h>
4#include <xrpl/protocol/Issue.h>
5#include <xrpl/protocol/Keylet.h>
6#include <xrpl/protocol/STXChainBridge.h>
7
8#include <gtest/gtest.h>
9#include <helpers/IOU.h>
10#include <ledger/EntryTestHelpers.h>
11
12namespace xrpl::test {
13
14TEST(BridgeEntryTests, constructors)
15{
17
18 STXChainBridge const bridge{e.alice.id(), xrpIssue(), e.bob.id(), IOU("USD", e.bob).issue()};
19
21 e,
23 "bridge(bridge, Locking)",
24 bridge,
26
28 e,
30 "bridge(bridge, Issuing)",
31 bridge,
33
34 // The two chain types must not collide, or the assertions above would
35 // pass with chainType ignored entirely.
36 EXPECT_NE(
39}
40
41} // namespace xrpl::test
Scaffolding shared by the per-entry-type suites.
AccountID id() const
Returns the Account ID.
Converts to IOU Issue or STAmount.
Keylet bridge(STXChainBridge const &bridge, STXChainBridge::ChainType chainType)
Definition Indexes.cpp:517
json::Value bridge(Account const &lockingChainDoor, Issue const &lockingChainIssue, Account const &issuingChainDoor, Issue const &issuingChainIssue)
TEST(UnitsTest, types)
Definition Units.cpp:16
void expectKeylet(EntryTestEnv &e, Keylet const &expected, std::string const &what, Args const &... args)
Assert that both flavors of Entry built from args resolve the ledger object that expected names.
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
Definition Issue.h:108