From 943e898217c5aa9a7b775530c1b0aa3cc7982dba Mon Sep 17 00:00:00 2001 From: Jorge Silva Date: Tue, 6 Feb 2024 15:52:56 +0000 Subject: [PATCH] fix: inconsistency in constants use --- packages/legacymigration/legacymigration.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/legacymigration/legacymigration.go b/packages/legacymigration/legacymigration.go index 74878d32dd..3729f779a4 100644 --- a/packages/legacymigration/legacymigration.go +++ b/packages/legacymigration/legacymigration.go @@ -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]) }