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 {
6868 return b .Header .Hash ()
6969}
7070
71+ func (b * AllegraBlock ) PrevHash () string {
72+ return b .Header .PrevHash ()
73+ }
74+
7175func (b * AllegraBlock ) BlockNumber () uint64 {
7276 return b .Header .BlockNumber ()
7377}
Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ func (b *AlonzoBlock) Hash() string {
7171 return b .Header .Hash ()
7272}
7373
74+ func (b * AlonzoBlock ) PrevHash () string {
75+ return b .Header .PrevHash ()
76+ }
77+
7478func (b * AlonzoBlock ) BlockNumber () uint64 {
7579 return b .Header .BlockNumber ()
7680}
Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ func (b *BabbageBlock) Hash() string {
7272 return b .Header .Hash ()
7373}
7474
75+ func (b * BabbageBlock ) PrevHash () string {
76+ return b .Header .PrevHash ()
77+ }
78+
7579func (b * BabbageBlock ) BlockNumber () uint64 {
7680 return b .Header .BlockNumber ()
7781}
@@ -174,6 +178,10 @@ func (h *BabbageBlockHeader) Hash() string {
174178 return h .hash
175179}
176180
181+ func (h * BabbageBlockHeader ) PrevHash () string {
182+ return h .Body .PrevHash .String ()
183+ }
184+
177185func (h * BabbageBlockHeader ) BlockNumber () uint64 {
178186 return h .Body .BlockNumber
179187}
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ type Block interface {
2929
3030type BlockHeader interface {
3131 Hash () string
32+ PrevHash () string
3233 BlockNumber () uint64
3334 SlotNumber () uint64
3435 IssuerVkey () IssuerVkey
Original file line number Diff line number Diff line change @@ -101,6 +101,10 @@ func (h *ByronMainBlockHeader) Hash() string {
101101 return h .hash
102102}
103103
104+ func (h * ByronMainBlockHeader ) PrevHash () string {
105+ return h .PrevBlock .String ()
106+ }
107+
104108func (h * ByronMainBlockHeader ) BlockNumber () uint64 {
105109 // Byron blocks don't store the block number in the block
106110 return 0
@@ -525,6 +529,10 @@ func (h *ByronEpochBoundaryBlockHeader) Hash() string {
525529 return h .hash
526530}
527531
532+ func (h * ByronEpochBoundaryBlockHeader ) PrevHash () string {
533+ return h .PrevBlock .String ()
534+ }
535+
528536func (h * ByronEpochBoundaryBlockHeader ) BlockNumber () uint64 {
529537 // Byron blocks don't store the block number in the block
530538 return 0
@@ -569,6 +577,10 @@ func (b *ByronMainBlock) Hash() string {
569577 return b .Header .Hash ()
570578}
571579
580+ func (b * ByronMainBlock ) PrevHash () string {
581+ return b .Header .PrevHash ()
582+ }
583+
572584func (b * ByronMainBlock ) BlockNumber () uint64 {
573585 return b .Header .BlockNumber ()
574586}
@@ -623,6 +635,10 @@ func (b *ByronEpochBoundaryBlock) Hash() string {
623635 return b .Header .Hash ()
624636}
625637
638+ func (b * ByronEpochBoundaryBlock ) PrevHash () string {
639+ return b .Header .PrevHash ()
640+ }
641+
626642func (b * ByronEpochBoundaryBlock ) BlockNumber () uint64 {
627643 return b .Header .BlockNumber ()
628644}
Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ func (b *ConwayBlock) Hash() string {
7171 return b .Header .Hash ()
7272}
7373
74+ func (b * ConwayBlock ) PrevHash () string {
75+ return b .Header .PrevHash ()
76+ }
77+
7478func (b * ConwayBlock ) BlockNumber () uint64 {
7579 return b .Header .BlockNumber ()
7680}
Original file line number Diff line number Diff line change @@ -70,6 +70,10 @@ func (b *MaryBlock) Hash() string {
7070 return b .Header .Hash ()
7171}
7272
73+ func (b * MaryBlock ) PrevHash () string {
74+ return b .Header .PrevHash ()
75+ }
76+
7377func (b * MaryBlock ) BlockNumber () uint64 {
7478 return b .Header .BlockNumber ()
7579}
Original file line number Diff line number Diff line change @@ -67,6 +67,10 @@ func (b *ShelleyBlock) Hash() string {
6767 return b .Header .Hash ()
6868}
6969
70+ func (b * ShelleyBlock ) PrevHash () string {
71+ return b .Header .PrevHash ()
72+ }
73+
7074func (b * ShelleyBlock ) BlockNumber () uint64 {
7175 return b .Header .BlockNumber ()
7276}
@@ -158,6 +162,10 @@ func (h *ShelleyBlockHeader) Hash() string {
158162 return h .hash
159163}
160164
165+ func (h * ShelleyBlockHeader ) PrevHash () string {
166+ return h .Body .PrevHash .String ()
167+ }
168+
161169func (h * ShelleyBlockHeader ) BlockNumber () uint64 {
162170 return h .Body .BlockNumber
163171}
You can’t perform that action at this time.
0 commit comments