Skip to content

Commit

Permalink
fix: inconsistency in constants use
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemmsilva committed Feb 6, 2024
1 parent 8fa9774 commit 943e898
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/legacymigration/legacymigration.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,12 @@ func validBundleFromBytes(data []byte) (bundle.Bundle, error) {
}

// ------- taken from legacy hornet
const (
hashTrytesSize = consts.HashTrytesSize
tagTrytesSize = consts.TagTrinarySize / consts.TritsPerTryte
)

// legacyAddressBytesFromTrytes returns the binary representation of the given address trytes.
// It panics when trytes hash invalid length.
func legacyAddressBytesFromTrytes(trytes trinary.Trytes) []byte {
if len(trytes) != hashTrytesSize && len(trytes) != consts.AddressWithChecksumTrytesSize {
if len(trytes) != consts.HashTrytesSize && len(trytes) != consts.AddressWithChecksumTrytesSize {
panic("invalid address length")
}
return t5b1.EncodeTrytes(trytes[:hashTrytesSize])
return t5b1.EncodeTrytes(trytes[:consts.HashTrytesSize])
}

0 comments on commit 943e898

Please sign in to comment.