From a0381fc8250aebc6b78eacd3b700d9e7a07fc5de Mon Sep 17 00:00:00 2001 From: Raghav Sood Date: Mon, 1 Sep 2025 04:50:05 +0800 Subject: [PATCH 1/2] plugin: remove dead code --- api/plugin.go | 22 ---------------------- api/server.go | 1 - config-plugin.yaml | 1 - 3 files changed, 24 deletions(-) diff --git a/api/plugin.go b/api/plugin.go index 4e01e10..e602594 100644 --- a/api/plugin.go +++ b/api/plugin.go @@ -185,28 +185,6 @@ func (s *Server) DeletePluginPolicyById(c echo.Context) error { }) } -func (s *Server) GetPolicySchema(c echo.Context) error { - pluginID := c.Request().Header.Get("plugin_id") // this is a unique identifier; this won't be needed once the DCA and Payroll are separate services - if pluginID == "" { - return c.JSON(http.StatusBadRequest, NewErrorResponse("missing required header: plugin_id")) - } - - // TODO: need to deal with both DCA and Payroll plugins - keyPath := filepath.Join("plugin", pluginID, "dcaPluginUiSchema.json") - jsonData, err := os.ReadFile(keyPath) - if err != nil { - return c.JSON(http.StatusInternalServerError, NewErrorResponse("failed to read plugin schema")) - } - - var data map[string]interface{} - jsonErr := json.Unmarshal(jsonData, &data) - if jsonErr != nil { - s.logger.WithError(jsonErr).Error("Failed to parse plugin schema") - return c.JSON(http.StatusInternalServerError, NewErrorResponse("failed to parse plugin schema")) - } - return c.JSON(http.StatusOK, data) -} - func (s *Server) GetRecipeSpecification(c echo.Context) error { recipeSpec, err := s.plugin.GetRecipeSpecification() if err != nil { diff --git a/api/server.go b/api/server.go index 03f274d..c92e70f 100644 --- a/api/server.go +++ b/api/server.go @@ -39,7 +39,6 @@ type Server struct { policyService service.Policy plugin plugin.Spec logger *logrus.Logger - mode string } // NewServer returns a new server. diff --git a/config-plugin.yaml b/config-plugin.yaml index 97b167c..eeaf2a4 100644 --- a/config-plugin.yaml +++ b/config-plugin.yaml @@ -6,7 +6,6 @@ server: verifier_url: "http://localhost:8081" base_config_path: /etc/vultisig vaults_file_path: test/vaults - mode: plugin plugin: type: fees From 6645a644ea20a45a8dd0dd5148d01e834a21b282 Mon Sep 17 00:00:00 2001 From: Raghav Sood Date: Mon, 1 Sep 2025 04:52:09 +0800 Subject: [PATCH 2/2] plugin: remove unused imports --- api/plugin.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/api/plugin.go b/api/plugin.go index e602594..72f2320 100644 --- a/api/plugin.go +++ b/api/plugin.go @@ -2,11 +2,8 @@ package api import ( "encoding/hex" - "encoding/json" "fmt" "net/http" - "os" - "path/filepath" "strings" gtypes "github.com/ethereum/go-ethereum/core/types"