From 2bf4441fe4cd79c653f18823516e5ed23dc8adc5 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sat, 26 Sep 2026 13:56:57 +0000 Subject: [PATCH] core: adapt to datascript Int64 values (pin e439cba) Datascript upstream c39cad1 changed value Int of int to Int64 of int64. Convert at the boundary: chat domain types stay int, wrapped via Int64.of_int/Int64.to_int; test literals get the L suffix; sync codec emits Transit.Int64 unconditionally like upstream. file/created-at and file/last-modified-at are written as Int64 rather than Instant since upstream now demotes Instant to Int64 for attrs without :db.type/instant on storage read. --- logseq_chat.opam | 4 +- shared/src/logseq_chat/core/cache_model.ml | 4 +- .../src/logseq_chat/core/datascript_value.ml | 13 ++-- shared/src/logseq_chat/core/e2e_seed_data.ml | 2 +- shared/src/logseq_chat/core/entity_sync.ml | 6 +- shared/src/logseq_chat/core/flashcards.ml | 14 ++--- .../src/logseq_chat/core/graph_bootstrap.ml | 8 +-- shared/src/logseq_chat/core/graph_read.ml | 8 +-- shared/src/logseq_chat/core/pending_ops.ml | 2 +- .../logseq_chat/core/pending_projection.ml | 59 ++++++++++--------- shared/src/logseq_chat/core/storage_codec.ml | 10 ++-- shared/src/logseq_chat/core/sync_tx.ml | 2 +- shared/test/logseq_chat/e2e_seed_data_test.ml | 2 +- shared/test/logseq_chat/flashcards_test.ml | 4 +- .../test/logseq_chat/graph_bootstrap_test.ml | 2 +- shared/test/logseq_chat/graph_read_test.ml | 8 +-- shared/test/logseq_chat/graph_runtime_test.ml | 32 +++++----- shared/test/logseq_chat/graph_store_test.ml | 2 +- .../logseq_chat/logseq_storage_codec_test.ml | 8 +-- shared/test/logseq_chat/model_test.ml | 2 +- .../logseq_chat/pending_projection_test.ml | 34 +++++------ shared/test/logseq_chat/search_index_test.ml | 2 +- shared/test/logseq_chat/sync_protocol_test.ml | 4 +- shared/test/logseq_chat/sync_tx_test.ml | 20 +++---- 24 files changed, 130 insertions(+), 122 deletions(-) diff --git a/logseq_chat.opam b/logseq_chat.opam index 4abd4a85..9d098dd7 100644 --- a/logseq_chat.opam +++ b/logseq_chat.opam @@ -22,8 +22,8 @@ depends: [ "sqlite3" ] pin-depends: [ - ["datascript_ocaml.dev" "git+https://github.com/logseq/datascript-ocaml.git#67f10f27db0a9fb075d47c385db39c52651ec846"] - ["datascript-ocaml-native.dev" "git+https://github.com/logseq/datascript-ocaml.git#67f10f27db0a9fb075d47c385db39c52651ec846"] + ["datascript_ocaml.dev" "git+https://github.com/logseq/datascript-ocaml.git#e439cbac48b28800820984ea3e285cf26a4f92b5"] + ["datascript-ocaml-native.dev" "git+https://github.com/logseq/datascript-ocaml.git#e439cbac48b28800820984ea3e285cf26a4f92b5"] ["persistent_sorted_set_ocaml.dev" "git+https://github.com/logseq/persistent-sorted-set-ocaml.git#4016dae1cdf4304207d8277ff9957656cdd8b177"] ["melange-edn-core.0.5.0" "git+https://github.com/logseq/melange-edn.git#main"] ["melange-edn-native.0.5.0" "git+https://github.com/logseq/melange-edn.git#main"] diff --git a/shared/src/logseq_chat/core/cache_model.ml b/shared/src/logseq_chat/core/cache_model.ml index 97d98b0d..035fba37 100644 --- a/shared/src/logseq_chat/core/cache_model.ml +++ b/shared/src/logseq_chat/core/cache_model.ml @@ -70,7 +70,7 @@ let one value_type indexed unique = } let string_decode = function Ds.String value -> value | _ -> failwith "expected string" -let int_decode = function Ds.Int value -> value | _ -> failwith "expected int" +let int_decode = function Ds.Int64 value -> Int64.to_int value | _ -> failwith "expected int" let text_attribute name indexed = { attr_name = name @@ -82,7 +82,7 @@ let text_attribute name indexed = let number_attribute name indexed = { attr_name = name ; attr_spec = one Ds.NumberType indexed None - ; attr_encode = (fun value -> Ds.Int value) + ; attr_encode = (fun value -> Ds.Int64 (Int64.of_int value)) ; attr_decode = int_decode } diff --git a/shared/src/logseq_chat/core/datascript_value.ml b/shared/src/logseq_chat/core/datascript_value.ml index 720af909..f1d166a1 100644 --- a/shared/src/logseq_chat/core/datascript_value.ml +++ b/shared/src/logseq_chat/core/datascript_value.ml @@ -9,12 +9,15 @@ let built_in_ref_attrs = let built_in_ref_attr attr = List.mem attr built_in_ref_attrs let value_type_is_ref db value = - match value with - | Ds.Keyword "db.type/ref" -> true - | Ds.Ref eid | Ds.Int eid -> + let check_eid eid = Seq.exists (fun (datom : Ds.datom) -> datom.v = Ds.Keyword "db.type/ref") (Ds.Db.datoms db Ds.Eavt ~e:eid ~a:"db/ident" ()) + in + match value with + | Ds.Keyword "db.type/ref" -> true + | Ds.Ref eid -> check_eid eid + | Ds.Int64 eid -> check_eid (Int64.to_int eid) | _ -> false let entity_declares_ref db attr = @@ -33,7 +36,7 @@ let is_ref_attr db attr = let ref_eid db attr value = match value with | Ds.Ref eid -> Some eid - | Ds.Int eid -> if is_ref_attr db attr then Some eid else None + | Ds.Int64 eid -> if is_ref_attr db attr then Some (Int64.to_int eid) else None | _ -> None let optional_ref_eid db attr value = @@ -44,7 +47,7 @@ let datoms_by_ref db index attr eid = let candidates = Seq.append (Ds.Db.datoms db index ~a:attr ~v:(Ds.Ref eid) ()) - (Ds.Db.datoms db index ~a:attr ~v:(Ds.Int eid) ()) + (Ds.Db.datoms db index ~a:attr ~v:(Ds.Int64 (Int64.of_int eid)) ()) in Seq.filter (fun (datom : Ds.datom) -> diff --git a/shared/src/logseq_chat/core/e2e_seed_data.ml b/shared/src/logseq_chat/core/e2e_seed_data.ml index 8ff7a3fb..ca4aad6b 100644 --- a/shared/src/logseq_chat/core/e2e_seed_data.ml +++ b/shared/src/logseq_chat/core/e2e_seed_data.ml @@ -44,7 +44,7 @@ let reset_user_page_entities conn = let uuid_attr value = Ds.One_value (Ds.Uuid value) let string_attr value = Ds.One_value (Ds.String value) -let int_attr value = Ds.One_value (Ds.Int value) +let int_attr value = Ds.One_value (Ds.Int64 (Int64.of_int value)) let ref_attr id = Ds.One_value (Ds.Ref_to (Ds.Temp_id id)) let many_refs ids = diff --git a/shared/src/logseq_chat/core/entity_sync.ml b/shared/src/logseq_chat/core/entity_sync.ml index b818f4af..4b4ef68d 100644 --- a/shared/src/logseq_chat/core/entity_sync.ml +++ b/shared/src/logseq_chat/core/entity_sync.ml @@ -43,12 +43,12 @@ let rec generic_value (input : Value.value) : Ds.value = | Value.Null -> Ds.Nil | Value.Bool value -> Ds.Bool value | Value.String value -> Ds.String value - | Value.Int value -> Ds.Int value - | Value.Int64 value -> Ds.Int (Int64.to_int value) + | Value.Int value -> Ds.Int64 (Int64.of_int value) + | Value.Int64 value -> Ds.Int64 value | Value.Float value -> Ds.Float value | Value.Binary value -> Ds.String value | Value.Big_decimal value -> Ds.Float (float_of_string value) - | Value.Big_int value -> Ds.Int (Int64.to_int (Int64.of_string value)) + | Value.Big_int value -> Ds.Int64 (Int64.of_string value) | Value.Date value -> Ds.Instant value | Value.Uuid value -> Ds.Uuid value | Value.Uri value -> Ds.String value diff --git a/shared/src/logseq_chat/core/flashcards.ml b/shared/src/logseq_chat/core/flashcards.ml index acf810c0..57fedabb 100644 --- a/shared/src/logseq_chat/core/flashcards.ml +++ b/shared/src/logseq_chat/core/flashcards.ml @@ -134,12 +134,12 @@ let state_value card = [ (Ds.Keyword "stability", Ds.Float card.stability); (Ds.Keyword "difficulty", Ds.Float card.difficulty); - (Ds.Keyword "elapsed-days", Ds.Int card.elapsed_days); - (Ds.Keyword "scheduled-days", Ds.Int card.scheduled_days); - (Ds.Keyword "reps", Ds.Int card.reps); - (Ds.Keyword "lapses", Ds.Int card.lapses); + (Ds.Keyword "elapsed-days", Ds.Int64 (Int64.of_int card.elapsed_days)); + (Ds.Keyword "scheduled-days", Ds.Int64 (Int64.of_int card.scheduled_days)); + (Ds.Keyword "reps", Ds.Int64 (Int64.of_int card.reps)); + (Ds.Keyword "lapses", Ds.Int64 (Int64.of_int card.lapses)); (Ds.Keyword "state", Ds.Keyword (state_name card.state)); - (Ds.Keyword "last-repeat", Ds.Int card.last_repeat); + (Ds.Keyword "last-repeat", Ds.Int64 (Int64.of_int card.last_repeat)); ] in let entries = @@ -163,12 +163,12 @@ let map_value key entries = let float_value value = match value with | Some (Ds.Float value) -> Some value - | Some (Ds.Int value) -> Some (float_of_int value) + | Some (Ds.Int64 value) -> Some (Int64.to_float value) | _ -> None let int_value value = match value with - | Some (Ds.Int value) -> Some value + | Some (Ds.Int64 value) -> Some (Int64.to_int value) | Some (Ds.Instant value) -> Some (Int64.to_int value) | _ -> None diff --git a/shared/src/logseq_chat/core/graph_bootstrap.ml b/shared/src/logseq_chat/core/graph_bootstrap.ml index 140cc637..a87b16bb 100644 --- a/shared/src/logseq_chat/core/graph_bootstrap.ml +++ b/shared/src/logseq_chat/core/graph_bootstrap.ml @@ -71,7 +71,7 @@ let graph_metadata graph_id e2ee now = kv "logseq.kv/graph-uuid" (Ds.Uuid graph_id) ; kv "logseq.kv/graph-remote?" (Ds.Bool true) ; kv "logseq.kv/graph-rtc-e2ee?" (Ds.Bool e2ee) - ; kv "logseq.kv/graph-created-at" (Ds.Int now) + ; kv "logseq.kv/graph-created-at" (Ds.Int64 (Int64.of_int now)) ; kv "logseq.kv/local-graph-uuid" (Ds.Uuid (fresh_local_graph_uuid ())) ] @@ -113,7 +113,7 @@ let normalize_scalar_maps (tx : Ds.tx_op) = let valid_ref_value (value : Ds.value) = match value with - | Ds.TxRef | Ds.Ref _ | Ds.Ref_to _ | Ds.Int _ | Ds.String _ + | Ds.TxRef | Ds.Ref _ | Ds.Ref_to _ | Ds.Int64 _ | Ds.String _ | Ds.Keyword _ -> true | Ds.Symbol value -> value = "db/current-tx" || value = "datomic.tx" @@ -249,11 +249,11 @@ let refresh_initial_timestamps now (tx : Ds.tx_op) = (fun (attr, value) -> ( attr , if attr = "block/created-at" || attr = "block/updated-at" - then Ds.One_value (Ds.Int now) + then Ds.One_value (Ds.Int64 (Int64.of_int now)) else if attr = "file/created-at" || attr = "file/last-modified-at" - then Ds.One_value (Ds.Instant (Int64.of_int now)) + then Ds.One_value (Ds.Int64 (Int64.of_int now)) else value )) entity.Ds.attrs; } diff --git a/shared/src/logseq_chat/core/graph_read.ml b/shared/src/logseq_chat/core/graph_read.ml index 3df80c6b..b72472a4 100644 --- a/shared/src/logseq_chat/core/graph_read.ml +++ b/shared/src/logseq_chat/core/graph_read.ml @@ -24,7 +24,7 @@ let uuid_value = function | _ -> None let int_value = function - | Some (Ds.Int value) -> Some value + | Some (Ds.Int64 value) -> Some (Int64.to_int value) | Some (Ds.Instant value) -> Some (Int64.to_int value) | _ -> None @@ -665,7 +665,7 @@ let recent_journal_page_ids limit db = List.of_seq (Ds.Db.datoms db Ds.Aevt ~a:"block/journal-day" ()) |> List.filter_map (fun (datom : Ds.datom) -> match datom.v with - | Ds.Int day -> + | Ds.Int64 day -> if page_is_hidden db datom.e then None else Some (day, datom.e) | _ -> None) |> List.sort (fun (left, _) (right, _) -> compare right left) @@ -688,8 +688,8 @@ let journal_page_uuid db day = List.of_seq (Ds.Db.datoms db Ds.Aevt ~a:"block/journal-day" ()) |> List.find_map (fun (datom : Ds.datom) -> match datom.v with - | Ds.Int candidate -> - if candidate = day && not (page_is_hidden db datom.e) then + | Ds.Int64 candidate -> + if Int64.equal candidate (Int64.of_int day) && not (page_is_hidden db datom.e) then uuid_for_eid db datom.e else None | _ -> None) diff --git a/shared/src/logseq_chat/core/pending_ops.ml b/shared/src/logseq_chat/core/pending_ops.ml index 2244a857..f16b8a70 100644 --- a/shared/src/logseq_chat/core/pending_ops.ml +++ b/shared/src/logseq_chat/core/pending_ops.ml @@ -24,7 +24,7 @@ let rec semantic_value_from_datascript input = let ( let* ) = Result.bind in match input with | Ds.String value -> Ok (String_value value) - | Ds.Int value -> Ok (Int_value value) + | Ds.Int64 value -> Ok (Int_value (Int64.to_int value)) | Ds.Instant value -> Ok (Instant_value (Int64.to_int value)) | Ds.Float value -> Ok (Float_value value) | Ds.Bool value -> Ok (Bool_value value) diff --git a/shared/src/logseq_chat/core/pending_projection.ml b/shared/src/logseq_chat/core/pending_projection.ml index b7d4090b..dcd4a754 100644 --- a/shared/src/logseq_chat/core/pending_projection.ml +++ b/shared/src/logseq_chat/core/pending_projection.ml @@ -60,7 +60,7 @@ let favorite_block_eid db page_uuid = let rec datascript_value (value : Ops.semantic_value) : Ds.value = match value with | Ops.String_value value -> Ds.String value - | Ops.Int_value value -> Ds.Int value + | Ops.Int_value value -> Ds.Int64 (Int64.of_int value) | Ops.Instant_value value -> Ds.Instant (Int64.of_int value) | Ops.Float_value value -> Ds.Float value | Ops.Bool_value value -> Ds.Bool value @@ -77,12 +77,12 @@ let rec datascript_value (value : Ops.semantic_value) : Ds.value = let rec semantic_value_equal_value db left right = match (left, right) with | Ds.String value, Ops.String_value expected -> value = expected - | Ds.Int value, Ops.Int_value expected -> value = expected + | Ds.Int64 value, Ops.Int_value expected -> Int64.equal value (Int64.of_int expected) | Ds.Instant value, Ops.Instant_value expected -> Int64.equal value (Int64.of_int expected) | Ds.Float value, Ops.Float_value expected -> Float.equal value expected - | Ds.Int value, Ops.Float_value expected -> - Float.equal (Float.of_int value) expected + | Ds.Int64 value, Ops.Float_value expected -> + Float.equal (Int64.to_float value) expected | Ds.Bool value, Ops.Bool_value expected -> value = expected | Ds.Keyword value, Ops.Keyword_value expected -> value = expected | Ds.Map entries, Ops.Map_value expected -> @@ -100,12 +100,12 @@ let rec semantic_value_equal_value db left right = expected | Ds.Ref eid, Ops.Ref_uuid uuid -> Ds.entid db "block/uuid" (Ds.Uuid uuid) = Some eid - | Ds.Int eid, Ops.Ref_uuid uuid -> - Ds.entid db "block/uuid" (Ds.Uuid uuid) = Some eid + | Ds.Int64 eid, Ops.Ref_uuid uuid -> + Ds.entid db "block/uuid" (Ds.Uuid uuid) = Some (Int64.to_int eid) | Ds.Ref eid, Ops.Ref_ident ident -> Ds.entid db "db/ident" (Ds.Keyword ident) = Some eid - | Ds.Int eid, Ops.Ref_ident ident -> - Ds.entid db "db/ident" (Ds.Keyword ident) = Some eid + | Ds.Int64 eid, Ops.Ref_ident ident -> + Ds.entid db "db/ident" (Ds.Keyword ident) = Some (Int64.to_int eid) | _ -> false let semantic_value_equal db left right = @@ -194,7 +194,7 @@ let journal_page_eid db day = Seq.find_map (fun datom -> match datom.Ds.v with - | Ds.Int value when value = day -> Some datom.Ds.e + | Ds.Int64 value when Int64.equal value (Int64.of_int day) -> Some datom.Ds.e | _ -> None) (Db.datoms db Ds.Aevt ~a:"block/journal-day" ()) @@ -237,8 +237,8 @@ let insert_tx db (block : Outliner.outliner_block) created_at = ; ( "block/parent" , Ds.One_value (Ds.Ref_to (lookup block.parent_uuid)) ) ; ( "block/order", Ds.One_value (Ds.String block.order) ) - ; ( "block/created-at", Ds.One_value (Ds.Int created_at) ) - ; ( "block/updated-at", Ds.One_value (Ds.Int created_at) ) + ; ( "block/created-at", Ds.One_value (Ds.Int64 (Int64.of_int created_at)) ) + ; ( "block/updated-at", Ds.One_value (Ds.Int64 (Int64.of_int created_at)) ) ] @ many_refs "block/refs" (refs_for_title db block.title) @ many_refs "block/tags" (tag_eids_for_title db block.title)); @@ -319,8 +319,8 @@ let create_attrs uuid title created_at = ; ( "block/name" , Ds.One_value (Ds.String (String.lowercase_ascii title)) ) ; ("block/title", Ds.One_value (Ds.String title)) - ; ("block/created-at", Ds.One_value (Ds.Int created_at)) - ; ("block/updated-at", Ds.One_value (Ds.Int created_at)) + ; ("block/created-at", Ds.One_value (Ds.Int64 (Int64.of_int created_at))) + ; ("block/updated-at", Ds.One_value (Ds.Int64 (Int64.of_int created_at))) ] let rec compile db (intent : Ops.pending_intent) = @@ -412,13 +412,13 @@ let rec compile db (intent : Ops.pending_intent) = ("db/ident", Ds.Keyword "logseq.class/Asset")) ] ) ; ( "block/created-at" - , Ds.One_value (Ds.Int value.created_at) ) + , Ds.One_value (Ds.Int64 (Int64.of_int value.created_at)) ) ; ( "block/updated-at" - , Ds.One_value (Ds.Int value.created_at) ) + , Ds.One_value (Ds.Int64 (Int64.of_int value.created_at)) ) ; ( "logseq.property.asset/type" , Ds.One_value (Ds.String value.asset_type) ) ; ( "logseq.property.asset/size" - , Ds.One_value (Ds.Int value.asset_size) ) + , Ds.One_value (Ds.Int64 (Int64.of_int value.asset_size)) ) ; ( "logseq.property.asset/checksum" , Ds.One_value (Ds.String value.asset_checksum) ) ; ( "logseq.property.asset/remote-metadata" @@ -551,9 +551,9 @@ let rec compile db (intent : Ops.pending_intent) = ("db/ident", Ds.Keyword "logseq.class/Root")) ] ) ; ( "block/created-at" - , Ds.One_value (Ds.Int value.created_at) ) + , Ds.One_value (Ds.Int64 (Int64.of_int value.created_at)) ) ; ( "block/updated-at" - , Ds.One_value (Ds.Int value.created_at) ) + , Ds.One_value (Ds.Int64 (Int64.of_int value.created_at)) ) ]; ] | Ops.Create_journal value -> @@ -571,11 +571,11 @@ let rec compile db (intent : Ops.pending_intent) = (Ds.String (String.lowercase_ascii value.title)) ) ; ("block/title", Ds.One_value (Ds.String value.title)) ; ( "block/journal-day" - , Ds.One_value (Ds.Int value.journal_day) ) + , Ds.One_value (Ds.Int64 (Int64.of_int value.journal_day)) ) ; ( "block/created-at" - , Ds.One_value (Ds.Int value.created_at) ) + , Ds.One_value (Ds.Int64 (Int64.of_int value.created_at)) ) ; ( "block/updated-at" - , Ds.One_value (Ds.Int value.created_at) ) + , Ds.One_value (Ds.Int64 (Int64.of_int value.created_at)) ) ] in let attrs = @@ -622,9 +622,9 @@ let rec compile db (intent : Ops.pending_intent) = ; ("block/parent", Ds.One_value (Ds.Ref_to page_ref)) ; ("block/order", Ds.One_value (Ds.String "a0")) ; ( "block/created-at" - , Ds.One_value (Ds.Int value.created_at) ) + , Ds.One_value (Ds.Int64 (Int64.of_int value.created_at)) ) ; ( "block/updated-at" - , Ds.One_value (Ds.Int value.created_at) ) + , Ds.One_value (Ds.Int64 (Int64.of_int value.created_at)) ) ]; ])) | Ops.Add_tag value -> @@ -672,9 +672,9 @@ let rec compile db (intent : Ops.pending_intent) = ; ( "block/order" , Ds.One_value (Ds.String value.order) ) ; ( "block/created-at" - , Ds.One_value (Ds.Int value.created_at) ) + , Ds.One_value (Ds.Int64 (Int64.of_int value.created_at)) ) ; ( "block/updated-at" - , Ds.One_value (Ds.Int value.created_at) ) + , Ds.One_value (Ds.Int64 (Int64.of_int value.created_at)) ) ]; ])) | Ops.Delete_page value -> @@ -701,11 +701,16 @@ let rec compile db (intent : Ops.pending_intent) = else let parent = match one_value db reference "block/parent" with - | Some (Ds.Ref eid) | Some (Ds.Int eid) -> + | Some (Ds.Ref eid) -> [ ( "logseq.property.recycle/original-parent" , Ds.One_value (Ds.Ref eid) ) ] + | Some (Ds.Int64 eid) -> + [ + ( "logseq.property.recycle/original-parent" + , Ds.One_value (Ds.Ref (Int64.to_int eid)) ) + ] | _ -> [] in let order = @@ -777,7 +782,7 @@ let rec satisfied db (intent : Ops.pending_intent) = (one_value db reference "logseq.property.asset/type") = Some value.asset_type && one_value db reference "logseq.property.asset/size" - = Some (Ds.Int value.asset_size) + = Some (Ds.Int64 (Int64.of_int value.asset_size)) && string_value (one_value db reference "logseq.property.asset/checksum") = Some value.asset_checksum diff --git a/shared/src/logseq_chat/core/storage_codec.ml b/shared/src/logseq_chat/core/storage_codec.ml index 372b1386..9d0f172e 100644 --- a/shared/src/logseq_chat/core/storage_codec.ml +++ b/shared/src/logseq_chat/core/storage_codec.ml @@ -228,12 +228,12 @@ let rec value_of_transit input : Ds.value = | Value.Null -> Ds.Nil | Value.Bool value -> Ds.Bool value | Value.String value -> Ds.String value - | Value.Int value -> Ds.Int value - | Value.Int64 value -> Ds.Int (Int64.to_int value) + | Value.Int value -> Ds.Int64 (Int64.of_int value) + | Value.Int64 value -> Ds.Int64 value | Value.Float value -> Ds.Float value | Value.Binary value -> Ds.String value | Value.Big_decimal value -> Ds.Float (float_of_string value) - | Value.Big_int value -> Ds.Int (Int64.to_int (Int64.of_string value)) + | Value.Big_int value -> Ds.Int64 (Int64.of_string value) | Value.Date value -> Ds.Instant value | Value.Uuid value -> Ds.Uuid value | Value.Uri value -> Ds.String value @@ -257,14 +257,14 @@ let rec value_of_transit input : Ds.value = let rec value_to_transit input : Value.value = match input with | Ds.Nil -> Value.Null - | Ds.Int value -> Value.Int value + | Ds.Int64 value -> Value.Int64 value | Ds.Float value -> Value.Float value | Ds.String value -> Value.String value | Ds.Symbol value -> Value.Symbol value | Ds.Bool value -> Value.Bool value | Ds.Keyword value -> Value.Keyword value | Ds.Uuid value -> Value.Tagged ("u", Value.String value) - | Ds.Instant value -> Value.Tagged ("m", Value.Int (Int64.to_int value)) + | Ds.Instant value -> Value.Tagged ("m", Value.Int64 value) | Ds.Regex value -> Value.Tagged ("regex", Value.String value) | Ds.Ref value -> Value.Int value | Ds.List values -> Value.List (List.map value_to_transit values) diff --git a/shared/src/logseq_chat/core/sync_tx.ml b/shared/src/logseq_chat/core/sync_tx.ml index 5b47de19..fd1e0f8e 100644 --- a/shared/src/logseq_chat/core/sync_tx.ml +++ b/shared/src/logseq_chat/core/sync_tx.ml @@ -33,7 +33,7 @@ let rec transit_of_entity_ref db entity_ref = and transit_of_value db value = match value with | Ds.Nil -> Transit.Null - | Ds.Int number -> Transit.Int number + | Ds.Int64 number -> Transit.Int64 number | Ds.Float number -> Transit.Float number | Ds.String text -> Transit.String text | Ds.Symbol symbol -> Transit.Symbol symbol diff --git a/shared/test/logseq_chat/e2e_seed_data_test.ml b/shared/test/logseq_chat/e2e_seed_data_test.ml index 28f6385f..2d8ab7cc 100644 --- a/shared/test/logseq_chat/e2e_seed_data_test.ml +++ b/shared/test/logseq_chat/e2e_seed_data_test.ml @@ -245,7 +245,7 @@ let composer_reset_preserves_built_ins_and_removes_user_content () = ("block/uuid", Ds.One_value (Ds.Uuid "e2e-stale-page")); ("block/name", Ds.One_value (Ds.String "stale journal")); ("block/title", Ds.One_value (Ds.String "Stale Journal")); - ("block/journal-day", Ds.One_value (Ds.Int 20260827)); + ("block/journal-day", Ds.One_value (Ds.Int64 20260827L)); ]; entity None [ diff --git a/shared/test/logseq_chat/flashcards_test.ml b/shared/test/logseq_chat/flashcards_test.ml index e0b80a37..f6b1e03c 100644 --- a/shared/test/logseq_chat/flashcards_test.ml +++ b/shared/test/logseq_chat/flashcards_test.ml @@ -119,8 +119,8 @@ let block_tx eid uuid title parent order created_at = add eid "block/page" (Ds.Ref 10); add eid "block/parent" (Ds.Ref parent); add eid "block/order" (Ds.String order); - add eid "block/created-at" (Ds.Int created_at); - add eid "block/updated-at" (Ds.Int created_at); + add eid "block/created-at" (Ds.Int64 (Int64.of_int created_at)); + add eid "block/updated-at" (Ds.Int64 (Int64.of_int created_at)); ] let ordered_uuids db = diff --git a/shared/test/logseq_chat/graph_bootstrap_test.ml b/shared/test/logseq_chat/graph_bootstrap_test.ml index 9a250f77..6c7bb2fe 100644 --- a/shared/test/logseq_chat/graph_bootstrap_test.ml +++ b/shared/test/logseq_chat/graph_bootstrap_test.ml @@ -147,7 +147,7 @@ let built_in_catalog_and_graph_metadata () = check_eq (Some (Ds.Bool true)) (kv_value db "logseq.kv/graph-remote?"); check_eq (Some (Ds.Bool false)) (kv_value db "logseq.kv/graph-rtc-e2ee?"); (match kv_value db "logseq.kv/graph-created-at" with - | Some (Ds.Int timestamp) -> check (timestamp >= started) + | Some (Ds.Int64 timestamp) -> check (Int64.compare timestamp (Int64.of_int started) >= 0) | _ -> failwith "missing graph creation timestamp"); check (kv_value db "logseq.kv/local-graph-uuid" diff --git a/shared/test/logseq_chat/graph_read_test.ml b/shared/test/logseq_chat/graph_read_test.ml index 0a431732..095580fd 100644 --- a/shared/test/logseq_chat/graph_read_test.ml +++ b/shared/test/logseq_chat/graph_read_test.ml @@ -81,7 +81,7 @@ let page id name title attributes = entity id title (field "block/name" (Ds.String name) :: attributes) let journal id title day = - page id id title [ field "block/journal-day" (Ds.Int day) ] + page id id title [ field "block/journal-day" (Ds.Int64 (Int64.of_int day)) ] let block id title page parent created attributes = entity id title @@ -659,11 +659,11 @@ let restored_raw_numeric_references_remain_navigable () = raw 1 "block/uuid" (Ds.Uuid "raw-page"); raw 1 "block/name" (Ds.String "raw-page"); raw 1 "block/title" (Ds.String "Raw journal"); - raw 1 "block/journal-day" (Ds.Int 20260817); + raw 1 "block/journal-day" (Ds.Int64 20260817L); raw 2 "block/uuid" (Ds.Uuid "raw-block"); raw 2 "block/title" (Ds.String "Restored block"); - raw 2 "block/page" (Ds.Int 1); - raw 2 "block/parent" (Ds.Int 1); + raw 2 "block/page" (Ds.Int64 1L); + raw 2 "block/parent" (Ds.Int64 1L); raw 2 "block/created-at" (Ds.Instant 1L); ] (Ds.conn_db conn) diff --git a/shared/test/logseq_chat/graph_runtime_test.ml b/shared/test/logseq_chat/graph_runtime_test.ml index 00e93917..e24cafa1 100644 --- a/shared/test/logseq_chat/graph_runtime_test.ml +++ b/shared/test/logseq_chat/graph_runtime_test.ml @@ -66,14 +66,14 @@ let base_db title = add 1 "block/uuid" (Ds.Uuid "page"); add 1 "block/title" (Ds.String "Page"); add 1 "block/name" (Ds.String "page"); - add 1 "block/journal-day" (Ds.Int 20260816); + add 1 "block/journal-day" (Ds.Int64 20260816L); add 10 "block/uuid" (Ds.Uuid "block"); add 10 "block/title" (Ds.String title); add 10 "block/page" (Ds.Ref 1); add 10 "block/parent" (Ds.Ref 1); add 10 "block/order" (Ds.String "a0"); - add 10 "block/created-at" (Ds.Int 1); - add 10 "block/updated-at" (Ds.Int 1); + add 10 "block/created-at" (Ds.Int64 1L); + add 10 "block/updated-at" (Ds.Int64 1L); ] (Ds.empty_db ~schema ()) @@ -153,7 +153,7 @@ let semantic_values_preserve_native_primitives () = let cases = [ (Ds.String "text", Pending.String_value "text"); - (Ds.Int 42, Pending.Int_value 42); + (Ds.Int64 42L, Pending.Int_value 42); (Ds.Instant 1234L, Pending.Instant_value 1234); (Ds.Float 0.5, Pending.Float_value 0.5); (Ds.Bool false, Pending.Bool_value false); @@ -171,8 +171,8 @@ let semantic_maps_preserve_nesting_entry_order_and_duplicate_keys () = [ ( Ds.Keyword "nested", Ds.Map [ (Ds.Keyword "flag", Ds.Bool true) ] ); - (Ds.Keyword "duplicate", Ds.Int 1); - (Ds.Keyword "duplicate", Ds.Int 2); + (Ds.Keyword "duplicate", Ds.Int64 1L); + (Ds.Keyword "duplicate", Ds.Int64 2L); ] in let expected = @@ -188,7 +188,7 @@ let semantic_maps_preserve_nesting_entry_order_and_duplicate_keys () = let semantic_maps_reject_invalid_keys_and_unsupported_values () = check_eq (Pending.semantic_value_from_datascript - (Ds.Map [ (Ds.String "invalid", Ds.Int 1); (Ds.Keyword "later", Ds.Int 2) ])) + (Ds.Map [ (Ds.String "invalid", Ds.Int64 1L); (Ds.Keyword "later", Ds.Int64 2L) ])) (Error "flashcard state contains a non-keyword key"); check_eq (Pending.semantic_value_from_datascript @@ -254,7 +254,7 @@ let page_deletion_is_optimistic_durable_and_rejects_built_ins () = let db = Ds.db_with [ - Ds.Retract (Ds.Entity_id 1, "block/journal-day", Some (Ds.Int 20260816)); + Ds.Retract (Ds.Entity_id 1, "block/journal-day", Some (Ds.Int64 20260816L)); add 20 "block/uuid" (Ds.Uuid "recycle-page"); add 20 "block/title" (Ds.String "Recycle"); add 20 "block/name" (Ds.String "recycle"); @@ -890,8 +890,8 @@ let encrypted_merge_encrypts_the_completed_title_once () = add 11 "block/page" (Ds.Ref 1); add 11 "block/parent" (Ds.Ref 1); add 11 "block/order" (Ds.String "Zz"); - add 11 "block/created-at" (Ds.Int 0); - add 11 "block/updated-at" (Ds.Int 0); + add 11 "block/created-at" (Ds.Int64 0L); + add 11 "block/updated-at" (Ds.Int64 0L); ] (base_db "Old") in @@ -930,12 +930,12 @@ let journal_window_grows_by_two_pages_per_request () = add page "block/uuid" (Ds.Uuid (Printf.sprintf "page-%d" index)); add page "block/title" (Ds.String (Printf.sprintf "Page %d" index)); add page "block/name" (Ds.String (Printf.sprintf "page-%d" index)); - add page "block/journal-day" (Ds.Int (20260801 + index)); + add page "block/journal-day" (Ds.Int64 (Int64.of_int (20260801 + index))); add block "block/uuid" (Ds.Uuid (Printf.sprintf "block-%d" index)); add block "block/title" (Ds.String (Printf.sprintf "Block %d" index)); add block "block/page" (Ds.Ref page); add block "block/parent" (Ds.Ref page); - add block "block/created-at" (Ds.Int index); + add block "block/created-at" (Ds.Int64 (Int64.of_int index)); ]) (List.init 8 (fun i -> i)) in @@ -1089,7 +1089,7 @@ let authoritative_today_journal_is_not_recreated () = add 1 "block/uuid" (Ds.Uuid "existing-today"); add 1 "block/title" (Ds.String "Today"); add 1 "block/name" (Ds.String "today"); - add 1 "block/journal-day" (Ds.Int day); + add 1 "block/journal-day" (Ds.Int64 (Int64.of_int day)); ] (Ds.empty_db ~schema ()) in @@ -1122,7 +1122,7 @@ let accepted_partial_journal_keeps_its_pending_first_block () = add 1 "block/uuid" (Ds.Uuid value.page_uuid); add 1 "block/title" (Ds.String value.title); add 1 "block/name" (Ds.String value.title); - add 1 "block/journal-day" (Ds.Int value.journal_day); + add 1 "block/journal-day" (Ds.Int64 (Int64.of_int value.journal_day)); ] (Ds.empty_db ~schema ()) in @@ -1247,8 +1247,8 @@ let startup_split_confirmation_distinguishes_submission_from_collision () = add 11 "block/page" (Ds.Ref 1); add 11 "block/parent" (Ds.Ref 1); add 11 "block/order" (Ds.String "a2"); - add 11 "block/created-at" (Ds.Int 2); - add 11 "block/updated-at" (Ds.Int 3); + add 11 "block/created-at" (Ds.Int64 2L); + add 11 "block/updated-at" (Ds.Int64 3L); ] (base_db "Old") in diff --git a/shared/test/logseq_chat/graph_store_test.ml b/shared/test/logseq_chat/graph_store_test.ml index e8920349..25db5e73 100644 --- a/shared/test/logseq_chat/graph_store_test.ml +++ b/shared/test/logseq_chat/graph_store_test.ml @@ -130,7 +130,7 @@ let typed_restore_and_writable_connection_persist () = (values db "block/uuid"); check_eq [ Ds.Ref 11 ] (values db "block/parent"); check_eq [ Ds.Keyword "whiteboard" ] (values db "block/type"); - check_eq [ Ds.Int 1723012345678 ] (values db "block/created-at"); + check_eq [ Ds.Int64 1723012345678L ] (values db "block/created-at"); check_eq [ Ds.Map [ (Ds.Keyword "priority", Ds.Keyword "A") ] ] (values db "block/properties"); check_eq [ Ds.Ref 11; Ds.Ref 12 ] (values db "block/tags"); diff --git a/shared/test/logseq_chat/logseq_storage_codec_test.ml b/shared/test/logseq_chat/logseq_storage_codec_test.ml index 51aa8950..cc449b5c 100644 --- a/shared/test/logseq_chat/logseq_storage_codec_test.ml +++ b/shared/test/logseq_chat/logseq_storage_codec_test.ml @@ -39,16 +39,16 @@ let all_value_types_and_storage_nodes_roundtrip () = Ds.Nil; Ds.Bool false; Ds.String "text"; - Ds.Int 12; + Ds.Int64 12L; Ds.Float 1.5; Ds.Keyword "block/page"; Ds.Uuid "00000000-0000-0000-0000-000000000007"; Ds.Instant 123L; Ds.Regex "a+"; Ds.Symbol "x"; - Ds.Vector [ Ds.Int 1; Ds.Nil ]; + Ds.Vector [ Ds.Int64 1L; Ds.Nil ]; Ds.List [ Ds.String "item" ]; - Ds.Map [ (Ds.Keyword "x", Ds.Set [ Ds.Int 2 ]) ]; + Ds.Map [ (Ds.Keyword "x", Ds.Set [ Ds.Int64 2L ]) ]; ] in let datoms = List.map datom values in @@ -136,7 +136,7 @@ let tuple_reference_normalization () = (Pset.Leaf [ datom ~added:true - (Ds.Vector [ Ds.Int 9; Ds.Nil ]); + (Ds.Vector [ Ds.Int64 9L; Ds.Nil ]); ])) (Codec.decode None content) diff --git a/shared/test/logseq_chat/model_test.ml b/shared/test/logseq_chat/model_test.ml index 611bbac1..44897280 100644 --- a/shared/test/logseq_chat/model_test.ml +++ b/shared/test/logseq_chat/model_test.ml @@ -313,7 +313,7 @@ let missing_attributes_default_but_malformed_attributes_raise () = false with Failure _ -> true)) [ - ("block/title", Ds.Int 42); + ("block/title", Ds.Int64 42L); ("block/created-at", Ds.Float 1.5); ("block/asset-size", Ds.String "large"); ("block/local-path", Ds.Bool false); diff --git a/shared/test/logseq_chat/pending_projection_test.ml b/shared/test/logseq_chat/pending_projection_test.ml index b15f1244..bfeee6cf 100644 --- a/shared/test/logseq_chat/pending_projection_test.ml +++ b/shared/test/logseq_chat/pending_projection_test.ml @@ -389,7 +389,7 @@ let flashcard_property_batch_is_atomic () = } in let projected = apply_intent db intent in - let remote = with_tx db [ add 10 "logseq.property.fsrs/due" (Ds.Int 99) ] in + let remote = with_tx db [ add 10 "logseq.property.fsrs/due" (Ds.Int64 99L) ] in check (Projection.satisfied projected intent); check (Projection.semantic_value_equal projected @@ -397,7 +397,7 @@ let flashcard_property_batch_is_atomic () = (Some state)); check_eq (value projected "block" "logseq.property.fsrs/due") - (Some (Ds.Int 1776000060000)); + (Some (Ds.Int64 1776000060000L)); check (match Projection.compile remote intent with | Error _ -> true @@ -431,7 +431,7 @@ let asset_projection_keeps_upload_metadata_and_built_in_class () = (Some (Ds.String "png")); check_eq (value db "asset" "logseq.property.asset/size") - (Some (Ds.Int 2048)); + (Some (Ds.Int64 2048L)); check_eq (value db "asset" "logseq.property.asset/checksum") (Some (Ds.String "abc123")); @@ -720,7 +720,7 @@ let partial_journal_creation_restores_the_missing_first_block () = add 20 "block/uuid" (Ds.Uuid "today-page"); add 20 "block/title" (Ds.String "Aug 22nd, 2026"); add 20 "block/name" (Ds.String "aug 22nd, 2026"); - add 20 "block/journal-day" (Ds.Int 20260822); + add 20 "block/journal-day" (Ds.Int64 20260822L); ] in let snapshot = @@ -729,7 +729,7 @@ let partial_journal_creation_restores_the_missing_first_block () = in check (Option.is_some - (Ds.entid db "block/journal-day" (Ds.Int 20260822))); + (Ds.entid db "block/journal-day" (Ds.Int64 20260822L))); check_eq (Ds.entid db "block/uuid" (Ds.Uuid "today-block")) None; check (not (Projection.satisfied db journal_intent)); check @@ -786,15 +786,15 @@ let semantic_equality_preserves_nested_values_and_reference_identities () = [ (Ds.Instant 42L, Ops.Instant_value 42); (Ds.Float 1.0, Ops.Float_value 1.0); - (Ds.Int 1, Ops.Float_value 1.0); - (Ds.Int 8, Ops.Int_value 8); + (Ds.Int64 1L, Ops.Float_value 1.0); + (Ds.Int64 8L, Ops.Int_value 8); (Ds.Bool true, Ops.Bool_value true); (Ds.Ref 50, Ops.Ref_ident "status.todo"); - (Ds.Int 50, Ops.Ref_ident "status.todo"); + (Ds.Int64 50L, Ops.Ref_ident "status.todo"); ( Ds.Map [ ( Ds.Keyword "nested", - Ds.Map [ (Ds.Keyword "value", Ds.Int 1) ] ); + Ds.Map [ (Ds.Keyword "value", Ds.Int64 1L) ] ); ], nested ); ]; @@ -808,12 +808,12 @@ let semantic_equality_preserves_nested_values_and_reference_identities () = Ds.Map [ ( Ds.String "nested", - Ds.Map [ (Ds.Keyword "value", Ds.Int 1) ] ); + Ds.Map [ (Ds.Keyword "value", Ds.Int64 1L) ] ); ]; Ds.Map [ ( Ds.Keyword "nested", - Ds.Map [ (Ds.Keyword "value", Ds.Int 2) ] ); + Ds.Map [ (Ds.Keyword "value", Ds.Int64 2L) ] ); ]; ] @@ -894,13 +894,13 @@ let raw_numeric_references_support_editing_and_recursive_deletion () = raw 1 "block/title" (Ds.String "Raw page"); raw 10 "block/uuid" (Ds.Uuid "raw-parent"); raw 10 "block/title" (Ds.String "Parent"); - raw 10 "block/page" (Ds.Int 1); - raw 10 "block/parent" (Ds.Int 1); + raw 10 "block/page" (Ds.Int64 1L); + raw 10 "block/parent" (Ds.Int64 1L); raw 10 "block/order" (Ds.String "a0"); raw 11 "block/uuid" (Ds.Uuid "raw-child"); raw 11 "block/title" (Ds.String "Child"); - raw 11 "block/page" (Ds.Int 1); - raw 11 "block/parent" (Ds.Int 10); + raw 11 "block/page" (Ds.Int64 1L); + raw 11 "block/parent" (Ds.Int64 10L); raw 11 "block/order" (Ds.String "a0"); ] in @@ -1098,7 +1098,7 @@ let journal_deletion_and_cyclic_parent_traversal_are_rejected () = [ add 30 "block/uuid" (Ds.Uuid "journal"); add 30 "block/title" (Ds.String "Journal"); - add 30 "block/journal-day" (Ds.Int 20260817); + add 30 "block/journal-day" (Ds.Int64 20260817L); ] in let cyclic = with_tx (base_db ()) [ add 10 "block/parent" (Ds.Ref 10) ] in @@ -1128,7 +1128,7 @@ let projected_properties_are_queryable_without_changing_authoritative_indexes (fun _ -> true) (List.of_seq (Ds.Db.datoms projected Ds.Aevt ~a:"user.property/effort" - ~v:(Ds.Int 8) ()))); + ~v:(Ds.Int64 8L) ()))); check_eq (List.of_seq (Ds.Db.datoms db Ds.Aevt ~a:"user.property/effort" ())) diff --git a/shared/test/logseq_chat/search_index_test.ml b/shared/test/logseq_chat/search_index_test.ml index 014e2fda..359a1f38 100644 --- a/shared/test/logseq_chat/search_index_test.ml +++ b/shared/test/logseq_chat/search_index_test.ml @@ -54,7 +54,7 @@ let seeded_conn () = add 4 "block/uuid" (Ds.Uuid journal_uuid); add 4 "block/name" (Ds.String "aug 16th, 2026"); add 4 "block/title" (Ds.String "Aug 16th, 2026"); - add 4 "block/journal-day" (Ds.Int 20260816); + add 4 "block/journal-day" (Ds.Int64 20260816L); add 5 "block/uuid" (Ds.Uuid hidden_uuid); add 5 "block/name" (Ds.String "secret"); add 5 "block/title" (Ds.String "Secret movies page"); diff --git a/shared/test/logseq_chat/sync_protocol_test.ml b/shared/test/logseq_chat/sync_protocol_test.ml index 5a34a6b3..06384b79 100644 --- a/shared/test/logseq_chat/sync_protocol_test.ml +++ b/shared/test/logseq_chat/sync_protocol_test.ml @@ -67,11 +67,11 @@ let lookup_preserves_first_false_and_null_values () = List.iter (fun input -> let entries = - [ (Ds.Keyword "key", input); (Ds.Keyword "key", Ds.Int 42) ] + [ (Ds.Keyword "key", input); (Ds.Keyword "key", Ds.Int64 42L) ] in check_eq (Some input) (Flashcards.map_value "key" entries); check (Flashcards.map_value "missing" entries = None)) - [ Ds.Nil; Ds.Bool false; Ds.Int 0; Ds.String "" ] + [ Ds.Nil; Ds.Bool false; Ds.Int64 0L; Ds.String "" ] let wire_contract_preserves_identities_sets_and_cursors () = let change = decode payload in diff --git a/shared/test/logseq_chat/sync_tx_test.ml b/shared/test/logseq_chat/sync_tx_test.ml index 12c5f881..4f193ac7 100644 --- a/shared/test/logseq_chat/sync_tx_test.ml +++ b/shared/test/logseq_chat/sync_tx_test.ml @@ -133,7 +133,7 @@ let every_datascript_value_has_a_sync_encoding () = check_eq expected (Sync.transit_of_value db value)) [ (Ds.Nil, Value.Null); - (Ds.Int 7, Value.Int 7); + (Ds.Int64 7L, Value.Int64 7L); (Ds.Float 1.5, Value.Float 1.5); (Ds.String "text", Value.String "text"); (Ds.Symbol "symbol", Value.Symbol "symbol"); @@ -143,12 +143,12 @@ let every_datascript_value_has_a_sync_encoding () = (Ds.Instant 123L, Value.Date 123L); (Ds.Regex "a+", Value.Tagged ("regex", Value.String "a+")); (Ds.Ref 1, stable_ref); - (Ds.List [ Ds.Int 1 ], Value.List [ Value.Int 1 ]); + (Ds.List [ Ds.Int64 1L ], Value.List [ Value.Int64 1L ]); (Ds.Vector [ Ds.String "v" ], array [ Value.String "v" ]); ( Ds.Map [ (Ds.Keyword "k", Ds.Bool false) ] , Value.Map [ (Value.Keyword "k", Value.Bool false) ] ); (Ds.Set [ Ds.Uuid "u" ], Value.Set [ Value.Uuid "u" ]); - (Ds.Tuple [ Some (Ds.Int 1); None ], array [ Value.Int 1; Value.Null ]); + (Ds.Tuple [ Some (Ds.Int64 1L); None ], array [ Value.Int64 1L; Value.Null ]); (Ds.TxRef, Value.Keyword "db/current-tx"); (Ds.Ref_to (Ds.Temp_id "ref"), Value.String "ref"); ] @@ -161,8 +161,8 @@ let nested_entity_cardinalities_are_preserved () = let value = entity (Some (Ds.Temp_id "entity")) [ - ("one", Ds.One_value (Ds.Int 1)); - ("many", Ds.Many_values [ Ds.Int 2; Ds.Int 3 ]); + ("one", Ds.One_value (Ds.Int64 1L)); + ("many", Ds.Many_values [ Ds.Int64 2L; Ds.Int64 3L ]); ("child", Ds.One_entity nested); ("children", Ds.Many_entities [ nested ]); ] @@ -171,8 +171,8 @@ let nested_entity_cardinalities_are_preserved () = (Value.Map [ (Value.Keyword "db/id", Value.String "entity"); - (Value.Keyword "one", Value.Int 1); - (Value.Keyword "many", array [ Value.Int 2; Value.Int 3 ]); + (Value.Keyword "one", Value.Int64 1L); + (Value.Keyword "many", array [ Value.Int64 2L; Value.Int64 3L ]); (Value.Keyword "child", wire); (Value.Keyword "children", array [ wire ]); ]) @@ -248,9 +248,9 @@ let transaction_operations_preserve_all_operands () = attr; Value.String "Raw"; ] ); - ( Ds.CallIdent (Ds.Ident "function", [ Ds.Int 1; Ds.String "x" ]) + ( Ds.CallIdent (Ds.Ident "function", [ Ds.Int64 1L; Ds.String "x" ]) , array - [ Value.Keyword "function"; Value.Int 1; Value.String "x" ] ); + [ Value.Keyword "function"; Value.Int64 1L; Value.String "x" ] ); ]; check_eq (array []) (Codec.of_string (expect_ok (encode db []))); List.iter @@ -330,7 +330,7 @@ let encryption_covers_protected_operands_and_nested_entities () = ]; check_error (Sync.encrypt_tx_op encrypt - (Ds.Add (reference, "block/title", Ds.Int 1))) + (Ds.Add (reference, "block/title", Ds.Int64 1L))) let cases = [