20TEST(TransactionsPermissionedDomainSetTests, BuilderSettersRoundTrip)
23 auto const [publicKey, secretKey] =
37 acceptedCredentialsValue,
43 builder.setDomainID(domainIDValue);
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 = acceptedCredentialsValue;
62 auto const actual = tx.getAcceptedCredentials();
68 auto const& expected = domainIDValue;
69 auto const actualOpt = tx.getDomainID();
70 ASSERT_TRUE(actualOpt.has_value()) <<
"Optional field sfDomainID should be present";
72 EXPECT_TRUE(tx.hasDomainID());
79TEST(TransactionsPermissionedDomainSetTests, BuilderFromStTxRoundTrip)
82 auto const [publicKey, secretKey] =
97 acceptedCredentialsValue,
102 initialBuilder.setDomainID(domainIDValue);
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 = acceptedCredentialsValue;
122 auto const actual = rebuiltTx.getAcceptedCredentials();
128 auto const& expected = domainIDValue;
129 auto const actualOpt = rebuiltTx.getDomainID();
130 ASSERT_TRUE(actualOpt.has_value()) <<
"Optional field sfDomainID should be present";
165TEST(TransactionsPermissionedDomainSetTests, OptionalFieldsReturnNullopt)
168 auto const [publicKey, secretKey] =
181 acceptedCredentialsValue,
188 auto tx = builder.build(publicKey, secretKey);
191 EXPECT_FALSE(tx.hasDomainID());
192 EXPECT_FALSE(tx.getDomainID().has_value());
Builder for PermissionedDomainSet transactions.
PermissionedDomainSet build(PublicKey const &publicKey, SecretKey const &secretKey)
Build and return the PermissionedDomainSet wrapper.
Transaction: PermissionedDomainSet.