ConsenSysMesh / Stow-Smart-Contracts

Formerly Linnia-Smart-Contracts
https://stow-protocol.com/
MIT License
56 stars 39 forks source link

Add keywords to logs #22

Closed libertylocked closed 6 years ago

libertylocked commented 6 years ago

keywords is a string that gets emitted in LogRecordAdded event. Database indexing services that listen for contract events can store the keywords along with the hash of a file, allowing record searching by keywords.

buendiadas commented 6 years ago

LGTM overall

Open question, no PR blocker wouldn't it be interesting to have keywords indexed as well? So I could look for a type of data directly without making any intermediate DB.

libertylocked commented 6 years ago

@buendiadas posibly, but keywords right now aren't editable after adding. also the keywords aren't attested.

edit: actually, i don't think indexed works with string. it may be possible to use indexed bytes32 instead of string if we limit the keywords to 256 characters

codecov-io commented 6 years ago

Codecov Report

Merging #22 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #22   +/-   ##
=======================================
  Coverage   96.33%   96.33%           
=======================================
  Files           4        4           
  Lines         109      109           
  Branches       22       22           
=======================================
  Hits          105      105           
  Misses          4        4
Impacted Files Coverage Δ
contracts/LinniaRecords.sol 98.14% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8f61517...333f8e9. Read the comment docs.

buendiadas commented 6 years ago

@libertylocked I don't think it can be done with string, sth like bytes.

Even something like a namehash could be interesting (could enable meta inheritance, and a bit extra privacy)

Food for thoughts!