Skip to content

Commit 6bc5afc

Browse files
chore: rename StakeCredential to Credential
Signed-off-by: goofy-liskov <[email protected]>
1 parent 928a938 commit 6bc5afc

File tree

9 files changed

+36
-36
lines changed

9 files changed

+36
-36
lines changed

ledger/allegra/rules_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ func TestUtxoValidateValueNotConservedUtxo(t *testing.T) {
568568
{
569569
Type: common.CertificateTypeStakeRegistration,
570570
Certificate: &common.StakeRegistrationCertificate{
571-
StakeRegistration: common.StakeCredential{},
571+
StakeRegistration: common.Credential{},
572572
},
573573
},
574574
}
@@ -595,7 +595,7 @@ func TestUtxoValidateValueNotConservedUtxo(t *testing.T) {
595595
{
596596
Type: common.CertificateTypeStakeRegistration,
597597
Certificate: &common.StakeDeregistrationCertificate{
598-
StakeDeregistration: common.StakeCredential{},
598+
StakeDeregistration: common.Credential{},
599599
},
600600
},
601601
}

ledger/alonzo/rules_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ func TestUtxoValidateValueNotConservedUtxo(t *testing.T) {
602602
{
603603
Type: common.CertificateTypeStakeRegistration,
604604
Certificate: &common.StakeRegistrationCertificate{
605-
StakeRegistration: common.StakeCredential{},
605+
StakeRegistration: common.Credential{},
606606
},
607607
},
608608
}
@@ -629,7 +629,7 @@ func TestUtxoValidateValueNotConservedUtxo(t *testing.T) {
629629
{
630630
Type: common.CertificateTypeStakeRegistration,
631631
Certificate: &common.StakeDeregistrationCertificate{
632-
StakeDeregistration: common.StakeCredential{},
632+
StakeDeregistration: common.Credential{},
633633
},
634634
},
635635
}

ledger/babbage/rules_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ func TestUtxoValidateValueNotConservedUtxo(t *testing.T) {
601601
{
602602
Type: common.CertificateTypeStakeRegistration,
603603
Certificate: &common.StakeRegistrationCertificate{
604-
StakeRegistration: common.StakeCredential{},
604+
StakeRegistration: common.Credential{},
605605
},
606606
},
607607
}
@@ -628,7 +628,7 @@ func TestUtxoValidateValueNotConservedUtxo(t *testing.T) {
628628
{
629629
Type: common.CertificateTypeStakeRegistration,
630630
Certificate: &common.StakeDeregistrationCertificate{
631-
StakeDeregistration: common.StakeCredential{},
631+
StakeDeregistration: common.Credential{},
632632
},
633633
},
634634
}

ledger/common/certs.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ type StakeRegistrationCertificate struct {
160160
cbor.StructAsArray
161161
cbor.DecodeStoreCbor
162162
CertType uint
163-
StakeRegistration StakeCredential
163+
StakeRegistration Credential
164164
}
165165

166166
func (c StakeRegistrationCertificate) isCertificate() {}
@@ -181,7 +181,7 @@ type StakeDeregistrationCertificate struct {
181181
cbor.StructAsArray
182182
cbor.DecodeStoreCbor
183183
CertType uint
184-
StakeDeregistration StakeCredential
184+
StakeDeregistration Credential
185185
}
186186

187187
func (c StakeDeregistrationCertificate) isCertificate() {}
@@ -202,7 +202,7 @@ type StakeDelegationCertificate struct {
202202
cbor.StructAsArray
203203
cbor.DecodeStoreCbor
204204
CertType uint
205-
StakeCredential *StakeCredential
205+
StakeCredential *Credential
206206
PoolKeyHash PoolKeyHash
207207
}
208208

