Skip to content

Commit 1a37167

Browse files
shutter-service: fix pre commit
1 parent f52e859 commit 1a37167

File tree

13 files changed

+27
-17
lines changed

13 files changed

+27
-17
lines changed

rolling-shutter/cmd/shutterservice/shutterservice.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import (
66
"github.com/jackc/pgx/v4/pgxpool"
77
"github.com/pkg/errors"
88
"github.com/rs/zerolog/log"
9+
"github.com/spf13/cobra"
10+
911
"github.com/shutter-network/rolling-shutter/rolling-shutter/cmd/shversion"
1012
keyper "github.com/shutter-network/rolling-shutter/rolling-shutter/keyperimpl/shutterservice"
1113
"github.com/shutter-network/rolling-shutter/rolling-shutter/keyperimpl/shutterservice/database"
1214
"github.com/shutter-network/rolling-shutter/rolling-shutter/medley/configuration/command"
1315
"github.com/shutter-network/rolling-shutter/rolling-shutter/medley/db"
1416
"github.com/shutter-network/rolling-shutter/rolling-shutter/medley/service"
15-
"github.com/spf13/cobra"
1617
)
1718

1819
func Cmd() *cobra.Command {

rolling-shutter/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ require (
3131
github.com/pkg/errors v0.9.1
3232
github.com/prometheus/client_golang v1.19.1
3333
github.com/rs/zerolog v1.28.0
34+
github.com/shutter-network/contracts/v2 v2.0.0-beta.2.0.20241129172533-e843e747ddb1
3435
github.com/shutter-network/gnosh-contracts v0.4.0
3536
github.com/shutter-network/shop-contracts v0.0.0-20240407151512-08ef5d8355b6
3637
github.com/shutter-network/shutter/shlib v0.1.19
@@ -217,7 +218,6 @@ require (
217218
github.com/rs/cors v1.9.0 // indirect
218219
github.com/sasha-s/go-deadlock v0.3.1 // indirect
219220
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
220-
github.com/shutter-network/contracts/v2 v2.0.0-beta.2.0.20241129172533-e843e747ddb1 // indirect
221221
github.com/spaolacci/murmur3 v1.1.0 // indirect
222222
github.com/spf13/cast v1.5.1 // indirect
223223
github.com/spf13/jwalterweatherman v1.1.0 // indirect

rolling-shutter/keyperimpl/shutterservice/config.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"io"
55

66
"github.com/ethereum/go-ethereum/common"
7+
78
"github.com/shutter-network/rolling-shutter/rolling-shutter/keyper/kprconfig"
89
"github.com/shutter-network/rolling-shutter/rolling-shutter/medley/configuration"
910
"github.com/shutter-network/rolling-shutter/rolling-shutter/medley/metricsserver"
@@ -39,7 +40,7 @@ type Config struct {
3940
}
4041

4142
func (c *Config) Validate() error {
42-
//TODO: needs to be implemented
43+
// TODO: needs to be implemented
4344
return nil
4445
}
4546

@@ -50,7 +51,7 @@ func (c *Config) Name() string {
5051
func (c *Config) SetDefaultValues() error {
5152
c.HTTPEnabled = false
5253
c.HTTPListenAddress = ":3000"
53-
c.MaxNumKeysPerMessage = 500 //TODO: need to confirm on this
54+
c.MaxNumKeysPerMessage = 500 // TODO: need to confirm on this
5455
return nil
5556
}
5657

rolling-shutter/keyperimpl/shutterservice/handlers.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
pubsub "github.com/libp2p/go-libp2p-pubsub"
99
"github.com/pkg/errors"
1010
"github.com/rs/zerolog/log"
11+
1112
obskeyperdatabase "github.com/shutter-network/rolling-shutter/rolling-shutter/chainobserver/db/keyper"
1213
corekeyperdatabase "github.com/shutter-network/rolling-shutter/rolling-shutter/keyper/database"
1314
"github.com/shutter-network/rolling-shutter/rolling-shutter/keyperimpl/shutterservice/database"
@@ -28,7 +29,7 @@ func (h *DecryptionKeySharesHandler) MessagePrototypes() []p2pmsg.Message {
2829
}
2930

3031
func (h *DecryptionKeySharesHandler) ValidateMessage(ctx context.Context, msg p2pmsg.Message) (pubsub.ValidationResult, error) {
31-
//TODO: should we implement some check that this identity is to be decrypted even or not, or this can be taken care of by implementing triggered block in decTrigger?
32+
// TODO: should we implement some check that this identity is to be decrypted even or not, or this can be taken care of by implementing triggered block in decTrigger?
3233
keyShares := msg.(*p2pmsg.DecryptionKeyShares)
3334
extra, ok := keyShares.Extra.(*p2pmsg.DecryptionKeyShares_Service)
3435
if !ok {

rolling-shutter/keyperimpl/shutterservice/handlers_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99

1010
"github.com/ethereum/go-ethereum/common"
1111
pubsub "github.com/libp2p/go-libp2p-pubsub"
12+
"gotest.tools/assert"
13+
1214
obskeyperdatabase "github.com/shutter-network/rolling-shutter/rolling-shutter/chainobserver/db/keyper"
1315
corekeyperdatabase "github.com/shutter-network/rolling-shutter/rolling-shutter/keyper/database"
1416
"github.com/shutter-network/rolling-shutter/rolling-shutter/keyperimpl/shutterservice/database"
@@ -17,7 +19,6 @@ import (
1719
"github.com/shutter-network/rolling-shutter/rolling-shutter/p2p"
1820
"github.com/shutter-network/rolling-shutter/rolling-shutter/p2pmsg"
1921
"github.com/shutter-network/rolling-shutter/rolling-shutter/shdb"
20-
"gotest.tools/assert"
2122
)
2223

2324
func TestHandleDecryptionKeySharesThresholdNotReached(t *testing.T) {

rolling-shutter/keyperimpl/shutterservice/keyper.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
"github.com/pkg/errors"
1010
"github.com/rs/zerolog/log"
1111
registryBindings "github.com/shutter-network/contracts/v2/bindings/shutterregistry"
12+
"golang.org/x/exp/slog"
13+
1214
"github.com/shutter-network/rolling-shutter/rolling-shutter/eonkeypublisher"
1315
"github.com/shutter-network/rolling-shutter/rolling-shutter/keyper"
1416
"github.com/shutter-network/rolling-shutter/rolling-shutter/keyper/epochkghandler"
@@ -20,7 +22,6 @@ import (
2022
"github.com/shutter-network/rolling-shutter/rolling-shutter/medley/db"
2123
"github.com/shutter-network/rolling-shutter/rolling-shutter/medley/service"
2224
"github.com/shutter-network/rolling-shutter/rolling-shutter/p2p"
23-
"golang.org/x/exp/slog"
2425
)
2526

2627
var ErrParseKeyperSet = errors.New("cannot parse KeyperSet")
@@ -153,7 +154,7 @@ func (kpr *Keyper) initRegistrySyncer(ctx context.Context) error {
153154
return err
154155
}
155156

156-
//TODO: need to update go module after contract is finalised
157+
// TODO: need to update go module after contract is finalised
157158
kpr.registrySyncer = &RegistrySyncer{
158159
Contract: contract,
159160
DBPool: kpr.dbpool,
@@ -185,7 +186,7 @@ func (kpr *Keyper) processInputs(ctx context.Context) error {
185186
err = kpr.processNewKeyperSet(ctx, ev)
186187
case ev := <-kpr.newEonPublicKeys:
187188
err = kpr.processNewEonPublicKey(ctx, ev)
188-
//TODO: handle explicit decryption trigger, if needed
189+
// TODO: handle explicit decryption trigger, if needed
189190
case <-ctx.Done():
190191
return ctx.Err()
191192
}

rolling-shutter/keyperimpl/shutterservice/messagingmiddleware.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
pubsub "github.com/libp2p/go-libp2p-pubsub"
1010
"github.com/pkg/errors"
1111
"github.com/rs/zerolog/log"
12+
"google.golang.org/protobuf/proto"
13+
1214
obskeyperdatabase "github.com/shutter-network/rolling-shutter/rolling-shutter/chainobserver/db/keyper"
1315
"github.com/shutter-network/rolling-shutter/rolling-shutter/keyperimpl/shutterservice/database"
1416
"github.com/shutter-network/rolling-shutter/rolling-shutter/keyperimpl/shutterservice/serviceztypes"
@@ -17,7 +19,6 @@ import (
1719
"github.com/shutter-network/rolling-shutter/rolling-shutter/medley/service"
1820
"github.com/shutter-network/rolling-shutter/rolling-shutter/p2p"
1921
"github.com/shutter-network/rolling-shutter/rolling-shutter/p2pmsg"
20-
"google.golang.org/protobuf/proto"
2122
)
2223

2324
type MessagingMiddleware struct {
@@ -175,7 +176,7 @@ func (i *MessagingMiddleware) interceptDecryptionKeys(
175176
ctx context.Context,
176177
originalMsg *p2pmsg.DecryptionKeys,
177178
) (p2pmsg.Message, error) {
178-
//TODO: update flag in event table to notify the decryption is already done
179+
// TODO: update flag in event table to notify the decryption is already done
179180
if originalMsg.Extra != nil {
180181
return originalMsg, nil
181182
}

rolling-shutter/keyperimpl/shutterservice/newblock.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/jackc/pgx/v4"
1010
"github.com/pkg/errors"
1111
"github.com/rs/zerolog/log"
12+
1213
obskeyper "github.com/shutter-network/rolling-shutter/rolling-shutter/chainobserver/db/keyper"
1314
corekeyperdatabase "github.com/shutter-network/rolling-shutter/rolling-shutter/keyper/database"
1415
"github.com/shutter-network/rolling-shutter/rolling-shutter/keyper/epochkghandler"

rolling-shutter/keyperimpl/shutterservice/newkeyperset.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/jackc/pgx/v4"
77
"github.com/pkg/errors"
88
"github.com/rs/zerolog/log"
9+
910
obskeyper "github.com/shutter-network/rolling-shutter/rolling-shutter/chainobserver/db/keyper"
1011
"github.com/shutter-network/rolling-shutter/rolling-shutter/medley"
1112
syncevent "github.com/shutter-network/rolling-shutter/rolling-shutter/medley/chainsync/event"

rolling-shutter/keyperimpl/shutterservice/registrysyncer.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"github.com/pkg/errors"
1616
"github.com/rs/zerolog/log"
1717
registryBindings "github.com/shutter-network/contracts/v2/bindings/shutterregistry"
18+
1819
"github.com/shutter-network/rolling-shutter/rolling-shutter/keyperimpl/shutterservice/database"
1920
"github.com/shutter-network/rolling-shutter/rolling-shutter/medley"
2021
"github.com/shutter-network/rolling-shutter/rolling-shutter/shdb"
@@ -263,7 +264,7 @@ func (s *RegistrySyncer) insertIdentityRegisteredEvents(
263264
}
264265

265266
func computeIdentity(event *registryBindings.ShutterregistryIdentityRegistered) []byte {
266-
//TODO: may need to change this if we want to create identity other way
267+
// TODO: may need to change this if we want to create identity other way
267268
var buf bytes.Buffer
268269
buf.Write(event.IdentityPrefix[:])
269270
buf.Write(event.Sender.Bytes())

0 commit comments

Comments
 (0)