{
  "group": "spin",
  "protocol": 1,
  "description": "DRAFT for Ф7, not part of protocol v1. Spin: R_spin = round(t + margin_s*1000) + 1; DrawInput with secret null, list_root = tagged(\"notarius/spin/v1\", draw, conditions_hash, ref), ref = spin ref, n = sum of weights.",
  "cases": [
    {
      "name": "spin_valid",
      "conditions": {
        "v": 1,
        "type": "conditions",
        "kind": "donation_wheel",
        "service": "vec-service",
        "draw": "vec-wheel-1",
        "version": 1,
        "surface": "stream",
        "organizer": "Тестовый канал",
        "title": "Колесо заданий",
        "rules_ack": [
          "donor_wins_nothing",
          "weights_fixed"
        ],
        "network": {
          "chain_hash": "52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971",
          "public_key": "83cf0f2896adee7eb8b5f01fcad3912212c437e0073e911fb90022d3e760183c8c4b450b6a0a6c3ac6a5776a2d1064510d1fec758c921cc22b0e17e63aaf4bcb5ed66304de9cf809bd274ca73bab4af5a6e9c76a4bc09e76eae8991ef5ece45a",
          "scheme": "bls-unchained-g1-rfc9380",
          "period": 3,
          "genesis": 1692803367
        },
        "open_at": "2026-10-16T12:10:00.000Z",
        "close_at": "2026-10-16T12:40:00.000Z",
        "margin_s": 6,
        "formula": {
          "name": "draw-v1",
          "population": "sectors"
        },
        "sectors": [
          {
            "label": "Спеть песню",
            "weight": 50
          },
          {
            "label": "Отжаться 10 раз",
            "weight": 25
          },
          {
            "label": "Сменить игру",
            "weight": 15
          },
          {
            "label": "Ответить на вопрос чата",
            "weight": 9
          },
          {
            "label": "Стрим ещё час",
            "weight": 1
          }
        ],
        "weights_fixed_at_start": true,
        "spins_per_donation": 1,
        "launch_threshold_rub": 100
      },
      "leaf": {
        "v": 1,
        "type": "spin",
        "draw": "vec-wheel-1",
        "seq": 0,
        "t": "2026-10-16T12:10:05.250Z",
        "round": 33116416,
        "ref": "evt-0001"
      },
      "beacon": {
        "round": 33116416,
        "signature": "94105416c9ba63c3eb6b8e0e1ed647ee1938d00816a355b68c4cfdd85f373586261f121817795ced3914bab2c1268eca"
      },
      "expected_status": "match",
      "expected_sector": 0
    },
    {
      "name": "spin_round_not_from_time",
      "conditions": {
        "v": 1,
        "type": "conditions",
        "kind": "donation_wheel",
        "service": "vec-service",
        "draw": "vec-wheel-1",
        "version": 1,
        "surface": "stream",
        "organizer": "Тестовый канал",
        "title": "Колесо заданий",
        "rules_ack": [
          "donor_wins_nothing",
          "weights_fixed"
        ],
        "network": {
          "chain_hash": "52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971",
          "public_key": "83cf0f2896adee7eb8b5f01fcad3912212c437e0073e911fb90022d3e760183c8c4b450b6a0a6c3ac6a5776a2d1064510d1fec758c921cc22b0e17e63aaf4bcb5ed66304de9cf809bd274ca73bab4af5a6e9c76a4bc09e76eae8991ef5ece45a",
          "scheme": "bls-unchained-g1-rfc9380",
          "period": 3,
          "genesis": 1692803367
        },
        "open_at": "2026-10-16T12:10:00.000Z",
        "close_at": "2026-10-16T12:40:00.000Z",
        "margin_s": 6,
        "formula": {
          "name": "draw-v1",
          "population": "sectors"
        },
        "sectors": [
          {
            "label": "Спеть песню",
            "weight": 50
          },
          {
            "label": "Отжаться 10 раз",
            "weight": 25
          },
          {
            "label": "Сменить игру",
            "weight": 15
          },
          {
            "label": "Ответить на вопрос чата",
            "weight": 9
          },
          {
            "label": "Стрим ещё час",
            "weight": 1
          }
        ],
        "weights_fixed_at_start": true,
        "spins_per_donation": 1,
        "launch_threshold_rub": 100
      },
      "leaf": {
        "v": 1,
        "type": "spin",
        "draw": "vec-wheel-1",
        "seq": 0,
        "t": "2026-10-16T12:10:05.250Z",
        "round": 33116417,
        "ref": "evt-0001"
      },
      "beacon": {
        "round": 33116417,
        "signature": "8b216ba2ac850555a73193e21c4b83320eb638fafd72f9dbe2230581850fc59f3f15790c361d9372ef25aa8777023ce7"
      },
      "expected_status": "mismatch"
    }
  ]
}
