diff --git a/api/node/server/server.go b/api/node/server/server.go index 00db5f6335..3bced27a58 100644 --- a/api/node/server/server.go +++ b/api/node/server/server.go @@ -17,6 +17,7 @@ import ( "github.com/spacemeshos/go-spacemesh/api/node/models" "github.com/spacemeshos/go-spacemesh/common/types" "github.com/spacemeshos/go-spacemesh/hare3" + "github.com/spacemeshos/go-spacemesh/hare3/eligibility" "github.com/spacemeshos/go-spacemesh/p2p/pubsub" ) @@ -288,6 +289,9 @@ func (s *Server) GetHareWeightNodeIdLayer(ctx context.Context, } weight, err := s.hare.MinerWeight(ctx, id, types.LayerID(request.Layer)) if err != nil { + if errors.Is(err, eligibility.ErrNotActive) { + return &GetHareWeightNodeIdLayer200JSONResponse{Weight: 0}, nil + } return nil, fmt.Errorf("miner weight: %w", err) } return &GetHareWeightNodeIdLayer200JSONResponse{Weight: weight}, nil diff --git a/systest/tests/transactions_test.go b/systest/tests/transactions_test.go index 278a7d3fd4..483b779a8e 100644 --- a/systest/tests/transactions_test.go +++ b/systest/tests/transactions_test.go @@ -104,8 +104,7 @@ func testTransactions( } diff := batch * amount * int(sendFor-1) * cl.Accounts() - for i := 0; i < cl.Total(); i++ { - client := cl.Client(i) + for _, client := range nodesReceivingTxs { state := pb.NewGlobalStateServiceClient(client.PubConn()) response, err := state.Account( tctx, @@ -119,7 +118,11 @@ func testTransactions( "expected-diff", diff, "diff", after.Value-before.Value, ) - require.Equal(tb, int(before.Value)+diff, - int(response.AccountWrapper.StateCurrent.Balance.Value), "client=%s", client.Name) + require.Equal(tb, + before.Value+uint64(diff), + response.AccountWrapper.StateCurrent.Balance.Value, + "client=%s", + client.Name, + ) } }