@@ -64,12 +64,14 @@ func Test_ExecuteQuery(t *testing.T) {
64
64
65
65
func Test_GenObjectQuery (t * testing.T ) {
66
66
assert .Equal (t ,
67
- "id height header { id daHeight consensusParametersVersion stateTransitionBytecodeVersion transactionsCount messageReceiptCount transactionsRoot messageOutboxRoot eventInboxRoot height prevRoot time applicationHash } consensus { __typename ... on Genesis { chainConfigHash coinsRoot contractsRoot messagesRoot transactionsRoot } ... on PoAConsensus { signature } } " ,
67
+ "version id height header { version id daHeight consensusParametersVersion stateTransitionBytecodeVersion transactionsCount messageReceiptCount transactionsRoot messageOutboxRoot eventInboxRoot height prevRoot time applicationHash } consensus { __typename ... on Genesis { chainConfigHash coinsRoot contractsRoot messagesRoot transactionsRoot } ... on PoAConsensus { signature } } transactionIds " ,
68
68
query .Simple .GenObjectQuery (types.Block {}, query .IgnoreObjects (types.Transaction {})),
69
69
)
70
- assert .Equal (t , `id
70
+ assert .Equal (t , `version
71
+ id
71
72
height
72
73
header {
74
+ version
73
75
id
74
76
daHeight
75
77
consensusParametersVersion
@@ -97,12 +99,13 @@ consensus {
97
99
signature
98
100
}
99
101
}
102
+ transactionIds
100
103
` ,
101
104
query .Beauty .GenObjectQuery (types.Block {}, query .IgnoreObjects (types.Transaction {})),
102
105
)
103
106
104
107
assert .Equal (t ,
105
- "id height header { id daHeight consensusParametersVersion stateTransitionBytecodeVersion transactionsCount messageReceiptCount transactionsRoot messageOutboxRoot eventInboxRoot height prevRoot time applicationHash } consensus { __typename ... on Genesis { chainConfigHash coinsRoot contractsRoot messagesRoot transactionsRoot } ... on PoAConsensus { signature } } transactions { id inputAssetIds inputContracts inputContract { utxoId balanceRoot stateRoot txPointer contractId } policies { tip witnessLimit maturity maxFee } scriptGasLimit maturity mintAmount mintAssetId mintGasPrice txPointer isScript isCreate isMint isUpgrade isUpload inputs { __typename ... on InputCoin { utxoId owner amount assetId txPointer witnessIndex predicateGasUsed predicate predicateData } ... on InputContract { utxoId balanceRoot stateRoot txPointer contractId } ... on InputMessage { sender recipient amount nonce witnessIndex predicateGasUsed data predicate predicateData } } outputs { __typename ... on CoinOutput { to amount assetId } ... on ContractOutput { inputIndex balanceRoot stateRoot } ... on ChangeOutput { to amount assetId } ... on VariableOutput { to amount assetId } ... on ContractCreated { contract stateRoot } } outputContract { inputIndex balanceRoot stateRoot } witnesses receiptsRoot status { __typename ... on SubmittedStatus { time } ... on SqueezedOutStatus { reason } } script scriptData bytecodeWitnessIndex salt storageSlots bytecodeRoot subsectionIndex subsectionsNumber proofSet upgradePurpose { __typename ... on ConsensusParametersPurpose { witnessIndex checksum } ... on StateTransitionPurpose { root } } rawPayload } " ,
108
+ "version id height header { version id daHeight consensusParametersVersion stateTransitionBytecodeVersion transactionsCount messageReceiptCount transactionsRoot messageOutboxRoot eventInboxRoot height prevRoot time applicationHash } consensus { __typename ... on Genesis { chainConfigHash coinsRoot contractsRoot messagesRoot transactionsRoot } ... on PoAConsensus { signature } } transactionIds transactions { id inputAssetIds inputContracts inputContract { utxoId balanceRoot stateRoot txPointer contractId } policies { tip witnessLimit maturity maxFee } scriptGasLimit maturity mintAmount mintAssetId mintGasPrice txPointer isScript isCreate isMint isUpgrade isUpload isBlob inputs { __typename ... on InputCoin { utxoId owner amount assetId txPointer witnessIndex predicateGasUsed predicate predicateData } ... on InputContract { utxoId balanceRoot stateRoot txPointer contractId } ... on InputMessage { sender recipient amount nonce witnessIndex predicateGasUsed data predicate predicateData } } outputs { __typename ... on CoinOutput { to amount assetId } ... on ContractOutput { inputIndex balanceRoot stateRoot } ... on ChangeOutput { to amount assetId } ... on VariableOutput { to amount assetId } ... on ContractCreated { contract stateRoot } } outputContract { inputIndex balanceRoot stateRoot } witnesses receiptsRoot status { __typename ... on SubmittedStatus { time } ... on SqueezedOutStatus { reason } } script scriptData bytecodeWitnessIndex blobId salt storageSlots bytecodeRoot subsectionIndex subsectionsNumber proofSet upgradePurpose { __typename ... on ConsensusParametersPurpose { witnessIndex checksum } ... on StateTransitionPurpose { root } } rawPayload } " ,
106
109
query .Simple .GenObjectQuery (types.Block {}, query .IgnoreObjects (types.SuccessStatus {}, types.FailureStatus {})),
107
110
)
108
111
}
@@ -143,10 +146,13 @@ func Test_Union_marshalJSON(t *testing.T) {
143
146
TransactionId : types.TransactionId {
144
147
Hash : common .HexToHash ("0x0000000000000000000000000000000000000000000000000000000000000123" ),
145
148
},
149
+ BlockHeight : 5 ,
146
150
Block : types.Block {
147
- Id : types.BlockId {Hash : common .HexToHash ("0x0000000000000000000000000000000000000000000000000000000000000001" )},
148
- Height : 5 ,
151
+ Version : "V1" ,
152
+ Id : types.BlockId {Hash : common .HexToHash ("0x0000000000000000000000000000000000000000000000000000000000000001" )},
153
+ Height : 5 ,
149
154
Header : types.Header {
155
+ Version : "V1" ,
150
156
Id : types.BlockId {Hash : common .HexToHash ("0x0000000000000000000000000000000000000000000000000000000000000001" )},
151
157
DaHeight : 2 ,
152
158
TransactionsCount : 3 ,
@@ -155,17 +161,23 @@ func Test_Union_marshalJSON(t *testing.T) {
155
161
Time : types.Tai64Timestamp {Time : time .Date (2024 , time .April , 15 , 2 , 44 , 2 , 0 , time .UTC )},
156
162
},
157
163
},
164
+ Transaction : types.Transaction {
165
+ Id : types.TransactionId {Hash : common .HexToHash ("0x9999" )},
166
+ },
158
167
},
159
168
}
160
169
text , err := json .MarshalIndent (status , "" , " " )
161
170
assert .NoError (t , err )
162
171
assert .Equal (t , `{
163
172
"__typename": "SuccessStatus",
164
173
"transactionId": "0x0000000000000000000000000000000000000000000000000000000000000123",
174
+ "blockHeight": "5",
165
175
"block": {
176
+ "version": "V1",
166
177
"id": "0x0000000000000000000000000000000000000000000000000000000000000001",
167
178
"height": "5",
168
179
"header": {
180
+ "version": "V1",
169
181
"id": "0x0000000000000000000000000000000000000000000000000000000000000001",
170
182
"daHeight": "2",
171
183
"consensusParametersVersion": "0",
@@ -181,8 +193,46 @@ func Test_Union_marshalJSON(t *testing.T) {
181
193
"applicationHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
182
194
},
183
195
"consensus": null,
196
+ "transactionIds": null,
184
197
"transactions": null
185
198
},
199
+ "transaction": {
200
+ "id": "0x0000000000000000000000000000000000000000000000000000000000009999",
201
+ "inputAssetIds": null,
202
+ "inputContracts": null,
203
+ "inputContract": null,
204
+ "policies": null,
205
+ "scriptGasLimit": null,
206
+ "maturity": null,
207
+ "mintAmount": null,
208
+ "mintAssetId": null,
209
+ "mintGasPrice": null,
210
+ "txPointer": null,
211
+ "isScript": false,
212
+ "isCreate": false,
213
+ "isMint": false,
214
+ "isUpgrade": false,
215
+ "isUpload": false,
216
+ "isBlob": false,
217
+ "inputs": null,
218
+ "outputs": null,
219
+ "outputContract": null,
220
+ "witnesses": null,
221
+ "receiptsRoot": null,
222
+ "status": null,
223
+ "script": null,
224
+ "scriptData": null,
225
+ "bytecodeWitnessIndex": null,
226
+ "blobId": null,
227
+ "salt": null,
228
+ "storageSlots": null,
229
+ "bytecodeRoot": null,
230
+ "subsectionIndex": null,
231
+ "subsectionsNumber": null,
232
+ "proofSet": null,
233
+ "upgradePurpose": null,
234
+ "rawPayload": "0x"
235
+ },
186
236
"time": "4611685956291791114",
187
237
"programState": null,
188
238
"receipts": null,
@@ -237,6 +287,7 @@ func Test_marshalStructpb(t *testing.T) {
237
287
"isMint" : structpb .NewBoolValue (false ),
238
288
"isUpgrade" : structpb .NewBoolValue (false ),
239
289
"isUpload" : structpb .NewBoolValue (false ),
290
+ "isBlob" : structpb .NewBoolValue (false ),
240
291
"inputs" : structpb .NewListValue (& structpb.ListValue {Values : []* structpb.Value {
241
292
structpb .NewStructValue (& structpb.Struct {Fields : map [string ]* structpb.Value {
242
293
"__typename" : structpb .NewStringValue ("InputContract" ),
@@ -279,11 +330,14 @@ func Test_marshalStructpb(t *testing.T) {
279
330
"receiptsRoot" : structpb .NewStringValue ("0x74ab41b67d3e1ccb4bda92dfac21bfb448f80d0500b3cd56480aaee2fa37cbf0" ),
280
331
"status" : structpb .NewStructValue (& structpb.Struct {Fields : map [string ]* structpb.Value {
281
332
"__typename" : structpb .NewStringValue ("SuccessStatus" ),
333
+ "blockHeight" : structpb .NewStringValue ("1067005" ),
282
334
"transactionId" : structpb .NewStringValue ("0x0ec0390a47eb248d579c74861d747259c2a2a3f4c5c4cdccf049f0670b9a4485" ),
283
335
"block" : structpb .NewStructValue (& structpb.Struct {Fields : map [string ]* structpb.Value {
284
- "id" : structpb .NewStringValue ("0x0000000000000000000000000000000000000000000000000000000000000000" ),
285
- "height" : structpb .NewStringValue ("0" ),
336
+ "version" : structpb .NewStringValue ("" ),
337
+ "id" : structpb .NewStringValue ("0x0000000000000000000000000000000000000000000000000000000000000000" ),
338
+ "height" : structpb .NewStringValue ("0" ),
286
339
"header" : structpb .NewStructValue (& structpb.Struct {Fields : map [string ]* structpb.Value {
340
+ "version" : structpb .NewStringValue ("" ),
287
341
"id" : structpb .NewStringValue ("0x0000000000000000000000000000000000000000000000000000000000000000" ),
288
342
"daHeight" : structpb .NewStringValue ("0" ),
289
343
"consensusParametersVersion" : structpb .NewStringValue ("0" ),
@@ -298,7 +352,25 @@ func Test_marshalStructpb(t *testing.T) {
298
352
"time" : structpb .NewStringValue ("4611685956291791114" ),
299
353
"applicationHash" : structpb .NewStringValue ("0x0000000000000000000000000000000000000000000000000000000000000000" ),
300
354
}}),
301
- "transactions" : structpb .NewListValue (& structpb.ListValue {Values : []* structpb.Value {}}),
355
+ "transactionIds" : structpb .NewListValue (& structpb.ListValue {Values : []* structpb.Value {}}),
356
+ "transactions" : structpb .NewListValue (& structpb.ListValue {Values : []* structpb.Value {}}),
357
+ }}),
358
+ "transaction" : structpb .NewStructValue (& structpb.Struct {Fields : map [string ]* structpb.Value {
359
+ "id" : structpb .NewStringValue ("0x0000000000000000000000000000000000000000000000000000000000000000" ),
360
+ "inputAssetIds" : structpb .NewListValue (& structpb.ListValue {Values : []* structpb.Value {}}),
361
+ "inputContracts" : structpb .NewListValue (& structpb.ListValue {Values : []* structpb.Value {}}),
362
+ "inputs" : structpb .NewListValue (& structpb.ListValue {Values : []* structpb.Value {}}),
363
+ "outputs" : structpb .NewListValue (& structpb.ListValue {Values : []* structpb.Value {}}),
364
+ "proofSet" : structpb .NewListValue (& structpb.ListValue {Values : []* structpb.Value {}}),
365
+ "storageSlots" : structpb .NewListValue (& structpb.ListValue {Values : []* structpb.Value {}}),
366
+ "witnesses" : structpb .NewListValue (& structpb.ListValue {Values : []* structpb.Value {}}),
367
+ "isScript" : structpb .NewBoolValue (false ),
368
+ "isCreate" : structpb .NewBoolValue (false ),
369
+ "isMint" : structpb .NewBoolValue (false ),
370
+ "isUpgrade" : structpb .NewBoolValue (false ),
371
+ "isUpload" : structpb .NewBoolValue (false ),
372
+ "isBlob" : structpb .NewBoolValue (false ),
373
+ "rawPayload" : structpb .NewStringValue ("0x" ),
302
374
}}),
303
375
"receipts" : structpb .NewListValue (& structpb.ListValue {Values : []* structpb.Value {
304
376
structpb .NewStructValue (& structpb.Struct {Fields : map [string ]* structpb.Value {
0 commit comments