-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathscript_verify_errors.json
More file actions
158 lines (158 loc) · 4.29 KB
/
script_verify_errors.json
File metadata and controls
158 lines (158 loc) · 4.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
{
"title": "Script Verification Error Cases",
"description": "Test cases where the verification operation fails to determine validity of the script due to bad user input",
"stateful": true,
"tests": [
{
"description": "Create P2PKH script pubkey",
"request": {
"id": "script_verify_errors#1",
"method": "btck_script_pubkey_create",
"params": {
"script_pubkey": "76a9144bfbaf6afb76cc5771bc6404810d1cc041a6933988ac"
},
"ref": "$spk"
},
"expected_response": {
"result": {
"ref": "$spk"
}
}
},
{
"description": "Create P2PKH transaction",
"request": {
"id": "script_verify_errors#2",
"method": "btck_transaction_create",
"params": {
"raw_transaction": "02000000013f7cebd65c27431a90bba7f796914fe8cc2ddfc3f2cbd6f7e5f2fc854534da95000000006b483045022100de1ac3bcdfb0332207c4a91f3832bd2c2915840165f876ab47c5f8996b971c3602201c6c053d750fadde599e6f5c4e1963df0f01fc0d97815e8157e3d59fe09ca30d012103699b464d1d8bc9e47d4fb1cdaa89a1c5783d68363c4dbc4b524ed3d857148617feffffff02836d3c01000000001976a914fc25d6d5c94003bf5b0c7b640a248e2c637fcfb088ac7ada8202000000001976a914fbed3d9b11183209a57999d54d59f67c019e756c88ac6acb0700"
},
"ref": "$tx"
},
"expected_response": {
"result": {
"ref": "$tx"
}
}
},
{
"description": "Create precomputed transaction data",
"request": {
"id": "script_verify_errors#3",
"method": "btck_precomputed_transaction_data_create",
"params": {
"tx_to": {
"ref": "$tx"
}
},
"ref": "$precomp"
},
"expected_response": {
"result": {
"ref": "$precomp"
}
}
},
{
"description": "btck_ScriptVerificationFlags_WITNESS flag requires btck_ScriptVerificationFlags_P2SH flag to be set as well",
"request": {
"id": "script_verify_errors#4",
"method": "btck_script_pubkey_verify",
"params": {
"script_pubkey": {
"ref": "$spk"
},
"amount": 0,
"tx_to": {
"ref": "$tx"
},
"precomputed_txdata": {
"ref": "$precomp"
},
"input_index": 0,
"flags": [
"btck_ScriptVerificationFlags_WITNESS"
]
}
},
"expected_response": {
"error": {
"code": {
"type": "btck_ScriptVerifyStatus",
"member": "ERROR_INVALID_FLAGS_COMBINATION"
}
}
}
},
{
"description": "btck_ScriptVerificationFlags_TAPROOT flag requires spent outputs to be provided",
"request": {
"id": "script_verify_errors#5",
"method": "btck_script_pubkey_verify",
"params": {
"script_pubkey": {
"ref": "$spk"
},
"amount": 0,
"tx_to": {
"ref": "$tx"
},
"precomputed_txdata": {
"ref": "$precomp"
},
"input_index": 0,
"flags": [
"btck_ScriptVerificationFlags_TAPROOT"
]
}
},
"expected_response": {
"error": {
"code": {
"type": "btck_ScriptVerifyStatus",
"member": "ERROR_SPENT_OUTPUTS_REQUIRED"
}
}
}
},
{
"description": "Destroy precomputed transaction data",
"request": {
"id": "script_verify_errors#6",
"method": "btck_precomputed_transaction_data_destroy",
"params": {
"precomputed_txdata": {
"ref": "$precomp"
}
}
},
"expected_response": {}
},
{
"description": "Destroy transaction",
"request": {
"id": "script_verify_errors#7",
"method": "btck_transaction_destroy",
"params": {
"transaction": {
"ref": "$tx"
}
}
},
"expected_response": {}
},
{
"description": "Destroy script pubkey",
"request": {
"id": "script_verify_errors#8",
"method": "btck_script_pubkey_destroy",
"params": {
"script_pubkey": {
"ref": "$spk"
}
}
},
"expected_response": {}
}
]
}