1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-25 10:33:43 +02:00

move channel stuffs from internal/redis to transport.

This commit is contained in:
Henrik Hautakoski 2023-01-13 13:38:04 +01:00
parent d0782c3c7c
commit b22118898d
8 changed files with 18 additions and 18 deletions

View file

@ -1,31 +0,0 @@
package redis
import "testing"
func TestKey_String(t *testing.T) {
type fields struct {
NS Namespace
Channel ChannelInterface
}
tests := []struct {
name string
fields fields
want string
}{
{"Empty", fields{NS: Namespace{}, Channel: Channel{}}, "ship::0000000000000000000000000000000000000000000000000000000000000000::"},
{"Transactions", fields{NS: Namespace{ChainID: "id"}, Channel: Channel{"transactions"}}, "ship::id::transactions"},
{"Nested", fields{NS: Namespace{ChainID: "id"}, Channel: Channel{"one.two"}}, "ship::id::one.two"},
{"Action", fields{NS: Namespace{ChainID: "id"}, Channel: ActionChannel{Contract: "mycontract"}}, "ship::id::actions/contract/mycontract"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
k := Key{
NS: tt.fields.NS,
Channel: tt.fields.Channel,
}
if got := k.String(); got != tt.want {
t.Errorf("Key.String() = %v, want %v", got, tt.want)
}
})
}
}