20TEST(TransactionsSponsorshipTransferTests, BuilderSettersRoundTrip)
23 auto const [publicKey, secretKey] =
45 auto tx = builder.
build(publicKey, secretKey);
48 EXPECT_TRUE(tx.validate(reason)) << reason;
51 EXPECT_FALSE(tx.getSigningPubKey().empty());
52 EXPECT_TRUE(tx.hasTxnSignature());
55 EXPECT_EQ(tx.getAccount(), accountValue);
56 EXPECT_EQ(tx.getSequence(), sequenceValue);
57 EXPECT_EQ(tx.getFee(), feeValue);
62 auto const& expected = objectIDValue;
63 auto const actualOpt = tx.getObjectID();
64 ASSERT_TRUE(actualOpt.has_value()) <<
"Optional field sfObjectID should be present";
66 EXPECT_TRUE(tx.hasObjectID());
70 auto const& expected = sponseeValue;
71 auto const actualOpt = tx.getSponsee();
72 ASSERT_TRUE(actualOpt.has_value()) <<
"Optional field sfSponsee should be present";
74 EXPECT_TRUE(tx.hasSponsee());
81TEST(TransactionsSponsorshipTransferTests, BuilderFromStTxRoundTrip)
84 auto const [publicKey, secretKey] =
106 auto initialTx = initialBuilder.
build(publicKey, secretKey);
111 auto rebuiltTx = builderFromTx.
build(publicKey, secretKey);
114 EXPECT_TRUE(rebuiltTx.validate(reason)) << reason;
117 EXPECT_EQ(rebuiltTx.getAccount(), accountValue);
118 EXPECT_EQ(rebuiltTx.getSequence(), sequenceValue);
119 EXPECT_EQ(rebuiltTx.getFee(), feeValue);
124 auto const& expected = objectIDValue;
125 auto const actualOpt = rebuiltTx.getObjectID();
126 ASSERT_TRUE(actualOpt.has_value()) <<
"Optional field sfObjectID should be present";
131 auto const& expected = sponseeValue;
132 auto const actualOpt = rebuiltTx.getSponsee();
133 ASSERT_TRUE(actualOpt.has_value()) <<
"Optional field sfSponsee should be present";