File tree Expand file tree Collapse file tree 8 files changed +49
-0
lines changed Expand file tree Collapse file tree 8 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ func (b *AllegraBlock) Hash() string {
68
68
return b .Header .Hash ()
69
69
}
70
70
71
+ func (b * AllegraBlock ) PrevHash () string {
72
+ return b .Header .PrevHash ()
73
+ }
74
+
71
75
func (b * AllegraBlock ) BlockNumber () uint64 {
72
76
return b .Header .BlockNumber ()
73
77
}
Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ func (b *AlonzoBlock) Hash() string {
71
71
return b .Header .Hash ()
72
72
}
73
73
74
+ func (b * AlonzoBlock ) PrevHash () string {
75
+ return b .Header .PrevHash ()
76
+ }
77
+
74
78
func (b * AlonzoBlock ) BlockNumber () uint64 {
75
79
return b .Header .BlockNumber ()
76
80
}
Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ func (b *BabbageBlock) Hash() string {
72
72
return b .Header .Hash ()
73
73
}
74
74
75
+ func (b * BabbageBlock ) PrevHash () string {
76
+ return b .Header .PrevHash ()
77
+ }
78
+
75
79
func (b * BabbageBlock ) BlockNumber () uint64 {
76
80
return b .Header .BlockNumber ()
77
81
}
@@ -174,6 +178,10 @@ func (h *BabbageBlockHeader) Hash() string {
174
178
return h .hash
175
179
}
176
180
181
+ func (h * BabbageBlockHeader ) PrevHash () string {
182
+ return h .Body .PrevHash .String ()
183
+ }
184
+
177
185
func (h * BabbageBlockHeader ) BlockNumber () uint64 {
178
186
return h .Body .BlockNumber
179
187
}
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ type Block interface {
29
29
30
30
type BlockHeader interface {
31
31
Hash () string
32
+ PrevHash () string
32
33
BlockNumber () uint64
33
34
SlotNumber () uint64
34
35
IssuerVkey () IssuerVkey
Original file line number Diff line number Diff line change @@ -101,6 +101,10 @@ func (h *ByronMainBlockHeader) Hash() string {
101
101
return h .hash
102
102
}
103
103
104
+ func (h * ByronMainBlockHeader ) PrevHash () string {
105
+ return h .PrevBlock .String ()
106
+ }
107
+
104
108
func (h * ByronMainBlockHeader ) BlockNumber () uint64 {
105
109
// Byron blocks don't store the block number in the block
106
110
return 0
@@ -525,6 +529,10 @@ func (h *ByronEpochBoundaryBlockHeader) Hash() string {
525
529
return h .hash
526
530
}
527
531
532
+ func (h * ByronEpochBoundaryBlockHeader ) PrevHash () string {
533
+ return h .PrevBlock .String ()
534
+ }
535
+
528
536
func (h * ByronEpochBoundaryBlockHeader ) BlockNumber () uint64 {
529
537
// Byron blocks don't store the block number in the block
530
538
return 0
@@ -569,6 +577,10 @@ func (b *ByronMainBlock) Hash() string {
569
577
return b .Header .Hash ()
570
578
}
571
579
580
+ func (b * ByronMainBlock ) PrevHash () string {
581
+ return b .Header .PrevHash ()
582
+ }
583
+
572
584
func (b * ByronMainBlock ) BlockNumber () uint64 {
573
585
return b .Header .BlockNumber ()
574
586
}
@@ -623,6 +635,10 @@ func (b *ByronEpochBoundaryBlock) Hash() string {
623
635
return b .Header .Hash ()
624
636
}
625
637
638
+ func (b * ByronEpochBoundaryBlock ) PrevHash () string {
639
+ return b .Header .PrevHash ()
640
+ }
641
+
626
642
func (b * ByronEpochBoundaryBlock ) BlockNumber () uint64 {
627
643
return b .Header .BlockNumber ()
628
644
}
Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ func (b *ConwayBlock) Hash() string {
71
71
return b .Header .Hash ()
72
72
}
73
73
74
+ func (b * ConwayBlock ) PrevHash () string {
75
+ return b .Header .PrevHash ()
76
+ }
77
+
74
78
func (b * ConwayBlock ) BlockNumber () uint64 {
75
79
return b .Header .BlockNumber ()
76
80
}
Original file line number Diff line number Diff line change @@ -70,6 +70,10 @@ func (b *MaryBlock) Hash() string {
70
70
return b .Header .Hash ()
71
71
}
72
72
73
+ func (b * MaryBlock ) PrevHash () string {
74
+ return b .Header .PrevHash ()
75
+ }
76
+
73
77
func (b * MaryBlock ) BlockNumber () uint64 {
74
78
return b .Header .BlockNumber ()
75
79
}
Original file line number Diff line number Diff line change @@ -67,6 +67,10 @@ func (b *ShelleyBlock) Hash() string {
67
67
return b .Header .Hash ()
68
68
}
69
69
70
+ func (b * ShelleyBlock ) PrevHash () string {
71
+ return b .Header .PrevHash ()
72
+ }
73
+
70
74
func (b * ShelleyBlock ) BlockNumber () uint64 {
71
75
return b .Header .BlockNumber ()
72
76
}
@@ -158,6 +162,10 @@ func (h *ShelleyBlockHeader) Hash() string {
158
162
return h .hash
159
163
}
160
164
165
+ func (h * ShelleyBlockHeader ) PrevHash () string {
166
+ return h .Body .PrevHash .String ()
167
+ }
168
+
161
169
func (h * ShelleyBlockHeader ) BlockNumber () uint64 {
162
170
return h .Body .BlockNumber
163
171
}
You can’t perform that action at this time.
0 commit comments