1#include <test/jtx/batch.h>
2#include <test/jtx/utility.h>
4#include <xrpl/protocol/Batch.h>
5#include <xrpl/protocol/HashPrefix.h>
6#include <xrpl/protocol/Sign.h>
7#include <xrpl/protocol/jss.h>
22 return ((numSigners + 2) * feeDrops) + feeDrops * txns;
30 jv[jss::TransactionType] = jss::Batch;
31 jv[jss::Account] = account.human();
33 jv[jss::Sequence] =
seq;
34 jv[jss::Flags] =
flags;
42 auto const index = jt.
jv[jss::RawTransactions].
size();
43 Json::Value& batchTransaction = jt.
jv[jss::RawTransactions][index];
47 batchTransaction[jss::RawTransaction] =
txn_;
58 jt.
jv[jss::SigningPubKey] =
"";
66 STTx const& stx =
STTx{std::move(*st)};
67 auto& js = jt[sfBatchSigners.getJsonName()];
70 auto const& e = mySigners[i];
71 auto& jo = js[i][sfBatchSigner.getJsonName()];
72 jo[jss::Account] = e.acct.human();
73 jo[jss::SigningPubKey] =
strHex(e.sig.pk().slice());
90 jt.
jv[jss::SigningPubKey] =
"";
98 STTx const& stx =
STTx{std::move(*st)};
99 auto& bs = jt[sfBatchSigners.getJsonName()];
100 auto const index = jt[sfBatchSigners.jsonName].size();
101 auto& bso = bs[index][sfBatchSigner.getJsonName()];
103 bso[jss::SigningPubKey] =
"";
104 auto& is = bso[sfSigners.getJsonName()];
107 auto const& e = mySigners[i];
108 auto& iso = is[i][sfSigner.getJsonName()];
109 iso[jss::Account] = e.acct.human();
110 iso[jss::SigningPubKey] =
strHex(e.sig.pk().slice());
UInt size() const
Number of values in array or object.
log_os< char > log
Logging output stream.
std::uint32_t getFlags() const
std::vector< uint256 > const & getBatchTransactionIDs() const
Retrieves a batch of transaction IDs from the STTx.
Slice slice() const noexcept
An immutable linear range of bytes.
Immutable cryptographic account descriptor.
std::string const & human() const
Returns the human readable public key.
A transaction testing environment.
beast::unit_test::suite & test
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
void operator()(Env &, JTx &jtx) const
std::vector< Reg > signers
void operator()(Env &, JTx &jt) const
Set a batch signature on a JTx.
void operator()(Env &, JTx &jt) const
std::vector< Reg > signers
@ arrayValue
array value (ordered list)
Json::Value outer(jtx::Account const &account, uint32_t seq, STAmount const &fee, std::uint32_t flags)
Batch.
XRPAmount calcBatchFee(jtx::Env const &env, uint32_t const &numSigners, uint32_t const &txns=0)
Calculate Batch Fee.
STObject parse(Json::Value const &jv)
Convert JSON to STObject.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::string to_string(base_uint< Bits, Tag > const &a)
std::string strHex(FwdIt begin, FwdIt end)
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
void finishMultiSigningData(AccountID const &signingID, Serializer &s)
Buffer sign(PublicKey const &pk, SecretKey const &sk, Slice const &message)
Generate a signature for a message.
void serializeBatch(Serializer &msg, std::uint32_t const &flags, std::vector< uint256 > const &txids)
void Rethrow()
Rethrow the exception currently being handled.
Execution context for applying a JSON transaction.
Set the sequence number on a JTx.