Commit 9279f79a authored by Julien's avatar Julien Committed by Pierre Boutillier

Proto/Client: no partial entrypoints list when typecheck fails

To detect the presence of a "default" entrypoint and get its type, the
current implementation uses the entrypoint typechecking RPC. If it
fails, it assumes that the entrypoint doesn't exists.

This patch discriminate the 404 Not Found error that indicates the
absence of such entrypoint with other error that can happen, for
example Forbidden access in presence of RPC filters, or internal error
in case of proxy malfunction.
parent 686bb91b
Pipeline #104369361 passed with stages
in 13 minutes and 47 seconds
......@@ -127,8 +127,10 @@ let list_contract_entrypoints cctxt ~chain ~block ~contract =
>>= function
| Ok (Some ty) ->
return (("default", ty) :: entrypoints)
| _ ->
| Ok None ->
return entrypoints
| Error _ as err ->
Lwt.return err
else return entrypoints
let list_unreachables cctxt ~chain ~block (program : Script.expr) =
......@@ -143,8 +145,10 @@ let list_entrypoints cctxt ~chain ~block (program : Script.expr) =
>>= function
| Ok (Some ty) ->
return (("default", ty) :: entrypoints)
| _ ->
| Ok None ->
return entrypoints
| Error _ as err ->
Lwt.return err
else return entrypoints
let print_entrypoints_list (cctxt : #Client_context.printer)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment