Proto: check the 'delegatable-ity' before to remove a delegate key.

We use the `remove` function instead of `delete` to check the
delegatable-ity to avoid a storage error (`remove` does nothing if the
bucket does not exist).
This commit is contained in:
Cagdas Bozman 2017-02-14 16:07:24 +01:00 committed by Grégoire Henry
parent d475d1ac29
commit a7c8975ec6

View File

@ -100,7 +100,7 @@ let delete c contract =
Roll_storage.Contract.assert_empty c contract >>=? fun () ->
Storage.Contract.Balance.delete c contract >>=? fun c ->
Storage.Contract.Manager.delete c contract >>=? fun c ->
Storage.Contract.Delegate.delete c contract >>=? fun c ->
Storage.Contract.Delegate.remove c contract >>= fun c ->
Storage.Contract.Spendable.delete c contract >>=? fun c ->
Storage.Contract.Delegatable.delete c contract >>=? fun c ->
Storage.Contract.Counter.delete c contract >>=? fun c ->