From 3e14615cc6e505bb552666348b6056a17f99b5fe Mon Sep 17 00:00:00 2001 From: "Lucijano JL." <218673409+Luzijano@users.noreply.github.com> Date: Thu, 21 May 2026 04:16:29 +0200 Subject: [PATCH] fix: correct returnsuccess redis status key Signed-off-by: Lucijano JL. <218673409+Luzijano@users.noreply.github.com> --- config/config.go | 2 +- config/config_test.go | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 config/config_test.go diff --git a/config/config.go b/config/config.go index d21d69e..75e6fb8 100644 --- a/config/config.go +++ b/config/config.go @@ -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 } diff --git a/config/config_test.go b/config/config_test.go new file mode 100644 index 0000000..be7ddc2 --- /dev/null +++ b/config/config_test.go @@ -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) + } +}