Add tezos RPC's new bigmap endpoint to morley-client
Clarification and motivation
At the moment, morley-client supports retrieving the value for a big_map
key through this endpoint:
POST ../<block_id>/context/contracts/<contract_id>/big_map_get
However, this endpoint has limitations, and has been deprecated:
-- | Read big_map value of given contract by key.
--
-- If the contract contains several @big_map@s with given key type, only one
-- of them will be considered.
readContractBigMapValue
-- Despite this RPC is deprecated, it is said to be implemented quite sanely,
-- and also we were said that it is not going to be removed soon.
-- In babylonnet this entrypoint finds big_map with relevant key type and
-- seeks for key in it; if there are multiple big_maps with the same key type,
-- only one of them is considered (which one - it seems better not to rely on
-- this info).
"head" :> "context" :> "contracts" :> Capture "contract" Address' :>
"big_map_get" :> ReqBody '[JSON] GetBigMap :> Post '[JSON] GetBigMapResult :<|>
We should add support for the new RPC endpoint, which allows passing a big_map ID and thus supports contracts with multiple big_maps.
GET ../<block_id>/context/big_maps/<big_map_id>/<script_expr>
Acceptance criteria
Morley-client exposes a function for retrieving a bigmap's value using the RPC's new endpoint.
Edited by Diogo Castro