File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -278,6 +278,18 @@ func testQuery(f *globalFlags) {
278
278
fmt .Printf ("Assets: %s\n " , assetsJson )
279
279
}
280
280
}
281
+ case "utxo-whole-result" :
282
+ result , err := o .LocalStateQuery ().Client .GetUTxOWhole ()
283
+ if err != nil {
284
+ fmt .Printf ("ERROR: failure querying UTxO whole: %s\n " , err )
285
+ os .Exit (1 )
286
+ }
287
+ jsonData , err := json .MarshalIndent (result , "" , " " )
288
+ if err != nil {
289
+ fmt .Printf ("ERROR: failed to marshal UTxO whole to JSON: %s\n " , err )
290
+ os .Exit (1 )
291
+ }
292
+ fmt .Println (string (jsonData ))
281
293
default :
282
294
fmt .Printf ("ERROR: unknown query: %s\n " , queryFlags .flagset .Args ()[0 ])
283
295
os .Exit (1 )
Original file line number Diff line number Diff line change 15
15
package localstatequery
16
16
17
17
import (
18
+ "encoding/json"
18
19
"errors"
19
20
"fmt"
20
21
"sync"
@@ -499,6 +500,12 @@ func (c *Client) GetUTxOWhole() (*UTxOWholeResult, error) {
499
500
if err := c .runQuery (query , & result ); err != nil {
500
501
return nil , err
501
502
}
503
+ jsonData , err := json .MarshalIndent (result , "" , " " )
504
+ if err != nil {
505
+ return nil , fmt .Errorf ("error marshaling UTxOWhole result to JSON: %s" , err )
506
+ }
507
+ fmt .Println ("UTxOWhole Result:" )
508
+ fmt .Println (string (jsonData ))
502
509
return & result , nil
503
510
}
504
511
You can’t perform that action at this time.
0 commit comments