diff --git a/lns.go b/lns.go index 089a732..886c55f 100644 --- a/lns.go +++ b/lns.go @@ -969,6 +969,13 @@ func IsReserved(nameHash primitives.Hash, height uint32, rules NameRules) bool { return covenant.IsReserved(nameHash, height, rules) } +// GetIsReserved is an alias for IsReserved. +// +// ok := lns.GetIsReserved(nameHash, height, rules) +func GetIsReserved(nameHash primitives.Hash, height uint32, rules NameRules) bool { + return IsReserved(nameHash, height, rules) +} + // IsLockedUp reports whether a name hash is locked at the given height. // // ok := lns.IsLockedUp(nameHash, height, rules) @@ -976,6 +983,13 @@ func IsLockedUp(nameHash primitives.Hash, height uint32, rules NameRules) bool { return covenant.IsLockedUp(nameHash, height, rules) } +// GetIsLockedUp is an alias for IsLockedUp. +// +// ok := lns.GetIsLockedUp(nameHash, height, rules) +func GetIsLockedUp(nameHash primitives.Hash, height uint32, rules NameRules) bool { + return IsLockedUp(nameHash, height, rules) +} + // GrindName searches for an available name that satisfies the current rollout // and reservation rules. // @@ -1546,11 +1560,21 @@ func (s *Service) IsReserved(nameHash primitives.Hash, height uint32, rules Name return covenant.IsReserved(nameHash, height, rules) } +// GetIsReserved is an alias for IsReserved. +func (s *Service) GetIsReserved(nameHash primitives.Hash, height uint32, rules NameRules) bool { + return s.IsReserved(nameHash, height, rules) +} + // IsLockedUp reports whether a name hash is locked at the given height. func (s *Service) IsLockedUp(nameHash primitives.Hash, height uint32, rules NameRules) bool { return covenant.IsLockedUp(nameHash, height, rules) } +// GetIsLockedUp is an alias for IsLockedUp. +func (s *Service) GetIsLockedUp(nameHash primitives.Hash, height uint32, rules NameRules) bool { + return s.IsLockedUp(nameHash, height, rules) +} + // GrindName searches for an available name that satisfies the current rollout // and reservation rules. func (s *Service) GrindName(size int, height uint32, rules NameRules) (string, error) { diff --git a/lns_package_test.go b/lns_package_test.go index 154f194..bae7583 100644 --- a/lns_package_test.go +++ b/lns_package_test.go @@ -703,6 +703,10 @@ func TestPackageRolloutHelpers(t *testing.T) { t.Fatal("IsReserved should report reserved hashes before the claim period") } + if !GetIsReserved(hash, 99, rules) { + t.Fatal("GetIsReserved should alias IsReserved") + } + rootHash, err := covenant.HashString("nec") if err != nil { t.Fatalf("HashString returned error: %v", err) @@ -711,6 +715,10 @@ func TestPackageRolloutHelpers(t *testing.T) { if !IsLockedUp(rootHash, 100, rules) { t.Fatal("IsLockedUp should keep root hashes locked after the claim period") } + + if !GetIsLockedUp(rootHash, 100, rules) { + t.Fatal("GetIsLockedUp should alias IsLockedUp") + } } func TestPackageCatalogLookupNormalization(t *testing.T) { diff --git a/lns_test.go b/lns_test.go index d58c1e6..fc79c5f 100644 --- a/lns_test.go +++ b/lns_test.go @@ -721,6 +721,10 @@ func TestServiceRolloutHelpers(t *testing.T) { t.Fatal("IsReserved should report reserved hashes before the claim period") } + if !svc.GetIsReserved(reservedHash, 99, rules) { + t.Fatal("GetIsReserved should alias IsReserved") + } + rootHash, err := covenant.HashString("nec") if err != nil { t.Fatalf("HashString returned error: %v", err) @@ -729,6 +733,10 @@ func TestServiceRolloutHelpers(t *testing.T) { if !svc.IsLockedUp(rootHash, 100, rules) { t.Fatal("IsLockedUp should keep root hashes locked after the claim period") } + + if !svc.GetIsLockedUp(rootHash, 100, rules) { + t.Fatal("GetIsLockedUp should alias IsLockedUp") + } } func TestServiceGrindAndCountHelpers(t *testing.T) {