Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions protocol/localstatequery/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ func (c *Client) GetStakeDistribution() (*StakeDistributionResult, error) {
// GetUTxOByAddress returns the UTxOs for a given list of ledger.Address structs
func (c *Client) GetUTxOByAddress(
addrs []ledger.Address,
) (*UTxOByAddressResult, error) {
) (*UTxOsResult, error) {
c.Protocol.Logger().
Debug(fmt.Sprintf("calling GetUTxOByAddress(addrs: %+v)", addrs),
"component", "network",
Expand All @@ -469,15 +469,15 @@ func (c *Client) GetUTxOByAddress(
QueryTypeShelleyUtxoByAddress,
addrs,
)
var result UTxOByAddressResult
var result UTxOsResult
if err := c.runQuery(query, &result); err != nil {
return nil, err
}
return &result, nil
}

// GetUTxOWhole returns the current UTxO set
func (c *Client) GetUTxOWhole() (*UTxOWholeResult, error) {
func (c *Client) GetUTxOWhole() (*UTxOsResult, error) {
c.Protocol.Logger().
Debug("calling GetUTxOWhole()",
"component", "network",
Expand All @@ -495,7 +495,7 @@ func (c *Client) GetUTxOWhole() (*UTxOWholeResult, error) {
currentEra,
QueryTypeShelleyUtxoWhole,
)
var result UTxOWholeResult
var result UTxOsResult
if err := c.runQuery(query, &result); err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions protocol/localstatequery/client_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Blink Labs Software
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -234,7 +234,7 @@ func TestGetUTxOByAddress(t *testing.T) {
Hash: ledger.NewBlake2b256([]byte{0x1, 0x2}),
Idx: 7,
}
expectedResult := localstatequery.UTxOByAddressResult{
expectedResult := localstatequery.UTxOsResult{
Results: map[localstatequery.UtxoId]ledger.BabbageTransactionOutput{
expectedUtxoId: {
OutputAddress: testAddress,
Expand Down
18 changes: 7 additions & 11 deletions protocol/localstatequery/queries.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023 Blink Labs Software
// Copyright 2025 Blink Labs Software
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -533,11 +533,16 @@ type StakeDistributionResult struct {
}
}

type UTxOByAddressResult struct {
type UTxOsResult struct {
cbor.StructAsArray
Results map[UtxoId]ledger.BabbageTransactionOutput
}

type (
UTxOByAddressResult = UTxOsResult
UTxOWholeResult = UTxOsResult
)

type UtxoId struct {
cbor.StructAsArray
Hash ledger.Blake2b256
Expand Down Expand Up @@ -592,15 +597,6 @@ func (u *UtxoId) MarshalCBOR() ([]byte, error) {
return cbor.Encode(tmpData)
}

// TODO (#862)
/*
result [{* utxo => value }]
*/
type UTxOWholeResult struct {
cbor.StructAsArray
Results map[UtxoId]ledger.BabbageTransactionOutput
}

// TODO (#863)
type DebugEpochStateResult any

Expand Down