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
2 changes: 1 addition & 1 deletion ledger/common/pparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type ProtocolParametersProtocolVersion struct {
Minor uint
}

type ProtocolParametersUtxorpc interface {
type ProtocolParameters interface {
Utxorpc() *cardano.PParams
}

Expand Down
15 changes: 8 additions & 7 deletions protocol/localstatequery/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (

"github.com/blinklabs-io/gouroboros/cbor"
"github.com/blinklabs-io/gouroboros/ledger"
ledgercommon "github.com/blinklabs-io/gouroboros/ledger/common"
"github.com/blinklabs-io/gouroboros/protocol"
"github.com/blinklabs-io/gouroboros/protocol/common"
)
Expand Down Expand Up @@ -303,7 +304,7 @@ func (c *Client) GetNonMyopicMemberRewards() (*NonMyopicMemberRewardsResult, err
}

// GetCurrentProtocolParams returns the set of protocol params that are currently in effect
func (c *Client) GetCurrentProtocolParams() (CurrentProtocolParamsResult, error) {
func (c *Client) GetCurrentProtocolParams() (ledgercommon.ProtocolParameters, error) {
c.Protocol.Logger().
Debug("calling GetCurrentProtocolParams()",
"component", "network",
Expand All @@ -327,37 +328,37 @@ func (c *Client) GetCurrentProtocolParams() (CurrentProtocolParamsResult, error)
if err := c.runQuery(query, &result); err != nil {
return nil, err
}
return result[0], nil
return &result[0], nil
case ledger.EraIdBabbage:
result := []ledger.BabbageProtocolParameters{}
if err := c.runQuery(query, &result); err != nil {
return nil, err
}
return result[0], nil
return &result[0], nil
case ledger.EraIdAlonzo:
result := []ledger.AlonzoProtocolParameters{}
if err := c.runQuery(query, &result); err != nil {
return nil, err
}
return result[0], nil
return &result[0], nil
case ledger.EraIdMary:
result := []ledger.MaryProtocolParameters{}
if err := c.runQuery(query, &result); err != nil {
return nil, err
}
return result[0], nil
return &result[0], nil
case ledger.EraIdAllegra:
result := []ledger.AllegraProtocolParameters{}
if err := c.runQuery(query, &result); err != nil {
return nil, err
}
return result[0], nil
return &result[0], nil
case ledger.EraIdShelley:
result := []ledger.ShelleyProtocolParameters{}
if err := c.runQuery(query, &result); err != nil {
return nil, err
}
return result[0], nil
return &result[0], nil
default:
return nil, fmt.Errorf("unknown era ID: %d", currentEra)
}
Expand Down