package tezos-protocol-020-PsParisC
Tezos protocol 020-PsParisC package
Install
Dune Dependency
Authors
Maintainers
Sources
tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/src/tezos_raw_protocol_020_PsParisC/pending_denunciations_storage.ml.html
Source file pending_denunciations_storage.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
(*****************************************************************************) (* *) (* SPDX-License-Identifier: MIT *) (* Copyright (c) 2024 Nomadic Labs. <contact@nomadic-labs.com> *) (* *) (*****************************************************************************) let find ctxt delegate = let open Lwt_result_syntax in let* denunciations_opt = Storage.Pending_denunciations.find ctxt delegate in return @@ Option.value denunciations_opt ~default:[] let add_denunciation ctxt ~misbehaving_delegate operation_hash ~rewarded_delegate misbehaviour = let open Lwt_result_syntax in let* denunciations = find ctxt misbehaving_delegate in let denunciations = Denunciations_repr.add operation_hash rewarded_delegate misbehaviour denunciations in let*! ctxt = Storage.Pending_denunciations.add ctxt misbehaving_delegate denunciations in return ctxt let set_denunciations ctxt delegate denunciations = match denunciations with | [] -> Storage.Pending_denunciations.remove ctxt delegate | _ -> Storage.Pending_denunciations.add ctxt delegate denunciations let has_pending_denunciations ctxt delegate = (* we rely here on the fact that we never insert an empty list in the table *) Storage.Pending_denunciations.mem ctxt delegate let fold = Storage.Pending_denunciations.fold let clear ctxt = Storage.Pending_denunciations.clear ctxt module For_RPC = struct let pending_denunciations_list ctxt = let open Lwt_syntax in let+ r = Storage.Pending_denunciations.bindings ctxt in List.map (fun (x, l) -> List.map (fun y -> (x, y)) l) r |> List.flatten end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>