From d9a0fa91941b7f9ec64f30f7a39fad9b8f74852d Mon Sep 17 00:00:00 2001 From: ChronosX88 Date: Fri, 14 May 2021 22:42:22 +0300 Subject: [PATCH] Change type of timestamp in transaction --- types/transaction.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/transaction.go b/types/transaction.go index efa79b7..463eac2 100644 --- a/types/transaction.go +++ b/types/transaction.go @@ -10,12 +10,12 @@ import ( type Transaction struct { Hash []byte - Timestamp int64 + Timestamp time.Time Data []byte } func CreateTransaction(data []byte) *Transaction { - timestamp := time.Now().Unix() + timestamp := time.Now() encodedData := hex.EncodeToString(data) hash := crypto.Keccak256([]byte(fmt.Sprintf("%d_%s", timestamp, encodedData))) return &Transaction{