Everywhere: use return_*
for * in unit none some true false
This commit is contained in:
parent
1767fcc861
commit
fd6ce36a7d
@ -57,15 +57,15 @@ module High_watermark = struct
|
||||
let chain_id = Chain_id.of_bytes_exn (MBytes.sub bytes 1 4) in
|
||||
let level = get_level () in
|
||||
begin match List.assoc_opt chain_id all with
|
||||
| None -> return None
|
||||
| None -> return_none
|
||||
| Some marks ->
|
||||
match List.assoc_opt pkh marks with
|
||||
| None -> return None
|
||||
| None -> return_none
|
||||
| Some (previous_level, _, None) ->
|
||||
if previous_level >= level then
|
||||
failwith "%s level %ld not above high watermark %ld" name level previous_level
|
||||
else
|
||||
return None
|
||||
return_none
|
||||
| Some (previous_level, previous_hash, Some signature) ->
|
||||
if previous_level > level then
|
||||
failwith "%s level %ld below high watermark %ld" name level previous_level
|
||||
@ -73,7 +73,7 @@ module High_watermark = struct
|
||||
if previous_hash <> hash then
|
||||
failwith "%s level %ld already signed with different data" name level
|
||||
else
|
||||
return (Some signature)
|
||||
return_some signature
|
||||
else return_none
|
||||
end >>=? function
|
||||
| Some signature -> return signature
|
||||
|
@ -59,7 +59,7 @@ let if_debug k =
|
||||
if !debug then k ()
|
||||
|
||||
let if_debug_s k =
|
||||
if !debug then k () else return ()
|
||||
if !debug then k () else return_unit
|
||||
|
||||
let args = default_args
|
||||
|
||||
|
@ -28,7 +28,7 @@ open Proto_alpha
|
||||
let error ~loc v f =
|
||||
match v with
|
||||
| Error err when List.exists f err ->
|
||||
return ()
|
||||
return_unit
|
||||
| Ok _ ->
|
||||
failwith "Unexpected successful result (%s)" loc
|
||||
| Error err ->
|
||||
@ -44,13 +44,13 @@ let equal ~loc (cmp : 'a -> 'a -> bool) msg pp a b =
|
||||
if not (cmp a b) then
|
||||
failwith "@[@[[%s]@] - @[%s : %a is not equal to %a@]@]" loc msg pp a pp b
|
||||
else
|
||||
return ()
|
||||
return_unit
|
||||
|
||||
let not_equal ~loc (cmp : 'a -> 'a -> bool) msg pp a b =
|
||||
if cmp a b then
|
||||
failwith "@[@[[%s]@] - @[%s : %a is equal to %a@]@]" loc msg pp a pp b
|
||||
else
|
||||
return ()
|
||||
return_unit
|
||||
|
||||
let equal_tez ~loc (a:Alpha_context.Tez.t) (b:Alpha_context.Tez.t) =
|
||||
let open Alpha_context in
|
||||
|
@ -46,7 +46,7 @@ module Seq_validator = struct
|
||||
|
||||
let close _ =
|
||||
lwt_log_notice "Shutting down ..." >>= fun () ->
|
||||
Lwt.return ()
|
||||
Lwt.return_unit
|
||||
|
||||
let apply_block
|
||||
validator_process
|
||||
|
@ -271,7 +271,7 @@ module Ledger = struct
|
||||
return_some
|
||||
(create ?git_commit ~device_info ~version
|
||||
~of_curve ~of_pkh ())
|
||||
| _ -> return None
|
||||
| _ -> return_none
|
||||
|
||||
let of_hidapi ?id device_info h =
|
||||
let buf = Buffer.create 100 in
|
||||
@ -296,7 +296,7 @@ module Ledger = struct
|
||||
%a"
|
||||
device_info.Hidapi.path
|
||||
Ledgerwallet.Transport.pp_error e ;
|
||||
return None
|
||||
return_none
|
||||
| Ok ({ major; minor; patch; _ } as version) ->
|
||||
log_info "Found a %a application at [%s]"
|
||||
Ledgerwallet_tezos.Version.pp version device_info.path ;
|
||||
|
@ -102,7 +102,7 @@ let test_random algo =
|
||||
let ctx = fake_ctx () in
|
||||
let decrypt_ctx = (ctx :> Client_context.prompter) in
|
||||
let rec inner i =
|
||||
if i >= loops then return ()
|
||||
if i >= loops then return_unit
|
||||
else
|
||||
let _, _, sk = Signature.generate_key ~algo () in
|
||||
encrypt ctx sk >>=? fun sk_uri ->
|
||||
|
Loading…
Reference in New Issue
Block a user