@@ -435,7 +435,7 @@ const (
435435

436436
type MoveInstantaneousRewardsCertificateReward struct {
437437
Source uint
438-
Rewards map[*StakeCredential]uint64
438+
Rewards map[*Credential]uint64
439439
OtherPot uint64
440440
}
441441

@@ -446,7 +446,7 @@ func (r *MoveInstantaneousRewardsCertificateReward) UnmarshalCBOR(
446446
tmpMapData := struct {
447447
cbor.StructAsArray
448448
Source uint
449-
Rewards map[*StakeCredential]uint64
449+
Rewards map[*Credential]uint64
450450
}{}
451451
if _, err := cbor.Decode(data, &tmpMapData); err == nil {
452452
r.Rewards = tmpMapData.Rewards
@@ -512,7 +512,7 @@ type RegistrationCertificate struct {
512512
cbor.StructAsArray
513513
cbor.DecodeStoreCbor
514514
CertType uint
515-
StakeCredential StakeCredential
515+
StakeCredential Credential
516516
Amount int64
517517
}
518518

@@ -533,7 +533,7 @@ type DeregistrationCertificate struct {
533533
cbor.StructAsArray
534534
cbor.DecodeStoreCbor
535535
CertType uint
536-
StakeCredential StakeCredential
536+
StakeCredential Credential
537537
Amount int64
538538
}
539539

@@ -554,7 +554,7 @@ type VoteDelegationCertificate struct {
554554
cbor.StructAsArray
555555
cbor.DecodeStoreCbor
556556
CertType uint
557-
StakeCredential StakeCredential
557+
StakeCredential Credential
558558
Drep Drep
559559
}
560560

@@ -575,7 +575,7 @@ type StakeVoteDelegationCertificate struct {
575575
cbor.StructAsArray
576576
cbor.DecodeStoreCbor
577577
CertType uint
578-
StakeCredential StakeCredential
578+
StakeCredential Credential
579579
PoolKeyHash []byte
580580
Drep Drep
581581
}
@@ -597,7 +597,7 @@ type StakeRegistrationDelegationCertificate struct {
597597
cbor.StructAsArray
598598
cbor.DecodeStoreCbor
599599
CertType uint
600-
StakeCredential StakeCredential
600+
StakeCredential Credential
601601
PoolKeyHash []byte
602602
Amount int64
603603
}
@@ -619,7 +619,7 @@ type VoteRegistrationDelegationCertificate struct {
619619
cbor.StructAsArray
620620
cbor.DecodeStoreCbor
621621
CertType uint
622-
StakeCredential StakeCredential
622+
StakeCredential Credential
623623
Drep Drep
624624
Amount int64
625625
}
@@ -641,7 +641,7 @@ type StakeVoteRegistrationDelegationCertificate struct {
641641
cbor.StructAsArray
642642
cbor.DecodeStoreCbor
643643
CertType uint
644-
StakeCredential StakeCredential
644+
StakeCredential Credential
645645
PoolKeyHash []byte
646646
Drep Drep
647647
Amount int64
@@ -664,8 +664,8 @@ type AuthCommitteeHotCertificate struct {
664664
cbor.StructAsArray
665665
cbor.DecodeStoreCbor
666666
CertType uint
667-
ColdCredential StakeCredential
668-
HostCredential StakeCredential
667+
ColdCredential Credential
668+
HostCredential Credential
669669
}
670670

671671
func (c AuthCommitteeHotCertificate) isCertificate() {}
@@ -685,7 +685,7 @@ type ResignCommitteeColdCertificate struct {
685685
cbor.StructAsArray
686686
cbor.DecodeStoreCbor
687687
CertType uint
688-
ColdCredential StakeCredential
688+
ColdCredential Credential
689689
Anchor *GovAnchor
690690
}
691691

@@ -706,7 +706,7 @@ type RegistrationDrepCertificate struct {
706706
cbor.StructAsArray
707707
cbor.DecodeStoreCbor
708708
CertType uint
709-
DrepCredential StakeCredential
709+
DrepCredential Credential
710710
Amount int64
711711
Anchor *GovAnchor
712712
}
@@ -728,7 +728,7 @@ type DeregistrationDrepCertificate struct {
728728
cbor.StructAsArray
729729
cbor.DecodeStoreCbor
730730
CertType uint
731-
DrepCredential StakeCredential
731+
DrepCredential Credential
732732
Amount int64
733733
}
734734

@@ -749,7 +749,7 @@ type UpdateDrepCertificate struct {
749749
cbor.StructAsArray
750750
cbor.DecodeStoreCbor
751751
CertType uint
752-
DrepCredential StakeCredential
752+
DrepCredential Credential
753753
Anchor *GovAnchor
754754
}
755755

ledger/common/credentials.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ const (
2727
StakeCredentialTypeScriptHash = 1
2828
)
2929

30-
type StakeCredential struct {
30+
type Credential struct {
3131
cbor.StructAsArray
3232
cbor.DecodeStoreCbor
3333
CredType uint
3434
Credential []byte
3535
}
3636

37-
func (c *StakeCredential) UnmarshalCBOR(data []byte) error {
37+
func (c *Credential) UnmarshalCBOR(data []byte) error {
3838
return c.UnmarshalCbor(data, c)
3939
}
4040

41-
func (c *StakeCredential) Hash() Blake2b224 {
41+
func (c *Credential) Hash() Blake2b224 {
4242
hash, err := blake2b.New(28, nil)
4343
if err != nil {
4444
panic(
@@ -54,7 +54,7 @@ func (c *StakeCredential) Hash() Blake2b224 {
5454
return Blake2b224(hash.Sum(nil))
5555
}
5656

57-
func (c *StakeCredential) Utxorpc() *utxorpc.StakeCredential {
57+
func (c *Credential) Utxorpc() *utxorpc.StakeCredential {
5858
ret := &utxorpc.StakeCredential{}
5959
switch c.CredType {
6060
case StakeCredentialTypeAddrKeyHash:

ledger/common/gov.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ type UpdateCommitteeGovAction struct {
171171
cbor.StructAsArray
172172
Type uint
173173
ActionId *GovActionId
174-
Credentials []StakeCredential
175-
CredEpochs map[*StakeCredential]uint
174+
Credentials []Credential
175+
CredEpochs map[*Credential]uint
176176
Unknown cbor.Rat
177177
}
178178

ledger/conway/rules_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ func TestUtxoValidateValueNotConservedUtxo(t *testing.T) {
601601
{
602602
Type: common.CertificateTypeStakeRegistration,
603603
Certificate: &common.StakeRegistrationCertificate{
604-
StakeRegistration: common.StakeCredential{},
604+
StakeRegistration: common.Credential{},
605605
},
606606
},
607607
}
@@ -628,7 +628,7 @@ func TestUtxoValidateValueNotConservedUtxo(t *testing.T) {
628628
{
629629
Type: common.CertificateTypeStakeRegistration,
630630
Certificate: &common.StakeDeregistrationCertificate{
631-
StakeDeregistration: common.StakeCredential{},
631+
StakeDeregistration: common.Credential{},
632632
},
633633
},
634634
}

ledger/mary/rules_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ func TestUtxoValidateValueNotConservedUtxo(t *testing.T) {
587587
{
588588
Type: common.CertificateTypeStakeRegistration,
589589
Certificate: &common.StakeRegistrationCertificate{
590-
StakeRegistration: common.StakeCredential{},
590+
StakeRegistration: common.Credential{},
591591
},
592592
},
593593
}
@@ -614,7 +614,7 @@ func TestUtxoValidateValueNotConservedUtxo(t *testing.T) {
614614
{
615615
Type: common.CertificateTypeStakeRegistration,
616616
Certificate: &common.StakeDeregistrationCertificate{
617-
StakeDeregistration: common.StakeCredential{},
617+
StakeDeregistration: common.Credential{},
618618
},
619619
},
620620
}

ledger/shelley/rules_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ func TestUtxoValidateValueNotConservedUtxo(t *testing.T) {
553553
{
554554
Type: common.CertificateTypeStakeRegistration,
555555
Certificate: &common.StakeRegistrationCertificate{
556-
StakeRegistration: common.StakeCredential{},
556+
StakeRegistration: common.Credential{},
557557
},
558558
},
559559
}
@@ -580,7 +580,7 @@ func TestUtxoValidateValueNotConservedUtxo(t *testing.T) {
580580
{
581581
Type: common.CertificateTypeStakeRegistration,
582582
Certificate: &common.StakeDeregistrationCertificate{
583-
StakeDeregistration: common.StakeCredential{},
583+
StakeDeregistration: common.Credential{},
584584
},
585585
},
586586
}

0 commit comments

Comments
 (0)