Commit c89bc35e authored by tavit ohanian's avatar tavit ohanian

initial port

parent 153778c8
Pipeline #693 failed with stages
in 6 seconds
stages:
- build
- test
variables:
BUILD_DIR: "/tmp/$CI_CONCURRENT_PROJECT_ID"
before_script:
- mkdir -p $BUILD_DIR/src
- cd $BUILD_DIR/src
- if [ -d $CI_PROJECT_DIR ]
- then
- echo "soft link $CI_PROJECT_DIR exists"
- else
- echo "creating soft link $CI_PROJECT_DIR"
- ln -s $CI_PROJECT_DIR
- fi
- cd $CI_PROJECT_DIR
build:
stage: build
tags:
- testing
script:
- echo $CI_JOB_STAGE
- go build
test:
stage: test
tags:
- testing
script:
- echo $CI_JOB_STAGE
- go test -cover
coverage: '/coverage: \d+.\d+% of statements/'
This diff is collapsed.
package kademlia
import (
"github.com/libp2p/go-libp2p-xor/key"
"github.com/libp2p/go-libp2p-xor/trie"
"gitlab.dms3.io/p2p/go-p2p-xor/key"
"gitlab.dms3.io/p2p/go-p2p-xor/trie"
)
// BucketAtDepth returns the bucket in the routing table at a given depth.
......
......@@ -4,8 +4,8 @@ import (
"sort"
"testing"
"github.com/libp2p/go-libp2p-xor/key"
"github.com/libp2p/go-libp2p-xor/trie"
"gitlab.dms3.io/p2p/go-p2p-xor/key"
"gitlab.dms3.io/p2p/go-p2p-xor/trie"
)
func randomTrie(count int, keySizeByte int) *trie.Trie {
......
......@@ -4,8 +4,8 @@ import (
"encoding/json"
"sort"
"github.com/libp2p/go-libp2p-xor/key"
"github.com/libp2p/go-libp2p-xor/trie"
"gitlab.dms3.io/p2p/go-p2p-xor/key"
"gitlab.dms3.io/p2p/go-p2p-xor/trie"
)
// TableHealthReport describes the discrepancy between a node's routing table from the theoretical ideal,
......
......@@ -4,7 +4,7 @@ import (
"math/rand"
"testing"
"github.com/libp2p/go-libp2p-xor/key"
"gitlab.dms3.io/p2p/go-p2p-xor/key"
)
func TestTableHealthFromSets(t *testing.T) {
......
......@@ -7,7 +7,7 @@ import (
"math/big"
"strings"
kbucket "github.com/libp2p/go-libp2p-kbucket"
kbucket "gitlab.dms3.io/p2p/go-p2p-kbucket"
)
func KbucketIDToKey(id kbucket.ID) Key {
......
......@@ -5,8 +5,8 @@ import (
"math/big"
"testing"
kbucket "github.com/libp2p/go-libp2p-kbucket"
ks "github.com/libp2p/go-libp2p-kbucket/keyspace"
kbucket "gitlab.dms3.io/p2p/go-p2p-kbucket"
ks "gitlab.dms3.io/p2p/go-p2p-kbucket/keyspace"
)
func TestKbucketConversion(t *testing.T) {
......
package trie
import (
"github.com/libp2p/go-libp2p-xor/key"
"gitlab.dms3.io/p2p/go-p2p-xor/key"
)
// Add adds the key q to the trie. Add mutates the trie.
......
......@@ -4,7 +4,7 @@ import (
"math/rand"
"testing"
"github.com/libp2p/go-libp2p-xor/key"
"gitlab.dms3.io/p2p/go-p2p-xor/key"
)
// Verify mutable and immutable add do the same thing.
......
package trie
import (
"github.com/libp2p/go-libp2p-xor/key"
"gitlab.dms3.io/p2p/go-p2p-xor/key"
)
type InvariantDiscrepancy struct {
......
package trie
import (
"github.com/libp2p/go-libp2p-xor/key"
"gitlab.dms3.io/p2p/go-p2p-xor/key"
)
func Equal(p, q *Trie) bool {
......
package trie
import (
"github.com/libp2p/go-libp2p-xor/key"
"gitlab.dms3.io/p2p/go-p2p-xor/key"
)
// Find looks for the key q in the trie.
......
package trie
import (
"github.com/libp2p/go-libp2p-xor/key"
"gitlab.dms3.io/p2p/go-p2p-xor/key"
)
func IntersectKeySlices(p, q []key.Key) []key.Key {
......
......@@ -5,7 +5,7 @@ import (
"math/rand"
"testing"
"github.com/libp2p/go-libp2p-xor/key"
"gitlab.dms3.io/p2p/go-p2p-xor/key"
)
func TestIntersectRandom(t *testing.T) {
......
package trie
import (
"github.com/libp2p/go-libp2p-xor/key"
"gitlab.dms3.io/p2p/go-p2p-xor/key"
)
// List returns a list of all keys in the trie.
......
package trie
import (
"github.com/libp2p/go-libp2p-xor/key"
"gitlab.dms3.io/p2p/go-p2p-xor/key"
)
// Remove removes the key q from the trie. Remove mutates the trie.
......
......@@ -3,7 +3,7 @@ package trie
import (
"encoding/json"
"github.com/libp2p/go-libp2p-xor/key"
"gitlab.dms3.io/p2p/go-p2p-xor/key"
)
// Trie is a trie for equal-length bit vectors, which stores values only in the leaves.
......
......@@ -3,7 +3,7 @@ package trie
import (
"testing"
"github.com/libp2p/go-libp2p-xor/key"
"gitlab.dms3.io/p2p/go-p2p-xor/key"
)
func TestInsertRemove(t *testing.T) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment