func (s *ShardRPCServer) SubmitBlock(ctx context.Context, req *pb.ShardBlockSubmission) (*empty.Empty, error) {
	block, err := primitives.ShardBlockFromProto(req.Block)
	if err != nil {
		return nil, err
	}

	manager, err := s.sm.GetManager(req.Shard)
	if err != nil {
		return nil, err
	}

	err = manager.ProcessBlock(*block)
	if err != nil {
		return nil, errors.Wrap(err, "error processing block submitted through RPC")
	}

	blockBytes, err := proto.Marshal(req.Block)
	if err != nil {
		return nil, err
	}

	err = s.hn.Broadcast(fmt.Sprintf("shard %d blocks", req.Shard), blockBytes)
	if err != nil {
		return nil, err
	}

	return &empty.Empty{}, nil
}
// SubmitBlock submits a block to the shard chain.
SubmitBlock submits a block to the shard chain.
// SubmitBlock submits a block to the shard chain .
func (s *ShardRPCServer) SubmitBlock(ctx context.Context, req *pb.ShardBlockSubmission) (*empty.Empty, error) {
	block, err := primitives.ShardBlockFromProto(req.Block)
	if err != nil {
		return nil, err
	}
	manager, err := s.sm.GetManager(req.Shard)
	if err != nil {
		return nil, err
	}
	err = manager.ProcessBlock(*block)
	if err != nil {
		return nil, errors.Wrap(err, "error processing block submitted through RPC")
	}
	blockBytes, err := proto.Marshal(req.Block)
	if err != nil {
		return nil, err
	}
	err = s.hn.Broadcast(fmt.Sprintf("shard %d blocks", req.Shard), blockBytes)
	if err != nil {
		return nil, err
	}
	return &empty.Empty{}, nil
}
func ( s * ShardRPCServer ) SubmitBlock ( ctx context . Context , req * pb . ShardBlockSubmission ) ( * empty . Empty , error ) { block , err := primitives . ShardBlockFromProto ( req . Block ) if err != nil { return nil , err } manager , err := s . sm . GetManager ( req . Shard ) if err != nil { return nil , err } err = manager . ProcessBlock ( * block ) if err != nil { return nil , errors . Wrap ( err , " " ) } blockBytes , err := proto . Marshal ( req . Block ) if err != nil { return nil , err } err = s . hn . Broadcast ( fmt . Sprintf ( " " , req . Shard ) , blockBytes ) if err != nil { return nil , err } return & empty . Empty { } , nil }
SubmitBlock submits a block to the shard chain.
SubmitBlock submits a block to the shard chain .