20TEST(TransactionsXChainCommitTests, BuilderSettersRoundTrip)
23 auto const [publicKey, secretKey] =
47 builder.setOtherChainDestination(otherChainDestinationValue);
49 auto tx = builder.build(publicKey, secretKey);
52 EXPECT_TRUE(tx.validate(reason)) << reason;
55 EXPECT_FALSE(tx.getSigningPubKey().empty());
56 EXPECT_TRUE(tx.hasTxnSignature());
59 EXPECT_EQ(tx.getAccount(), accountValue);
60 EXPECT_EQ(tx.getSequence(), sequenceValue);
61 EXPECT_EQ(tx.getFee(), feeValue);
65 auto const& expected = xChainBridgeValue;
66 auto const actual = tx.getXChainBridge();
71 auto const& expected = xChainClaimIDValue;
72 auto const actual = tx.getXChainClaimID();
77 auto const& expected = amountValue;
78 auto const actual = tx.getAmount();
84 auto const& expected = otherChainDestinationValue;
85 auto const actualOpt = tx.getOtherChainDestination();
86 ASSERT_TRUE(actualOpt.has_value()) <<
"Optional field sfOtherChainDestination should be present";
88 EXPECT_TRUE(tx.hasOtherChainDestination());
95TEST(TransactionsXChainCommitTests, BuilderFromStTxRoundTrip)
98 auto const [publicKey, secretKey] =
122 initialBuilder.setOtherChainDestination(otherChainDestinationValue);
124 auto initialTx = initialBuilder.build(publicKey, secretKey);
129 auto rebuiltTx = builderFromTx.
build(publicKey, secretKey);
132 EXPECT_TRUE(rebuiltTx.validate(reason)) << reason;
135 EXPECT_EQ(rebuiltTx.getAccount(), accountValue);
136 EXPECT_EQ(rebuiltTx.getSequence(), sequenceValue);
137 EXPECT_EQ(rebuiltTx.getFee(), feeValue);
141 auto const& expected = xChainBridgeValue;
142 auto const actual = rebuiltTx.getXChainBridge();
147 auto const& expected = xChainClaimIDValue;
148 auto const actual = rebuiltTx.getXChainClaimID();
153 auto const& expected = amountValue;
154 auto const actual = rebuiltTx.getAmount();
160 auto const& expected = otherChainDestinationValue;
161 auto const actualOpt = rebuiltTx.getOtherChainDestination();
162 ASSERT_TRUE(actualOpt.has_value()) <<
"Optional field sfOtherChainDestination should be present";