diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 8df987b90..5fcb67f05 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -101,7 +101,7 @@ jobs: run: make test-all-db-ci - name: Update code coverage - uses: codecov/codecov-action@v5.1.1 + uses: codecov/codecov-action@v5.1.2 with: token: ${{ secrets.CODECOV_TOKEN }} flags: unittests diff --git a/actions/admin/routes.go b/actions/admin/routes.go index e4393d822..d18013458 100644 --- a/actions/admin/routes.go +++ b/actions/admin/routes.go @@ -36,7 +36,7 @@ func RegisterRoutes(handlersManager *handlers.Manager) { adminGroupOld.POST("/xpubs/count", handlers.AsAdmin(xpubsCount)) adminGroupOld.POST("/webhooks/subscriptions", handlers.AsAdmin(subscribeWebhookOld)) adminGroupOld.DELETE("/webhooks/subscriptions", handlers.AsAdmin(unsubscribeWebhookOld)) - adminGroupOld.GET("/webhooks/subscriptions", handlers.AsAdmin(getAllWebhooks)) + adminGroupOld.GET("/webhooks/subscriptions", handlers.AsAdmin(getAllWebhooksOld)) adminGroupOld.GET("/transactions/:id", handlers.AsAdmin(getTxAdminByIDOld)) adminGroupOld.GET("/transactions", handlers.AsAdmin(getTransactionsOld)) @@ -71,6 +71,7 @@ func RegisterRoutes(handlersManager *handlers.Manager) { adminGroup.GET("/utxos", handlers.AsAdmin(utxosSearch)) // webhooks + adminGroup.GET("/webhooks/subscriptions", handlers.AsAdmin(getAllWebhooks)) adminGroup.POST("/webhooks/subscriptions", handlers.AsAdmin(subscribeWebhook)) adminGroup.DELETE("/webhooks/subscriptions", handlers.AsAdmin(unsubscribeWebhook)) diff --git a/actions/admin/webhooks.go b/actions/admin/webhooks.go index f09321279..0fada6406 100644 --- a/actions/admin/webhooks.go +++ b/actions/admin/webhooks.go @@ -4,6 +4,7 @@ import ( "net/http" "github.com/bitcoin-sv/spv-wallet/engine/spverrors" + "github.com/bitcoin-sv/spv-wallet/mappings" "github.com/bitcoin-sv/spv-wallet/models" "github.com/bitcoin-sv/spv-wallet/server/reqctx" "github.com/gin-gonic/gin" @@ -61,3 +62,27 @@ func unsubscribeWebhook(c *gin.Context, _ *reqctx.AdminContext) { c.Status(http.StatusOK) } + +// getAllWebhooks will return all the stored webhooks +// @Summary Get All Webhooks +// @Description Get All Webhooks currently subscribed to +// @Tags Admin +// @Produce json +// @Success 200 {object} []models.Webhook "List of webhooks" +// @Failure 500 "Internal server error - Error while getting all webhooks" +// @Router /api/v1/admin/webhooks/subscriptions [get] +// @Security x-auth-xpub +func getAllWebhooks(c *gin.Context, _ *reqctx.AdminContext) { + wh, err := reqctx.Engine(c).GetWebhooks(c.Request.Context()) + if err != nil { + spverrors.ErrorResponse(c, err, reqctx.Logger(c)) + return + } + + webhookDTOs := make([]*models.Webhook, len(wh)) + for i, w := range wh { + webhookDTOs[i] = mappings.MapToWebhookContract(w) + } + + c.JSON(http.StatusOK, webhookDTOs) +} diff --git a/actions/admin/webhooks_old.go b/actions/admin/webhooks_old.go index 0080387a6..b7f2ed4b1 100644 --- a/actions/admin/webhooks_old.go +++ b/actions/admin/webhooks_old.go @@ -64,7 +64,7 @@ func unsubscribeWebhookOld(c *gin.Context, _ *reqctx.AdminContext) { c.JSON(http.StatusOK, true) } -// getAllWebhooks will return all the stored webhooks +// getAllWebhooksOld will return all the stored webhooks // @DeprecatedRouter /v1/admin/webhooks/subscriptions [get] // @Summary Get All Webhooks // @Description Get All Webhooks currently subscribed to @@ -74,7 +74,7 @@ func unsubscribeWebhookOld(c *gin.Context, _ *reqctx.AdminContext) { // @Failure 500 "Internal server error - Error while getting all webhooks" // @Router /v1/admin/webhooks/subscriptions [get] // @Security x-auth-xpub -func getAllWebhooks(c *gin.Context, _ *reqctx.AdminContext) { +func getAllWebhooksOld(c *gin.Context, _ *reqctx.AdminContext) { wh, err := reqctx.Engine(c).GetWebhooks(c.Request.Context()) if err != nil { spverrors.ErrorResponse(c, err, reqctx.Logger(c)) diff --git a/actions/admin/webhooks_test.go b/actions/admin/webhooks_test.go new file mode 100644 index 000000000..1e89a465c --- /dev/null +++ b/actions/admin/webhooks_test.go @@ -0,0 +1,72 @@ +package admin_test + +import ( + "testing" + + "github.com/bitcoin-sv/spv-wallet/actions/testabilities" + testengine "github.com/bitcoin-sv/spv-wallet/engine/testabilities" +) + +func TestAdminWebhooks(t *testing.T) { + t.Run("subscribe, get and unsubscribe webhook", func(t *testing.T) { + // given: + given, then := testabilities.New(t) + cleanup := given.StartedSPVWalletWithConfiguration(testengine.WithNotificationsEnabled()) + defer cleanup() + + // and: + client := given.HttpClient().ForAdmin() + + // and: + webhook := map[string]string{ + "url": "http://localhost:8080", + "tokenHeader": "Authorization", + "tokenValue": "123", + } + + // when: + res, _ := client.R().Get("/api/v1/admin/webhooks/subscriptions") + + // then: + then.Response(res). + IsOK(). + WithJSONf(`[]`) + + // when: + res, _ = client. + R(). + SetBody(webhook). + Post("/api/v1/admin/webhooks/subscriptions") + + // then: + then.Response(res).IsOK() + + // when: + res, _ = client.R().Get("/api/v1/admin/webhooks/subscriptions") + + // then: + then.Response(res). + IsOK(). + WithJSONf(`[{ + "url": "http://localhost:8080", + "banned": false + }]`) + + // when: + res, _ = client. + R(). + SetBody(map[string]string{"url": webhook["url"]}). + Delete("/api/v1/admin/webhooks/subscriptions") + + // then: + then.Response(res).IsOK() + + // when: + res, _ = client.R().Get("/api/v1/admin/webhooks/subscriptions") + + // then: + then.Response(res). + IsOK(). + WithJSONf(`[]`) + }) +} diff --git a/actions/utxos/routes_test.go b/actions/utxos/routes_test.go deleted file mode 100644 index 1e314dd9b..000000000 --- a/actions/utxos/routes_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package utxos - -import ( - "testing" - - "github.com/bitcoin-sv/spv-wallet/config" - "github.com/stretchr/testify/assert" -) - -// TestUtxoRegisterRoutes will test routes -func (ts *TestSuite) TestUtxoRegisterRoutes() { - ts.T().Run("test routes", func(t *testing.T) { - testCases := []struct { - method string - url string - }{ - {"GET", "/" + config.APIVersion + "/utxo"}, - {"POST", "/" + config.APIVersion + "/utxo/count"}, - {"POST", "/" + config.APIVersion + "/utxo/search"}, - - {"GET", "/api/" + config.APIVersion + "/utxos"}, - } - - ts.Router.Routes() - - for _, testCase := range testCases { - found := false - for _, routeInfo := range ts.Router.Routes() { - if testCase.url == routeInfo.Path && testCase.method == routeInfo.Method { - assert.NotNil(t, routeInfo.HandlerFunc) - found = true - break - } - } - assert.True(t, found) - } - }) -} diff --git a/actions/utxos/search_test.go b/actions/utxos/search_test.go new file mode 100644 index 000000000..31328eb39 --- /dev/null +++ b/actions/utxos/search_test.go @@ -0,0 +1,65 @@ +package utxos_test + +import ( + "testing" + + "github.com/bitcoin-sv/spv-wallet/actions/testabilities" + "github.com/bitcoin-sv/spv-wallet/engine/tester/fixtures" +) + +func TestUserUTXOs(t *testing.T) { + t.Run("return UTXOs for user", func(t *testing.T) { + // given: + given, then := testabilities.New(t) + cleanup := given.StartedSPVWallet() + defer cleanup() + + // and: + client := given.HttpClient().ForGivenUser(fixtures.Sender) + + // when: + res, _ := client.R().Get("/api/v1/utxos") + + // then: + then.Response(res). + IsOK(). + WithJSONf(`{ + "content": [], + "page": { + "number": 1, + "size": 50, + "totalElements": 0, + "totalPages": 0 + } + }`) + + }) + + t.Run("try to return UTXOs for admin", func(t *testing.T) { + // given: + given, then := testabilities.New(t) + cleanup := given.StartedSPVWallet() + defer cleanup() + client := given.HttpClient().ForAdmin() + + // when: + res, _ := client.R().Get("/api/v1/utxos") + + // then: + then.Response(res).IsUnauthorizedForAdmin() + }) + + t.Run("return UTXOs for anonymous", func(t *testing.T) { + // given: + given, then := testabilities.New(t) + cleanup := given.StartedSPVWallet() + defer cleanup() + client := given.HttpClient().ForAnonymous() + + // when: + res, _ := client.R().Get("/api/v1/utxos") + + // then: + then.Response(res).IsUnauthorized() + }) +} diff --git a/actions/utxos/utxo_test.go b/actions/utxos/utxo_test.go deleted file mode 100644 index cd245c0ee..000000000 --- a/actions/utxos/utxo_test.go +++ /dev/null @@ -1,42 +0,0 @@ -package utxos - -import ( - "testing" - - "github.com/bitcoin-sv/spv-wallet/server/handlers" - "github.com/bitcoin-sv/spv-wallet/tests" - "github.com/stretchr/testify/suite" -) - -// TestSuite is for testing the entire package using real/mocked services -type TestSuite struct { - tests.TestSuite -} - -// SetupSuite runs at the start of the suite -func (ts *TestSuite) SetupSuite() { - ts.BaseSetupSuite() -} - -// TearDownSuite runs after the suite finishes -func (ts *TestSuite) TearDownSuite() { - ts.BaseTearDownSuite() -} - -// SetupTest runs before each test -func (ts *TestSuite) SetupTest() { - ts.BaseSetupTest() - - handlersManager := handlers.NewManager(ts.Router, ts.AppConfig) - RegisterRoutes(handlersManager) -} - -// TearDownTest runs after each test -func (ts *TestSuite) TearDownTest() { - ts.BaseTearDownTest() -} - -// TestTestSuite kick-starts all suite tests -func TestTestSuite(t *testing.T) { - suite.Run(t, new(TestSuite)) -} diff --git a/docs/docs.go b/docs/docs.go index 254321881..825b7ad18 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -803,6 +803,35 @@ const docTemplate = `{ } }, "/api/v1/admin/webhooks/subscriptions": { + "get": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Get All Webhooks currently subscribed to", + "produces": [ + "application/json" + ], + "tags": [ + "Admin" + ], + "summary": "Get All Webhooks", + "responses": { + "200": { + "description": "List of webhooks", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Webhook" + } + } + }, + "500": { + "description": "Internal server error - Error while getting all webhooks" + } + } + }, "post": { "security": [ { diff --git a/docs/swagger.json b/docs/swagger.json index 60bbd7988..28a4e4e04 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -794,6 +794,35 @@ } }, "/api/v1/admin/webhooks/subscriptions": { + "get": { + "security": [ + { + "x-auth-xpub": [] + } + ], + "description": "Get All Webhooks currently subscribed to", + "produces": [ + "application/json" + ], + "tags": [ + "Admin" + ], + "summary": "Get All Webhooks", + "responses": { + "200": { + "description": "List of webhooks", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/models.Webhook" + } + } + }, + "500": { + "description": "Internal server error - Error while getting all webhooks" + } + } + }, "post": { "security": [ { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index ba435c219..cfd6262fe 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -3277,6 +3277,24 @@ paths: summary: Unsubscribe to a webhook tags: - Admin + get: + description: Get All Webhooks currently subscribed to + produces: + - application/json + responses: + "200": + description: List of webhooks + schema: + items: + $ref: '#/definitions/models.Webhook' + type: array + "500": + description: Internal server error - Error while getting all webhooks + security: + - x-auth-xpub: [] + summary: Get All Webhooks + tags: + - Admin post: description: Subscribe to a webhook to receive notifications parameters: diff --git a/engine/client.go b/engine/client.go index 331459b0f..6697e4a7d 100644 --- a/engine/client.go +++ b/engine/client.go @@ -217,6 +217,10 @@ func (c *Client) Cluster() cluster.ClientInterface { // Close will safely close any open connections (cache, datastore, etc.) func (c *Client) Close(ctx context.Context) error { + // Close WebhookManager + if c.options.notifications != nil && c.options.notifications.webhookManager != nil { + c.options.notifications.webhookManager.Stop() + } // Close Datastore ds := c.Datastore() @@ -235,10 +239,6 @@ func (c *Client) Close(ctx context.Context) error { } c.options.taskManager.TaskEngine = nil } - - if c.options.notifications != nil && c.options.notifications.webhookManager != nil { - c.options.notifications.webhookManager.Stop() - } return nil } diff --git a/engine/datastore/sql.go b/engine/datastore/sql.go index 32c58d829..3b2f0bc78 100644 --- a/engine/datastore/sql.go +++ b/engine/datastore/sql.go @@ -128,6 +128,14 @@ func openSQLiteDatabase(optionalLogger glogger.Interface, config *SQLiteConfig) ); err != nil { return } + sqlDB, err := db.DB() + if err != nil { + return + } + sqlDB.SetMaxIdleConns(config.MaxIdleConnections) + sqlDB.SetMaxOpenConns(config.MaxOpenConnections) + sqlDB.SetConnMaxLifetime(config.MaxConnectionTime) + sqlDB.SetConnMaxIdleTime(config.MaxConnectionIdleTime) // Return the connection return diff --git a/engine/testabilities/fixture_configopts.go b/engine/testabilities/fixture_configopts.go index 4f4429238..08e2c0366 100644 --- a/engine/testabilities/fixture_configopts.go +++ b/engine/testabilities/fixture_configopts.go @@ -15,3 +15,9 @@ func WithDomainValidationDisabled() ConfigOpts { c.Paymail.DomainValidationEnabled = false } } + +func WithNotificationsEnabled() ConfigOpts { + return func(c *config.AppConfig) { + c.Notifications.Enabled = true + } +} diff --git a/go.mod b/go.mod index 881e4fc62..1dcf8f2f4 100644 --- a/go.mod +++ b/go.mod @@ -10,15 +10,15 @@ go 1.23.1 replace github.com/bitcoin-sv/spv-wallet/models => ./models require ( - github.com/99designs/gqlgen v0.17.60 + github.com/99designs/gqlgen v0.17.61 github.com/aws/aws-sdk-go v1.55.5 github.com/bitcoin-sv/go-paymail v0.21.3 - github.com/bitcoin-sv/go-sdk v1.1.16 + github.com/bitcoin-sv/go-sdk v1.1.17 github.com/bitcoin-sv/spv-wallet/models v0.28.0 github.com/bitcoinschema/go-map v0.2.0 github.com/coocood/freecache v1.2.4 github.com/fergusstrange/embedded-postgres v1.30.0 - github.com/gin-contrib/pprof v1.5.1 + github.com/gin-contrib/pprof v1.5.2 github.com/gin-gonic/gin v1.10.0 github.com/go-ozzo/ozzo-validation v3.6.0+incompatible github.com/go-redis/redis/v8 v8.11.5 @@ -69,14 +69,14 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bitcoinschema/go-bpu v0.2.0 // indirect github.com/bsm/redislock v0.9.4 // indirect - github.com/bytedance/sonic v1.12.4 // indirect + github.com/bytedance/sonic v1.12.6 // indirect github.com/capnm/sysinfo v0.0.0-20130621111458-5909a53897f3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.6 // indirect + github.com/gabriel-vasile/mimetype v1.4.7 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect @@ -84,9 +84,9 @@ require ( github.com/go-openapi/swag v0.23.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.22.1 // indirect + github.com/go-playground/validator/v10 v10.23.0 // indirect github.com/go-resty/resty/v2 v2.16.2 - github.com/goccy/go-json v0.10.3 // indirect + github.com/goccy/go-json v0.10.4 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect @@ -135,14 +135,14 @@ require ( golang.org/x/crypto v0.31.0 golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.31.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect golang.org/x/tools v0.24.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect google.golang.org/grpc v1.67.1 // indirect - google.golang.org/protobuf v1.35.2 // indirect + google.golang.org/protobuf v1.36.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 6bfdbc5c7..cda8d3494 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= -github.com/99designs/gqlgen v0.17.60 h1:xxl7kQDCNw79itzWQtCUSXgkovCyq9r+ogSXfZpKPYM= -github.com/99designs/gqlgen v0.17.60/go.mod h1:vQJzWXyGya2TYL7cig1G4OaCQzyck031MgYBlUwaI9I= +github.com/99designs/gqlgen v0.17.61 h1:vE7xLRC066n9wehgjeplILOWtwz75zbzcV2/Iv9i3pw= +github.com/99designs/gqlgen v0.17.61/go.mod h1:rFU1T3lhv/tPeAlww/DJ4ol2YxT/pPpue+xxPbkd3r4= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 h1:uvdUDbHQHO85qeSydJtItA4T55Pw6BtAejd0APRJOCE= @@ -18,8 +18,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bitcoin-sv/go-paymail v0.21.3 h1:7zrl7wdAlYZB1LCopYMVaIb56BIGexlBbX9CTps9tAs= github.com/bitcoin-sv/go-paymail v0.21.3/go.mod h1:RE5ccfCZMLv8hotWaWoVxydlQONUcMnc0zAazor4cfY= -github.com/bitcoin-sv/go-sdk v1.1.16 h1:n2X0RiENFGD/1fQ/1y6osbostRB7I/xq9I7tcIKcCPY= -github.com/bitcoin-sv/go-sdk v1.1.16/go.mod h1:3CsNdEDBwB+SIv6UBcJPC9bTvPqxQvg3GULt7wsuL58= +github.com/bitcoin-sv/go-sdk v1.1.17 h1:AMMAR4RP5ucq2AdVZcmHFQKwRBB7jrTJocxQDfDDeqE= +github.com/bitcoin-sv/go-sdk v1.1.17/go.mod h1:3CsNdEDBwB+SIv6UBcJPC9bTvPqxQvg3GULt7wsuL58= github.com/bitcoinschema/go-bob v0.5.0 h1:Fjl60RuiQiUuZWLfXE8ETdcgmJBHYu9MYfbrbZU7yHs= github.com/bitcoinschema/go-bob v0.5.0/go.mod h1:bREtBvZuMKe3DX2oCUSE+LOuy9HDJnOC3qcWr0oLoy4= github.com/bitcoinschema/go-bpu v0.2.0 h1:/WI/F+ShIj50HUD1EBPPHTCBzSeiPDohy77W3Y8xx+s= @@ -28,8 +28,8 @@ github.com/bitcoinschema/go-map v0.2.0 h1:piuYjUycLZWOFPG4Kj5dUGqLBTlrYbq7VNWQCu github.com/bitcoinschema/go-map v0.2.0/go.mod h1:fXRo0x/h3liZR+xdRc+dm5oa2SA+tTB2Q/CmPUVUkVY= github.com/bsm/redislock v0.7.2 h1:jggqOio8JyX9FJBKIfjF3fTxAu/v7zC5mAID9LveqG4= github.com/bsm/redislock v0.7.2/go.mod h1:kS2g0Yvlymc9Dz8V3iVYAtLAaSVruYbAFdYBDrmC5WU= -github.com/bytedance/sonic v1.12.4 h1:9Csb3c9ZJhfUWeMtpCDCq6BUoH5ogfDFLUgQ/jG+R0k= -github.com/bytedance/sonic v1.12.4/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= +github.com/bytedance/sonic v1.12.6 h1:/isNmCUF2x3Sh8RAp/4mh4ZGkcFAX/hLrzrK3AvpRzk= +github.com/bytedance/sonic v1.12.6/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/bytedance/sonic/loader v0.2.1 h1:1GgorWTqf12TA8mma4DDSbaQigE2wOgQo7iCjjJv3+E= github.com/bytedance/sonic/loader v0.2.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= @@ -61,12 +61,12 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/gabriel-vasile/mimetype v1.4.6 h1:3+PzJTKLkvgjeTbts6msPJt4DixhT4YtFNf1gtGe3zc= -github.com/gabriel-vasile/mimetype v1.4.6/go.mod h1:JX1qVKqZd40hUPpAfiNTe0Sne7hdfKSbOqqmkq8GCXc= +github.com/gabriel-vasile/mimetype v1.4.7 h1:SKFKl7kD0RiPdbht0s7hFtjl489WcQ1VyPW8ZzUMYCA= +github.com/gabriel-vasile/mimetype v1.4.7/go.mod h1:GDlAgAyIRT27BhFl53XNAFtfjzOkLaF35JdEG0P7LtU= github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4= github.com/gin-contrib/gzip v0.0.6/go.mod h1:QOJlmV2xmayAjkNS2Y8NQsMneuRShOU/kjovCXNuzzk= -github.com/gin-contrib/pprof v1.5.1 h1:Mzy+3HHtHbtwr4VewBTXZp/hR7pS6ZuZkueBIrQiLL4= -github.com/gin-contrib/pprof v1.5.1/go.mod h1:uwzoF6FxdzJJGyMdcZB+VSuVjOBe1kSH+KMIvKGwvCQ= +github.com/gin-contrib/pprof v1.5.2 h1:Kcq5W2bA2PBcVtF0MqkQjpvCpwJr+pd7zxcQh2csg7E= +github.com/gin-contrib/pprof v1.5.2/go.mod h1:a1W4CDXwAPm2zql2AKdnT7OVCJdV/oFPhJXVOrDs5Ns= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= @@ -87,8 +87,8 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA= -github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/go-playground/validator/v10 v10.23.0 h1:/PwmTwZhS0dPkav3cdK9kV1FsAmrL8sThn8IHr/sO+o= +github.com/go-playground/validator/v10 v10.23.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= @@ -101,8 +101,8 @@ github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9 github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= -github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= +github.com/goccy/go-json v0.10.4 h1:JSwxQzIqKfmFX1swYPpUThQZp/Ka4wzJdK0LWVytLPM= +github.com/goccy/go-json v0.10.4/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= @@ -337,8 +337,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -403,8 +403,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= -google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk= +google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/regression_tests/operator.go b/regression_tests/operator.go index e8aa382b0..29b8de4a9 100644 --- a/regression_tests/operator.go +++ b/regression_tests/operator.go @@ -19,7 +19,6 @@ import ( const ( domainLocalHost = "http://localhost:3003" adminXPriv = "xprv9s21ZrQH143K3CbJXirfrtpLvhT3Vgusdo8coBritQ3rcS7Jy7sxWhatuxG5h2y1Cqj8FKmPp69536gmjYRpfga2MJdsGyBsnB12E19CESK" - adminXPub = "xpub661MyMwAqRbcFgfmdkPgE2m5UjHXu9dj124DbaGLSjaqVESTWfCD4VuNmEbVPkbYLCkykwVZvmA8Pbf8884TQr1FgdG2nPoHR8aB36YdDQh" leaderPaymailAlias = "leader" minimalBalance = 14 // 7 satoshi per test defaultGoClientPath = "../../spv-wallet-go-client/regression_tests" diff --git a/regression_tests/utils.go b/regression_tests/utils.go index 2523dcbd2..9404f35a8 100644 --- a/regression_tests/utils.go +++ b/regression_tests/utils.go @@ -29,7 +29,7 @@ const ( ClientOneLeaderXPrivEnvVar = "CLIENT_ONE_LEADER_XPRIV" ClientTwoLeaderXPrivEnvVar = "CLIENT_TWO_LEADER_XPRIV" - timeoutDuration = 30 * time.Second + timeoutDuration = 120 * time.Second yes = 1 no = 0