{
 "format": "zoobc-conformance-vectors/1",
 "edition": "0.6.1",
 "chapter": "17",
 "license": "CC BY 4.0, ZooBC Foundation",
 "cases": [
  {
   "id": "17-1-quorum-11",
   "chapter": "17",
   "section": "1",
   "title": "Eleven counted registered nodes need eight",
   "kind": "17-quorum",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "num": "2",
    "den": "3",
    "min_registry_size": "7",
    "n": "11"
   },
   "expected": {
    "quorum": "8",
    "floor_met": "true"
   }
  },
  {
   "id": "17-1-quorum-9",
   "chapter": "17",
   "section": "1",
   "title": "Two of them suspended: nine registered nodes need six",
   "kind": "17-quorum",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "num": "2",
    "den": "3",
    "min_registry_size": "7",
    "n": "9"
   },
   "expected": {
    "quorum": "6",
    "floor_met": "true"
   }
  },
  {
   "id": "17-1-below-floor",
   "chapter": "17",
   "section": "1",
   "title": "Six counted registered nodes on TestNet: nothing resolves",
   "kind": "17-quorum",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "num": "2",
    "den": "3",
    "min_registry_size": "7",
    "n": "6"
   },
   "expected": {
    "floor": "7",
    "floor_met": "false"
   }
  },
  {
   "id": "17-1-attester",
   "chapter": "17",
   "section": "1",
   "title": "A node key's attester account",
   "kind": "17-attester",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "node_key": "66a2b2c675658eb327982f0ec7539de1ab51f528d586ff2f9381afa15f86eb7e"
   },
   "expected": {
    "account": "0000000066a2b2c675658eb327982f0ec7539de1ab51f528d586ff2f9381afa15f86eb7e"
   }
  },
  {
   "id": "17-1-bare-key",
   "chapter": "17",
   "section": "1",
   "title": "A vote sent with the bare 32-byte node key as sender",
   "kind": "17-vote-check",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "type": "51",
    "sender": "66a2b2c675658eb327982f0ec7539de1ab51f528d586ff2f9381afa15f86eb7e",
    "body": "1600000065786368616e67655f74616b65725f6665655f6270730a00000000000000"
   },
   "expected": {
    "error": "accounts are typed: a bare 32-byte key is not an account on this chain"
   }
  },
  {
   "id": "17-1-governance-view",
   "chapter": "17",
   "section": "1",
   "title": "The governance view in the first cycle of a chain whose 11 genesis nodes are all registered",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "counted_seats": "11",
    "floor_met": "true",
    "count_height": "172800",
    "cycle_first_block": "1"
   }
  },
  {
   "id": "17-1a-frozen",
   "chapter": "17",
   "section": "1a",
   "title": "A SetConsensusParam while four distinct blocksmiths made the window",
   "kind": "17-survival-gate",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "type": "51",
    "made": "4",
    "min_producers": "5",
    "was": "true"
   },
   "expected": {
    "error": "SurvivalMode: transaction type 51 is not accepted while fewer than survival_min_producers distinct producers made the last 120 blocks (survival mode: governance and bridge are frozen until N produce again)"
   }
  },
  {
   "id": "17-1a-attest-frozen",
   "chapter": "17",
   "section": "1a",
   "title": "An AttestEvent in the same block is refused like the vote",
   "kind": "17-survival-gate",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "type": "17",
    "made": "4",
    "min_producers": "5",
    "was": "true"
   },
   "expected": {
    "error": "SurvivalMode: transaction type 17 is not accepted while fewer than survival_min_producers distinct producers made the last 120 blocks (survival mode: governance and bridge are frozen until N produce again)"
   }
  },
  {
   "id": "17-1a-send-passes",
   "chapter": "17",
   "section": "1a",
   "title": "A SendZBC in the same block",
   "kind": "17-survival-gate",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "type": "1",
    "made": "4",
    "min_producers": "5",
    "was": "true"
   },
   "expected": {
    "flag": "true",
    "verdict": "valid"
   }
  },
  {
   "id": "17-1a-skipped-count",
   "chapter": "17",
   "section": "1a",
   "title": "A cycle's last block in survival mode counts nothing",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "fee_scale_row": "none",
    "parameter_change": "none"
   }
  },
  {
   "id": "17-1a-exactly-n",
   "chapter": "17",
   "section": "1a",
   "title": "Five distinct blocksmiths end survival mode and the vote is accepted",
   "kind": "17-survival-gate",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "type": "51",
    "made": "5",
    "min_producers": "5",
    "was": "true",
    "height": "1001"
   },
   "expected": {
    "flag": "false",
    "verdict": "valid"
   },
   "note": "The previous flag does not enter: N or more distinct blocksmiths in the window end survival mode."
  },
  {
   "id": "17-1a-on-again",
   "chapter": "17",
   "section": "1a",
   "title": "A window of four distinct blocksmiths at 1,002 turns the flag on again",
   "kind": "17-survival-gate",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "type": "51",
    "made": "4",
    "min_producers": "5",
    "was": "false",
    "height": "1002"
   },
   "expected": {
    "error": "SurvivalMode: transaction type 51 is not accepted while fewer than survival_min_producers distinct producers made the last 120 blocks (survival mode: governance and bridge are frozen until N produce again)"
   }
  },
  {
   "id": "17-2-phase-1",
   "chapter": "17",
   "section": "2",
   "title": "Block 1 is in the first half of cycle 0",
   "kind": "17-fee-vote-phase",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "type": "0",
    "height": "1",
    "cycle": "240"
   },
   "expected": {
    "position": "0",
    "half": "first",
    "cycle_index": "0"
   }
  },
  {
   "id": "17-2-phase-120",
   "chapter": "17",
   "section": "2",
   "title": "Block 120 is in the first half of cycle 0",
   "kind": "17-fee-vote-phase",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "type": "0",
    "height": "120",
    "cycle": "240"
   },
   "expected": {
    "position": "119",
    "half": "first",
    "cycle_index": "0"
   }
  },
  {
   "id": "17-2-phase-121",
   "chapter": "17",
   "section": "2",
   "title": "Block 121 is in the second half of cycle 0",
   "kind": "17-fee-vote-phase",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "type": "0",
    "height": "121",
    "cycle": "240"
   },
   "expected": {
    "position": "120",
    "half": "second",
    "cycle_index": "0"
   }
  },
  {
   "id": "17-2-late-commit",
   "chapter": "17",
   "section": "2",
   "title": "A commitment at block 130",
   "kind": "17-fee-vote-phase",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "type": "7",
    "height": "130",
    "cycle": "240"
   },
   "expected": {
    "error": "FeeVoteCommitment: outside the commit phase (the first half of the snapshot cycle)"
   }
  },
  {
   "id": "17-2-reveal-240",
   "chapter": "17",
   "section": "2",
   "title": "A reveal at block 240 counts for cycle 0",
   "kind": "17-fee-vote-phase",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "type": "263",
    "height": "240",
    "cycle": "240"
   },
   "expected": {
    "half": "second",
    "cycle_index": "0",
    "count_block": "true"
   }
  },
  {
   "id": "17-2-reveal-body",
   "chapter": "17",
   "section": "2",
   "title": "A reveal of 2,000,000 at recent height 100",
   "kind": "17-fee-vote-reveal",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "recent_hash": "1111111111111111111111111111111111111111111111111111111111111111",
    "recent_height": "100",
    "vote": "2000000",
    "seed": "51bae95d58f32304a5c9d894819989a4fb04da6115d9a43612a026e7a5dd5d96"
   },
   "expected": {
    "info": "11111111111111111111111111111111111111111111111111111111111111116400000080841e0000000000",
    "length": "112",
    "commitment": "62eccc8b8f52bb087449d28c05b59cde137bd6f15cb7dd26a5c4ca2964d9f061"
   }
  },
  {
   "id": "17-2-commit-31",
   "chapter": "17",
   "section": "2",
   "title": "A 31-byte commitment fails at execution",
   "kind": "17-fee-vote-commit",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "body": "22222222222222222222222222222222222222222222222222222222222222"
   },
   "expected": {
    "error": "ParseFeeVoteCommitBody: expected 32 bytes, got 31"
   }
  },
  {
   "id": "17-2-commit-31-stateless",
   "chapter": "17",
   "section": "2",
   "title": "A 31-byte commitment is refused before execution",
   "kind": "17-vote-check",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "type": "7",
    "sender": "000000005e8eb28dccaa94a992f7169fa67966207d96aa55df7d24d2d6ec1f538c9f2152",
    "body": "22222222222222222222222222222222222222222222222222222222222222"
   },
   "expected": {
    "error": "FeeVoteCommitment: body must be 32 bytes"
   },
   "note": "A stateless check: refused at admission, and a block carrying it is invalid."
  },
  {
   "id": "17-2-reveal-eth-v0",
   "chapter": "17",
   "section": "2",
   "title": "An Ethereum-typed reveal whose voter signature ends in 00",
   "kind": "17-vote-check",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "type": "263",
    "sender": "040000000102030405060708090a0b0c0d0e0f1011121314",
    "body": "11111111111111111111111111111111111111111111111111111111111111116400000080841e0000000000410000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100"
   },
   "expected": {
    "error": "FeeVoteReveal: voter_signature: Ethereum signature recovery id must be 27 or 28"
   }
  },
  {
   "id": "17-3-three-votes",
   "chapter": "17",
   "section": "3",
   "title": "Three registered nodes vote 1.5, 0.9 and 0.4 times the start scale",
   "kind": "17-count-average",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "11",
    "today": "1000000",
    "min": "1",
    "max": "100000000",
    "votes": "1500000\n900000\n400000"
   },
   "expected": {
    "limited": "1200000\n900000\n500000",
    "new": "963636"
   }
  },
  {
   "id": "17-3-no-vote",
   "chapter": "17",
   "section": "3",
   "title": "No reveal: the scale stays",
   "kind": "17-count-average",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "11",
    "today": "1000000",
    "min": "1",
    "max": "100000000",
    "votes": ""
   },
   "expected": {
    "new": "1000000"
   }
  },
  {
   "id": "17-3-from-one",
   "chapter": "17",
   "section": "3",
   "title": "From a scale of 1 every registered node votes 5",
   "kind": "17-count-average",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "11",
    "today": "1",
    "min": "1",
    "max": "100000000",
    "votes": "5\n5\n5\n5\n5\n5\n5\n5\n5\n5\n5"
   },
   "expected": {
    "new": "2"
   }
  },
  {
   "id": "17-3-below-floor",
   "chapter": "17",
   "section": "3",
   "title": "Below the registry floor no registered node counts",
   "kind": "17-count-average",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "0",
    "today": "1000000",
    "min": "1",
    "max": "100000000",
    "votes": "1500000"
   },
   "expected": {
    "new": "1000000"
   }
  },
  {
   "id": "17-3-fee-params",
   "chapter": "17",
   "section": "3",
   "title": "The fee parameters before the first count block (the seeded row)",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "fee_scale": "1000000",
    "initial_fee_scale": "1000000"
   }
  },
  {
   "id": "17-4-attest",
   "chapter": "17",
   "section": "4",
   "title": "An attestation of 105 for PRICE:X1",
   "kind": "17-attest-event",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "body": "0800000050524943453a583103000000313035"
   },
   "expected": {
    "event_id": "PRICE:X1",
    "value": "105"
   }
  },
  {
   "id": "17-4-empty-id",
   "chapter": "17",
   "section": "4",
   "title": "An empty event id",
   "kind": "17-attest-event",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "body": "0000000000000000"
   },
   "expected": {
    "error": "AttestEvent: event_id cannot be empty"
   }
  },
  {
   "id": "17-4-truncated",
   "chapter": "17",
   "section": "4",
   "title": "A truncated event id",
   "kind": "17-attest-event",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "body": "080000005052"
   },
   "expected": {
    "error": "AttestEvent: truncated event_id"
   }
  },
  {
   "id": "17-4-vote-prefix",
   "chapter": "17",
   "section": "4",
   "title": "An attestation under the parameter-vote prefix ZBCGOV1:",
   "kind": "17-attest-event",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "body": "120000005a4243474f56313a626173655f6665653a390100000031"
   },
   "expected": {
    "error": "AttestEvent: the event id prefix ZBCGOV1: is reserved for parameter votes (SetConsensusParam)"
   }
  },
  {
   "id": "17-4-vote-prefix-inside",
   "chapter": "17",
   "section": "4",
   "title": "ZBCGOV1: further in the event id is not the prefix",
   "kind": "17-attest-event",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "body": "11000000776561746865723a5a4243474f56313a780100000031"
   },
   "expected": {
    "event_id": "weather:ZBCGOV1:x",
    "value": "1"
   }
  },
  {
   "id": "17-5-taker-fee",
   "chapter": "17",
   "section": "5",
   "title": "The taker fee: three registered nodes vote 100, one votes 1",
   "kind": "17-count-average",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "11",
    "votes": "100\n100\n100\n1",
    "today": "10",
    "min": "1",
    "max": "100"
   },
   "expected": {
    "limited": "12\n12\n12\n5",
    "new": "10"
   }
  },
  {
   "id": "17-5-market-cost",
   "chapter": "17",
   "section": "5",
   "title": "The market creation cost: six registered nodes vote 1",
   "kind": "17-count-average",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "11",
    "votes": "1\n1\n1\n1\n1\n1",
    "today": "5000000000",
    "min": "1",
    "max": "1000000000000"
   },
   "expected": {
    "limited": "2500000000\n2500000000\n2500000000\n2500000000\n2500000000\n2500000000",
    "new": "3636363636"
   }
  },
  {
   "id": "17-5-from-one",
   "chapter": "17",
   "section": "5",
   "title": "A price at one unit voted up by every registered node",
   "kind": "17-count-average",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "11",
    "votes": "1000\n1000\n1000\n1000\n1000\n1000\n1000\n1000\n1000\n1000\n1000",
    "today": "1",
    "min": "1",
    "max": "1000000000000"
   },
   "expected": {
    "new": "2"
   }
  },
  {
   "id": "17-5-vote",
   "chapter": "17",
   "section": "5",
   "title": "A vote of 0.1 ZBC per MiB for the storage price",
   "kind": "17-set-param",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "body": "1c000000646174617365745f73746f726167655f636f73745f7065725f6d69628096980000000000"
   },
   "expected": {
    "name": "dataset_storage_cost_per_mib",
    "value": "10000000",
    "event_id": "ZBCGOV1:dataset_storage_cost_per_mib:10000000",
    "event_length": "45"
   }
  },
  {
   "id": "17-5-not-governable",
   "chapter": "17",
   "section": "5",
   "title": "min_fee is not governable",
   "kind": "17-set-param",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "body": "070000006d696e5f6665650100000000000000"
   },
   "expected": {
    "error": "SetConsensusParam: parameter is not governable: min_fee"
   }
  },
  {
   "id": "17-5-below-floor",
   "chapter": "17",
   "section": "5",
   "title": "A taker fee of 0",
   "kind": "17-set-param",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "body": "1600000065786368616e67655f74616b65725f6665655f6270730000000000000000"
   },
   "expected": {
    "error": "SetConsensusParam: exchange_taker_fee_bps below its floor (0 < 1)"
   }
  },
  {
   "id": "17-6-register",
   "chapter": "17",
   "section": "6",
   "title": "The RegisterRelease of v0.6.1-testnet-arm64 by the genesis release authority",
   "kind": "17-release",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "body": "1400000076302e362e312d746573746e65742d61726d3634908214389dbb341555c3d85b3bf030a0b5f2dd12b037344f799fd21459e247be0000000088661ffab0a2333edf0b51bdc3cda35ce3dbf7ab8857ef8e7c44ceb30c7c7469",
    "sender": "authority",
    "registered": "false"
   },
   "expected": {
    "version": "v0.6.1-testnet-arm64",
    "manifest_hash": "908214389dbb341555c3d85b3bf030a0b5f2dd12b037344f799fd21459e247be",
    "release_address": "0000000088661ffab0a2333edf0b51bdc3cda35ce3dbf7ab8857ef8e7c44ceb30c7c7469"
   }
  },
  {
   "id": "17-6-register-views",
   "chapter": "17",
   "section": "6",
   "title": "The release views after that registration at height 348",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "list_entry": "{\"version\":\"v0.6.1-testnet-arm64\",\"manifest_hash\":\"908214389dbb341555c3d85b3bf030a0b5f2dd12b037344f799fd21459e247be\",\"release_address\":\"0000000088661ffab0a2333edf0b51bdc3cda35ce3dbf7ab8857ef8e7c44ceb30c7c7469\",\"revoked\":false,\"block_height\":348}",
    "latest": "v0.6.1-testnet-arm64",
    "authority": "{\"found\":true,\"authority_address\":\"000000007d8bd8a41dceea4986d1e99dfe99ca9303874b7c3aac7eeecd60a82f61902572\",\"pending_address\":\"\"}"
   },
   "note": "The authority is the genesis file's ZBC_PWF5RJA5_Z3VETBWR_5GO75GOK_SMBYOS34_HKWH53WN_MCUC6YMQ_EVZAAFOQ decoded."
  },
  {
   "id": "17-6-again",
   "chapter": "17",
   "section": "6",
   "title": "The same version registered again",
   "kind": "17-release",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "body": "1400000076302e362e312d746573746e65742d61726d3634908214389dbb341555c3d85b3bf030a0b5f2dd12b037344f799fd21459e247be0000000088661ffab0a2333edf0b51bdc3cda35ce3dbf7ab8857ef8e7c44ceb30c7c7469",
    "sender": "authority",
    "registered": "true"
   },
   "expected": {
    "error": "RegisterRelease: version v0.6.1-testnet-arm64 is already registered; a version string registers once, use a new one"
   }
  },
  {
   "id": "17-6-not-authority",
   "chapter": "17",
   "section": "6",
   "title": "The same body from another account",
   "kind": "17-release",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "body": "1400000076302e362e312d746573746e65742d61726d3634908214389dbb341555c3d85b3bf030a0b5f2dd12b037344f799fd21459e247be0000000088661ffab0a2333edf0b51bdc3cda35ce3dbf7ab8857ef8e7c44ceb30c7c7469",
    "sender": "other",
    "registered": "false"
   },
   "expected": {
    "error": "not the current release authority"
   }
  },
  {
   "id": "17-6-vlen-0",
   "chapter": "17",
   "section": "6",
   "title": "A version length of 0",
   "kind": "17-release",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "body": "0000000076302e362e312d746573746e65742d61726d3634908214389dbb341555c3d85b3bf030a0b5f2dd12b037344f799fd21459e247be0000000088661ffab0a2333edf0b51bdc3cda35ce3dbf7ab8857ef8e7c44ceb30c7c7469",
    "sender": "authority",
    "registered": "false"
   },
   "expected": {
    "error": "RegisterRelease: version length out of range"
   }
  },
  {
   "id": "17-6-propose-zbs",
   "chapter": "17",
   "section": "6",
   "title": "A ReleaseAuthorityPropose naming a ZBS_ address, which cannot sign",
   "kind": "17-vote-check",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "type": "33",
    "sender": "000000005e8eb28dccaa94a992f7169fa67966207d96aa55df7d24d2d6ec1f538c9f2152",
    "body": "0a0000000000000000000000000000000000000000000000000000000000000000000000"
   },
   "expected": {
    "error": "ReleaseAuthorityPropose: the new authority's kind cannot sign, so it could never accept"
   }
  },
  {
   "id": "17-6-propose-full-key",
   "chapter": "17",
   "section": "6",
   "title": "A ReleaseAuthorityPropose naming an Ethereum account in its full-key form",
   "kind": "17-vote-check",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "type": "33",
    "sender": "000000005e8eb28dccaa94a992f7169fa67966207d96aa55df7d24d2d6ec1f538c9f2152",
    "body": "0400000079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
   },
   "expected": {
    "error": "ReleaseAuthorityPropose: new authority: a full-key account form (an Ethereum or Tron key, a Bitcoin key) is not an account: no transaction can be sent from it; name the 20-byte address (rule canonical_account_forms)"
   }
  },
  {
   "id": "17-6-release-full-key",
   "chapter": "17",
   "section": "6",
   "title": "A RegisterRelease whose release_address is a full-key form (124 bytes)",
   "kind": "17-release",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "body": "1400000076302e362e312d746573746e65742d61726d3634908214389dbb341555c3d85b3bf030a0b5f2dd12b037344f799fd21459e247be0400000079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",
    "sender": "authority",
    "registered": "false"
   },
   "expected": {
    "error": "RegisterRelease: release_address: a full-key account form (an Ethereum or Tron key, a Bitcoin key) is not an account: no transaction can be sent from it; name the 20-byte address (rule canonical_account_forms)"
   }
  },
  {
   "id": "17-6-authority-upper",
   "chapter": "17",
   "section": "6",
   "title": "An authority vote spelled in upper case is one event",
   "kind": "17-release-event",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "n_now": "11",
    "n_then": "12",
    "num": "2",
    "den": "3",
    "vote_height": "20000",
    "event_id": "ZBCREL1:authority:000000007D8BD8A41DCEEA4986D1E99DFE99CA9303874B7C3AAC7EEECD60A82F61902572"
   },
   "expected": {
    "canonical": "ZBCREL1:authority:000000007d8bd8a41dceea4986d1e99dfe99ca9303874b7c3aac7eeecd60a82f61902572",
    "quorum": "8",
    "authority_earliest": "60320",
    "vote_last_height": "192800"
   }
  },
  {
   "id": "17-6-authority-lower",
   "chapter": "17",
   "section": "6",
   "title": "An authority vote spelled in lower case is one event",
   "kind": "17-release-event",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "n_now": "11",
    "n_then": "12",
    "num": "2",
    "den": "3",
    "vote_height": "20000",
    "event_id": "ZBCREL1:authority:000000007d8bd8a41dceea4986d1e99dfe99ca9303874b7c3aac7eeecd60a82f61902572"
   },
   "expected": {
    "canonical": "ZBCREL1:authority:000000007d8bd8a41dceea4986d1e99dfe99ca9303874b7c3aac7eeecd60a82f61902572",
    "quorum": "8",
    "authority_earliest": "60320",
    "vote_last_height": "192800"
   }
  },
  {
   "id": "17-6-veto",
   "chapter": "17",
   "section": "6",
   "title": "A veto vote cast at 20,000 counts through 192,800",
   "kind": "17-release-event",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "n_now": "11",
    "n_then": "12",
    "num": "2",
    "den": "3",
    "vote_height": "20000",
    "event_id": "ZBCREL1:veto:v0.6.1-testnet-arm64",
    "at": "192801"
   },
   "expected": {
    "canonical": "ZBCREL1:veto:v0.6.1-testnet-arm64",
    "vote_last_height": "192800",
    "counts_at": "false"
   }
  },
  {
   "id": "17-6-veto-survival",
   "chapter": "17",
   "section": "6",
   "title": "After 10,000 survival heights the same veto vote still counts at 200,000 and stops at 202,801",
   "kind": "17-release-event",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "n_now": "11",
    "n_then": "12",
    "num": "2",
    "den": "3",
    "vote_height": "20000",
    "event_id": "ZBCREL1:veto:v0.6.1-testnet-arm64",
    "survival": "20001 30000",
    "at": "200000"
   },
   "expected": {
    "age_at": "170000",
    "counts_at": "true",
    "vote_last_height": "202800",
    "authority_earliest": "70320"
   },
   "note": "A frozen chain does not spend the vote window or the authority delay."
  },
  {
   "id": "17-6-veto-applied",
   "chapter": "17",
   "section": "6",
   "title": "A veto at quorum marks the release revoked",
   "kind": "17-release-apply",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "event_id": "ZBCREL1:veto:v0.6.1-testnet-arm64",
    "authority": "000000007d8bd8a41dceea4986d1e99dfe99ca9303874b7c3aac7eeecd60a82f61902572",
    "registered": "v0.6.1-testnet-arm64"
   },
   "expected": {
    "changed": "true",
    "log": "release v0.6.1-testnet-arm64 revoked by the registry",
    "authority": "000000007d8bd8a41dceea4986d1e99dfe99ca9303874b7c3aac7eeecd60a82f61902572"
   }
  },
  {
   "id": "17-6-authority-zbs",
   "chapter": "17",
   "section": "6",
   "title": "An authority event naming a ZBS_ address resolves and changes nothing",
   "kind": "17-release-apply",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "event_id": "ZBCREL1:authority:0a0000000000000000000000000000000000000000000000000000000000000000000000",
    "authority": "000000007d8bd8a41dceea4986d1e99dfe99ca9303874b7c3aac7eeecd60a82f61902572"
   },
   "expected": {
    "changed": "false",
    "log": "authority proposal names an account that can never sign",
    "authority": "000000007d8bd8a41dceea4986d1e99dfe99ca9303874b7c3aac7eeecd60a82f61902572"
   }
  },
  {
   "id": "17-6-authority-full-key",
   "chapter": "17",
   "section": "6",
   "title": "An authority event naming a full-key form resolves and changes nothing",
   "kind": "17-release-apply",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "event_id": "ZBCREL1:authority:0400000079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",
    "authority": "000000007d8bd8a41dceea4986d1e99dfe99ca9303874b7c3aac7eeecd60a82f61902572"
   },
   "expected": {
    "changed": "false",
    "log": "authority proposal names an account that can never sign",
    "authority": "000000007d8bd8a41dceea4986d1e99dfe99ca9303874b7c3aac7eeecd60a82f61902572"
   }
  },
  {
   "id": "17-6-authority-replaced",
   "chapter": "17",
   "section": "6",
   "title": "An authority event naming a ZooBC account replaces the authority",
   "kind": "17-release-apply",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "event_id": "ZBCREL1:authority:00000000fd4472bbdec43b919aa37b9b3366a3318f2902a753a15f5fd6d43c44b5121b67",
    "authority": "000000007d8bd8a41dceea4986d1e99dfe99ca9303874b7c3aac7eeecd60a82f61902572"
   },
   "expected": {
    "changed": "true",
    "log": "release authority replaced by the registry",
    "authority": "00000000fd4472bbdec43b919aa37b9b3366a3318f2902a753a15f5fd6d43c44b5121b67"
   }
  },
  {
   "id": "17-6-bundle-v0_6_1-testnet-arm64",
   "chapter": "17",
   "section": "6",
   "title": "The version string v0.6.1-testnet-arm64 parses to bundle 601",
   "kind": "17-bundle-floor",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "version": "v0.6.1-testnet-arm64"
   },
   "expected": {
    "bundle_id": "601"
   }
  },
  {
   "id": "17-6-bundle-0_6_1",
   "chapter": "17",
   "section": "6",
   "title": "The version string 0.6.1 parses to bundle 601",
   "kind": "17-bundle-floor",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "version": "0.6.1"
   },
   "expected": {
    "bundle_id": "601"
   }
  },
  {
   "id": "17-6-bundle-v0_6_1-rc1",
   "chapter": "17",
   "section": "6",
   "title": "The version string v0.6.1-rc1 parses to bundle 601",
   "kind": "17-bundle-floor",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "version": "v0.6.1-rc1"
   },
   "expected": {
    "bundle_id": "601"
   }
  },
  {
   "id": "17-6-bundle-0_7",
   "chapter": "17",
   "section": "6",
   "title": "The version string 0.7 parses to bundle 0",
   "kind": "17-bundle-floor",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "version": "0.7"
   },
   "expected": {
    "bundle_id": "0"
   }
  },
  {
   "id": "17-6-bundle-v0_6_100",
   "chapter": "17",
   "section": "6",
   "title": "The version string v0.6.100 parses to bundle 0",
   "kind": "17-bundle-floor",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "version": "v0.6.100"
   },
   "expected": {
    "bundle_id": "0"
   }
  },
  {
   "id": "17-6-bundle-0_6_1_2",
   "chapter": "17",
   "section": "6",
   "title": "The version string 0.6.1.2 parses to bundle 0",
   "kind": "17-bundle-floor",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "version": "0.6.1.2"
   },
   "expected": {
    "bundle_id": "0"
   }
  },
  {
   "id": "17-6-floor",
   "chapter": "17",
   "section": "6",
   "title": "Registrations at 348 and 400 give bundle 601 the floor 6,108",
   "kind": "17-bundle-floor",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "bundle": "601",
    "as_of": "347\n348\n6999\n7000",
    "registrations": "v0.6.1-testnet-arm64 348\nv0.6.1-testnet-amd64 400"
   },
   "expected": {
    "floors": "347 none\n348 6108\n6999 6108\n7000 6108"
   }
  },
  {
   "id": "17-6-floor-revoked",
   "chapter": "17",
   "section": "6",
   "title": "A revocation of the first at 7,000 leaves the floor 6,160",
   "kind": "17-bundle-floor",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "bundle": "601",
    "as_of": "347\n348\n6999\n7000",
    "registrations": "v0.6.1-testnet-arm64 348 7000\nv0.6.1-testnet-amd64 400"
   },
   "expected": {
    "floors": "347 none\n348 6108\n6999 6108\n7000 6160"
   }
  },
  {
   "id": "17-6-floor-none",
   "chapter": "17",
   "section": "6",
   "title": "A revocation of both leaves no floor",
   "kind": "17-bundle-floor",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "bundle": "601",
    "as_of": "347\n348\n6999\n7000",
    "registrations": "v0.6.1-testnet-arm64 348 7000\nv0.6.1-testnet-amd64 400 7000"
   },
   "expected": {
    "floors": "347 none\n348 6108\n6999 6108\n7000 none"
   }
  },
  {
   "id": "17-7-register",
   "chapter": "17",
   "section": "7",
   "title": "A gateway registered at 1,000 and never heard from",
   "kind": "17-register-gateway",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "height": "1000",
    "cost": "1000000000",
    "interval": "240",
    "grace": "480",
    "body": "5e8eb28dccaa94a992f7169fa67966207d96aa55df7d24d2d6ec1f538c9f21520e00000067772e6578616d706c652e6f72671600000068747470733a2f2f67772e6578616d706c652e6f7267"
   },
   "expected": {
    "gateway_key": "5e8eb28dccaa94a992f7169fa67966207d96aa55df7d24d2d6ec1f538c9f2152",
    "domain": "gw.example.org",
    "url": "https://gw.example.org",
    "locked_stake": "1000000000",
    "last_heartbeat_height": "1000",
    "pruned_at": "1721"
   }
  },
  {
   "id": "17-7-http",
   "chapter": "17",
   "section": "7",
   "title": "An http:// url",
   "kind": "17-register-gateway",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "height": "1000",
    "cost": "1000000000",
    "interval": "240",
    "grace": "480",
    "body": "5e8eb28dccaa94a992f7169fa67966207d96aa55df7d24d2d6ec1f538c9f21520e00000067772e6578616d706c652e6f726715000000687474703a2f2f67772e6578616d706c652e6f7267"
   },
   "expected": {
    "error": "RegisterGateway: url must begin https:// and contain no whitespace, control character, quote, angle bracket or backtick"
   }
  },
  {
   "id": "17-7-underscore",
   "chapter": "17",
   "section": "7",
   "title": "A domain with an underscore",
   "kind": "17-register-gateway",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "height": "1000",
    "cost": "1000000000",
    "interval": "240",
    "grace": "480",
    "body": "5e8eb28dccaa94a992f7169fa67966207d96aa55df7d24d2d6ec1f538c9f21520e00000067775f6578616d706c652e6f72671600000068747470733a2f2f67772e6578616d706c652e6f7267"
   },
   "expected": {
    "error": "RegisterGateway: domain must be 1-256 chars of A-Z a-z 0-9 . -"
   }
  },
  {
   "id": "17-7-heartbeat-131",
   "chapter": "17",
   "section": "7",
   "title": "A heartbeat of 131 bytes",
   "kind": "17-vote-check",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "type": "37",
    "sender": "000000005e8eb28dccaa94a992f7169fa67966207d96aa55df7d24d2d6ec1f538c9f2152",
    "body": "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
   },
   "expected": {
    "error": "GatewayHeartbeat body must be exactly 132 bytes"
   }
  },
  {
   "id": "17-7-fresh",
   "chapter": "17",
   "section": "7",
   "title": "A heartbeat naming the block at tip - 5",
   "kind": "17-heartbeat-fresh",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "tip": "5000",
    "ref_height": "4995"
   },
   "expected": {
    "verdict": "valid"
   }
  },
  {
   "id": "17-7-stale",
   "chapter": "17",
   "section": "7",
   "title": "A heartbeat naming the block at tip - 21",
   "kind": "17-heartbeat-fresh",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "tip": "5000",
    "ref_height": "4979"
   },
   "expected": {
    "error": "GatewayHeartbeat: reference block not fresh"
   }
  },
  {
   "id": "17-7-heartbeat",
   "chapter": "17",
   "section": "7",
   "title": "A heartbeat naming the block at tip - 5, signed by the gateway key",
   "kind": "17-heartbeat",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "seed": "1111111111111111111111111111111111111111111111111111111111111111",
    "registered_height": "4000",
    "height": "5001",
    "tip": "5000",
    "ref_height": "4995",
    "ref_hash": "abababababababababababababababababababababababababababababababab"
   },
   "expected": {
    "last_heartbeat_height": "5001"
   }
  },
  {
   "id": "17-7-heartbeat-bad-signature",
   "chapter": "17",
   "section": "7",
   "title": "The same body with 64 other bytes in place of the signature",
   "kind": "17-heartbeat",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "seed": "1111111111111111111111111111111111111111111111111111111111111111",
    "registered_height": "4000",
    "height": "5001",
    "tip": "5000",
    "ref_height": "4995",
    "ref_hash": "abababababababababababababababababababababababababababababababab",
    "signature": "22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222"
   },
   "expected": {
    "error": "GatewayHeartbeat: signature does not verify against the registered gateway key"
   }
  },
  {
   "id": "17-7-heartbeat-bad-signature-mined",
   "chapter": "17",
   "section": "7",
   "title": "Mined, that heartbeat is a paid no-op: the row is unchanged",
   "kind": "17-heartbeat",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "seed": "1111111111111111111111111111111111111111111111111111111111111111",
    "registered_height": "4000",
    "height": "5001",
    "tip": "5000",
    "ref_height": "4995",
    "ref_hash": "abababababababababababababababababababababababababababababababab",
    "signature": "22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222",
    "mined": "true"
   },
   "expected": {
    "last_heartbeat_height": "4000"
   }
  },
  {
   "id": "17-7-genesis-gateway",
   "chapter": "17",
   "section": "7",
   "title": "The gateway view before any gateway transaction: the genesis gateway",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "value": "{\"domain\":\"zoobc.network\",\"gateway_address\":\"ZBG_SPF4XQ7D_2O3ULG4I_D2X5X4HM_IYUCIWM5_4IK74SGR_QGAFIQN7_SCFK2UQO\",\"gateway_key\":\"93CBCBC3E3D3B7459B881EAFDBF0EC462824599DE215FE48D181805441BF908A\",\"height\":0,\"last_heartbeat_height\":0,\"locked_stake\":0,\"owner\":\"ZBC_5VJEDDEI_U3PTD7CN_VYSSHQLH_HSZOFBTR_BMGRZGPP_DOZHKAIB_IRIQ4P5D\",\"owner_address\":\"00000000ED52418C88A6DF31FC4DAE2523C1673CB2E286710B0D1C99EF1BB27501014451\",\"status\":0,\"url\":\"https://zoobc.network\",\"verified_count\":0}"
   }
  },
  {
   "id": "17-8-register",
   "chapter": "17",
   "section": "8",
   "title": "The owner of node N declares it archival",
   "kind": "17-register-archival",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "body": "fd4472bbdec43b919aa37b9b3366a3318f2902a753a15f5fd6d43c44b5121b670e00000061722e6578616d706c652e6f72671600000068747470733a2f2f61722e6578616d706c652e6f7267",
    "sender": "owner"
   },
   "expected": {
    "node_public_key": "fd4472bbdec43b919aa37b9b3366a3318f2902a753a15f5fd6d43c44b5121b67",
    "domain": "ar.example.org",
    "url": "https://ar.example.org"
   }
  },
  {
   "id": "17-8-not-owner",
   "chapter": "17",
   "section": "8",
   "title": "Another account declares node N archival",
   "kind": "17-register-archival",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "body": "fd4472bbdec43b919aa37b9b3366a3318f2902a753a15f5fd6d43c44b5121b670e00000061722e6578616d706c652e6f72671600000068747470733a2f2f61722e6578616d706c652e6f7267",
    "sender": "other"
   },
   "expected": {
    "error": "RegisterArchival: only the node's owner may declare it archival"
   }
  },
  {
   "id": "17-8-unregister-33",
   "chapter": "17",
   "section": "8",
   "title": "An UnregisterArchival of 33 bytes",
   "kind": "17-vote-check",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "type": "47",
    "sender": "000000005e8eb28dccaa94a992f7169fa67966207d96aa55df7d24d2d6ec1f538c9f2152",
    "body": "000000000000000000000000000000000000000000000000000000000000000000"
   },
   "expected": {
    "error": "UnregisterArchival body must be exactly 32 bytes"
   }
  },
  {
   "id": "17-8-genesis-registries",
   "chapter": "17",
   "section": "8",
   "title": "The archival and relay registries before any registry transaction, from the genesis file",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "archivals": "{\"archivals\":[{\"domain\":\"zoobc.network\",\"url\":\"https://zoobc.network\",\"node_public_key\":\"eb89f581920cac9343663a33911d76cef5c89390f25865651d902792b881ad65\",\"owner_address\":\"00000000ed52418c88a6df31fc4dae2523c1673cb2e286710b0d1c99ef1bb27501014451\",\"block_height\":0,\"status\":0}]}",
    "relays": "one genesis relay, relay.zoobc.network, relay key 37008FC9..., bound to the genesis gateway 93CBCBC3...908A, the same owner"
   }
  },
  {
   "id": "17-9-none",
   "chapter": "17",
   "section": "9",
   "title": "The node-local announcement registry has no consensus vector",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "value": "none needed"
   }
  }
 ]
}
