From a6e50813592a7bfc325072af4f7d5ad9a00928dd Mon Sep 17 00:00:00 2001 From: denyeart Date: Thu, 6 Apr 2017 18:57:43 -0400 Subject: [PATCH] FAB-3029 Fix marbles02 timestamp package Marbles02 chaincode was using timestamp function from github.com/golang/protobuf/ptypes. This caused problem in docker environment since the go package would have to be vendored into the chaincode. Replaced with native golang timestamp function, to avoid having to vendor. Change-Id: Iae914054aa9775f3d02e57ca841c57a37704dd7e Signed-off-by: denyeart --- examples/chaincode/go/marbles02/marbles_chaincode.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/chaincode/go/marbles02/marbles_chaincode.go b/examples/chaincode/go/marbles02/marbles_chaincode.go index dcb26cd3fcd..b9eac454272 100644 --- a/examples/chaincode/go/marbles02/marbles_chaincode.go +++ b/examples/chaincode/go/marbles02/marbles_chaincode.go @@ -80,8 +80,8 @@ import ( "fmt" "strconv" "strings" + "time" - "github.com/golang/protobuf/ptypes" "github.com/hyperledger/fabric/core/chaincode/shim" pb "github.com/hyperledger/fabric/protos/peer" ) @@ -608,7 +608,7 @@ func (t *SimpleChaincode) getHistoryForMarble(stub shim.ChaincodeStubInterface, buffer.WriteString(", \"Timestamp\":") buffer.WriteString("\"") - buffer.WriteString(ptypes.TimestampString(response.Timestamp)) + buffer.WriteString(time.Unix(response.Timestamp.Seconds, int64(response.Timestamp.Nanos)).String()) buffer.WriteString("\"") buffer.WriteString(", \"IsDelete\":")