fixed tests that need to be really fixed later
This commit is contained in:
@@ -87,52 +87,28 @@ func (c *Client) runner() (out bool) {
|
||||
switch on := onion.(type) {
|
||||
case *cipher.OnionSkin:
|
||||
c.cipher(on, b)
|
||||
break
|
||||
|
||||
case *confirmation.OnionSkin:
|
||||
c.confirmation(on, b)
|
||||
break
|
||||
|
||||
case *delay.OnionSkin:
|
||||
c.delay(on, b)
|
||||
break
|
||||
|
||||
case *exit.OnionSkin:
|
||||
c.exit(on, b)
|
||||
break
|
||||
|
||||
case *forward.OnionSkin:
|
||||
c.forward(on, b)
|
||||
break
|
||||
|
||||
case *layer.OnionSkin:
|
||||
c.layer(on, b)
|
||||
break
|
||||
|
||||
case *noop.OnionSkin:
|
||||
c.noop(on, b)
|
||||
break
|
||||
|
||||
case *purchase.OnionSkin:
|
||||
c.purchase(on, b)
|
||||
break
|
||||
|
||||
case *reply.OnionSkin:
|
||||
c.reply(on, b)
|
||||
break
|
||||
|
||||
case *response.OnionSkin:
|
||||
c.response(on, b)
|
||||
break
|
||||
|
||||
case *session.OnionSkin:
|
||||
c.session(on, b)
|
||||
break
|
||||
|
||||
case *token.OnionSkin:
|
||||
c.token(on, b)
|
||||
break
|
||||
|
||||
default:
|
||||
log.I.S("unrecognised packet", b)
|
||||
}
|
||||
@@ -152,7 +128,7 @@ func (c *Client) confirmation(on *confirmation.OnionSkin, b slice.Bytes) {
|
||||
}
|
||||
|
||||
func (c *Client) delay(on *delay.OnionSkin, b slice.Bytes) {
|
||||
// this is a message to hold the message in the buffer until a time
|
||||
// this is a message to hold the message in the buffer until a duration
|
||||
// elapses. The accounting for the remainder of the message adds a
|
||||
// factor to the effective byte consumption in accordance with the time
|
||||
// to be stored.
|
||||
|
||||
@@ -2,17 +2,20 @@ package node
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/netip"
|
||||
"testing"
|
||||
|
||||
"github.com/Indra-Labs/indra/pkg/transport"
|
||||
)
|
||||
|
||||
var testAddrPort, _ = netip.ParseAddrPort("1.1.1.1:20000")
|
||||
|
||||
func TestNodes_Add(t *testing.T) {
|
||||
n := NewNodes()
|
||||
const nNodes = 10000
|
||||
for i := 0; i < nNodes; i++ {
|
||||
var nn *Node
|
||||
nn, _ = New(nil, nil, nil, nil, nil, transport.NewSim(0))
|
||||
nn, _ = New(&testAddrPort, nil, nil, nil, nil, transport.NewSim(0))
|
||||
n = n.Add(nn)
|
||||
}
|
||||
if n.Len() != nNodes {
|
||||
@@ -26,7 +29,7 @@ func TestNodes_DeleteByID(t *testing.T) {
|
||||
var e error
|
||||
for i := 0; i < nNodes; i++ {
|
||||
var nn *Node
|
||||
nn, _ = New(nil, nil, nil, nil, nil, transport.NewSim(0))
|
||||
nn, _ = New(&testAddrPort, nil, nil, nil, nil, transport.NewSim(0))
|
||||
n.Add(nn)
|
||||
}
|
||||
for i := range n {
|
||||
@@ -42,7 +45,7 @@ func TestNodes_DeleteByAddrPort(t *testing.T) {
|
||||
var e error
|
||||
for i := 0; i < nNodes; i++ {
|
||||
var nn *Node
|
||||
nn, _ = New(nil, nil, nil, nil, nil, transport.NewSim(0))
|
||||
nn, _ = New(&testAddrPort, nil, nil, nil, nil, transport.NewSim(0))
|
||||
n.Add(nn)
|
||||
}
|
||||
for i := range n {
|
||||
@@ -57,7 +60,7 @@ func TestNodes_FindByID(t *testing.T) {
|
||||
const nNodes = 10000
|
||||
for i := 0; i < nNodes; i++ {
|
||||
var nn *Node
|
||||
nn, _ = New(nil, nil, nil, nil, nil, transport.NewSim(0))
|
||||
nn, _ = New(&testAddrPort, nil, nil, nil, nil, transport.NewSim(0))
|
||||
n.Add(nn)
|
||||
}
|
||||
for i := range n {
|
||||
@@ -73,7 +76,7 @@ func TestNodes_FindByAddrPort(t *testing.T) {
|
||||
const nNodes = 10000
|
||||
for i := 0; i < nNodes; i++ {
|
||||
var nn *Node
|
||||
nn, _ = New(nil, nil, nil, nil, nil, transport.NewSim(0))
|
||||
nn, _ = New(&testAddrPort, nil, nil, nil, nil, transport.NewSim(0))
|
||||
n.Add(nn)
|
||||
}
|
||||
for i := range n {
|
||||
|
||||
@@ -10,11 +10,11 @@ var (
|
||||
// GitRef is the gitref, as in refs/heads/branchname.
|
||||
GitRef = "refs/heads/main"
|
||||
// ParentGitCommit is the commit hash of the parent HEAD.
|
||||
ParentGitCommit = "1f73709fbafd7e43150a298f32d9f00520e7e47b"
|
||||
ParentGitCommit = "894afbd3a2ec5742387f3203e4e08b906557c319"
|
||||
// BuildTime stores the time when the current binary was built.
|
||||
BuildTime = "2022-12-28T12:22:54Z"
|
||||
BuildTime = "2022-12-28T13:19:51Z"
|
||||
// SemVer lists the (latest) git tag on the build.
|
||||
SemVer = "v0.0.253"
|
||||
SemVer = "v0.0.254"
|
||||
// PathBase is the path base returned from runtime caller.
|
||||
PathBase = "/home/loki/src/github.com/Indra-Labs/indra/"
|
||||
// Major is the major number from the tag.
|
||||
@@ -22,7 +22,7 @@ var (
|
||||
// Minor is the minor number from the tag.
|
||||
Minor = 0
|
||||
// Patch is the patch version number from the tag.
|
||||
Patch = 253
|
||||
Patch = 254
|
||||
)
|
||||
|
||||
// Version returns a pretty printed version information string.
|
||||
|
||||
Reference in New Issue
Block a user