func (s *server) GetStateKey(ctx context.Context, req *pb.GetStateKeyRequest) (*pb.StateKey, error) {
	if r, found := s.relayers[req.ShardID]; found {
		var keyH chainhash.Hash
		copy(keyH[:], req.Key)
		val, err := r.GetStateKey(keyH)
		if err != nil {
			return nil, err
		}
		return &pb.StateKey{
			Value: val[:],
		}, nil
	}
	return nil, fmt.Errorf("not tracking shard %d", req.ShardID)
}
// GetStateKey gets a key from the state for a certain shard.
GetStateKey gets a key from the state for a certain shard.
// GetStateKey gets a key from the state for a certain shard .
func (s *server) GetStateKey(ctx context.Context, req *pb.GetStateKeyRequest) (*pb.StateKey, error) {
	if r, found := s.relayers[req.ShardID]; found {
		var keyH chainhash.Hash
		copy(keyH[:], req.Key)
		val, err := r.GetStateKey(keyH)
		if err != nil {
			return nil, err
		}
		return &pb.StateKey{
			Value: val[:],
		}, nil
	}
	return nil, fmt.Errorf("not tracking shard %d", req.ShardID)
}
func ( s * server ) GetStateKey ( ctx context . Context , req * pb . GetStateKeyRequest ) ( * pb . StateKey , error ) { if r , found := s . relayers [ req . ShardID ] ; found { var keyH chainhash . Hash copy ( keyH [ : ] , req . Key ) val , err := r . GetStateKey ( keyH ) if err != nil { return nil , err } return & pb . StateKey { Value : val [ : ] , } , nil } return nil , fmt . Errorf ( " " , req . ShardID ) }
GetStateKey gets a key from the state for a certain shard.
GetStateKey gets a key from the state for a certain shard .