rippled
Loading...
Searching...
No Matches
include
xrpl
protocol
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
22
namespace
ripple
{
23
24
inline
void
25
serializeBatch
(
26
Serializer
& msg,
27
std::uint32_t
const
&
flags
,
28
std::vector<uint256>
const
& txids)
29
{
30
msg.
add32
(
HashPrefix::batch
);
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
ripple::Serializer
Definition:
Serializer.h:42
ripple::Serializer::add32
int add32(T i)
Definition:
Serializer.h:95
ripple::Serializer::addBitString
int addBitString(base_uint< Bits, Tag > const &v)
Definition:
Serializer.h:132
ripple::test::jtx::flags
Match set account flags.
Definition:
flags.h:125
std::uint32_t
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition:
algorithm.h:26
ripple::serializeBatch
void serializeBatch(Serializer &msg, std::uint32_t const &flags, std::vector< uint256 > const &txids)
Definition:
include/xrpl/protocol/Batch.h:25
ripple::HashPrefix::batch
@ batch
Batch.
std::vector::size
T size(T... args)
std::vector
Generated by
1.9.5