refactor(lns): simplify canonical name helpers

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-02 13:10:14 +00:00
parent fbb93f26a3
commit a07c951f4d
2 changed files with 3 additions and 2 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.cache/

4
lns.go
View file

@ -107,7 +107,7 @@ func resolveCanonicalName(method string, name any) (primitives.Hash, error) {
return primitives.Hash{}, core.E(method, "invalid name", nil)
}
return covenant.HashBinary([]byte(normalized))
return covenant.HashString(normalized)
default:
return primitives.Hash{}, core.E(method, "invalid name type", nil)
}
@ -119,7 +119,7 @@ func verifyCanonicalName(name any) bool {
return false
}
return covenant.VerifyBinary([]byte(normalized))
return covenant.VerifyString(normalized)
}
// Resolve returns the canonical hash for a validated .lthn name.