From a7c8975ec6e1297fd01fb42bdc0b9ae6d44c5d2b Mon Sep 17 00:00:00 2001 From: Cagdas Bozman Date: Tue, 14 Feb 2017 16:07:24 +0100 Subject: [PATCH] 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). --- src/proto/bootstrap/contract_storage.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proto/bootstrap/contract_storage.ml b/src/proto/bootstrap/contract_storage.ml index 28501948f..4d3d0efe8 100644 --- a/src/proto/bootstrap/contract_storage.ml +++ b/src/proto/bootstrap/contract_storage.ml @@ -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 ->