MCPcopy Create free account
hub / github.com/ElementsProject/elements / Set

Method Set

src/assetsdir.cpp:14–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12#include <boost/algorithm/string/split.hpp>
13
14void CAssetsDir::Set(const CAsset& asset, const AssetMetadata& metadata)
15{
16 // No asset or label repetition
17 if (GetLabel(asset) != "")
18 throw std::runtime_error(strprintf("duplicated asset '%s'", asset.GetHex()));
19 if (GetAsset(metadata.GetLabel()) != CAsset())
20 throw std::runtime_error(strprintf("duplicated label '%s'", metadata.GetLabel()));
21
22 mapAssetMetadata[asset] = metadata;
23 mapAssets[metadata.GetLabel()] = asset;
24}
25
26void CAssetsDir::SetHex(const std::string& assetHex, const std::string& label)
27{

Callers

nothing calls this directly

Calls 3

CAssetClass · 0.85
GetLabelMethod · 0.80
GetHexMethod · 0.45

Tested by

no test coverage detected