Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
poszu committed Aug 8, 2024
1 parent 9a834fa commit 287b528
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 4 additions & 0 deletions activation/e2e/atx_merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,5 +513,9 @@ func Test_MarryAndMerge(t *testing.T) {
require.Equal(t, units[i], atxFromDb.NumUnits)
require.Equal(t, signer.NodeID(), atxFromDb.SmesherID)
require.Equal(t, publish, atxFromDb.PublishEpoch)
prev, err := atxs.Previous(db, atxFromDb.ID())
require.NoError(t, err)
require.Len(t, prev, 1)
require.Equal(t, mergedATX2.ID(), prev[0])
}
}
6 changes: 1 addition & 5 deletions activation/handler_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,11 +786,7 @@ func (h *HandlerV2) checkDoubleMerge(ctx context.Context, tx *sql.Tx, watx *acti
}

// Store an ATX in the DB.
func (h *HandlerV2) storeAtx(
ctx context.Context,
atx *types.ActivationTx,
watx *activationTx,
) error {
func (h *HandlerV2) storeAtx(ctx context.Context, atx *types.ActivationTx, watx *activationTx) error {
if err := h.cdb.WithTx(ctx, func(tx *sql.Tx) error {
if len(watx.marriages) != 0 {
marriageData := identities.MarriageData{
Expand Down
2 changes: 1 addition & 1 deletion api/grpcserver/v2alpha1/activation.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (s *ActivationStreamService) Stream(
}
continue
}
err = stream.Send(toAtx(rst))
err := stream.Send(toAtx(rst))
switch {
case errors.Is(err, io.EOF):
return nil
Expand Down
6 changes: 3 additions & 3 deletions api/grpcserver/v2alpha1/activation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,19 +194,19 @@ func TestActivationStreamService_Stream(t *testing.T) {
_, err = stream.Header()
require.NoError(t, err)

var expect []*events.ActivationTx
var expect []*types.ActivationTx
for _, rst := range streamed {
events.ReportNewActivation(rst.ActivationTx)
matcher := atxsMatcher{tc.request, ctx}
if matcher.match(rst) {
expect = append(expect, rst)
expect = append(expect, rst.ActivationTx)
}
}

for _, rst := range expect {
received, err := stream.Recv()
require.NoError(t, err)
require.Equal(t, toAtx(rst.ActivationTx).String(), received.String())
require.Equal(t, toAtx(rst).String(), received.String())
}
})
}
Expand Down

0 comments on commit 287b528

Please sign in to comment.