Skip to content

Commit

Permalink
rpc: remove num assets from universe Info call
Browse files Browse the repository at this point in the history
The call it just used as a quick sanity check, so doesn't need to depend
on a potentially expensive db transaction.

Fixes #643
  • Loading branch information
Roasbeef committed Nov 2, 2023
1 parent e3cf11e commit ce0d533
Show file tree
Hide file tree
Showing 5 changed files with 326 additions and 351 deletions.
2 changes: 1 addition & 1 deletion itest/universe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ func testUniverseFederation(t *harnessTest) {
// Test the content of the universe info call.
info, err := bob.Info(ctxt, &unirpc.InfoRequest{})
require.NoError(t.t, err)
require.EqualValues(t.t, 1, info.NumAssets)
require.NotZero(t.t, info.RuntimeId)

// We'll now make two new assets with Bob, and ensure that the state is
// properly pushed to the main node which is a part of the federation.
Expand Down
6 changes: 0 additions & 6 deletions rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3716,14 +3716,8 @@ func (r *rpcServer) InsertProof(ctx context.Context,
func (r *rpcServer) Info(ctx context.Context,
_ *unirpc.InfoRequest) (*unirpc.InfoResponse, error) {

universeStats, err := r.cfg.UniverseStats.AggregateSyncStats(ctx)
if err != nil {
return nil, err
}

return &unirpc.InfoResponse{
RuntimeId: r.cfg.RuntimeID,
NumAssets: universeStats.NumTotalAssets,
}, nil
}

Expand Down
Loading

0 comments on commit ce0d533

Please sign in to comment.