Skip to content

Commit a6e5081

Browse files
committed
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 <[email protected]>
1 parent 9e40c3c commit a6e5081

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/chaincode/go/marbles02/marbles_chaincode.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ import (
8080
"fmt"
8181
"strconv"
8282
"strings"
83+
"time"
8384

84-
"github.com/golang/protobuf/ptypes"
8585
"github.com/hyperledger/fabric/core/chaincode/shim"
8686
pb "github.com/hyperledger/fabric/protos/peer"
8787
)
@@ -608,7 +608,7 @@ func (t *SimpleChaincode) getHistoryForMarble(stub shim.ChaincodeStubInterface,
608608

609609
buffer.WriteString(", \"Timestamp\":")
610610
buffer.WriteString("\"")
611-
buffer.WriteString(ptypes.TimestampString(response.Timestamp))
611+
buffer.WriteString(time.Unix(response.Timestamp.Seconds, int64(response.Timestamp.Nanos)).String())
612612
buffer.WriteString("\"")
613613

614614
buffer.WriteString(", \"IsDelete\":")

0 commit comments

Comments
 (0)