parent
8f30934220
commit
6e68fb425a
@ -63,7 +63,7 @@ module ContractAlias = struct
|
||||
let alias_param ?(name = "name") ?(desc = "existing contract alias") next =
|
||||
let desc =
|
||||
desc ^ "\n"
|
||||
^ "can be an contract alias or a key alias (autodetected in this order)\n\
|
||||
^ "can be a contract alias or a key alias (autodetected in this order)\n\
|
||||
use 'key:name' to force the later" in
|
||||
Cli_entries.(
|
||||
param ~name ~desc
|
||||
@ -97,7 +97,8 @@ module ContractAlias = struct
|
||||
| Error k_errs ->
|
||||
ContractEntity.of_source cctxt s >>= function
|
||||
| Ok v -> return (s, v)
|
||||
| Error c_errs -> Lwt.return (Error (k_errs @ c_errs))
|
||||
| Error c_errs ->
|
||||
Lwt.return (Error (k_errs @ c_errs))
|
||||
end)))
|
||||
next
|
||||
|
||||
|
@ -214,6 +214,7 @@ module MakeEncodings(E: sig
|
||||
l p enc.encoded_length
|
||||
|
||||
let decode ?alphabet s =
|
||||
try
|
||||
let rec find s = function
|
||||
| [] -> None
|
||||
| Encoding { prefix ; of_raw ; wrap } :: encodings ->
|
||||
@ -222,6 +223,7 @@ module MakeEncodings(E: sig
|
||||
| Some msg -> of_raw msg |> Utils.map_option ~f:wrap in
|
||||
let s = safe_decode ?alphabet s in
|
||||
find s !encodings
|
||||
with Invalid_argument _ -> None
|
||||
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user