diff --git a/internal/test/ledger/ledger.go b/internal/test/ledger/ledger.go index 6e4e3ead..8c9f7430 100644 --- a/internal/test/ledger/ledger.go +++ b/internal/test/ledger/ledger.go @@ -64,13 +64,13 @@ func (ls MockLedgerState) StakeRegistration( } func (ls MockLedgerState) PoolCurrentState( - poolKeyHash []byte, + poolKeyHash common.PoolKeyHash, ) (*common.PoolRegistrationCertificate, *uint64, error) { for _, cert := range ls.MockPoolRegistration { if string( common.Blake2b224(cert.Operator).Bytes(), ) == string( - poolKeyHash, + common.Blake2b224(poolKeyHash).Bytes(), ) { // pretend latest registration is current; no retirement support in mock c := cert diff --git a/ledger/alonzo/rules.go b/ledger/alonzo/rules.go index 5419f3d1..37ee6162 100644 --- a/ledger/alonzo/rules.go +++ b/ledger/alonzo/rules.go @@ -289,7 +289,7 @@ func UtxoValidateValueNotConservedUtxo( for _, cert := range tx.Certificates() { switch tmpCert := cert.(type) { case *common.PoolRegistrationCertificate: - reg, _, err := ls.PoolCurrentState(common.Blake2b224(tmpCert.Operator).Bytes()) + reg, _, err := ls.PoolCurrentState(common.Blake2b224(tmpCert.Operator)) if err != nil { return err } diff --git a/ledger/babbage/rules.go b/ledger/babbage/rules.go index 2aa6e7ac..5071a484 100644 --- a/ledger/babbage/rules.go +++ b/ledger/babbage/rules.go @@ -275,7 +275,7 @@ func UtxoValidateValueNotConservedUtxo( for _, cert := range tx.Certificates() { switch tmpCert := cert.(type) { case *common.PoolRegistrationCertificate: - reg, _, err := ls.PoolCurrentState(common.Blake2b224(tmpCert.Operator).Bytes()) + reg, _, err := ls.PoolCurrentState(common.Blake2b224(tmpCert.Operator)) if err != nil { return err } diff --git a/ledger/common/state.go b/ledger/common/state.go index ec562d6b..eb96cd47 100644 --- a/ledger/common/state.go +++ b/ledger/common/state.go @@ -35,7 +35,7 @@ type PoolState interface { // PoolCurrentState returns the latest active registration certificate for the given pool key hash. // It also returns the epoch of a pending retirement certificate, if one exists. // If the pool is not registered, the registration certificate will be nil. - PoolCurrentState([]byte) (*PoolRegistrationCertificate, *uint64, error) + PoolCurrentState(PoolKeyHash) (*PoolRegistrationCertificate, *uint64, error) } // LedgerState defines the interface for querying the ledger diff --git a/ledger/conway/rules.go b/ledger/conway/rules.go index cfce8a33..37870808 100644 --- a/ledger/conway/rules.go +++ b/ledger/conway/rules.go @@ -272,7 +272,7 @@ func UtxoValidateValueNotConservedUtxo( for _, cert := range tx.Certificates() { switch tmpCert := cert.(type) { case *common.PoolRegistrationCertificate: - reg, _, err := ls.PoolCurrentState(common.Blake2b224(tmpCert.Operator).Bytes()) + reg, _, err := ls.PoolCurrentState(common.Blake2b224(tmpCert.Operator)) if err != nil { return err } diff --git a/ledger/mary/rules.go b/ledger/mary/rules.go index d7796aed..3d6520fd 100644 --- a/ledger/mary/rules.go +++ b/ledger/mary/rules.go @@ -175,7 +175,7 @@ func UtxoValidateValueNotConservedUtxo( for _, cert := range tx.Certificates() { switch tmpCert := cert.(type) { case *common.PoolRegistrationCertificate: - reg, _, err := ls.PoolCurrentState(common.Blake2b224(tmpCert.Operator).Bytes()) + reg, _, err := ls.PoolCurrentState(common.Blake2b224(tmpCert.Operator)) if err != nil { return err } diff --git a/ledger/shelley/rules.go b/ledger/shelley/rules.go index e0263d37..62ad73f6 100644 --- a/ledger/shelley/rules.go +++ b/ledger/shelley/rules.go @@ -196,7 +196,7 @@ func UtxoValidateValueNotConservedUtxo( for _, cert := range tx.Certificates() { switch tmpCert := cert.(type) { case *common.PoolRegistrationCertificate: - reg, _, err := ls.PoolCurrentState(common.Blake2b224(tmpCert.Operator).Bytes()) + reg, _, err := ls.PoolCurrentState(common.Blake2b224(tmpCert.Operator)) if err != nil { return err }