aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/api_test.go
diff options
context:
space:
mode:
authorJanos Guljas <janos@resenje.org>2017-12-19 06:07:48 +0800
committerJanos Guljas <janos@resenje.org>2017-12-19 06:07:48 +0800
commit0d6a735a72340130acd6b7e536dad5d8bee40d84 (patch)
tree0dbe9c9c1ca2cf130a790c9e6080e8515965dbf5 /swarm/api/api_test.go
parentc0a4d9e1e64a09a19484c8c12e24505d9bacbd57 (diff)
downloaddexon-0d6a735a72340130acd6b7e536dad5d8bee40d84.tar
dexon-0d6a735a72340130acd6b7e536dad5d8bee40d84.tar.gz
dexon-0d6a735a72340130acd6b7e536dad5d8bee40d84.tar.bz2
dexon-0d6a735a72340130acd6b7e536dad5d8bee40d84.tar.lz
dexon-0d6a735a72340130acd6b7e536dad5d8bee40d84.tar.xz
dexon-0d6a735a72340130acd6b7e536dad5d8bee40d84.tar.zst
dexon-0d6a735a72340130acd6b7e536dad5d8bee40d84.zip
swarm/api: implement NoResolverError with information about TLD
MultiResolver needs to provide information about TLD that has no resolver configured for.
Diffstat (limited to 'swarm/api/api_test.go')
-rw-r--r--swarm/api/api_test.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/swarm/api/api_test.go b/swarm/api/api_test.go
index 36cbdb83c..dbe7c1dac 100644
--- a/swarm/api/api_test.go
+++ b/swarm/api/api_test.go
@@ -259,7 +259,7 @@ func TestMultiResolver(t *testing.T) {
{
desc: "No resolvers, returns error",
r: NewMultiResolver(),
- err: errNoResolver,
+ err: NewNoResolverError(""),
},
{
desc: "One default resolver, returns resolved address",
@@ -332,6 +332,14 @@ func TestMultiResolver(t *testing.T) {
addr: testAddr,
result: testHash,
},
+ {
+ desc: "One TLD resolver, no default resolver, returns error for different TLD",
+ r: NewMultiResolver(
+ MultiResolverOptionWithResolver(ethResolve, "eth"),
+ ),
+ addr: testAddr,
+ err: NewNoResolverError("test"),
+ },
}
for _, x := range tests {
t.Run(x.desc, func(t *testing.T) {