[#81] Add domain in the error message in NNS
DCO action / DCO (pull_request) Successful in 5m44s Details
Tests / Tests (1.21) (pull_request) Successful in 11m11s Details
Tests / Tests (1.22) (pull_request) Successful in 11m6s Details

Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
Ekaterina Lebedeva 2024-04-16 02:56:31 +03:00
parent 6eb492025b
commit c4a6f82953
2 changed files with 2 additions and 2 deletions

View File

@ -232,7 +232,7 @@ func IsAvailable(name string) bool {
return true return true
} }
if parentExpired(ctx, fragments) { if parentExpired(ctx, fragments) {
panic("parent does not exist or is expired") panic("parent of " + name + " does not exist or is expired")
} }
return storage.Get(ctx, append([]byte{prefixName}, getTokenKey([]byte(name))...)) == nil return storage.Get(ctx, append([]byte{prefixName}, getTokenKey([]byte(name))...)) == nil
} }

View File

@ -349,7 +349,7 @@ func TestNNSIsAvailable(t *testing.T) {
c.Invoke(t, false, "isAvailable", "domain.com") c.Invoke(t, false, "isAvailable", "domain.com")
c.Invoke(t, true, "isAvailable", "dom.domain.com") c.Invoke(t, true, "isAvailable", "dom.domain.com")
c.InvokeFail(t, "parent does not exist or is expired", "isAvailable", "dom.dom.domain.com") c.InvokeFail(t, "parent of dom.dom.domain.com does not exist or is expired", "isAvailable", "dom.dom.domain.com")
c1.Invoke(t, true, "register", c1.Invoke(t, true, "register",
"dom.domain.com", acc.ScriptHash(), "dom.domain.com", acc.ScriptHash(),