production.v1.json (7023B)
1 { 2 "suite": "social_production", 3 "contract_version": "0.1.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_calendar_collection_valid_005", 99 "kind": "social.calendar.build_tags.valid", 100 "input": { 101 "calendar": { 102 "d_tag": "AAAAAAAAAAAAAAAAAAAA_A", 103 "title": "farm calendar", 104 "description": "Shared schedule for farm operations.", 105 "events": [ 106 { 107 "kind": "address", 108 "address": "31923:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc:AAAAAAAAAAAAAAAAAAAA-A", 109 "author": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", 110 "event_kind": 31923, 111 "relays": [ 112 "wss://relay.example.test" 113 ] 114 } 115 ] 116 } 117 }, 118 "expected": { 119 "result": "ok", 120 "required_tags": [ 121 "d", 122 "title", 123 "a" 124 ], 125 "content": "Shared schedule for farm operations." 126 } 127 }, 128 { 129 "id": "social_calendar_collection_empty_invalid_006", 130 "kind": "social.calendar.build_tags.invalid", 131 "input": { 132 "calendar": { 133 "d_tag": "AAAAAAAAAAAAAAAAAAAA_A", 134 "title": "farm calendar", 135 "events": [] 136 } 137 }, 138 "expected": { 139 "result": "error", 140 "error_class": "encode_error", 141 "field": "events" 142 } 143 }, 144 { 145 "id": "social_calendar_rsvp_valid_007", 146 "kind": "social.calendar_rsvp.build_tags.valid", 147 "input": { 148 "rsvp": { 149 "d_tag": "AAAAAAAAAAAAAAAAAAAAAQ", 150 "event": { 151 "kind": "address", 152 "address": "31923:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc:AAAAAAAAAAAAAAAAAAAA-A", 153 "author": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", 154 "event_kind": 31923, 155 "relays": [ 156 "wss://relay.example.test" 157 ] 158 }, 159 "event_id": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 160 "status": "tentative", 161 "free_busy": "busy" 162 } 163 }, 164 "expected": { 165 "result": "ok", 166 "required_tags": [ 167 "d", 168 "a", 169 "e", 170 "status", 171 "fb" 172 ] 173 } 174 }, 175 { 176 "id": "social_calendar_rsvp_event_target_invalid_008", 177 "kind": "social.calendar_rsvp.build_tags.invalid", 178 "input": { 179 "rsvp": { 180 "d_tag": "AAAAAAAAAAAAAAAAAAAAAQ", 181 "event": { 182 "kind": "event", 183 "id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 184 "author": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", 185 "event_kind": 31923, 186 "relays": [] 187 }, 188 "status": "accepted" 189 } 190 }, 191 "expected": { 192 "result": "error", 193 "error_class": "encode_error", 194 "field": "event" 195 } 196 }, 197 { 198 "id": "social_report_event_and_file_valid_009", 199 "kind": "social.report.build_tags.valid", 200 "input": { 201 "report": { 202 "reported_pubkey": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", 203 "report_type": "spam", 204 "event": { 205 "kind": "event", 206 "id": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", 207 "author": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", 208 "event_kind": 1, 209 "relays": [ 210 "wss://relay.example.test" 211 ] 212 }, 213 "file": { 214 "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", 215 "url": "https://media.example.test/bad.jpg" 216 } 217 } 218 }, 219 "expected": { 220 "result": "ok", 221 "required_tags": [ 222 "p", 223 "e", 224 "x", 225 "server" 226 ] 227 } 228 }, 229 { 230 "id": "social_report_missing_pubkey_invalid_010", 231 "kind": "social.report.build_tags.invalid", 232 "input": { 233 "report": { 234 "reported_pubkey": "", 235 "report_type": "spam" 236 } 237 }, 238 "expected": { 239 "result": "error", 240 "error_class": "encode_error", 241 "field": "reported_pubkey" 242 } 243 } 244 ] 245 }