libCwtch-go changes for storage engine refactor and profile api changes #47

Merged
sarah merged 14 commits from cwtch_refactor into trunk 2021-12-08 00:44:03 +00:00
2 changed files with 1 additions and 22 deletions
Showing only changes of commit a43c225267 - Show all commits

View File

@ -9,13 +9,8 @@ import (
"fmt"
)
const serverPrefix = "server:"
const tofuBundlePrefix = "tofubundle:"
const groupPrefix = "torv3"
const groupExperiment = "tapir-groups-experiment"
const importBundlePrefix = "importBundle"
const (
// ServerList is a json encoded list of servers
ServerList = event.Field("ServerList")
@ -60,4 +55,4 @@ func (gf *GroupFunctionality) GetServerInfo(serverOnion string, profile peer.Cwt
}
}
return Server{Onion: serverOnion, Status: connections.ConnectionStateName[profile.GetPeerState(serverInfo.Handle)], Keys: serverKeys}
}
}

View File

@ -2,22 +2,6 @@ package groups
import "testing"
func TestGroupFunctionality_ValidPrefix(t *testing.T) {
gf, _ := ExperimentGate(map[string]bool{groupExperiment: true})
if gf.ValidPrefix("torv3blahblahblah") == false {
t.Fatalf("torv3 should be a valid prefix")
}
if gf.ValidPrefix("tofubundle:32432423||3242342") == false {
t.Fatalf("tofubundle should be a valid prefix")
}
if gf.ValidPrefix("server:23541233t") == false {
t.Fatalf("server should be a valid prefix")
}
if gf.ValidPrefix("alice!24234") == true {
t.Fatalf("alice should be an invalid predix")
}
}
func TestGroupFunctionality_IsEnabled(t *testing.T) {
_, err := ExperimentGate(map[string]bool{})