diff --git a/internal/test/ledger/ledger.go b/internal/test/ledger/ledger.go index d4f474d3..dff9a789 100644 --- a/internal/test/ledger/ledger.go +++ b/internal/test/ledger/ledger.go @@ -51,7 +51,11 @@ func (ls MockLedgerState) StakeRegistration( ) ([]common.StakeRegistrationCertificate, error) { ret := []common.StakeRegistrationCertificate{} for _, cert := range ls.MockStakeRegistration { - if string(cert.StakeRegistration.Credential) == string(stakingKey) { + if string( + common.Blake2b224(cert.StakeRegistration.Credential).Bytes(), + ) == string( + stakingKey, + ) { ret = append(ret, cert) } } diff --git a/ledger/common/credentials.go b/ledger/common/credentials.go index 72425b4f..67a9a7ab 100644 --- a/ledger/common/credentials.go +++ b/ledger/common/credentials.go @@ -27,11 +27,13 @@ const ( CredentialTypeScriptHash = 1 ) +type CredentialHash Blake2b224 + type Credential struct { cbor.StructAsArray cbor.DecodeStoreCbor CredType uint - Credential []byte + Credential CredentialHash } func (c *Credential) UnmarshalCBOR(data []byte) error {