rippled
Loading...
Searching...
No Matches
include/xrpl/protocol/Batch.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2024 Ripple Labs Inc.
5 Permission to use, copy, modify, and/or distribute this software for any
6 purpose with or without fee is hereby granted, provided that the above
7 copyright notice and this permission notice appear in all copies.
8 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16//==============================================================================
17
18#include <xrpl/protocol/HashPrefix.h>
19#include <xrpl/protocol/STVector256.h>
20#include <xrpl/protocol/Serializer.h>
21
22namespace ripple {
23
24inline void
26 Serializer& msg,
27 std::uint32_t const& flags,
28 std::vector<uint256> const& txids)
29{
31 msg.add32(flags);
32 msg.add32(std::uint32_t(txids.size()));
33 for (auto const& txid : txids)
34 msg.addBitString(txid);
35}
36
37} // namespace ripple
int addBitString(base_uint< Bits, Tag > const &v)
Definition Serializer.h:131
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:25
void serializeBatch(Serializer &msg, std::uint32_t const &flags, std::vector< uint256 > const &txids)
T size(T... args)