Use updated swarm hash.

This commit is contained in:
chriseth
2019-06-27 12:49:06 +02:00
parent aa11ad7d0a
commit 89f0e1e6da
5 changed files with 16 additions and 15 deletions
+3 -3
View File
@@ -784,7 +784,7 @@ h256 const& CompilerStack::Source::keccak256() const
h256 const& CompilerStack::Source::swarmHash() const
{
if (swarmHashCached == h256{})
swarmHashCached = dev::bzzr0Hash(scanner->source());
swarmHashCached = dev::bzzr1Hash(scanner->source());
return swarmHashCached;
}
@@ -1085,7 +1085,7 @@ string CompilerStack::createMetadata(Contract const& _contract) const
else
{
meta["sources"][s.first]["urls"] = Json::arrayValue;
meta["sources"][s.first]["urls"].append("bzzr://" + toHex(s.second.swarmHash().asBytes()));
meta["sources"][s.first]["urls"].append("bzz-raw://" + toHex(s.second.swarmHash().asBytes()));
meta["sources"][s.first]["urls"].append(s.second.ipfsUrl());
}
}
@@ -1232,7 +1232,7 @@ private:
bytes CompilerStack::createCBORMetadata(string const& _metadata, bool _experimentalMode)
{
MetadataCBOREncoder encoder;
encoder.pushBytes("bzzr0", dev::bzzr0Hash(_metadata).asBytes());
encoder.pushBytes("bzzr1", dev::bzzr1Hash(_metadata).asBytes());
if (_experimentalMode)
encoder.pushBool("experimental", true);
if (m_release)