feat(lns): keep lookup helpers on direct paths
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
d7867068ac
commit
7884eb636f
2 changed files with 40 additions and 18 deletions
6
go.sum
6
go.sum
|
|
@ -2,19 +2,13 @@ dappco.re/go/core v0.8.0-alpha.1 h1:gj7+Scv+L63Z7wMxbJYHhaRFkHJo2u4MMPuUSv/Dhtk=
|
|||
dappco.re/go/core v0.8.0-alpha.1/go.mod h1:f2/tBZ3+3IqDrg2F5F598llv0nmb/4gJVCFzM5geE4A=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4=
|
||||
golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA=
|
||||
golang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y=
|
||||
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
|
||||
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||
golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A=
|
||||
golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
|
|
|||
52
lns.go
52
lns.go
|
|
@ -300,14 +300,22 @@ func (s *Service) GetReservedName(name any) (covenant.ReservedName, bool) {
|
|||
//
|
||||
// item, ok := svc.GetReservedString("reserved")
|
||||
func (s *Service) GetReservedString(name string) (covenant.ReservedName, bool) {
|
||||
return s.GetReservedName(name)
|
||||
if item, ok := covenant.GetReservedString(name); ok {
|
||||
return item, true
|
||||
}
|
||||
|
||||
return s.GetReserved(name)
|
||||
}
|
||||
|
||||
// GetReservedBinary looks up a reserved name supplied as bytes.
|
||||
//
|
||||
// item, ok := svc.GetReservedBinary([]byte("reserved"))
|
||||
func (s *Service) GetReservedBinary(name []byte) (covenant.ReservedName, bool) {
|
||||
return s.GetReservedName(name)
|
||||
if item, ok := covenant.GetReservedBinary(name); ok {
|
||||
return item, true
|
||||
}
|
||||
|
||||
return s.GetReserved(name)
|
||||
}
|
||||
|
||||
// GetReservedByString is an alias for GetReservedString.
|
||||
|
|
@ -339,16 +347,22 @@ func (s *Service) HasReserved(name any) bool {
|
|||
//
|
||||
// ok := svc.HasReservedString("reserved")
|
||||
func (s *Service) HasReservedString(name string) bool {
|
||||
_, ok := s.GetReservedName(name)
|
||||
return ok
|
||||
if covenant.HasReservedString(name) {
|
||||
return true
|
||||
}
|
||||
|
||||
return s.HasReserved(name)
|
||||
}
|
||||
|
||||
// HasReservedBinary reports whether a reserved name supplied as bytes exists.
|
||||
//
|
||||
// ok := svc.HasReservedBinary([]byte("reserved"))
|
||||
func (s *Service) HasReservedBinary(name []byte) bool {
|
||||
_, ok := s.GetReservedName(name)
|
||||
return ok
|
||||
if covenant.HasReservedBinary(name) {
|
||||
return true
|
||||
}
|
||||
|
||||
return s.HasReserved(name)
|
||||
}
|
||||
|
||||
// HasReservedByString is an alias for HasReservedString.
|
||||
|
|
@ -463,14 +477,22 @@ func (s *Service) GetLockedName(name any) (covenant.LockedName, bool) {
|
|||
//
|
||||
// item, ok := svc.GetLockedString("nec")
|
||||
func (s *Service) GetLockedString(name string) (covenant.LockedName, bool) {
|
||||
return s.GetLockedName(name)
|
||||
if item, ok := covenant.GetLockedString(name); ok {
|
||||
return item, true
|
||||
}
|
||||
|
||||
return s.GetLocked(name)
|
||||
}
|
||||
|
||||
// GetLockedBinary looks up a locked name supplied as bytes.
|
||||
//
|
||||
// item, ok := svc.GetLockedBinary([]byte("nec"))
|
||||
func (s *Service) GetLockedBinary(name []byte) (covenant.LockedName, bool) {
|
||||
return s.GetLockedName(name)
|
||||
if item, ok := covenant.GetLockedBinary(name); ok {
|
||||
return item, true
|
||||
}
|
||||
|
||||
return s.GetLocked(name)
|
||||
}
|
||||
|
||||
// GetLockedByString is an alias for GetLockedString.
|
||||
|
|
@ -502,16 +524,22 @@ func (s *Service) HasLocked(name any) bool {
|
|||
//
|
||||
// ok := svc.HasLockedString("nec")
|
||||
func (s *Service) HasLockedString(name string) bool {
|
||||
_, ok := s.GetLockedName(name)
|
||||
return ok
|
||||
if covenant.HasLockedString(name) {
|
||||
return true
|
||||
}
|
||||
|
||||
return s.HasLocked(name)
|
||||
}
|
||||
|
||||
// HasLockedBinary reports whether a locked name supplied as bytes exists.
|
||||
//
|
||||
// ok := svc.HasLockedBinary([]byte("nec"))
|
||||
func (s *Service) HasLockedBinary(name []byte) bool {
|
||||
_, ok := s.GetLockedName(name)
|
||||
return ok
|
||||
if covenant.HasLockedBinary(name) {
|
||||
return true
|
||||
}
|
||||
|
||||
return s.HasLocked(name)
|
||||
}
|
||||
|
||||
// HasLockedByString is an alias for HasLockedString.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue