Skip to content

Commit ce0d533

Browse files
committed
rpc: remove num assets from universe Info call
The call it just used as a quick sanity check, so doesn't need to depend on a potentially expensive db transaction. Fixes #643
1 parent e3cf11e commit ce0d533

File tree

5 files changed

+326
-351
lines changed

5 files changed

+326
-351
lines changed

itest/universe_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ func testUniverseFederation(t *harnessTest) {
458458
// Test the content of the universe info call.
459459
info, err := bob.Info(ctxt, &unirpc.InfoRequest{})
460460
require.NoError(t.t, err)
461-
require.EqualValues(t.t, 1, info.NumAssets)
461+
require.NotZero(t.t, info.RuntimeId)
462462

463463
// We'll now make two new assets with Bob, and ensure that the state is
464464
// properly pushed to the main node which is a part of the federation.

rpcserver.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3716,14 +3716,8 @@ func (r *rpcServer) InsertProof(ctx context.Context,
37163716
func (r *rpcServer) Info(ctx context.Context,
37173717
_ *unirpc.InfoRequest) (*unirpc.InfoResponse, error) {
37183718

3719-
universeStats, err := r.cfg.UniverseStats.AggregateSyncStats(ctx)
3720-
if err != nil {
3721-
return nil, err
3722-
}
3723-
37243719
return &unirpc.InfoResponse{
37253720
RuntimeId: r.cfg.RuntimeID,
3726-
NumAssets: universeStats.NumTotalAssets,
37273721
}, nil
37283722
}
37293723

0 commit comments

Comments
 (0)