20TEST(TransactionsBatchTests, BuilderSettersRoundTrip)
23 auto const [publicKey, secretKey] =
43 builder.setBatchSigners(batchSignersValue);
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);
61 auto const& expected = rawTransactionsValue;
62 auto const actual = tx.getRawTransactions();
68 auto const& expected = batchSignersValue;
69 auto const actualOpt = tx.getBatchSigners();
70 ASSERT_TRUE(actualOpt.has_value()) <<
"Optional field sfBatchSigners should be present";
72 EXPECT_TRUE(tx.hasBatchSigners());
79TEST(TransactionsBatchTests, BuilderFromStTxRoundTrip)
82 auto const [publicKey, secretKey] =
102 initialBuilder.setBatchSigners(batchSignersValue);
104 auto initialTx = initialBuilder.build(publicKey, secretKey);
109 auto rebuiltTx = builderFromTx.
build(publicKey, secretKey);
112 EXPECT_TRUE(rebuiltTx.validate(reason)) << reason;
115 EXPECT_EQ(rebuiltTx.getAccount(), accountValue);
116 EXPECT_EQ(rebuiltTx.getSequence(), sequenceValue);
117 EXPECT_EQ(rebuiltTx.getFee(), feeValue);
121 auto const& expected = rawTransactionsValue;
122 auto const actual = rebuiltTx.getRawTransactions();
128 auto const& expected = batchSignersValue;
129 auto const actualOpt = rebuiltTx.getBatchSigners();
130 ASSERT_TRUE(actualOpt.has_value()) <<
"Optional field sfBatchSigners should be present";