Skip to content

Commit 51035ad

Browse files
jkawanJenita
andauthored
fix(protocol): Implemented ProposedProtocolParamsUpdatesResult type (#1214)
Signed-off-by: Jenita <[email protected]> Co-authored-by: Jenita <[email protected]>
1 parent e580ea1 commit 51035ad

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

cmd/gouroboros/query.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,13 @@ func testQuery(f *globalFlags) {
305305
}
306306
}
307307
}
308+
case "proposed-protocol-params-updates":
309+
proposedUpdates, err := o.LocalStateQuery().Client.GetProposedProtocolParamsUpdates()
310+
if err != nil {
311+
fmt.Printf("ERROR: failure querying proposed protocol params updates: %s\n", err)
312+
os.Exit(1)
313+
}
314+
fmt.Printf("proposed-protocol-params-updates: %v\n", *proposedUpdates)
308315
default:
309316
fmt.Printf("ERROR: unknown query: %s\n", queryFlags.flagset.Args()[0])
310317
os.Exit(1)

ledger/common/common.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ func Blake2b224Hash(data []byte) Blake2b224 {
110110
return Blake2b224(tmpHash.Sum(nil))
111111
}
112112

113+
// GenesisHash is a type alias for the Blake2b-224 hash used for genesis keys
114+
type GenesisHash = Blake2b224
115+
113116
type Blake2b160 [Blake2b160Size]byte
114117

115118
func NewBlake2b160(data []byte) Blake2b160 {

protocol/localstatequery/queries.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121

2222
"github.com/blinklabs-io/gouroboros/cbor"
2323
"github.com/blinklabs-io/gouroboros/ledger"
24+
"github.com/blinklabs-io/gouroboros/ledger/common"
2425
)
2526

2627
// Query types
@@ -521,8 +522,7 @@ type CurrentProtocolParamsResult interface {
521522
any
522523
}
523524

524-
// TODO (#861)
525-
type ProposedProtocolParamsUpdatesResult any
525+
type ProposedProtocolParamsUpdatesResult map[common.GenesisHash]common.ProtocolParameterUpdate
526526

527527
type StakeDistributionResult struct {
528528
cbor.StructAsArray

0 commit comments

Comments
 (0)