You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/handler-spec.md
+36-23Lines changed: 36 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,33 +31,37 @@ Handlers communicate with the test runner via **stdin/stdout**:
31
31
```json
32
32
{
33
33
"id": "unique-request-id",
34
-
"success": { /* method-specific result */ }
34
+
"success": true
35
35
}
36
36
```
37
37
38
38
**Success response fields:**
39
39
-`id` (string, required): Must match the request ID
40
-
-`success` (any, required): Method-specific result data. Must be present on success (can be empty `{}`)
40
+
-`success` (boolean, required): Must be `true` on successful operation
41
41
-`error` (null or omitted): Must not be present on success
42
42
43
43
### Error Response
44
44
45
45
```json
46
46
{
47
47
"id": "unique-request-id",
48
+
"success": false,
48
49
"error": {
49
-
"type": "error_category",
50
-
"variant": "specific_error"
50
+
"code": {
51
+
"type": "error_type",
52
+
"member": "ERROR_MEMBER_NAME"
53
+
}
51
54
}
52
55
}
53
56
```
54
57
55
58
**Error response fields:**
56
59
-`id` (string, required): Must match the request ID
57
-
-`success` (null or omitted): Must not be present on error
58
-
-`error` (object, required): Error details
59
-
-`type` (string, required): Error category/type
60
-
-`variant` (string, optional): Specific error variant within the type. Whether the runner expects this field depends on the specific test case
60
+
-`success` (boolean, required): Must be `false` on error
61
+
-`error` (object, optional): Error details. Whether this field is required depends on the specific test case.
62
+
-`code` (object, optional): Error code details
63
+
-`type` (string, required): Error type (e.g., "btck_ScriptVerifyStatus")
64
+
-`member` (string, required): Specific error member (e.g., "ERROR_INVALID_FLAGS_COMBINATION")
61
65
62
66
## Handler Requirements
63
67
@@ -76,13 +80,13 @@ The conformance tests are organized into suites, each testing a specific aspect
76
80
77
81
Tests valid Bitcoin script verification scenarios across different transaction types.
78
82
79
-
**Method:**`script_pubkey.verify`
83
+
**Method:**`btck_script_pubkey_verify`
80
84
81
85
**Expected Response Format:**
82
86
```json
83
87
{
84
88
"id": "test-id",
85
-
"success": {}
89
+
"success": true
86
90
}
87
91
```
88
92
@@ -91,26 +95,35 @@ Tests valid Bitcoin script verification scenarios across different transaction t
91
95
92
96
Tests error handling for invalid script verification scenarios.
93
97
94
-
**Method:**`script_pubkey.verify`
98
+
**Method:**`btck_script_pubkey_verify`
95
99
96
-
**Expected Response Format:**
100
+
**Expected Response Formats:**
101
+
102
+
**With specific error code:**
97
103
```json
98
104
{
99
105
"id": "test-id",
106
+
"success": false,
100
107
"error": {
101
-
"type": "ScriptVerify",
102
-
"variant": "ErrorVariant"
108
+
"code": {
109
+
"type": "btck_ScriptVerifyStatus",
110
+
"member": "ERROR_MEMBER_NAME"
111
+
}
103
112
}
104
113
}
105
114
```
106
115
107
-
**Error Variants:**
116
+
**Generic failure (no error details):**
117
+
```json
118
+
{
119
+
"id": "test-id",
120
+
"success": false
121
+
}
122
+
```
123
+
124
+
**Error Members:**
108
125
109
-
| Variant | Description |
110
-
|---------|-------------|
111
-
|`TxInputIndex`| The specified input index is out of bounds. The `input_index` parameter is greater than or equal to the number of inputs in the transaction. |
112
-
|`InvalidFlags`| Invalid verification flags were provided. The flags parameter contains bits that don't correspond to any defined verification flag. |
113
-
|`InvalidFlagsCombination`| Invalid or inconsistent verification flags were provided. This occurs when the supplied `script_verify_flags` combination violates internal consistency rules. |
114
-
|`SpentOutputsMismatch`| The spent_outputs array length doesn't match the input count. When spent_outputs is non-empty, it must contain exactly one output for each input in the transaction. |
115
-
|`SpentOutputsRequired`| Spent outputs are required but were not provided. |
116
-
|`Invalid`| Script verification failed. |
126
+
| Member | Description |
127
+
|--------|-------------|
128
+
|`ERROR_INVALID_FLAGS_COMBINATION`| Invalid or inconsistent verification flags were provided. This occurs when the supplied `script_verify_flags` combination violates internal consistency rules. |
129
+
|`ERROR_SPENT_OUTPUTS_REQUIRED`| Spent outputs are required but were not provided (e.g., for Taproot verification). |
0 commit comments