From dbb1d76ba6168f73712768f11cc5b4d9a9d727db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20R=C3=B3=C5=BCa=C5=84ski?= Date: Tue, 31 Oct 2023 16:57:27 +0100 Subject: [PATCH] Fix format --- registration/config.go | 2 +- registration/registration_test.go | 20 ++++++++++++++++++-- rpc/rpcserver.go | 10 +++++++++- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/registration/config.go b/registration/config.go index d81dad71..92fd2df5 100644 --- a/registration/config.go +++ b/registration/config.go @@ -26,7 +26,7 @@ type Config struct { } type CertifierConfig struct { - URL string `long:"certifier-url" description:"The URL of the certifier service"` + URL string `long:"certifier-url" description:"The URL of the certifier service"` PubKey []byte `long:"certifier-pubkey" description:"The public key of the certifier service"` } diff --git a/registration/registration_test.go b/registration/registration_test.go index 2fe65d6f..baf15b37 100644 --- a/registration/registration_test.go +++ b/registration/registration_test.go @@ -58,7 +58,15 @@ func TestSubmitIdempotence(t *testing.T) { eg.Go(func() error { return r.Run(ctx) }) // Submit challenge - epoch, _, err := r.Submit(context.Background(), challenge, nodeID, nonce, registration.PowParams{}, nil, time.Time{}) + epoch, _, err := r.Submit( + context.Background(), + challenge, + nodeID, + nonce, + registration.PowParams{}, + nil, + time.Time{}, + ) req.NoError(err) req.Equal(uint(0), epoch) @@ -319,7 +327,15 @@ func Test_CheckCertificate(t *testing.T) { // passed certificate - still fallback to PoW powVerifier.EXPECT().Verify(challenge, nodeID, uint64(7)).Return(nil) - _, _, err = r.Submit(context.Background(), challenge, nodeID, 7, registration.PowParams{}, []byte{1, 2, 3, 4}, time.Time{}) + _, _, err = r.Submit( + context.Background(), + challenge, + nodeID, + 7, + registration.PowParams{}, + []byte{1, 2, 3, 4}, + time.Time{}, + ) require.NoError(t, err) }) t.Run("certification check enabled", func(t *testing.T) { diff --git a/rpc/rpcserver.go b/rpc/rpcserver.go index 110d1c86..fd3e9deb 100644 --- a/rpc/rpcserver.go +++ b/rpc/rpcserver.go @@ -71,7 +71,15 @@ func (r *rpcServer) Submit(ctx context.Context, in *api.SubmitRequest) (*api.Sub deadline = in.Deadline.AsTime() } - epoch, end, err := r.registration.Submit(ctx, in.Challenge, in.Pubkey, in.Nonce, powParams, in.Certificate.GetSignature(), deadline) + epoch, end, err := r.registration.Submit( + ctx, + in.Challenge, + in.Pubkey, + in.Nonce, + powParams, + in.Certificate.GetSignature(), + deadline, + ) switch { // FIXME: remove deprecated PoW case errors.Is(err, registration.ErrInvalidPow) || errors.Is(err, registration.ErrInvalidPowParams):