Skip to content

Commit 7150ab9

Browse files
authored
refactor: remove DetermineBlockData (#1143)
It never worked that well, and we don't use it anywhere Fixes #1022 Signed-off-by: Aurora Gaffney <[email protected]>
1 parent 44b7e7d commit 7150ab9

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

ledger/block.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package ledger
1616

1717
import (
18-
"errors"
1918
"fmt"
2019

2120
"github.com/blinklabs-io/gouroboros/ledger/common"
@@ -71,31 +70,3 @@ func NewBlockHeaderFromCbor(blockType uint, data []byte) (BlockHeader, error) {
7170
return nil, fmt.Errorf("unknown node-to-node block type: %d", blockType)
7271
}
7372
}
74-
75-
func DetermineBlockType(data []byte) (uint, error) {
76-
if _, err := NewByronEpochBoundaryBlockFromCbor(data); err == nil {
77-
return BlockTypeByronEbb, nil
78-
}
79-
if _, err := NewByronMainBlockFromCbor(data); err == nil {
80-
return BlockTypeByronMain, nil
81-
}
82-
if _, err := NewShelleyBlockFromCbor(data); err == nil {
83-
return BlockTypeShelley, nil
84-
}
85-
if _, err := NewAllegraBlockFromCbor(data); err == nil {
86-
return BlockTypeAllegra, nil
87-
}
88-
if _, err := NewMaryBlockFromCbor(data); err == nil {
89-
return BlockTypeMary, nil
90-
}
91-
if _, err := NewAlonzoBlockFromCbor(data); err == nil {
92-
return BlockTypeAlonzo, nil
93-
}
94-
if _, err := NewBabbageBlockFromCbor(data); err == nil {
95-
return BlockTypeBabbage, nil
96-
}
97-
if _, err := NewConwayBlockFromCbor(data); err == nil {
98-
return BlockTypeConway, nil
99-
}
100-
return 0, errors.New("unknown block type")
101-
}

0 commit comments

Comments
 (0)