-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtransaction_output.json
More file actions
162 lines (162 loc) · 4.24 KB
/
Copy pathtransaction_output.json
File metadata and controls
162 lines (162 loc) · 4.24 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
159
160
161
162
{
"title": "Transaction Output Operations",
"description": "Covers transaction output object creation from a script pubkey and amount, amount and script getters, copying, and cleanup",
"stateful": true,
"tests": [
{
"description": "Creates a script pubkey from raw bytes",
"request": {
"id": "transaction_output#1",
"method": "btck_script_pubkey_create",
"params": {
"script_pubkey": "4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac"
},
"ref": "$spk"
},
"expected_response": {
"result": {
"ref": "$spk"
}
}
},
{
"description": "Creates a transaction output from the script pubkey and amount",
"request": {
"id": "transaction_output#2",
"method": "btck_transaction_output_create",
"params": {
"script_pubkey": {
"ref": "$spk"
},
"amount": 5000000000
},
"ref": "$txout"
},
"expected_response": {
"result": {
"ref": "$txout"
}
}
},
{
"description": "Destroys the original script pubkey after output creation",
"request": {
"id": "transaction_output#3",
"method": "btck_script_pubkey_destroy",
"params": {
"script_pubkey": {
"ref": "$spk"
}
}
},
"expected_response": {}
},
{
"description": "Verifies the transaction output amount",
"request": {
"id": "transaction_output#4",
"method": "btck_transaction_output_get_amount",
"params": {
"transaction_output": {
"ref": "$txout"
}
}
},
"expected_response": {
"result": 5000000000
}
},
{
"description": "Gets the script pubkey from the transaction output",
"request": {
"id": "transaction_output#5",
"method": "btck_transaction_output_get_script_pubkey",
"params": {
"transaction_output": {
"ref": "$txout"
}
},
"ref": "$txout_spk"
},
"expected_response": {
"result": {
"ref": "$txout_spk"
}
}
},
{
"description": "Verifies the output script pubkey serializes to the original bytes",
"request": {
"id": "transaction_output#6",
"method": "btck_script_pubkey_to_bytes",
"params": {
"script_pubkey": {
"ref": "$txout_spk"
}
}
},
"expected_response": {
"result": "4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac"
}
},
{
"description": "Copies the transaction output",
"request": {
"id": "transaction_output#7",
"method": "btck_transaction_output_copy",
"params": {
"transaction_output": {
"ref": "$txout"
}
},
"ref": "$txout_copy"
},
"expected_response": {
"result": {
"ref": "$txout_copy"
}
}
},
{
"description": "Destroys the original transaction output after copying",
"request": {
"id": "transaction_output#8",
"method": "btck_transaction_output_destroy",
"params": {
"transaction_output": {
"ref": "$txout"
}
}
},
"expected_response": {}
},
{
"description": "Verifies the copied transaction output has the same amount",
"request": {
"id": "transaction_output#9",
"method": "btck_transaction_output_get_amount",
"params": {
"transaction_output": {
"ref": "$txout_copy"
}
}
},
"expected_response": {
"result": 5000000000
}
},
{
"description": "Destroys the copied transaction output",
"request": {
"id": "transaction_output#10",
"method": "btck_transaction_output_destroy",
"params": {
"transaction_output": {
"ref": "$txout_copy"
}
}
},
"expected_response": {}
}
]
}