mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
Remove unused header file (#5908)
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <test/jtx.h>
|
||||
#include <test/jtx/confidentialTransfer.h>
|
||||
#include <test/jtx/trust.h>
|
||||
|
||||
#include <xrpl/protocol/ConfidentialTransfer.h>
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of rippled: https://github.com/ripple/rippled
|
||||
Copyright (c) 2024 Ripple Labs Inc.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#ifndef RIPPLE_TEST_JTX_CONFIDENTIALTRANSFER_H_INCLUDED
|
||||
#define RIPPLE_TEST_JTX_CONFIDENTIALTRANSFER_H_INCLUDED
|
||||
|
||||
#include <test/jtx/Account.h>
|
||||
#include <test/jtx/Env.h>
|
||||
#include <test/jtx/owners.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace test {
|
||||
namespace jtx {
|
||||
|
||||
Json::Value
|
||||
convert(
|
||||
MPTID const mptId,
|
||||
jtx::Account const& account,
|
||||
std::uint64_t const amount,
|
||||
std::optional<std::string> holderPk,
|
||||
std::string holderEncAmt,
|
||||
std::string issuerEncAmt,
|
||||
std::string zkp);
|
||||
|
||||
} // namespace jtx
|
||||
} // namespace test
|
||||
} // namespace ripple
|
||||
|
||||
#endif
|
||||
@@ -257,60 +257,77 @@ MPTTester::set(MPTSet const& arg)
|
||||
jv[sfMPTokenMetadata] = strHex(*arg.metadata);
|
||||
if (arg.pubKey)
|
||||
jv[sfIssuerElGamalPublicKey] = strHex(*arg.pubKey);
|
||||
if (submit(arg, jv) == tesSUCCESS && (arg.flags || arg.mutableFlags))
|
||||
if (submit(arg, jv) == tesSUCCESS)
|
||||
{
|
||||
auto require = [&](std::optional<Account> const& holder,
|
||||
bool unchanged) {
|
||||
auto flags = getFlags(holder);
|
||||
if (!unchanged)
|
||||
{
|
||||
if (arg.flags)
|
||||
if ((arg.flags || arg.mutableFlags))
|
||||
{
|
||||
auto require = [&](std::optional<Account> const& holder,
|
||||
bool unchanged) {
|
||||
auto flags = getFlags(holder);
|
||||
if (!unchanged)
|
||||
{
|
||||
if (*arg.flags & tfMPTLock)
|
||||
flags |= lsfMPTLocked;
|
||||
else if (*arg.flags & tfMPTUnlock)
|
||||
flags &= ~lsfMPTLocked;
|
||||
if (arg.flags)
|
||||
{
|
||||
if (*arg.flags & tfMPTLock)
|
||||
flags |= lsfMPTLocked;
|
||||
else if (*arg.flags & tfMPTUnlock)
|
||||
flags &= ~lsfMPTLocked;
|
||||
}
|
||||
|
||||
if (arg.mutableFlags)
|
||||
{
|
||||
if (*arg.mutableFlags & tmfMPTSetCanLock)
|
||||
flags |= lsfMPTCanLock;
|
||||
else if (*arg.mutableFlags & tmfMPTClearCanLock)
|
||||
flags &= ~lsfMPTCanLock;
|
||||
|
||||
if (*arg.mutableFlags & tmfMPTSetRequireAuth)
|
||||
flags |= lsfMPTRequireAuth;
|
||||
else if (*arg.mutableFlags & tmfMPTClearRequireAuth)
|
||||
flags &= ~lsfMPTRequireAuth;
|
||||
|
||||
if (*arg.mutableFlags & tmfMPTSetCanEscrow)
|
||||
flags |= lsfMPTCanEscrow;
|
||||
else if (*arg.mutableFlags & tmfMPTClearCanEscrow)
|
||||
flags &= ~lsfMPTCanEscrow;
|
||||
|
||||
if (*arg.mutableFlags & tmfMPTSetCanClawback)
|
||||
flags |= lsfMPTCanClawback;
|
||||
else if (*arg.mutableFlags & tmfMPTClearCanClawback)
|
||||
flags &= ~lsfMPTCanClawback;
|
||||
|
||||
if (*arg.mutableFlags & tmfMPTSetCanTrade)
|
||||
flags |= lsfMPTCanTrade;
|
||||
else if (*arg.mutableFlags & tmfMPTClearCanTrade)
|
||||
flags &= ~lsfMPTCanTrade;
|
||||
|
||||
if (*arg.mutableFlags & tmfMPTSetCanTransfer)
|
||||
flags |= lsfMPTCanTransfer;
|
||||
else if (*arg.mutableFlags & tmfMPTClearCanTransfer)
|
||||
flags &= ~lsfMPTCanTransfer;
|
||||
}
|
||||
}
|
||||
env_.require(mptflags(*this, flags, holder));
|
||||
};
|
||||
if (arg.account)
|
||||
require(std::nullopt, arg.holder.has_value());
|
||||
if (arg.holder)
|
||||
require(*arg.holder, false);
|
||||
}
|
||||
|
||||
if (arg.mutableFlags)
|
||||
{
|
||||
if (*arg.mutableFlags & tmfMPTSetCanLock)
|
||||
flags |= lsfMPTCanLock;
|
||||
else if (*arg.mutableFlags & tmfMPTClearCanLock)
|
||||
flags &= ~lsfMPTCanLock;
|
||||
|
||||
if (*arg.mutableFlags & tmfMPTSetRequireAuth)
|
||||
flags |= lsfMPTRequireAuth;
|
||||
else if (*arg.mutableFlags & tmfMPTClearRequireAuth)
|
||||
flags &= ~lsfMPTRequireAuth;
|
||||
|
||||
if (*arg.mutableFlags & tmfMPTSetCanEscrow)
|
||||
flags |= lsfMPTCanEscrow;
|
||||
else if (*arg.mutableFlags & tmfMPTClearCanEscrow)
|
||||
flags &= ~lsfMPTCanEscrow;
|
||||
|
||||
if (*arg.mutableFlags & tmfMPTSetCanClawback)
|
||||
flags |= lsfMPTCanClawback;
|
||||
else if (*arg.mutableFlags & tmfMPTClearCanClawback)
|
||||
flags &= ~lsfMPTCanClawback;
|
||||
|
||||
if (*arg.mutableFlags & tmfMPTSetCanTrade)
|
||||
flags |= lsfMPTCanTrade;
|
||||
else if (*arg.mutableFlags & tmfMPTClearCanTrade)
|
||||
flags &= ~lsfMPTCanTrade;
|
||||
|
||||
if (*arg.mutableFlags & tmfMPTSetCanTransfer)
|
||||
flags |= lsfMPTCanTransfer;
|
||||
else if (*arg.mutableFlags & tmfMPTClearCanTransfer)
|
||||
flags &= ~lsfMPTCanTransfer;
|
||||
}
|
||||
}
|
||||
env_.require(mptflags(*this, flags, holder));
|
||||
};
|
||||
if (arg.account)
|
||||
require(std::nullopt, arg.holder.has_value());
|
||||
if (arg.holder)
|
||||
require(*arg.holder, false);
|
||||
if (arg.pubKey)
|
||||
{
|
||||
env_.require(requireAny([&]() -> bool {
|
||||
return forObject([&](SLEP const& sle) -> bool {
|
||||
if (sle)
|
||||
{
|
||||
return strHex((*sle)[sfIssuerElGamalPublicKey]) ==
|
||||
strHex(getPubKey(issuer_));
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -634,12 +651,12 @@ MPTTester::convert(MPTConvert const& arg)
|
||||
|
||||
if (submit(arg, jv) == tesSUCCESS)
|
||||
{
|
||||
auto const curConfidentialOutstanding =
|
||||
auto const postConfidentialOutstanding =
|
||||
getIssuanceConfidentialBalance();
|
||||
env_.require(mptbalance(*this, *arg.account, holderAmt - *arg.amt));
|
||||
env_.require(requireAny([&]() -> bool {
|
||||
return prevConfidentialOutstanding + *arg.amt ==
|
||||
curConfidentialOutstanding;
|
||||
postConfidentialOutstanding;
|
||||
}));
|
||||
|
||||
uint64_t postInboxBalance =
|
||||
@@ -672,6 +689,22 @@ MPTTester::convert(MPTConvert const& arg)
|
||||
env_.require(requireAny([&]() -> bool {
|
||||
return postInboxBalance + postSpendingBalance == postIssuerBalance;
|
||||
}));
|
||||
|
||||
if (arg.holderPubKey)
|
||||
{
|
||||
env_.require(requireAny([&]() -> bool {
|
||||
return forObject(
|
||||
[&](SLEP const& sle) -> bool {
|
||||
if (sle)
|
||||
{
|
||||
return strHex((*sle)[sfHolderElGamalPublicKey]) ==
|
||||
strHex(getPubKey(*arg.account));
|
||||
}
|
||||
return false;
|
||||
},
|
||||
*arg.account);
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user