lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

production.v1.json (4073B)


      1 {
      2   "suite": "social_production",
      3   "contract_version": "1.0.0",
      4   "vectors": [
      5     {
      6       "id": "social_repost_note_valid_001",
      7       "kind": "social.repost.build_tags.valid",
      8       "input": {
      9         "repost": {
     10           "target": {
     11             "kind": "event",
     12             "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
     13             "author": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
     14             "event_kind": 1,
     15             "relays": [
     16               "wss://relay.example.test"
     17             ]
     18           },
     19           "content": "field update"
     20         }
     21       },
     22       "expected": {
     23         "result": "ok",
     24         "required_tags": [
     25           "e",
     26           "p"
     27         ]
     28       }
     29     },
     30     {
     31       "id": "social_repost_non_note_invalid_002",
     32       "kind": "social.repost.build_tags.invalid",
     33       "input": {
     34         "repost": {
     35           "target": {
     36             "kind": "event",
     37             "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
     38             "author": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
     39             "event_kind": 30023,
     40             "relays": []
     41           }
     42         }
     43       },
     44       "expected": {
     45         "result": "error",
     46         "error_class": "encode_error",
     47         "field": "target_kind"
     48       }
     49     },
     50     {
     51       "id": "social_generic_repost_address_valid_003",
     52       "kind": "social.generic_repost.build_tags.valid",
     53       "input": {
     54         "repost": {
     55           "target": {
     56             "kind": "address",
     57             "address": "30023:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc:AAAAAAAAAAAAAAAAAAAAAg",
     58             "author": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
     59             "event_kind": 30023,
     60             "relays": [
     61               "wss://relay.example.test"
     62             ]
     63           },
     64           "target_kind": 30023,
     65           "content": "article share"
     66         }
     67       },
     68       "expected": {
     69         "result": "ok",
     70         "required_tags": [
     71           "a",
     72           "k"
     73         ]
     74       }
     75     },
     76     {
     77       "id": "social_generic_repost_kind_one_invalid_004",
     78       "kind": "social.generic_repost.build_tags.invalid",
     79       "input": {
     80         "repost": {
     81           "target": {
     82             "kind": "event",
     83             "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
     84             "author": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
     85             "event_kind": 1,
     86             "relays": []
     87           },
     88           "target_kind": 1
     89         }
     90       },
     91       "expected": {
     92         "result": "error",
     93         "error_class": "encode_error",
     94         "field": "target_kind"
     95       }
     96     },
     97     {
     98       "id": "social_report_event_and_file_valid_009",
     99       "kind": "social.report.build_tags.valid",
    100       "input": {
    101         "report": {
    102           "reported_pubkey": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
    103           "report_type": "spam",
    104           "event": {
    105             "kind": "event",
    106             "id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
    107             "author": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
    108             "event_kind": 1,
    109             "relays": [
    110               "wss://relay.example.test"
    111             ]
    112           },
    113           "file": {
    114             "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
    115             "url": "https://media.example.test/bad.jpg"
    116           }
    117         }
    118       },
    119       "expected": {
    120         "result": "ok",
    121         "required_tags": [
    122           "p",
    123           "e",
    124           "x",
    125           "server"
    126         ]
    127       }
    128     },
    129     {
    130       "id": "social_report_missing_pubkey_invalid_010",
    131       "kind": "social.report.build_tags.invalid",
    132       "input": {
    133         "report": {
    134           "reported_pubkey": "",
    135           "report_type": "spam"
    136         }
    137       },
    138       "expected": {
    139         "result": "error",
    140         "error_class": "encode_error",
    141         "field": "reported_pubkey"
    142       }
    143     }
    144   ]
    145 }