Commits

Oliver Gu committed 889585a

Updated pickler/unpickler names

  • Participants
  • Parent commits e8d1001

Comments (0)

Files changed (2)

File lib/query.ml

   let ( = ) t1 t2 = (t1 = t2)
 
   let pickler =
-    Pickler.create ~name:"Server_log_level"
+    Pickler.create ~name:"Query.Server_log_level"
       Pickler.Spec.(value (required Level.val_type))
 
   let unpickler = Only_in_test.of_thunk (fun () ->
-    Unpickler.create ~name:"Server_log_level"
+    Unpickler.create ~name:"Query.Server_log_level"
       Unpickler.Spec.(value (required Level.val_type) ~name:"log_level")
       Fn.id)
 end
     let contract_spec =
       Raw_contract.Pickler_specs.market_data_query ()
     in
-    Pickler.create ~name:"Market_data"
+    Pickler.create ~name:"Query.Market_data"
       Pickler.Spec.(
         wrap (
           Fields.fold
     let contract_spec =
       Raw_contract.Unpickler_specs.market_data_query ()
     in
-    Unpickler.create ~name:"Market_data"
+    Unpickler.create ~name:"Query.Market_data"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())
     let contract_spec =
       Raw_contract.Pickler_specs.common_option_calc ()
     in
-    Pickler.create ~name:"Option_price"
+    Pickler.create ~name:"Query.Option_price"
       Pickler.Spec.(
         wrap (
           Fields.fold
     let contract_spec =
       Raw_contract.Unpickler_specs.option_price_query ()
     in
-    Unpickler.create ~name:"Option_price"
+    Unpickler.create ~name:"Query.Option_price"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())
     let contract_spec =
       Raw_contract.Pickler_specs.common_option_calc ()
     in
-    Pickler.create ~name:"Implied_volatility"
+    Pickler.create ~name:"Query.Implied_volatility"
       Pickler.Spec.(
         wrap (
           Fields.fold
     let contract_spec =
       Raw_contract.Unpickler_specs.implied_volatility_query ()
     in
-    Unpickler.create ~name:"Implied_volatility"
+    Unpickler.create ~name:"Query.Implied_volatility"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())
       ~account_code:(use Account_code.(=))
 
   let pickler =
-    Pickler.create ~name:"Account_and_portfolio_updates"
+    Pickler.create ~name:"Query.Account_and_portfolio_updates"
       Pickler.Spec.(
         wrap (
           Fields.fold
       (fun t -> `Args $ t.subscribe $ t.account_code))
 
   let unpickler = Only_in_test.of_thunk (fun () ->
-    Unpickler.create ~name:"Account_and_portfolio_updates"
+    Unpickler.create ~name:"Query.Account_and_portfolio_updates"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())
       ~order_action:(use (=))
 
   let pickler =
-    Pickler.create ~name:"Execution_data"
+    Pickler.create ~name:"Query.Execution_reports"
       Pickler.Spec.(
         wrap (
           Fields.fold
               $ t.order_action))
 
   let unpickler = Only_in_test.of_thunk (fun () ->
-    Unpickler.create ~name:"Execution_data"
+    Unpickler.create ~name:"Query.Execution_reports"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())
   let ( = ) t1 t2 = Raw_contract.(=) t1 t2
 
   let pickler =
-    Pickler.create ~name:"Contract_specs"
+    Pickler.create ~name:"Query.Contract_specs"
       (Raw_contract.Pickler_specs.contract_specs_query ())
 
   let unpickler = Only_in_test.of_thunk (fun () ->
-    Unpickler.create ~name:"Contract_specs"
+    Unpickler.create ~name:"Query.Contract_specs"
       (Raw_contract.Unpickler_specs.contract_specs_query ())
       Fn.id)
 end
     let contract_spec =
       Raw_contract.Pickler_specs.market_depth_query ()
     in
-    Pickler.create ~name:"Market_depth"
+    Pickler.create ~name:"Query.Market_depth"
       Pickler.Spec.(
         wrap (
           Fields.fold
     let contract_spec =
       Raw_contract.Unpickler_specs.market_depth_query ()
     in
-    Unpickler.create ~name:"Market_depth"
+    Unpickler.create ~name:"Query.Market_depth"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())
     let contract_spec =
       Raw_contract.Pickler_specs.historical_data_query ()
     in
-    Pickler.create ~name:"Historical_data"
+    Pickler.create ~name:"Query.Historical_data"
       Pickler.Spec.(
         wrap (
           Fields.fold
     let contract_spec =
       Raw_contract.Unpickler_specs.historical_data_query ()
     in
-    Unpickler.create ~name:"Historical_data"
+    Unpickler.create ~name:"Query.Historical_data"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())
     let contract_spec =
       Raw_contract.Pickler_specs.realtime_bars_query ()
     in
-    Pickler.create ~name:"Realtime_bars"
+    Pickler.create ~name:"Query.Realtime_bars"
       Pickler.Spec.(
         wrap (
           Fields.fold
     let contract_spec =
       Raw_contract.Unpickler_specs.realtime_bars_query ()
     in
-    Unpickler.create ~name:"Realtime_bars"
+    Unpickler.create ~name:"Query.Realtime_bars"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())

File lib/response.ml

   let ( = ) t1 t2 = (t1 = t2)
 
   let unpickler =
-    Unpickler.create ~name:"Tws_error"
+    Unpickler.create ~name:"Response.Tws_error"
       Unpickler.Spec.(
         Fields.fold
           ~init:(step Fn.id)
       (fun error_code error_msg  -> { error_code; error_msg })
 
   let pickler = Only_in_test.of_thunk (fun () ->
-    Pickler.create ~name:"Tws_error"
+    Pickler.create ~name:"Response.Tws_error"
       Pickler.Spec.(
         wrap (
           Fields.fold
   let ( = ) t1 t2 = (t1 = t2)
 
   let unpickler =
-    Unpickler.create ~name:"Server_time"
+    Unpickler.create ~name:"Response.Server_time"
       Unpickler.Spec.(value (required int64) ~name:"time")
       (fun long_int -> Time.of_float (Int64.to_float long_int))
 
   let pickler = Only_in_test.of_thunk (fun () ->
-    Pickler.create ~name:"Server_time"
+    Pickler.create ~name:"Response.Server_time"
       Pickler.Spec.(wrap (value (required int64))
                       (fun tm -> Int64.of_float (Time.to_float tm))))
 end
       ~can_auto_execute:(use (Option.equal (=)))
 
   let unpickler =
-    Unpickler.create ~name:"Tick_price"
+    Unpickler.create ~name:"Response.Tick_price"
       Unpickler.Spec.(
         Fields.fold
           ~init:(step Fn.id)
         { tick_type; price; size; can_auto_execute })
 
   let pickler = Only_in_test.of_thunk (fun () ->
-    Pickler.create ~name:"Tick_price"
+    Pickler.create ~name:"Response.Tick_price"
       Pickler.Spec.(
         wrap (
           Fields.fold
   let ( = ) t1 t2 = (t1 = t2)
 
   let unpickler =
-    Unpickler.create ~name:"Tick_size"
+    Unpickler.create ~name:"Response.Tick_size"
       Unpickler.Spec.(
         Fields.fold
           ~init:(step Fn.id)
       (fun tick_type size -> { tick_type; size })
 
   let pickler = Only_in_test.of_thunk (fun () ->
-    Pickler.create ~name:"Tick_size"
+    Pickler.create ~name:"Response.Tick_size"
       Pickler.Spec.(
         wrap (
           Fields.fold
       ~underlying_price:(use (Option.equal Price.(=.)))
 
   let unpickler =
-    Unpickler.create ~name:"Tick_option"
+    Unpickler.create ~name:"Response.Tick_option"
       Unpickler.Spec.(
         Fields.fold
           ~init:(step Fn.id)
           })
 
   let pickler = Only_in_test.of_thunk (fun () ->
-    Pickler.create ~name:"Tick_option"
+    Pickler.create ~name:"Response.Tick_option"
       Pickler.Spec.(
         wrap (
           Fields.fold
       ~value:(use (=))
 
   let unpickler =
-    Unpickler.create ~name:"Tick_string"
+    Unpickler.create ~name:"Response.Tick_string"
       Unpickler.Spec.(
         Fields.fold
           ~init:(step Fn.id)
       (fun tick_type value -> { tick_type; value })
 
   let pickler = Only_in_test.of_thunk (fun () ->
-    Pickler.create ~name:"Tick_string"
+    Pickler.create ~name:"Response.Tick_string"
       Pickler.Spec.(
         wrap (
           Fields.fold
   let create ~order_id = order_id
   let ( = ) t1 t2 = (t1 = t2)
   let unpickler =
-    Unpickler.create ~name:"Next_order_id"
+    Unpickler.create ~name:"Response.Next_order_id"
       Unpickler.Spec.(
         value (required Raw_order.Id.val_type)
           ~name:(Fieldslib.Field.name (Raw_order.Fields.order_id))
       ) Fn.id
 
   let pickler = Only_in_test.of_thunk (fun () ->
-    Pickler.create ~name:"Next_order_id"
+    Pickler.create ~name:"Response.Next_order_id"
       Pickler.Spec.(value (required Raw_order.Id.val_type)))
 end
 
       ~why_held:(use (=))
 
   let unpickler =
-    Unpickler.create ~name:"Order_status"
+    Unpickler.create ~name:"Response.Order_status"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())
           })
 
   let pickler = Only_in_test.of_thunk (fun () ->
-    Pickler.create ~name:"Order_status"
+    Pickler.create ~name:"Response.Order_status"
       Pickler.Spec.(
         wrap (
           Fields.fold
       ~account_code:(use (=))
 
   let unpickler =
-    Unpickler.create ~name:"Account_update"
+    Unpickler.create ~name:"Response.Account_update"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())
         { key; value; currency; account_code })
 
   let pickler = Only_in_test.of_thunk (fun () ->
-    Pickler.create ~name:"Account_update"
+    Pickler.create ~name:"Response.Account_update"
       Pickler.Spec.(
         wrap (
           Fields.fold
     let contract_spec =
       Raw_contract.Unpickler_specs.portfolio_update_response ()
     in
-    Unpickler.create ~name:"Portfolio_update"
+    Unpickler.create ~name:"Response.Portfolio_update"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())
     let contract_spec =
       Raw_contract.Pickler_specs.portfolio_update_response ()
     in
-    Pickler.create ~name:"Portfolio_value"
+    Pickler.create ~name:"Response.Portfolio_value"
       Pickler.Spec.(
         wrap (
           Fields.fold
       ~liquid_hours:(use (=))
 
   let unpickler =
-    Unpickler.create ~name:"Contract_specs"
+    Unpickler.create ~name:"Response.Contract_specs"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())
           })
 
   let pickler = Only_in_test.of_thunk (fun () ->
-    Pickler.create ~name:"Contract_specs"
+    Pickler.create ~name:"Response.Contract_specs"
       Pickler.Spec.(
         wrap (
           Fields.fold
     let contract_spec =
       Raw_contract.Unpickler_specs.execution_report_response ()
     in
-    Unpickler.create ~name:"Execution"
+    Unpickler.create ~name:"Response.Execution_report"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())
     let contract_spec =
       Raw_contract.Pickler_specs.execution_report_response ()
     in
-    Pickler.create ~name:"Execution"
+    Pickler.create ~name:"Response.Execution_report"
       Pickler.Spec.(
         wrap (
           Fields.fold
       ~yield_redemption_date:(use (=))
 
   let unpickler =
-    Unpickler.create ~name:"Commission_report"
+    Unpickler.create ~name:"Response.Commission_report"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())
           })
 
   let pickler = Only_in_test.of_thunk (fun () ->
-    Pickler.create ~name:"Commission_report"
+    Pickler.create ~name:"Response.Commission_report"
       Pickler.Spec.(
         wrap (
           Fields.fold
       ~size:(use (=))
 
   let unpickler =
-    Unpickler.create ~name:"Book_update"
+    Unpickler.create ~name:"Response.Book_update"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())
         { position; operation; side; price; size })
 
   let pickler = Only_in_test.of_thunk (fun () ->
-    Pickler.create ~name:"Book_update"
+    Pickler.create ~name:"Response.Book_update"
       Pickler.Spec.(
         wrap (
           Fields.fold
         ~count:(use (=))
 
     let unpickler =
-      Unpickler.create ~name:"Historical_data.Bar"
+      Unpickler.create ~name:"Response.Historical_data.Bar"
         Unpickler.Spec.(
           Fields.fold
             ~init:(empty ())
           })
 
     let pickler = Only_in_test.of_thunk (fun () ->
-      Pickler.create ~name:"Historical_data.Bar"
+      Pickler.create ~name:"Response.Historical_data.Bar"
         Pickler.Spec.(
           wrap (
             Fields.fold
       ~bars:(use (List.for_all2_exn ~f:Bar.(=)))
 
   let unpickler =
-    Unpickler.create ~name:"Historical_data"
+    Unpickler.create ~name:"Response.Historical_data"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())
         })
 
   let pickler = Only_in_test.of_thunk (fun () ->
-    Pickler.create ~name:"Historical_data"
+    Pickler.create ~name:"Response.Historical_data"
       Pickler.Spec.(
         wrap (
           Fields.fold
       ~count:(use (=))
 
   let unpickler =
-    Unpickler.create ~name:"Realtime_bar"
+    Unpickler.create ~name:"Response.Realtime_bar"
       Unpickler.Spec.(
         Fields.fold
           ~init:(empty ())
           })
 
   let pickler = Only_in_test.of_thunk (fun () ->
-    Pickler.create ~name:"Realtime_bar"
+    Pickler.create ~name:"Response.Realtime_bar"
       Pickler.Spec.(
         wrap (
           Fields.fold