From d0079f51a6ae6d146ad8f6321f46938de4d7a798 Mon Sep 17 00:00:00 2001 From: romever <360876221@qq.com> Date: Sun, 17 Nov 2024 02:51:44 +0800 Subject: [PATCH] fix:transaction list time field. --- api/internal/logic/chain/chainblockslogic.go | 4 ++-- api/internal/logic/chain/chaintransactionslogic.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/internal/logic/chain/chainblockslogic.go b/api/internal/logic/chain/chainblockslogic.go index b579f32..6a53768 100644 --- a/api/internal/logic/chain/chainblockslogic.go +++ b/api/internal/logic/chain/chainblockslogic.go @@ -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, diff --git a/api/internal/logic/chain/chaintransactionslogic.go b/api/internal/logic/chain/chaintransactionslogic.go index 857a6ec..3bff52a 100644 --- a/api/internal/logic/chain/chaintransactionslogic.go +++ b/api/internal/logic/chain/chaintransactionslogic.go @@ -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,