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
6 changes: 5 additions & 1 deletion internal/test/ledger/ledger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably avoid this whole dance with []byte(cert.StakeRegistration.Credential)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept this because it's what's being done in the other test.

) == string(
stakingKey,
) {
ret = append(ret, cert)
}
}
Expand Down
4 changes: 3 additions & 1 deletion ledger/common/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading