Retrieve a contract's metadata via cleveland
Clarification and motivation
We should make it easy to retrieve a contract's metadata in Cleveland.
This means adding a new companion package, morley-metadata-test (similar to morley-ledgers and morley-ledgers-test).
For now, this package will expose something like:
getMetadata :: forall st caps base m. MonadNettest caps base m => AddressOrAlias -> m (Metadata st)
The gist of the algorithm should be something like this:
- retrieve the contract's storage
- inspect the metadata bigmap
- check the empty key
""in the bigmap. if the value:- is an http/https link: make an http/https request
- is an ipfs link: i don't know much about ipfs, but I'm guessing we can use something like this? more investigation is needed.
- is a tezos-storage link to the current contract: fetch the metadata and return it
- is a tezos-storage link to another contract: go back to step 1 and retrieve that contract's storage.
As such, this issue depends on these two other morley issues being addressed first:
Note: This will pave the way to, later, being able to run off-chain-views via cleveland.
Acceptance criteria
We can easily retrieve a contract's metadata via cleveland.