mirror of
https://github.com/NixOS/nix.git
synced 2025-11-28 13:11:00 +01:00
Futher cleans up store object info JSON v2
Since we haven't released v2 yet (2.32 has v1) we can just update this in-place and avoid version churn. Note that as a nice side effect of using the standard `Hash` JSON impl, we don't neeed this `hashFormat` parameter anymore.
This commit is contained in:
parent
9c04c629e5
commit
4f1c8f62c3
16 changed files with 91 additions and 48 deletions
|
|
@ -149,8 +149,7 @@ ValidPathInfo ValidPathInfo::makeFromCA(
|
|||
return res;
|
||||
}
|
||||
|
||||
nlohmann::json
|
||||
UnkeyedValidPathInfo::toJSON(const StoreDirConfig & store, bool includeImpureInfo, HashFormat hashFormat) const
|
||||
nlohmann::json UnkeyedValidPathInfo::toJSON(const StoreDirConfig & store, bool includeImpureInfo) const
|
||||
{
|
||||
using nlohmann::json;
|
||||
|
||||
|
|
@ -158,7 +157,7 @@ UnkeyedValidPathInfo::toJSON(const StoreDirConfig & store, bool includeImpureInf
|
|||
|
||||
jsonObject["version"] = 2;
|
||||
|
||||
jsonObject["narHash"] = narHash.to_string(hashFormat, true);
|
||||
jsonObject["narHash"] = narHash;
|
||||
jsonObject["narSize"] = narSize;
|
||||
|
||||
{
|
||||
|
|
@ -198,7 +197,7 @@ UnkeyedValidPathInfo UnkeyedValidPathInfo::fromJSON(const StoreDirConfig & store
|
|||
throw Error("Unsupported path info JSON format version %d, only version 2 is currently supported", version);
|
||||
}
|
||||
|
||||
res.narHash = Hash::parseAny(getString(valueAt(json, "narHash")), std::nullopt);
|
||||
res.narHash = valueAt(json, "narHash");
|
||||
res.narSize = getUnsigned(valueAt(json, "narSize"));
|
||||
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue