4#include <gtest/gtest.h>
6#include <protocol_autogen/TestHelpers.h>
8#include <xrpl/protocol/SecretKey.h>
9#include <xrpl/protocol/Seed.h>
10#include <xrpl/protocol/STTx.h>
11#include <xrpl/protocol_autogen/transactions/DIDDelete.h>
12#include <xrpl/protocol_autogen/transactions/AccountSet.h>
20TEST(TransactionsDIDDeleteTests, BuilderSettersRoundTrip)
23 auto const [publicKey, secretKey] =
41 auto tx = builder.build(publicKey, secretKey);
44 EXPECT_TRUE(tx.validate(reason)) << reason;
47 EXPECT_FALSE(tx.getSigningPubKey().empty());
48 EXPECT_TRUE(tx.hasTxnSignature());
51 EXPECT_EQ(tx.getAccount(), accountValue);
52 EXPECT_EQ(tx.getSequence(), sequenceValue);
53 EXPECT_EQ(tx.getFee(), feeValue);
61TEST(TransactionsDIDDeleteTests, BuilderFromStTxRoundTrip)
64 auto const [publicKey, secretKey] =
82 auto initialTx = initialBuilder.build(publicKey, secretKey);
87 auto rebuiltTx = builderFromTx.
build(publicKey, secretKey);
90 EXPECT_TRUE(rebuiltTx.validate(reason)) << reason;
93 EXPECT_EQ(rebuiltTx.getAccount(), accountValue);
94 EXPECT_EQ(rebuiltTx.getSequence(), sequenceValue);
95 EXPECT_EQ(rebuiltTx.getFee(), feeValue);
102TEST(TransactionsDIDDeleteTests, WrapperThrowsOnWrongTxType)
105 auto const [pk, sk] =
110 auto wrongTx = wrongBuilder.build(pk, sk);
116TEST(TransactionsDIDDeleteTests, BuilderThrowsOnWrongTxType)
119 auto const [pk, sk] =
124 auto wrongTx = wrongBuilder.build(pk, sk);
Builder for AccountSet transactions.
Builder for DIDDelete transactions.
DIDDelete build(PublicKey const &publicKey, SecretKey const &secretKey)
Transaction-specific field setters.
std::shared_ptr< STTx const > getSTTx() const
Get the underlying STTx object.
TEST(TransactionsAccountDeleteTests, BuilderSettersRoundTrip)
Seed generateSeed(std::string const &passPhrase)
Generate a seed deterministically.
std::pair< PublicKey, SecretKey > generateKeyPair(KeyType type, Seed const &seed)
Generate a key pair deterministically.
AmountValue canonical_AMOUNT()
AccountID calcAccountID(PublicKey const &pk)