Skip to content

Commit

Permalink
fix:transaction list time field.
Browse files Browse the repository at this point in the history
  • Loading branch information
romever committed Nov 16, 2024
1 parent f8e04be commit d0079f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/internal/logic/chain/chainblockslogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ func (l *ChainBlocksLogic) ChainBlocks(req *types.ChainBlocksRequest) (resp *typ
list = append(list, &types.ChainBlockInfo{
Height: block.Height,
Epoch: block.Epoch,
Timestamp: uint64(block.Timestamp.UTC().Unix()),
Time: uint64(time.Now().UTC().Unix() - block.Timestamp.UTC().Unix()),
Timestamp: uint64(block.Timestamp.Unix()),
Time: uint64(time.Now().Unix() - block.Timestamp.Unix()),
Hash: block.Hash,
Txs: block.Txs,
EntityAddress: block.EntityAddress,
Expand Down
4 changes: 2 additions & 2 deletions api/internal/logic/chain/chaintransactionslogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ func FormatTx(tx *model.Transaction, txType string, ctx context.Context, svcCtx
Amount: amount,
Shares: shares,
Add: add,
Timestamp: uint64(tx.Timestamp.UTC().Unix()),
Time: uint64(time.Now().UTC().Unix() - tx.Timestamp.UTC().Unix()),
Timestamp: uint64(tx.Timestamp.Unix()),
Time: uint64(time.Now().Unix() - tx.Timestamp.Unix()),
Status: tx.Status,
From: tx.SignAddr,
To: tx.ToAddr,
Expand Down

0 comments on commit d0079f5

Please sign in to comment.