20TEST(TransactionsXChainCreateBridgeTests, BuilderSettersRoundTrip)
23 auto const [publicKey, secretKey] =
45 builder.setMinAccountCreateAmount(minAccountCreateAmountValue);
47 auto tx = builder.build(publicKey, secretKey);
50 EXPECT_TRUE(tx.validate(reason)) << reason;
53 EXPECT_FALSE(tx.getSigningPubKey().empty());
54 EXPECT_TRUE(tx.hasTxnSignature());
57 EXPECT_EQ(tx.getAccount(), accountValue);
58 EXPECT_EQ(tx.getSequence(), sequenceValue);
59 EXPECT_EQ(tx.getFee(), feeValue);
63 auto const& expected = xChainBridgeValue;
64 auto const actual = tx.getXChainBridge();
69 auto const& expected = signatureRewardValue;
70 auto const actual = tx.getSignatureReward();
76 auto const& expected = minAccountCreateAmountValue;
77 auto const actualOpt = tx.getMinAccountCreateAmount();
78 ASSERT_TRUE(actualOpt.has_value()) <<
"Optional field sfMinAccountCreateAmount should be present";
80 EXPECT_TRUE(tx.hasMinAccountCreateAmount());
87TEST(TransactionsXChainCreateBridgeTests, BuilderFromStTxRoundTrip)
90 auto const [publicKey, secretKey] =
107 signatureRewardValue,
112 initialBuilder.setMinAccountCreateAmount(minAccountCreateAmountValue);
114 auto initialTx = initialBuilder.build(publicKey, secretKey);
119 auto rebuiltTx = builderFromTx.
build(publicKey, secretKey);
122 EXPECT_TRUE(rebuiltTx.validate(reason)) << reason;
125 EXPECT_EQ(rebuiltTx.getAccount(), accountValue);
126 EXPECT_EQ(rebuiltTx.getSequence(), sequenceValue);
127 EXPECT_EQ(rebuiltTx.getFee(), feeValue);
131 auto const& expected = xChainBridgeValue;
132 auto const actual = rebuiltTx.getXChainBridge();
137 auto const& expected = signatureRewardValue;
138 auto const actual = rebuiltTx.getSignatureReward();
144 auto const& expected = minAccountCreateAmountValue;
145 auto const actualOpt = rebuiltTx.getMinAccountCreateAmount();
146 ASSERT_TRUE(actualOpt.has_value()) <<
"Optional field sfMinAccountCreateAmount should be present";