refactor(lns): simplify canonical name helpers
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
fbb93f26a3
commit
a07c951f4d
2 changed files with 3 additions and 2 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
.cache/
|
||||
4
lns.go
4
lns.go
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue