Alpha: replace 'try ... with'
This commit is contained in:
parent
1ccdea0d08
commit
e498a15a1a
@ -100,8 +100,9 @@ let add_rewards ctxt rewards =
|
||||
|
||||
let add_deposit ctxt delegate deposit =
|
||||
let previous =
|
||||
try Signature.Public_key_hash.Map.find delegate ctxt.deposits
|
||||
with Not_found -> Tez_repr.zero in
|
||||
match Signature.Public_key_hash.Map.find_opt delegate ctxt.deposits with
|
||||
| Some tz -> tz
|
||||
| None -> Tez_repr.zero in
|
||||
Lwt.return Tez_repr.(previous +? deposit) >>=? fun deposit ->
|
||||
let deposits =
|
||||
Signature.Public_key_hash.Map.add delegate deposit ctxt.deposits in
|
||||
|
Loading…
Reference in New Issue
Block a user