Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ var RedisStatusSets = map[string]string{
"success": "bridgeops:success", // destination transaction entered block and was scanned
"returning": "bridgeops:returning", // tried to return funds because destination has not enough BGL or gas
"returnfail": "bridgeops:returnfail", // tried to initiate return but encountered a fn error
"returnsuccess": "brdigeops:returnsuccess", // funds returned successfully
"returnsuccess": "bridgeops:returnsuccess", // funds returned successfully
}
21 changes: 21 additions & 0 deletions config/config_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package config

import "testing"

func TestRedisStatusSetsUseBridgeOpsNamespace(t *testing.T) {
for status, key := range RedisStatusSets {
if key == "" {
t.Fatalf("status %q has an empty Redis key", status)
}

if wantPrefix := "bridgeops:"; len(key) < len(wantPrefix) || key[:len(wantPrefix)] != wantPrefix {
t.Fatalf("status %q uses Redis key %q, want prefix %q", status, key, wantPrefix)
}
}
}

func TestReturnSuccessRedisStatusKey(t *testing.T) {
if got, want := RedisStatusSets["returnsuccess"], "bridgeops:returnsuccess"; got != want {
t.Fatalf("returnsuccess Redis key = %q, want %q", got, want)
}
}