From 15a6c1dcbec5b970edfdb37a4b2d6b4b915aaabe Mon Sep 17 00:00:00 2001 From: Artem Poltorzhitskiy Date: Fri, 17 May 2024 19:33:03 +0200 Subject: [PATCH] Refactoring: change rollup id to base64url (#12) --- cmd/api/docs/docs.go | 21 +++++++++------------ cmd/api/docs/swagger.json | 18 ++++++------------ cmd/api/docs/swagger.yaml | 18 ++++++------------ cmd/api/handler/address_test.go | 2 +- cmd/api/handler/block_test.go | 4 +++- cmd/api/handler/responses/rollup.go | 16 +++++++--------- cmd/api/handler/rollup.go | 18 +++++++++--------- cmd/api/handler/rollup_test.go | 10 +++++----- cmd/api/handler/stats.go | 16 ++++++++-------- cmd/api/handler/stats_test.go | 2 +- cmd/api/handler/validators.go | 18 ------------------ cmd/api/handler/validators_test.go | 9 --------- internal/storage/mock/action.go | 3 +++ internal/storage/mock/address.go | 3 +++ internal/storage/mock/balance.go | 3 +++ internal/storage/mock/balance_update.go | 3 +++ internal/storage/mock/block.go | 3 +++ internal/storage/mock/block_signature.go | 3 +++ internal/storage/mock/block_stats.go | 3 +++ internal/storage/mock/constant.go | 3 +++ internal/storage/mock/generic.go | 3 +++ internal/storage/mock/rollup.go | 3 +++ internal/storage/mock/state.go | 3 +++ internal/storage/mock/stats.go | 3 +++ internal/storage/mock/tx.go | 3 +++ internal/storage/mock/validator.go | 3 +++ internal/storage/postgres/sentry_hook.go | 3 +++ internal/storage/types/action_type_enum.go | 3 +++ internal/storage/types/module_enum.go | 3 +++ internal/storage/types/status_enum.go | 3 +++ pkg/node/mock/api.go | 3 +++ 31 files changed, 112 insertions(+), 97 deletions(-) diff --git a/cmd/api/docs/docs.go b/cmd/api/docs/docs.go index 3f91ce1..771f8ab 100644 --- a/cmd/api/docs/docs.go +++ b/cmd/api/docs/docs.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Package docs Code generated by swaggo/swag. DO NOT EDIT package docs @@ -1036,10 +1039,8 @@ const docTemplate = `{ "operationId": "get-rollup", "parameters": [ { - "maxLength": 64, - "minLength": 64, "type": "string", - "description": "Hash", + "description": "Base64Url encoded rollup id", "name": "hash", "in": "path", "required": true @@ -1083,10 +1084,8 @@ const docTemplate = `{ "operationId": "rollup-actions", "parameters": [ { - "maxLength": 48, - "minLength": 48, "type": "string", - "description": "Hash", + "description": "Base64Url encoded rollup id", "name": "hash", "in": "path", "required": true @@ -1260,10 +1259,8 @@ const docTemplate = `{ "operationId": "stats-rollup-series", "parameters": [ { - "maxLength": 48, - "minLength": 48, "type": "string", - "description": "Hash", + "description": "Base64Url encoded rollup id", "name": "hash", "in": "path", "required": true @@ -2338,7 +2335,7 @@ const docTemplate = `{ "properties": { "actions_count": { "type": "integer", - "example": 100 + "example": 101 }, "bridge_address": { "type": "string", @@ -2350,7 +2347,7 @@ const docTemplate = `{ }, "hash": { "type": "string", - "example": "19ba8abb3e4b56a309df6756c47b97e298e3a72d88449d36a0fadb1ca7366539" + "example": "O0Ia+lPYYMf3iFfxBaWXCSdlhphc6d4ZoBXINov6Tjc=" }, "id": { "type": "integer", @@ -2682,7 +2679,7 @@ const docTemplate = `{ // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "1.0", - Host: "api-dusk-3.astrotrek.io", + Host: "api-dusk-5.astrotrek.io", BasePath: "", Schemes: []string{}, Title: "Swagger Astria Explorer API", diff --git a/cmd/api/docs/swagger.json b/cmd/api/docs/swagger.json index ba5a264..f6d12c8 100644 --- a/cmd/api/docs/swagger.json +++ b/cmd/api/docs/swagger.json @@ -6,7 +6,7 @@ "contact": {}, "version": "1.0" }, - "host": "api-dusk-3.astrotrek.io", + "host": "api-dusk-5.astrotrek.io", "paths": { "/v1/address": { "get": { @@ -1029,10 +1029,8 @@ "operationId": "get-rollup", "parameters": [ { - "maxLength": 64, - "minLength": 64, "type": "string", - "description": "Hash", + "description": "Base64Url encoded rollup id", "name": "hash", "in": "path", "required": true @@ -1076,10 +1074,8 @@ "operationId": "rollup-actions", "parameters": [ { - "maxLength": 48, - "minLength": 48, "type": "string", - "description": "Hash", + "description": "Base64Url encoded rollup id", "name": "hash", "in": "path", "required": true @@ -1253,10 +1249,8 @@ "operationId": "stats-rollup-series", "parameters": [ { - "maxLength": 48, - "minLength": 48, "type": "string", - "description": "Hash", + "description": "Base64Url encoded rollup id", "name": "hash", "in": "path", "required": true @@ -2331,7 +2325,7 @@ "properties": { "actions_count": { "type": "integer", - "example": 100 + "example": 101 }, "bridge_address": { "type": "string", @@ -2343,7 +2337,7 @@ }, "hash": { "type": "string", - "example": "19ba8abb3e4b56a309df6756c47b97e298e3a72d88449d36a0fadb1ca7366539" + "example": "O0Ia+lPYYMf3iFfxBaWXCSdlhphc6d4ZoBXINov6Tjc=" }, "id": { "type": "integer", diff --git a/cmd/api/docs/swagger.yaml b/cmd/api/docs/swagger.yaml index 7f21354..f84db05 100644 --- a/cmd/api/docs/swagger.yaml +++ b/cmd/api/docs/swagger.yaml @@ -213,7 +213,7 @@ definitions: responses.Rollup: properties: actions_count: - example: 100 + example: 101 type: integer bridge_address: example: 115F94D8C98FFD73FE65182611140F0EDC7C3C94 @@ -222,7 +222,7 @@ definitions: example: 100 type: integer hash: - example: 19ba8abb3e4b56a309df6756c47b97e298e3a72d88449d36a0fadb1ca7366539 + example: O0Ia+lPYYMf3iFfxBaWXCSdlhphc6d4ZoBXINov6Tjc= type: string id: example: 321 @@ -467,7 +467,7 @@ definitions: example: "0.97" type: string type: object -host: api-dusk-3.astrotrek.io +host: api-dusk-5.astrotrek.io info: contact: {} description: This is docs of Astria Explorer API. @@ -1152,10 +1152,8 @@ paths: description: Get rollup info operationId: get-rollup parameters: - - description: Hash + - description: Base64Url encoded rollup id in: path - maxLength: 64 - minLength: 64 name: hash required: true type: string @@ -1184,10 +1182,8 @@ paths: description: Get rollup actions operationId: rollup-actions parameters: - - description: Hash + - description: Base64Url encoded rollup id in: path - maxLength: 48 - minLength: 48 name: hash required: true type: string @@ -1322,10 +1318,8 @@ paths: description: Get histogram with precomputed rollup by series name and timeframe operationId: stats-rollup-series parameters: - - description: Hash + - description: Base64Url encoded rollup id in: path - maxLength: 48 - minLength: 48 name: hash required: true type: string diff --git a/cmd/api/handler/address_test.go b/cmd/api/handler/address_test.go index ca3d70b..636f10a 100644 --- a/cmd/api/handler/address_test.go +++ b/cmd/api/handler/address_test.go @@ -348,5 +348,5 @@ func (s *AddressTestSuite) TestRollups() { s.Require().EqualValues(1, rollup.ActionsCount) s.Require().EqualValues(100, rollup.FirstHeight) s.Require().EqualValues(10, rollup.Size) - s.Require().Equal(testRollupHash, rollup.AstriaId) + s.Require().Equal(testRollup.AstriaId, rollup.AstriaId) } diff --git a/cmd/api/handler/block_test.go b/cmd/api/handler/block_test.go index 1abbb40..283db21 100644 --- a/cmd/api/handler/block_test.go +++ b/cmd/api/handler/block_test.go @@ -6,6 +6,7 @@ package handler import ( "context" "database/sql" + "encoding/base64" "encoding/hex" "encoding/json" "net/http" @@ -80,7 +81,8 @@ var ( ActionsCount: 1, Size: 10, } - testRollupHash = hex.EncodeToString(testRollup.AstriaId) + testRollupURLHash = base64.URLEncoding.EncodeToString(testRollup.AstriaId) + testRollupHash = base64.StdEncoding.EncodeToString(testRollup.AstriaId) testRollupAction = storage.RollupAction{ Action: &storage.Action{ diff --git a/cmd/api/handler/responses/rollup.go b/cmd/api/handler/responses/rollup.go index a84e9e4..89ff68e 100644 --- a/cmd/api/handler/responses/rollup.go +++ b/cmd/api/handler/responses/rollup.go @@ -4,25 +4,23 @@ package responses import ( - "encoding/hex" - "github.com/celenium-io/astria-indexer/internal/storage" "github.com/celenium-io/astria-indexer/pkg/types" ) type Rollup struct { - Id uint64 `example:"321" json:"id" swaggertype:"integer"` - FirstHeight types.Level `example:"100" json:"first_height" swaggertype:"integer"` - AstriaId string `example:"19ba8abb3e4b56a309df6756c47b97e298e3a72d88449d36a0fadb1ca7366539" json:"hash" swaggertype:"string"` - ActionsCount int64 `example:"100" json:"actions_count" swaggertype:"integer"` - Size int64 `example:"100" json:"size" swaggertype:"integer"` - BridgeAddress string `example:"115F94D8C98FFD73FE65182611140F0EDC7C3C94" json:"bridge_address,omitempty" swaggertype:"string"` + Id uint64 `example:"321" json:"id" swaggertype:"integer"` + FirstHeight types.Level `example:"100" json:"first_height" swaggertype:"integer"` + AstriaId []byte `example:"O0Ia+lPYYMf3iFfxBaWXCSdlhphc6d4ZoBXINov6Tjc=" json:"hash" swaggertype:"string"` + ActionsCount int64 `example:"101" json:"actions_count" swaggertype:"integer"` + Size int64 `example:"100" json:"size" swaggertype:"integer"` + BridgeAddress string `example:"115F94D8C98FFD73FE65182611140F0EDC7C3C94" json:"bridge_address,omitempty" swaggertype:"string"` } func NewRollup(rollup *storage.Rollup) Rollup { r := Rollup{ Id: rollup.Id, - AstriaId: hex.EncodeToString(rollup.AstriaId), + AstriaId: rollup.AstriaId, FirstHeight: rollup.FirstHeight, ActionsCount: rollup.ActionsCount, Size: rollup.Size, diff --git a/cmd/api/handler/rollup.go b/cmd/api/handler/rollup.go index e6fe94e..728fe53 100644 --- a/cmd/api/handler/rollup.go +++ b/cmd/api/handler/rollup.go @@ -4,7 +4,7 @@ package handler import ( - "encoding/hex" + "encoding/base64" "net/http" "github.com/celenium-io/astria-indexer/cmd/api/handler/responses" @@ -34,7 +34,7 @@ func NewRollupHandler( } type getRollupRequest struct { - Hash string `param:"hash" validate:"required,rollup_id"` + Hash string `param:"hash" validate:"required,base64url"` } // Get godoc @@ -43,7 +43,7 @@ type getRollupRequest struct { // @Description Get rollup info // @Tags rollup // @ID get-rollup -// @Param hash path string true "Hash" minlength(64) maxlength(64) +// @Param hash path string true "Base64Url encoded rollup id" // @Produce json // @Success 200 {object} responses.Rollup // @Success 204 @@ -56,9 +56,9 @@ func (handler *RollupHandler) Get(c echo.Context) error { return badRequestError(c, err) } - hash, err := hex.DecodeString(req.Hash) + hash, err := base64.URLEncoding.DecodeString(req.Hash) if err != nil { - return badRequestError(c, err) + return handleError(c, err, handler.rollups) } rollup, err := handler.rollups.ByHash(c.Request().Context(), hash) @@ -127,7 +127,7 @@ func (handler *RollupHandler) List(c echo.Context) error { } type getRollupList struct { - Hash string `param:"hash" validate:"required,rollup_id"` + Hash string `param:"hash" validate:"required,base64url"` Limit int `query:"limit" validate:"omitempty,min=1,max=100"` Offset int `query:"offset" validate:"omitempty,min=0"` Sort string `query:"sort" validate:"omitempty,oneof=asc desc"` @@ -148,7 +148,7 @@ func (p *getRollupList) SetDefault() { // @Description Get rollup actions // @Tags rollup // @ID rollup-actions -// @Param hash path string true "Hash" minlength(48) maxlength(48) +// @Param hash path string true "Base64Url encoded rollup id" // @Param limit query integer false "Count of requested entities" minimum(1) maximum(100) // @Param offset query integer false "Offset" minimum(1) // @Param sort query string false "Sort order" Enums(asc, desc) @@ -164,7 +164,7 @@ func (handler *RollupHandler) Actions(c echo.Context) error { } req.SetDefault() - hash, err := hex.DecodeString(req.Hash) + hash, err := base64.URLEncoding.DecodeString(req.Hash) if err != nil { return badRequestError(c, err) } @@ -226,7 +226,7 @@ func (handler *RollupHandler) Addresses(c echo.Context) error { } req.SetDefault() - hash, err := hex.DecodeString(req.Hash) + hash, err := base64.URLEncoding.DecodeString(req.Hash) if err != nil { return badRequestError(c, err) } diff --git a/cmd/api/handler/rollup_test.go b/cmd/api/handler/rollup_test.go index d9c38c4..c51a574 100644 --- a/cmd/api/handler/rollup_test.go +++ b/cmd/api/handler/rollup_test.go @@ -59,7 +59,7 @@ func (s *RollupTestSuite) TestGet() { c := s.echo.NewContext(req, rec) c.SetPath("/rollup/:hash") c.SetParamNames("hash") - c.SetParamValues(testRollupHash) + c.SetParamValues(testRollupURLHash) s.rollups.EXPECT(). ByHash(gomock.Any(), testRollup.AstriaId). @@ -76,7 +76,7 @@ func (s *RollupTestSuite) TestGet() { s.Require().EqualValues(1, rollup.ActionsCount) s.Require().EqualValues(100, rollup.FirstHeight) s.Require().EqualValues(10, rollup.Size) - s.Require().Equal(testRollupHash, rollup.AstriaId) + s.Require().Equal(testRollup.AstriaId, rollup.AstriaId) } func (s *RollupTestSuite) TestGetInvalidAddress() { @@ -126,7 +126,7 @@ func (s *RollupTestSuite) TestList() { s.Require().EqualValues(1, rollup.ActionsCount) s.Require().EqualValues(100, rollup.FirstHeight) s.Require().EqualValues(10, rollup.Size) - s.Require().Equal(testRollupHash, rollup.AstriaId) + s.Require().Equal(testRollup.AstriaId, rollup.AstriaId) } func (s *RollupTestSuite) TestActions() { @@ -140,7 +140,7 @@ func (s *RollupTestSuite) TestActions() { c := s.echo.NewContext(req, rec) c.SetPath("/rollup/:hash/actions") c.SetParamNames("hash") - c.SetParamValues(testRollupHash) + c.SetParamValues(testRollupURLHash) s.rollups.EXPECT(). ByHash(gomock.Any(), testRollup.AstriaId). @@ -215,7 +215,7 @@ func (s *RollupTestSuite) TestAddresses() { c := s.echo.NewContext(req, rec) c.SetPath("/rollup/:hash/addresses") c.SetParamNames("hash") - c.SetParamValues(testRollupHash) + c.SetParamValues(testRollupURLHash) s.rollups.EXPECT(). ByHash(gomock.Any(), testRollup.AstriaId). diff --git a/cmd/api/handler/stats.go b/cmd/api/handler/stats.go index 3a22a27..bf46cb1 100644 --- a/cmd/api/handler/stats.go +++ b/cmd/api/handler/stats.go @@ -4,7 +4,7 @@ package handler import ( - "encoding/hex" + "encoding/base64" "net/http" "github.com/celenium-io/astria-indexer/cmd/api/handler/responses" @@ -88,11 +88,11 @@ func (sh StatsHandler) Series(c echo.Context) error { } type rollupSeriesRequest struct { - Hash string `example:"00112233" param:"hash" swaggertype:"string" validate:"required,rollup_id"` - Timeframe string `example:"hour" param:"timeframe" swaggertype:"string" validate:"required,oneof=hour day month"` - SeriesName string `example:"size" param:"name" swaggertype:"string" validate:"required,oneof=size avg_size min_size max_size actions_count"` - From int64 `example:"1692892095" query:"from" swaggertype:"integer" validate:"omitempty,min=1"` - To int64 `example:"1692892095" query:"to" swaggertype:"integer" validate:"omitempty,min=1"` + Hash string `example:"O0Ia+lPYYMf3iFfxBaWXCSdlhphc6d4ZoBXINov6Tjc=" param:"hash" swaggertype:"string" validate:"required,base64url"` + Timeframe string `example:"hour" param:"timeframe" swaggertype:"string" validate:"required,oneof=hour day month"` + SeriesName string `example:"size" param:"name" swaggertype:"string" validate:"required,oneof=size avg_size min_size max_size actions_count"` + From int64 `example:"1692892095" query:"from" swaggertype:"integer" validate:"omitempty,min=1"` + To int64 `example:"1692892095" query:"to" swaggertype:"integer" validate:"omitempty,min=1"` } // RollupSeries godoc @@ -101,7 +101,7 @@ type rollupSeriesRequest struct { // @Description Get histogram with precomputed rollup by series name and timeframe // @Tags stats // @ID stats-rollup-series -// @Param hash path string true "Hash" minlength(48) maxlength(48) +// @Param hash path string true "Base64Url encoded rollup id" // @Param timeframe path string true "Timeframe" Enums(hour, day, month) // @Param name path string true "Series name" Enums(size, avg_size, min_size, max_size, actions_count) // @Param from query integer false "Time from in unix timestamp" mininum(1) @@ -117,7 +117,7 @@ func (sh StatsHandler) RollupSeries(c echo.Context) error { return badRequestError(c, err) } - hash, err := hex.DecodeString(req.Hash) + hash, err := base64.URLEncoding.DecodeString(req.Hash) if err != nil { return badRequestError(c, err) } diff --git a/cmd/api/handler/stats_test.go b/cmd/api/handler/stats_test.go index 9c16a1e..3028dba 100644 --- a/cmd/api/handler/stats_test.go +++ b/cmd/api/handler/stats_test.go @@ -123,7 +123,7 @@ func (s *StatsTestSuite) TestRollupStatsHistogram() { c := s.echo.NewContext(req, rec) c.SetPath("/v1/stats/rollup/series/:hash/:name/:timeframe") c.SetParamNames("hash", "name", "timeframe") - c.SetParamValues(testRollupHash, name, string(tf)) + c.SetParamValues(testRollupURLHash, name, string(tf)) s.rollups.EXPECT(). ByHash(gomock.Any(), testRollup.AstriaId). diff --git a/cmd/api/handler/validators.go b/cmd/api/handler/validators.go index d8bf303..3a2150d 100644 --- a/cmd/api/handler/validators.go +++ b/cmd/api/handler/validators.go @@ -27,9 +27,6 @@ func NewApiValidator() *ApiValidator { if err := v.RegisterValidation("action_type", actionTypeValidator()); err != nil { panic(err) } - if err := v.RegisterValidation("rollup_id", rollupIdValidator()); err != nil { - panic(err) - } return &ApiValidator{validator: v} } @@ -68,18 +65,3 @@ func actionTypeValidator() validator.Func { return err == nil } } - -var regexHash = regexp.MustCompile("[0-9A-Fa-f]{64}") - -func isHash(s string) bool { - if len(s) != 64 { - return false - } - return regexHash.MatchString(s) -} - -func rollupIdValidator() validator.Func { - return func(fl validator.FieldLevel) bool { - return isHash(fl.Field().String()) - } -} diff --git a/cmd/api/handler/validators_test.go b/cmd/api/handler/validators_test.go index ced7cbf..c0bbabd 100644 --- a/cmd/api/handler/validators_test.go +++ b/cmd/api/handler/validators_test.go @@ -40,12 +40,3 @@ func Test_isAddress(t *testing.T) { }) } } - -func TestRollupIdValidate(t *testing.T) { - t.Run("validate rollup id", func(t *testing.T) { - require.True(t, isHash("19BA8ABB3E4B56A309DF6756C47B97E298E3A72D88449D36A0FADB1CA7366539")) - require.False(t, isHash("LLBA8ABB3E4B56A309DF6756C47B97E298E3A72D88449D36A0FADB1CA7366539")) - require.False(t, isHash("invalid")) - require.False(t, isHash("")) - }) -} diff --git a/internal/storage/mock/action.go b/internal/storage/mock/action.go index f9eb807..fc104b6 100644 --- a/internal/storage/mock/action.go +++ b/internal/storage/mock/action.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by MockGen. DO NOT EDIT. // Source: action.go // diff --git a/internal/storage/mock/address.go b/internal/storage/mock/address.go index be1866e..482044d 100644 --- a/internal/storage/mock/address.go +++ b/internal/storage/mock/address.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by MockGen. DO NOT EDIT. // Source: address.go // diff --git a/internal/storage/mock/balance.go b/internal/storage/mock/balance.go index 0b9f79e..7476455 100644 --- a/internal/storage/mock/balance.go +++ b/internal/storage/mock/balance.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by MockGen. DO NOT EDIT. // Source: balance.go // diff --git a/internal/storage/mock/balance_update.go b/internal/storage/mock/balance_update.go index 1410a2f..a1a23d0 100644 --- a/internal/storage/mock/balance_update.go +++ b/internal/storage/mock/balance_update.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by MockGen. DO NOT EDIT. // Source: balance_update.go // diff --git a/internal/storage/mock/block.go b/internal/storage/mock/block.go index 3920ab2..032cc20 100644 --- a/internal/storage/mock/block.go +++ b/internal/storage/mock/block.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by MockGen. DO NOT EDIT. // Source: block.go // diff --git a/internal/storage/mock/block_signature.go b/internal/storage/mock/block_signature.go index 3453ec6..dfd557e 100644 --- a/internal/storage/mock/block_signature.go +++ b/internal/storage/mock/block_signature.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by MockGen. DO NOT EDIT. // Source: block_signature.go // diff --git a/internal/storage/mock/block_stats.go b/internal/storage/mock/block_stats.go index 9cc3de6..17cebf8 100644 --- a/internal/storage/mock/block_stats.go +++ b/internal/storage/mock/block_stats.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by MockGen. DO NOT EDIT. // Source: block_stats.go // diff --git a/internal/storage/mock/constant.go b/internal/storage/mock/constant.go index 37cca30..c3525dc 100644 --- a/internal/storage/mock/constant.go +++ b/internal/storage/mock/constant.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by MockGen. DO NOT EDIT. // Source: constant.go // diff --git a/internal/storage/mock/generic.go b/internal/storage/mock/generic.go index 6866b66..f515393 100644 --- a/internal/storage/mock/generic.go +++ b/internal/storage/mock/generic.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by MockGen. DO NOT EDIT. // Source: generic.go // diff --git a/internal/storage/mock/rollup.go b/internal/storage/mock/rollup.go index cf40f54..6a54681 100644 --- a/internal/storage/mock/rollup.go +++ b/internal/storage/mock/rollup.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by MockGen. DO NOT EDIT. // Source: rollup.go // diff --git a/internal/storage/mock/state.go b/internal/storage/mock/state.go index 8e4ff83..21be0f8 100644 --- a/internal/storage/mock/state.go +++ b/internal/storage/mock/state.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by MockGen. DO NOT EDIT. // Source: state.go // diff --git a/internal/storage/mock/stats.go b/internal/storage/mock/stats.go index 076501f..25272e7 100644 --- a/internal/storage/mock/stats.go +++ b/internal/storage/mock/stats.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by MockGen. DO NOT EDIT. // Source: stats.go // diff --git a/internal/storage/mock/tx.go b/internal/storage/mock/tx.go index 4d65f0c..faf5d92 100644 --- a/internal/storage/mock/tx.go +++ b/internal/storage/mock/tx.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by MockGen. DO NOT EDIT. // Source: tx.go // diff --git a/internal/storage/mock/validator.go b/internal/storage/mock/validator.go index 3bb0fc0..4b13c68 100644 --- a/internal/storage/mock/validator.go +++ b/internal/storage/mock/validator.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by MockGen. DO NOT EDIT. // Source: validator.go // diff --git a/internal/storage/postgres/sentry_hook.go b/internal/storage/postgres/sentry_hook.go index 3bc1fe3..01289bd 100644 --- a/internal/storage/postgres/sentry_hook.go +++ b/internal/storage/postgres/sentry_hook.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + package postgres import ( diff --git a/internal/storage/types/action_type_enum.go b/internal/storage/types/action_type_enum.go index 1075bb5..6914ffc 100644 --- a/internal/storage/types/action_type_enum.go +++ b/internal/storage/types/action_type_enum.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by go-enum DO NOT EDIT. // Version: 0.5.7 // Revision: bf63e108589bbd2327b13ec2c5da532aad234029 diff --git a/internal/storage/types/module_enum.go b/internal/storage/types/module_enum.go index 7f790ad..f1574fb 100644 --- a/internal/storage/types/module_enum.go +++ b/internal/storage/types/module_enum.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by go-enum DO NOT EDIT. // Version: 0.5.7 // Revision: bf63e108589bbd2327b13ec2c5da532aad234029 diff --git a/internal/storage/types/status_enum.go b/internal/storage/types/status_enum.go index 9520183..fe296df 100644 --- a/internal/storage/types/status_enum.go +++ b/internal/storage/types/status_enum.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by go-enum DO NOT EDIT. // Version: 0.5.7 // Revision: bf63e108589bbd2327b13ec2c5da532aad234029 diff --git a/pkg/node/mock/api.go b/pkg/node/mock/api.go index f211cc2..2ac0b6e 100644 --- a/pkg/node/mock/api.go +++ b/pkg/node/mock/api.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 PK Lab AG +// SPDX-License-Identifier: MIT + // Code generated by MockGen. DO NOT EDIT. // Source: api.go //