forked from TrueCloudLab/frostfs-api-go
[#265] pkg/reputation: Implement PeerID and Trust types
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
51d443c6fc
commit
009f704377
5 changed files with 205 additions and 0 deletions
18
pkg/reputation/peer_test.go
Normal file
18
pkg/reputation/peer_test.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package reputation_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/reputation"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestPeerID(t *testing.T) {
|
||||
peerID := reputation.NewPeerID()
|
||||
|
||||
data := []byte{1, 2, 3}
|
||||
peerID.SetBytes(data)
|
||||
require.Equal(t, data, peerID.Bytes())
|
||||
|
||||
require.Equal(t, peerID, reputation.PeerIDFromV2(peerID.ToV2()))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue