Skip to content

Commit

Permalink
FAB-3029 Fix marbles02 timestamp package
Browse files Browse the repository at this point in the history
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 <enyeart@us.ibm.com>
  • Loading branch information
denyeart committed Apr 6, 2017
1 parent 9e40c3c commit a6e5081
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/chaincode/go/marbles02/marbles_chaincode.go
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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\":")
Expand Down

0 comments on commit a6e5081

Please sign in to comment.