Explorer

core.check-event

description
Rules for accepting a signed event (after the signature and the shape are checked). The server gives only the facts it has stored (core.event-check-facts); what the rules use is derived here (core.event-check-state-of). Returns the reasons to reject it (empty means accept). The server runs this on SubmitEvent. See docs/event.md
type
Fn(content: @core.event-content, facts: @core.event-check-facts) -> List<@core.event-rejection>
expression
fn(content$0, facts$1) =>
  @core.check-event-in-state(
    content: $0,
    state: match $0 {
      #project_commit(commit$2) =>
        @core.event-check-state-of(commit: $2, facts: $1),
      _ =>
        {
          account_created: $1.account_created,
          branch_latest_commit_hash: #none,
          is_branch_creator: false,
          merged_in_project: false,
          modules_in_other_projects: [],
          parent_in_project: false,
          project_has_commits: false
        }
    }
  )
visibility
public
core.check-event (project definy, branch auto-release, snapshot oiQgPqhJm-TbM4kexXeRHBaJB_tS7gwBSewII64P-44)
id: 2Lyy0ECmSisPD-K2PsEVhG_Iy-UUxjqGzd8NjlA9bFo
content hash: GqKvtyU12XKGOdYFMoy0hoi9kVkRBDpw8oB6ozDoy1o