mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Prefer keylets instead of naked hashes:
Entries in the ledger are located using 256-bit locators. The locators are calculated using a wide range of parameters specific to the entry whose locator we are calculating (e.g. an account's locator is derived from the account's address, whereas the locator for an offer is derived from the account and the offer sequence.) Keylets enhance type safety during lookup and make the code more robust, so this commit removes most of the earlier code, which used naked uint256 values.
This commit is contained in:
@@ -353,7 +353,7 @@ class LedgerRPC_test : public beast::unit_test::suite
|
||||
env.fund(XRP(10000), alice);
|
||||
env.close();
|
||||
|
||||
uint256 const checkId{getCheckIndex(env.master, env.seq(env.master))};
|
||||
auto const checkId = keylet::check(env.master, env.seq(env.master));
|
||||
|
||||
env(check::create(env.master, alice, XRP(100)));
|
||||
env.close();
|
||||
@@ -362,7 +362,7 @@ class LedgerRPC_test : public beast::unit_test::suite
|
||||
{
|
||||
// Request a check.
|
||||
Json::Value jvParams;
|
||||
jvParams[jss::check] = to_string(checkId);
|
||||
jvParams[jss::check] = to_string(checkId.key);
|
||||
jvParams[jss::ledger_hash] = ledgerHash;
|
||||
Json::Value const jrr = env.rpc(
|
||||
"json", "ledger_entry", to_string(jvParams))[jss::result];
|
||||
|
||||
Reference in New Issue
Block a user