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:

  1. retrieve the contract's storage
  2. inspect the metadata bigmap
  3. check the empty key "" in the bigmap. if the value:
    1. is an http/https link: make an http/https request
    2. 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.
    3. is a tezos-storage link to the current contract: fetch the metadata and return it
    4. 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:

  1. morley#520 (closed)
  2. morley#346 (closed)

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.

Assignee Loading
Time tracking Loading