mirror of
https://github.com/XRPLF/clio.git
synced 2026-07-23 23:20:24 +00:00
chore: Update libxrpl to 3.2.0 (#3114)
This commit is contained in:
@@ -43,20 +43,20 @@ createTxAndMetaBlobs(std::string metaStr, std::string txnStr)
|
||||
return {hexStringToBinaryString(metaStr), hexStringToBinaryString(txnStr)};
|
||||
}
|
||||
|
||||
std::pair<ripple::STTx, ripple::TxMeta>
|
||||
std::pair<xrpl::STTx, xrpl::TxMeta>
|
||||
createTxAndMeta(std::string hashStr, std::string metaStr, std::string txnStr)
|
||||
{
|
||||
ripple::uint256 hash;
|
||||
xrpl::uint256 hash;
|
||||
EXPECT_TRUE(hash.parseHex(hashStr));
|
||||
|
||||
auto const [metaBlob, txnBlob] = createTxAndMetaBlobs(metaStr, txnStr);
|
||||
|
||||
ripple::SerialIter it{txnBlob.data(), txnBlob.size()};
|
||||
return {ripple::STTx{it}, ripple::TxMeta{hash, kSeq, metaBlob}};
|
||||
xrpl::SerialIter it{txnBlob.data(), txnBlob.size()};
|
||||
return {xrpl::STTx{it}, xrpl::TxMeta{hash, kSeq, xrpl::Blob{metaBlob.begin(), metaBlob.end()}}};
|
||||
}
|
||||
|
||||
etl::model::Transaction
|
||||
createTransaction(ripple::TxType type, std::string hashStr, std::string metaStr, std::string txnStr)
|
||||
createTransaction(xrpl::TxType type, std::string hashStr, std::string metaStr, std::string txnStr)
|
||||
{
|
||||
auto const [sttx, meta] = createTxAndMeta(hashStr, metaStr, txnStr);
|
||||
return {
|
||||
@@ -64,7 +64,7 @@ createTransaction(ripple::TxType type, std::string hashStr, std::string metaStr,
|
||||
.metaRaw = "",
|
||||
.sttx = sttx,
|
||||
.meta = meta,
|
||||
.id = ripple::uint256{"0000000000000000000000000000000000000000000000000000000000000001"},
|
||||
.id = xrpl::uint256{"0000000000000000000000000000000000000000000000000000000000000001"},
|
||||
.key = "0000000000000000000000000000000000000000000000000000000000000001",
|
||||
.type = type
|
||||
};
|
||||
@@ -92,8 +92,8 @@ createObject(etl::model::Object::ModType modType, std::string key)
|
||||
.key = binaryStringToUint256(hexStringToBinaryString(key)),
|
||||
.keyRaw = hexStringToBinaryString(key),
|
||||
.data = modType == etl::model::Object::ModType::Deleted
|
||||
? ripple::Blob{}
|
||||
: *ripple::strUnHex(kObjBlob), // NOLINT(bugprone-unchecked-optional-access)
|
||||
? xrpl::Blob{}
|
||||
: *xrpl::strUnHex(kObjBlob), // NOLINT(bugprone-unchecked-optional-access)
|
||||
.dataRaw = modType == etl::model::Object::ModType::Deleted
|
||||
? ""
|
||||
: hexStringToBinaryString(kObjBlob),
|
||||
@@ -122,8 +122,8 @@ createObjectWithBookBase(etl::model::Object::ModType modType, std::string key)
|
||||
.key = binaryStringToUint256(hexStringToBinaryString(key)),
|
||||
.keyRaw = hexStringToBinaryString(key),
|
||||
.data = modType == etl::model::Object::ModType::Deleted
|
||||
? ripple::Blob{}
|
||||
: *ripple::strUnHex(kObjBlob), // NOLINT(bugprone-unchecked-optional-access)
|
||||
? xrpl::Blob{}
|
||||
: *xrpl::strUnHex(kObjBlob), // NOLINT(bugprone-unchecked-optional-access)
|
||||
.dataRaw = modType == etl::model::Object::ModType::Deleted
|
||||
? ""
|
||||
: hexStringToBinaryString(kObjBlob),
|
||||
@@ -138,8 +138,8 @@ createObjectWithTwoNFTs()
|
||||
{
|
||||
std::string const url1 = "abcd1";
|
||||
std::string const url2 = "abcd2";
|
||||
ripple::Blob const uri1Blob(url1.begin(), url1.end());
|
||||
ripple::Blob const uri2Blob(url2.begin(), url2.end());
|
||||
xrpl::Blob const uri1Blob(url1.begin(), url1.end());
|
||||
xrpl::Blob const uri2Blob(url2.begin(), url2.end());
|
||||
|
||||
constexpr auto kAccount = "rM2AGCCCRb373FRuD8wHyUwUsh2dV4BW5Q";
|
||||
constexpr auto kNftId = "0008013AE1CD8B79A8BCB52335CD40DE97401B2D60A828720000099B00000000";
|
||||
@@ -175,13 +175,13 @@ createObjectWithMPT()
|
||||
constexpr auto kAccount = "rM2AGCCCRb373FRuD8wHyUwUsh2dV4BW5Q";
|
||||
|
||||
auto const account = getAccountIdWithString(kAccount);
|
||||
auto const mptID = ripple::makeMptID(2, getAccountIdWithString(kAccount));
|
||||
auto const mptID = xrpl::makeMptID(2, getAccountIdWithString(kAccount));
|
||||
auto const mptokenObject = createMpTokenObject(kAccount, mptID);
|
||||
|
||||
// key is a token made up from several fields described here:
|
||||
// https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0033-multi-purpose-tokens#2121-mptoken-ledger-identifier
|
||||
constexpr auto kSpaceKey = 0x007F;
|
||||
auto const keySha512Half = ripple::sha512Half(kSpaceKey, mptID, account);
|
||||
auto const keySha512Half = xrpl::sha512Half(kSpaceKey, mptID, account);
|
||||
|
||||
return {
|
||||
.key = {},
|
||||
@@ -202,10 +202,10 @@ createSuccessor()
|
||||
{
|
||||
return {
|
||||
.firstBook = uint256ToString(
|
||||
ripple::uint256{"A000000000000000000000000000000000000000000000000000000000000000"}
|
||||
xrpl::uint256{"A000000000000000000000000000000000000000000000000000000000000000"}
|
||||
),
|
||||
.bookBase = uint256ToString(
|
||||
ripple::uint256{"A000000000000000000000000000000000000000000000000000000000000001"}
|
||||
xrpl::uint256{"A000000000000000000000000000000000000000000000000000000000000001"}
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user