Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
number571 committed Dec 9, 2024
1 parent 4117521 commit 1d5827c
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 139 deletions.
11 changes: 0 additions & 11 deletions pkg/anonymity/logger/log_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package logger
import (
"github.com/number571/go-peer/pkg/crypto/asymmetric"
"github.com/number571/go-peer/pkg/crypto/hashing"
"github.com/number571/go-peer/pkg/network/conn"
)

var (
Expand All @@ -18,7 +17,6 @@ type sLogger struct {
fProof uint64
fSize uint64
fPubKey asymmetric.IPubKey
fConn conn.IConn
}

func NewLogBuilder(pService string) ILogBuilder {
Expand All @@ -37,10 +35,6 @@ func (p *sLogger) GetType() ILogType {
return p.fType
}

func (p *sLogger) GetConn() conn.IConn {
return p.fConn
}

func (p *sLogger) GetHash() []byte {
return p.fHash
}
Expand Down Expand Up @@ -81,11 +75,6 @@ func (p *sLogger) WithPubKey(pPubKey asymmetric.IPubKey) ILogBuilder {
return p
}

func (p *sLogger) WithConn(pConn conn.IConn) ILogBuilder {
p.fConn = pConn
return p
}

func (p *sLogger) WithSize(pSize int) ILogBuilder {
p.fSize = uint64(pSize)
return p
Expand Down
6 changes: 0 additions & 6 deletions pkg/anonymity/logger/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ func TestLogger(t *testing.T) {

pubKey := asymmetric.NewPrivKey().GetPubKey()
builder := NewLogBuilder(tcService).
WithConn(nil).
WithHash([]byte(tcHash)).
WithProof(tcProof).
WithPubKey(pubKey).
Expand All @@ -32,11 +31,6 @@ func TestLogger(t *testing.T) {
return
}

if getter.GetConn() != nil {
t.Error("getter.GetConn() != nil")
return
}

if !bytes.Equal(getter.GetHash(), []byte(tcHash)) {
t.Error("!bytes.Equal(getter.GetHash(), []byte(tcHash))")
return
Expand Down
3 changes: 0 additions & 3 deletions pkg/anonymity/logger/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package logger

import (
"github.com/number571/go-peer/pkg/crypto/asymmetric"
"github.com/number571/go-peer/pkg/network/conn"
)

type (
Expand Down Expand Up @@ -46,7 +45,6 @@ type ILogBuilder interface {
WithSize(int) ILogBuilder
WithProof(uint64) ILogBuilder
WithHash([]byte) ILogBuilder
WithConn(conn.IConn) ILogBuilder
WithPubKey(asymmetric.IPubKey) ILogBuilder
}

Expand All @@ -56,6 +54,5 @@ type ILogGetter interface {
GetSize() uint64
GetProof() uint64
GetHash() []byte
GetConn() conn.IConn
GetPubKey() asymmetric.IPubKey
}
2 changes: 1 addition & 1 deletion test/result/badge_codelines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1d5827c

Please sign in to comment.