diff --git a/internal/redis/channel.go b/internal/redis/channel.go index 6d21a76..77b4350 100644 --- a/internal/redis/channel.go +++ b/internal/redis/channel.go @@ -18,7 +18,7 @@ func (c *Channel) Append(name string) { } func (c Channel) String() string { - return strings.Join(c, ".") + return strings.Join(c, "/") } // Define channels without any variables. diff --git a/internal/redis/channel_test.go b/internal/redis/channel_test.go index 56b9621..778b0a4 100644 --- a/internal/redis/channel_test.go +++ b/internal/redis/channel_test.go @@ -32,7 +32,7 @@ func TestChannel_String(t *testing.T) { want string }{ {"Empty", Channel{}, ""}, - {"Alot", Channel{"one", "two", "three"}, "one.two.three"}, + {"Alot", Channel{"one", "two", "three"}, "one/two/three"}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -54,9 +54,9 @@ func TestActionChannel_String(t *testing.T) { want string }{ {"Empty", fields{}, "actions"}, - {"Contract", fields{Contract: "mycontract"}, "actions.contract:mycontract"}, - {"Action", fields{Action: "myaction"}, "actions.action:myaction"}, - {"ContractAction", fields{Contract: "mycontract", Action: "myaction"}, "actions.contract:mycontract.action:myaction"}, + {"Contract", fields{Contract: "mycontract"}, "actions/contract/mycontract"}, + {"Action", fields{Action: "myaction"}, "actions/action/myaction"}, + {"ContractAction", fields{Contract: "mycontract", Action: "myaction"}, "actions/contract/mycontract/action/myaction"}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/internal/redis/key_test.go b/internal/redis/key_test.go index 2fe05a3..d34a899 100644 --- a/internal/redis/key_test.go +++ b/internal/redis/key_test.go @@ -15,7 +15,7 @@ func TestKey_String(t *testing.T) { {"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"}, + {"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) {