mirror of
https://github.com/Xahau/xahaud.git
synced 2026-04-29 15:37:46 +00:00
Implement enhanced Ticket support:
Tickets are a mechanism to allow for the "out-of-order" execution of transactions on the XRP Ledger. This commit, if merged, reworks the existing support for tickets and introduces support for 'ticket batching', completing the feature set needed for tickets. The code is gated under the newly-introduced `TicketBatch` amendment and the `Tickets` amendment, which is not presently active on the network, is being removed. The specification for this change can be found at: https://github.com/xrp-community/standards-drafts/issues/16
This commit is contained in:
committed by
Nik Bougalis
parent
01bd5a2646
commit
7724cca384
@@ -18,6 +18,7 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
#include <ripple/protocol/SeqProxy.h>
|
||||
#include <ripple/protocol/digest.h>
|
||||
#include <boost/endian/conversion.hpp>
|
||||
#include <algorithm>
|
||||
@@ -107,10 +108,17 @@ getQuality(uint256 const& uBase)
|
||||
}
|
||||
|
||||
uint256
|
||||
getTicketIndex(AccountID const& account, std::uint32_t uSequence)
|
||||
getTicketIndex(AccountID const& account, std::uint32_t ticketSeq)
|
||||
{
|
||||
return indexHash(
|
||||
LedgerNameSpace::TICKET, account, std::uint32_t(uSequence));
|
||||
LedgerNameSpace::TICKET, account, std::uint32_t(ticketSeq));
|
||||
}
|
||||
|
||||
uint256
|
||||
getTicketIndex(AccountID const& account, SeqProxy ticketSeq)
|
||||
{
|
||||
assert(ticketSeq.isTicket());
|
||||
return getTicketIndex(account, ticketSeq.value());
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -238,9 +246,15 @@ next_t::operator()(Keylet const& k) const
|
||||
}
|
||||
|
||||
Keylet
|
||||
ticket_t::operator()(AccountID const& id, std::uint32_t seq) const
|
||||
ticket_t::operator()(AccountID const& id, std::uint32_t ticketSeq) const
|
||||
{
|
||||
return {ltTICKET, getTicketIndex(id, seq)};
|
||||
return {ltTICKET, getTicketIndex(id, ticketSeq)};
|
||||
}
|
||||
|
||||
Keylet
|
||||
ticket_t::operator()(AccountID const& id, SeqProxy ticketSeq) const
|
||||
{
|
||||
return {ltTICKET, getTicketIndex(id, ticketSeq)};
|
||||
}
|
||||
|
||||
// This function is presently static, since it's never accessed from anywhere
|
||||
|
||||
Reference in New Issue
Block a user