Up until now the ipfs hashes of the products and product types were emitted as events which made it a bit more difficult for the frontend to fetch them without an indexer. Given those events are only triggered by AB members there aren't a lot of them.
Changes proposed in this pull request
This PR the ipfs hashes from being emitted as events into contract storage. Those can be added when adding/editing the product or product type or by pushing them individually without a product edit.
Test plan
Added unit tests for all functions that deal with metadata as well as a migration script that fetches all events from the Cover contract and outputs the tx data that an AB can manually send to set the metadata in the CoverProducts contract.
Checklist
[x] Rebased the base branch
[ ] Attached corresponding Github issue
[x] Prefixed the name with the type of change (i.e. feat, chore, test)
[x] Performed a self-review of my own code
[x] Followed the style guidelines of this project
[ ] Made corresponding changes to the documentation
[x] Didn't generate new warnings
[x] Didn't generate failures on existing tests
[x] Added tests that prove my fix is effective or that my feature works
Review
When reviewing a PR, please indicate intention in comments using the following emojis:
:cake: = Nice to have but not essential.
:bulb: = Suggestion or a comment based on personal opinion
:hammer: = I believe this should be changed.
:thinking: = I don’t understand something, do you mind giving me more context?
Context
Up until now the ipfs hashes of the products and product types were emitted as events which made it a bit more difficult for the frontend to fetch them without an indexer. Given those events are only triggered by AB members there aren't a lot of them.
Changes proposed in this pull request
This PR the ipfs hashes from being emitted as events into contract storage. Those can be added when adding/editing the product or product type or by pushing them individually without a product edit.
Test plan
Added unit tests for all functions that deal with metadata as well as a migration script that fetches all events from the Cover contract and outputs the tx data that an AB can manually send to set the metadata in the CoverProducts contract.
Checklist
Review
When reviewing a PR, please indicate intention in comments using the following emojis: