Allow retrieving a contract's storage as an expression in cleveland
Clarification and motivation
In morley-metadata
, we want to have a way of easily retrieving a contract's metadata (see morley-metadata#6)
This means we'll have to:
- retrieve the contract's storage
- inspect the metadata bigmap
- check the empty key
""
in the bigmap- if the value is a link to the current contract, fetch the metadata and return it
- if the value is a link to another contract, go back to step 1 and retrieve that contract's storage.
As you can see, this algorithm is recursive. And when it recurses, we must retrieve the storage of an arbitrary contract, and there's no way of knowing in advance what the type of that contract's storage is.
Therefore, we need a way of retrieving a contract's storage without knowing its type.
The RPC already represents storages as Micheline Expression
s, so we could just expose a getStorageExpr :: AddressOrAlias -> m Expression
function from cleveland.
Acceptance criteria
We can retrieve a contract's storage without knowing its type.
Edited by Diogo Castro