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 add_deposit ctxt delegate deposit =
|
||||||
let previous =
|
let previous =
|
||||||
try Signature.Public_key_hash.Map.find delegate ctxt.deposits
|
match Signature.Public_key_hash.Map.find_opt delegate ctxt.deposits with
|
||||||
with Not_found -> Tez_repr.zero in
|
| Some tz -> tz
|
||||||
|
| None -> Tez_repr.zero in
|
||||||
Lwt.return Tez_repr.(previous +? deposit) >>=? fun deposit ->
|
Lwt.return Tez_repr.(previous +? deposit) >>=? fun deposit ->
|
||||||
let deposits =
|
let deposits =
|
||||||
Signature.Public_key_hash.Map.add delegate deposit ctxt.deposits in
|
Signature.Public_key_hash.Map.add delegate deposit ctxt.deposits in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user