func transactionContextID(chainID, txid string) string {
	return chainID + txid
}
transactionContextID builds a transaction context identifier by
concatenating a channel ID and a transaction ID.
package shim
import (
	"errors"
	"fmt"
	"sync"
	"github.com/golang/protobuf/proto"
	pb "github.com/hyperledger/fabric-protos-go/peer"
)
type state string
const (
	created     state = "created"      
	established state = "established"  
	ready       state = "ready"        
)
type PeerChaincodeStream interface {
	Send(*pb.ChaincodeMessage) error
	Recv() (*pb.ChaincodeMessage, error)
}
type ClientStream interface {
	PeerChaincodeStream
	CloseSend() error
}
type Handler struct {
	serialLock sync.Mutex
	chatStream PeerChaincodeStream
	cc Chaincode
	state state
	responseChannelsMutex sync.Mutex
	responseChannels      map[string]chan pb.ChaincodeMessage
}
func shorttxid(txid string) string {
	if len(txid) < 8 {
		return txid
	}
	return txid[0:8]
}
func (h *Handler) serialSend(msg *pb.ChaincodeMessage) error {
	h.serialLock.Lock()
	defer h.serialLock.Unlock()
	return h.chatStream.Send(msg)
}
func (h *Handler) serialSendAsync(msg *pb.ChaincodeMessage, errc chan<- error) {
	go func() {
		errc <- h.serialSend(msg)
	}()
}