Alpha: check delegatable flag before removing the delegate
This commit is contained in:
parent
af5a8939cf
commit
b669632075
@ -128,10 +128,14 @@ let set c contract delegate =
|
|||||||
| Some pkh ->
|
| Some pkh ->
|
||||||
fail (No_deletion pkh)
|
fail (No_deletion pkh)
|
||||||
| None ->
|
| None ->
|
||||||
Storage.Contract.Balance.get c contract >>=? fun balance ->
|
is_delegatable c contract >>=? fun delegatable ->
|
||||||
unlink c contract balance >>=? fun c ->
|
if delegatable then
|
||||||
Storage.Contract.Delegate.remove c contract >>= fun c ->
|
Storage.Contract.Balance.get c contract >>=? fun balance ->
|
||||||
return c
|
unlink c contract balance >>=? fun c ->
|
||||||
|
Storage.Contract.Delegate.remove c contract >>= fun c ->
|
||||||
|
return c
|
||||||
|
else
|
||||||
|
fail (Non_delegatable_contract contract)
|
||||||
end
|
end
|
||||||
| Some delegate ->
|
| Some delegate ->
|
||||||
known c delegate >>=? fun known_delegate ->
|
known c delegate >>=? fun known_delegate ->
|
||||||
|
Loading…
Reference in New Issue
Block a user