From f381558d4d7941b6f6b288b38bf0b2618458f7c9 Mon Sep 17 00:00:00 2001 From: gabe Date: Fri, 19 Apr 2024 13:42:10 -0700 Subject: [PATCH] tmp --- impl/internal/did/client_test.go | 16 ++++++++++++++++ impl/pkg/service/pkarr.go | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/impl/internal/did/client_test.go b/impl/internal/did/client_test.go index 42ceecd3..37cdcedd 100644 --- a/impl/internal/did/client_test.go +++ b/impl/internal/did/client_test.go @@ -5,6 +5,7 @@ import ( "time" "github.com/anacrolix/dht/v2/bep44" + "github.com/goccy/go-json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -42,6 +43,21 @@ func TestClient(t *testing.T) { t.Logf("time to put and get: %s", since) } +func TestGet(t *testing.T) { + client, err := NewGatewayClient("https://diddht-staging.tbd.engineering") + require.NoError(t, err) + require.NotNil(t, client) + + did, types, gateways, err := client.GetDIDDocument("did:dht:ijy37zs6sudo4d73h6c4pecbuaxzohontmtfuk3338fp3ogqm73y") + assert.NoError(t, err) + assert.NotEmpty(t, did) + assert.Empty(t, types) + assert.Empty(t, gateways) + + b, _ := json.Marshal(did) + println(string(b)) +} + func TestClientInvalidGateway(t *testing.T) { g, err := NewGatewayClient("\n") assert.Error(t, err) diff --git a/impl/pkg/service/pkarr.go b/impl/pkg/service/pkarr.go index 1b17ac68..0dcdadcd 100644 --- a/impl/pkg/service/pkarr.go +++ b/impl/pkg/service/pkarr.go @@ -281,7 +281,7 @@ func (s *PkarrService) republish() { defer cancel() if _, putErr := s.dht.Put(putCtx, record.BEP44()); putErr != nil { - logrus.WithContext(putCtx).WithError(putErr).Debugf("failed to republish record: %s", recordID) + logrus.WithContext(putCtx).WithError(putErr).Warnf("failed to republish record: %s", recordID) atomic.AddInt32(&batchErrCnt, 1) } else { atomic.AddInt32(&batchSuccessCnt, 1)