Skip to content

Commit

Permalink
renames
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe committed Apr 9, 2024
1 parent 636ce74 commit 7d89e99
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions impl/cmd/cli/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ var identityAddCmd = &cobra.Command{
Answer: rrds,
}
// generate put request
putReq, err := dht.CreatePKARRPublishRequest(privKey, msg)
putReq, err := dht.CreatePkarrPublishRequest(privKey, msg)
if err != nil {
logrus.WithError(err).Error("failed to create put request")
return err
Expand Down Expand Up @@ -170,7 +170,7 @@ var identityGetCmd = &cobra.Command{
return err
}

msg, err := dht.ParsePKARRGetResponse(*gotResp)
msg, err := dht.ParsePkarrGetResponse(*gotResp)
if err != nil {
logrus.WithError(err).Error("failed to parse get response")
return err
Expand Down
2 changes: 1 addition & 1 deletion impl/concurrencytest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func generateDIDPutRequest() (string, []byte, error) {
return "", nil, err
}

bep44Put, err := dht.CreatePKARRPublishRequest(sk, *packet)
bep44Put, err := dht.CreatePkarrPublishRequest(sk, *packet)
if err != nil {
return "", nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion impl/integrationtest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func generateDIDPutRequest() (string, []byte, error) {
return "", nil, err
}

bep44Put, err := dht.CreatePKARRPublishRequest(sk, *packet)
bep44Put, err := dht.CreatePkarrPublishRequest(sk, *packet)
if err != nil {
return "", nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion impl/internal/did/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestClient(t *testing.T) {
assert.NoError(t, err)
assert.NotEmpty(t, packet)

bep44Put, err := dht.CreatePKARRPublishRequest(sk, *packet)
bep44Put, err := dht.CreatePkarrPublishRequest(sk, *packet)
assert.NoError(t, err)
assert.NotEmpty(t, bep44Put)

Expand Down
8 changes: 4 additions & 4 deletions impl/pkg/dht/pkarr.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/miekg/dns"
)

// CreatePKARRPublishRequest creates a put request for the given records. Requires a public/private keypair and the records to put.
// CreatePkarrPublishRequest creates a put request for the given records. Requires a public/private keypair and the records to put.
// The records are expected to be a DNS message packet, such as:
//
// dns.Msg{
Expand All @@ -33,7 +33,7 @@ import (
// },
// }
// }
func CreatePKARRPublishRequest(privateKey ed25519.PrivateKey, msg dns.Msg) (*bep44.Put, error) {
func CreatePkarrPublishRequest(privateKey ed25519.PrivateKey, msg dns.Msg) (*bep44.Put, error) {
packed, err := msg.Pack()
if err != nil {
return nil, util.LoggingErrorMsg(err, "failed to pack records")
Expand All @@ -48,9 +48,9 @@ func CreatePKARRPublishRequest(privateKey ed25519.PrivateKey, msg dns.Msg) (*bep
return put, nil
}

// ParsePKARRGetResponse parses the response from a get request.
// ParsePkarrGetResponse parses the response from a get request.
// The response is expected to be a slice of DNS resource records.
func ParsePKARRGetResponse(response getput.GetResult) (*dns.Msg, error) {
func ParsePkarrGetResponse(response getput.GetResult) (*dns.Msg, error) {
var payload string
if err := bencode.Unmarshal(response.V, &payload); err != nil {
return nil, util.LoggingErrorMsg(err, "failed to unmarshal payload value")
Expand Down
8 changes: 4 additions & 4 deletions impl/pkg/dht/pkarr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestGetPutPKARRDHT(t *testing.T) {
},
Answer: []dns.RR{&txtRecord},
}
put, err := CreatePKARRPublishRequest(privKey, msg)
put, err := CreatePkarrPublishRequest(privKey, msg)
require.NoError(t, err)

id, err := d.Put(context.Background(), *put)
Expand All @@ -52,7 +52,7 @@ func TestGetPutPKARRDHT(t *testing.T) {
require.NoError(t, err)
require.NotEmpty(t, got)

gotMsg, err := ParsePKARRGetResponse(*got)
gotMsg, err := ParsePkarrGetResponse(*got)
require.NoError(t, err)
require.NotEmpty(t, gotMsg.Answer)

Expand Down Expand Up @@ -101,7 +101,7 @@ func TestGetPutDIDDHT(t *testing.T) {
didDocPacket, err := didID.ToDNSPacket(*doc, nil, nil)
require.NoError(t, err)

putReq, err := CreatePKARRPublishRequest(privKey, *didDocPacket)
putReq, err := CreatePkarrPublishRequest(privKey, *didDocPacket)
require.NoError(t, err)

gotID, err := dht.Put(context.Background(), *putReq)
Expand All @@ -112,7 +112,7 @@ func TestGetPutDIDDHT(t *testing.T) {
require.NoError(t, err)
require.NotEmpty(t, got)

gotMsg, err := ParsePKARRGetResponse(*got)
gotMsg, err := ParsePkarrGetResponse(*got)
require.NoError(t, err)
require.NotEmpty(t, gotMsg.Answer)

Expand Down
2 changes: 1 addition & 1 deletion impl/pkg/pkarr/record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestNewRecord(t *testing.T) {
assert.NoError(t, err)
assert.NotEmpty(t, packet)

putMsg, err := dht.CreatePKARRPublishRequest(sk, *packet)
putMsg, err := dht.CreatePkarrPublishRequest(sk, *packet)
require.NoError(t, err)
require.NotEmpty(t, putMsg)

Expand Down
2 changes: 1 addition & 1 deletion impl/pkg/server/pkarr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func generateDIDPutRequest(t *testing.T) (string, []byte) {
assert.NoError(t, err)
assert.NotEmpty(t, packet)

bep44Put, err := dht.CreatePKARRPublishRequest(sk, *packet)
bep44Put, err := dht.CreatePkarrPublishRequest(sk, *packet)
assert.NoError(t, err)
assert.NotEmpty(t, bep44Put)

Expand Down
8 changes: 4 additions & 4 deletions impl/pkg/service/pkarr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestPkarrService(t *testing.T) {
assert.NoError(t, err)
assert.NotEmpty(t, packet)

putMsg, err := dht.CreatePKARRPublishRequest(sk, *packet)
putMsg, err := dht.CreatePkarrPublishRequest(sk, *packet)
require.NoError(t, err)
require.NotEmpty(t, putMsg)

Expand All @@ -77,7 +77,7 @@ func TestPkarrService(t *testing.T) {
assert.NoError(t, err)
assert.NotEmpty(t, packet)

putMsg, err := dht.CreatePKARRPublishRequest(sk, *packet)
putMsg, err := dht.CreatePkarrPublishRequest(sk, *packet)
require.NoError(t, err)
require.NotEmpty(t, putMsg)

Expand Down Expand Up @@ -105,7 +105,7 @@ func TestPkarrService(t *testing.T) {
require.NoError(t, err)
require.NotEmpty(t, packet)

putMsg, err := dht.CreatePKARRPublishRequest(sk, *packet)
putMsg, err := dht.CreatePkarrPublishRequest(sk, *packet)
require.NoError(t, err)
require.NotEmpty(t, putMsg)

Expand Down Expand Up @@ -138,7 +138,7 @@ func TestDHT(t *testing.T) {
packet, err := d.ToDNSPacket(*doc, nil, nil)
require.NoError(t, err)
require.NotEmpty(t, packet)
putMsg, err := dht.CreatePKARRPublishRequest(sk, *packet)
putMsg, err := dht.CreatePkarrPublishRequest(sk, *packet)
require.NoError(t, err)
require.NotEmpty(t, putMsg)
suffix, err := d.Suffix()
Expand Down
6 changes: 3 additions & 3 deletions impl/pkg/storage/db/bolt/bolt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func TestReadWrite(t *testing.T) {
require.NoError(t, err)
require.NotEmpty(t, packet)

putMsg, err := dht.CreatePKARRPublishRequest(sk, *packet)
putMsg, err := dht.CreatePkarrPublishRequest(sk, *packet)
require.NoError(t, err)
require.NotEmpty(t, putMsg)

Expand Down Expand Up @@ -168,7 +168,7 @@ func TestDBPagination(t *testing.T) {
assert.NoError(t, err)
assert.NotEmpty(t, packet)

putMsg, err := dht.CreatePKARRPublishRequest(sk, *packet)
putMsg, err := dht.CreatePkarrPublishRequest(sk, *packet)
require.NoError(t, err)
require.NotEmpty(t, putMsg)

Expand All @@ -189,7 +189,7 @@ func TestDBPagination(t *testing.T) {
assert.NoError(t, err)
assert.NotEmpty(t, packet)

putMsg, err := dht.CreatePKARRPublishRequest(sk, *packet)
putMsg, err := dht.CreatePkarrPublishRequest(sk, *packet)
require.NoError(t, err)
require.NotEmpty(t, putMsg)

Expand Down
6 changes: 3 additions & 3 deletions impl/pkg/storage/db/postgres/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestReadWrite(t *testing.T) {
require.NoError(t, err)
require.NotEmpty(t, packet)

putMsg, err := dht.CreatePKARRPublishRequest(sk, *packet)
putMsg, err := dht.CreatePkarrPublishRequest(sk, *packet)
require.NoError(t, err)
require.NotEmpty(t, putMsg)

Expand Down Expand Up @@ -95,7 +95,7 @@ func TestDBPagination(t *testing.T) {
assert.NoError(t, err)
assert.NotEmpty(t, packet)

putMsg, err := dht.CreatePKARRPublishRequest(sk, *packet)
putMsg, err := dht.CreatePkarrPublishRequest(sk, *packet)
require.NoError(t, err)
require.NotEmpty(t, putMsg)

Expand All @@ -116,7 +116,7 @@ func TestDBPagination(t *testing.T) {
assert.NoError(t, err)
assert.NotEmpty(t, packet)

putMsg, err := dht.CreatePKARRPublishRequest(sk, *packet)
putMsg, err := dht.CreatePkarrPublishRequest(sk, *packet)
require.NoError(t, err)
require.NotEmpty(t, putMsg)

Expand Down

0 comments on commit 7d89e99

Please sign in to comment.