Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew7234 committed Feb 13, 2024
1 parent b16c163 commit 932be12
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions storage/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1493,29 +1493,19 @@ func (c *StorageClient) RuntimeAccount(ctx context.Context, address staking.Addr
evmContract.Verification = nil
}

var totalSent pgtype.Numeric
var totalReceived pgtype.Numeric
err = c.db.QueryRow(
ctx,
queries.RuntimeAccountStats,
runtimeFromCtx(ctx),
address.String(),
).Scan(
&totalSent,
&totalReceived,
&a.Stats.TotalSent,
&a.Stats.TotalReceived,
&a.Stats.NumTxns,
)

switch err {
case nil:
a.Stats.TotalSent, err = common.NumericToBigInt(totalSent)
if err != nil {
return nil, wrapError(err)
}
a.Stats.TotalReceived, err = common.NumericToBigInt(totalReceived)
if err != nil {
return nil, wrapError(err)
}
case pgx.ErrNoRows:
// If an account address has no activity, default to 0.
a.Stats.TotalSent = common.NewBigInt(0)
Expand Down

0 comments on commit 932be12

Please sign in to comment.