text stringlengths 0 601k |
|---|
module All_annotations_correctly_used = struct type ' a t = | N of ' a | Graft of int | Tau of ' a t | C of ' a t * ' a t let [ @ inline never ] rec graft n = graft n let [ @ tail_mod_cons ] rec map f l = match l with | N v -> N ( f v ) | Graft n -> if n >= 0 then ( graft [ @ tailcall false ] ) n else Tau ( ( graft [ @... |
module All_annotations_correctly_used : sig type ' a t = N of ' a | Graft of int | Tau of ' a t | C of ' a t * ' a t val graft : ' a -> ' b val map : ( ' a -> ' b ) -> ' a t -> ' b t end } ] | |
module All_annotations_flipped = struct type ' a t = | N of ' a | Graft of int | Tau of ' a t | C of ' a t * ' a t let [ @ inline never ] rec graft n = graft n let [ @ tail_mod_cons ] rec map_wrong f l = match l with | N v -> N ( f v ) | Graft n -> if n >= 0 then ( graft [ @ tailcall ] ) n else Tau ( ( graft [ @ tailca... |
module All_annotations_flipped : sig type ' a t = N of ' a | Graft of int | Tau of ' a t | C of ' a t * ' a t val graft : ' a -> ' b val map_wrong : ( ' a -> ' b ) -> ' a t -> ' b t end } ] | |
module Uint8 = struct type t = int let pp ppf t = Format . fprintf ppf " 0x % 02X " t let of_int i = if i < 0 then invalid_arg " out of range " else if i > 255 then invalid_arg " out of range " else i external add : t -> t -> t * bool = " caml__uint8_add_overflow " external mul : t -> t -> t * bool = " caml__uint8_mul_... |
module Uint16 = struct type t = int let pp ppf t = Format . fprintf ppf " 0x % 04X " t let of_int i = if i < 0 then invalid_arg " out of range " else if i > 65535 then invalid_arg " out of range " else i external add : t -> t -> t * bool = " caml__uint16_add_overflow " external mul : t -> t -> t * bool = " caml__uint16... |
module Uint32 = struct type t = int32 let pp ppf t = Format . fprintf ppf " 0x % 08lX " t let of_int i = if i < 0 then invalid_arg " out of range " else if i > 2 * Int32 . ( to_int max_int ) + 1 then invalid_arg " out of range " else Int32 . of_int i let to_int t = if Sys . word_size <= 32 && t < 0l then None else if t... |
module Uint64 = struct type t = int64 let pp ppf t = Format . fprintf ppf " 0x % 016LX " t let of_int i = if i < 0 then invalid_arg " out of range " else Int64 . of_int i let to_int t = if Sys . word_size <= 64 && t < 0L then None else if t < 0L then Some Int64 . ( to_int ( add t min_int ) + to_int max_int + 1 ) else S... |
module Logging = struct type log_opts = { log_conns : bool ; log_async_exn : bool ; log_plugged_inout : bool ; log_everything_else : bool } bool let ( conn_section , async_exn , plugged_inout , everything_else ) everything_else = Lwt_log . Section . make " connections " , Lwt_log . Section . make " async_exceptions " ,... |
let byte_swap_16 value = ( ( value land 0xFF ) 0xFF lsl 8 ) 8 lor ( ( value lsr 8 ) 8 land 0xFF ) 0xFF |
module Protocol = struct type msg_version_t = Binary | Plist type conn_code = Success | Device_requested_not_connected | Port_requested_not_available | Malformed_request type event = Attached of device_t | Detached of int and device_t = { serial_number : string ; connection_speed : int ; connection_type : string ; prod... |
module Relay = struct type action = Shutdown | Reload type tunnel = { udid : string ; name : string option ; forwarding : forward list ; } [ @@ deriving of_yojson ] of_yojson and forward = { local_port : int ; device_port : int ; } type exn += Client_closed | Mapping_file_error of string let relay_lock = Lwt_mutex . cr... |
type t = { id : Common . id ; bio : string mc_option ; birthday : Common . calendar_us_date mc_option ; email : string mc_option ; first_name : string mc_option ; gender : string mc_option ; is_verified : bool mc_option ; last_name : string mc_option ; link : Common . uri mc_option ; locale : string mc_option ; name : ... |
module Home = struct end end end type t = { id : Common . id ; name : string ; category : string mc_option ; } [ @@ conv . ignore_unknown_fields ] [ @@ deriving conv { json } ] end | Application [ @ conv . as " application " ] | Event [ @ conv . as " event " ] end end let err type ' = let msg = Printf . sprintf " Expec... |
module Feed = struct module ReadResponse : Common . PagedResponse with type data = Home . Post . t = struct type data = Home . Post . t [ @@ deriving conv { json } ] type cursors = { after : string ; before : string ; } [ @@ conv . ignore_unknown_fields ] [ @@ deriving conv { json } ] type page_navigation = { next : Co... |
module Posts = struct let read_permissions = [ " read_stream " ; ] module ReadResponse : Common . PagedResponse with type data = Home . Post . t = struct type data = Home . Post . t [ @@ deriving conv { json } ] type cursors = { after : string ; before : string ; } [ @@ conv . ignore_unknown_fields ] [ @@ deriving conv... |
module Friends = struct let read_permissions = [ " user_friends " ] module ReadResponse : Common . PagedResponse with type data = t = struct type data = t [ @@ deriving conv { json } ] type cursors = { after : string ; before : string ; } [ @@ conv . ignore_unknown_fields ] [ @@ deriving conv { json } ] type page_navig... |
let section = Lwt_log . Section . make " ocsigen : ext : userconf " |
let err_500 = Ocsigen_extensions . Ext_stop_site ( Ocsigen_cookie_map . empty , ` Internal_server_error ) Internal_server_error |
let handle_parsing_error { Ocsigen_extensions . request_info ; _ } _ = function | Ocsigen_extensions . Error_in_config_file s -> Lwt_log . ign_error_f ~ section " Syntax error in userconf configuration file for url % s : % s " ( Uri . to_string ( Ocsigen_request . uri request_info ) request_info ) request_info s ; Lwt ... |
let subresult new_req user_parse_site conf previous_err req req_state = Ocsigen_extensions . Ext_sub_result ( fun cookies_to_set _rs -> Lwt . catch ( fun ( ) -> user_parse_site conf cookies_to_set ( Ocsigen_extensions . Req_not_found ( previous_err , new_req ) new_req ) new_req >>= fun ( answer , cookies ) cookies -> l... |
let conf_to_xml conf = try [ Xml . parse_file conf ] conf with | Sys_error _ -> raise NoConfFile | Xml . Error ( s , loc ) loc -> let begin_char , end_char = Xml . range loc and line = Xml . line loc in raise ( Ocsigen_extensions . Error_in_config_file ( Printf . sprintf " % s , line % d , characters % d -% d " ( Xml .... |
let gen hostpattern sitepath ( regexp , conf , url , prefix , localpath ) localpath = function | Ocsigen_extensions . Req_found _ -> Lwt . return Ocsigen_extensions . Ext_do_nothing | Ocsigen_extensions . Req_not_found ( previous_err , ( { Ocsigen_extensions . request_info ; request_config } request_config as req ) req... |
let parse_config _ hostpattern _ path _ _ config_elem = let regexp = ref None in let conf = ref None in let url = ref None in let prefix = ref None in let localpath = ref None in Ocsigen_extensions ( . Configuration . process_element ~ in_tag " : host " ~ other_elements ( : fun t _ _ -> raise ( Bad_config_tag_for_exten... |
let ( ) = Ocsigen_extensions . register ~ name " : userconf " ~ fun_site : parse_config ( ) |
let ( ) |> x f = f x ; ; |
let allocate how_many str_len = let l = ref [ ] in for _i = 1 to how_many do let s = Bytes . create str_len in l := s ( ::! l ) ; done ; ! l |
let allocate_a_lot ( ) = allocate 499 99991 |
let allocate_many_small ( ) = allocate 99991 499 |
module LuaBookDir = struct let readdir ls = let handle : Unix . dir_handle = let w = Lua . touserdata ls 1 in match w with | Some ` Userdata h -> h | _ -> failwith " Dir handle expected " ! in try Lua . pushstring ls ( Unix . readdir handle ) ; 1 with End_of_file -> 0 let dir_gc ls = let handle : Unix . dir_handle = le... |
let closure ( ) = let l1 = LuaL . newstate ( ) in LuaL . openlibs l1 ; LuaBookDir . luaopen_dir l1 ; LuaL . loadbuffer l1 " handle = opendir ( " " ) \/\ d = readdir ( handle ) end match Lua . pcall l1 0 0 0 with | Lua . LUA_OK -> ( ) | _err -> begin Printf . printf " % s \ n " %! ( Lua . tostring l1 ( - 1 ) |> Option .... |
let print_timings start_space start_wtime start_ptime = let end_ptime = Unix . times ( ) in let self_u = end_ptime . Unix . tms_utime . - start_ptime . Unix . tms_utime in let self_s = end_ptime . Unix . tms_stime . - start_ptime . Unix . tms_stime in let self = self_u . + self_s in let child_u = end_ptime . Unix . tms... |
let run func args = Gc . compact ( ) ; let start_space = Gc . quick_stat ( ) in let start_wtime = Unix . time ( ) in let start_ptime = Unix . times ( ) in let ret = try func args with e -> print_timings start_space start_wtime start_ptime ; raise e in print_timings start_space start_wtime start_ptime ; ret ; ; |
let test_duration = 60 . 0 . * 10 . 0 ; ; |
let time_start = Unix . gettimeofday ( ) ; ; |
let main ( ) = while Unix . gettimeofday ( ) < time_start . + test_duration do closure ( ) |> ignore ; Printf . printf " Calling Gc . compact from OCaml . . . " ; %! Gc . compact ( ) ; Printf . printf " done !\ n " ; %! done ; Gc . compact ( ) ; ; ; |
type upgrades = ( Int32 . t * Protocol_hash . t ) list |
let upgrades_encoding = let open Data_encoding in def " user_activated . upgrades " ~ title " : User activated upgrades " ~ description : " User activated upgrades : at given level , switch to given protocol . " ( list ( obj2 ( req " level " int32 ) ( req " replacement_protocol " Protocol_hash . encoding ) ) ) |
type protocol_overrides = ( Protocol_hash . t * Protocol_hash . t ) list |
let protocol_overrides_encoding = let open Data_encoding in def " user_activated . protocol_overrides " ~ title " : User activated protocol overrides " ~ description : " User activated protocol overrides : activate a protocol instead of \ another . " @@ list ( obj2 ( req " replaced_protocol " Protocol_hash . encoding )... |
let ( ) = Data_encoding . Registration . register upgrades_encoding ; Data_encoding . Registration . register protocol_overrides_encoding |
let test_metadata_consistency ~ migrate_from ~ migrate_to = Test . register ~ __FILE__ ~ title " : metadata consistency " ~ tags [ " : rpc " ; " metadata " ; " migration " ] @@ fun ( ) -> let node = Node . create [ ] in let * ( ) = Node . config_init node [ ] in let migration_level = 3 in Node . Config_file . ( update ... |
let register ~ migrate_from ~ migrate_to = test_metadata_consistency ~ migrate_from ~ migrate_to |
type t = { ua_family : string ; ua_major : string option ; ua_minor : string option ; ua_patch : string option ; os_family : string ; os_major : string option ; os_minor : string option ; os_patch : string option ; os_patch_minor : string option ; device_family : string ; device_brand : string option ; device_model : s... |
let uaparser = User_agent_parser . init ( ) |
let parse s = let parsed = User_agent_parser . parse uaparser s in let open User_agent_parser in let open User_agent_parser . UAParser in let open User_agent_parser . OSParser in let open User_agent_parser . DeviceParser in { ua_family = parsed . ua . family ; ua_major = parsed . ua . major ; ua_minor = parsed . ua . m... |
let is_bot t = let is_google_bot ( ) = let regex = Str . regexp " Googlebot ( \\- Mobile \\|- Image \\|- Video \\|- News ) \\?\\| Feedfetcher - Google \\| Google - Test \\| Google - Site - Verification \\| Google \ Web \ Preview \\| AdsBot - Google ( \\- Mobile ) \\?\\| Mediapartners - Google \\| Google . */\\+/ web / ... |
module Poly = struct [ %% versioned module Stable = struct module V2 = struct type ( ' u , ' s ) ' s t = Signed_command of ' u | Parties of ' s [ @@ deriving sexp , compare , equal , hash , yojson ] yojson let to_latest = Fn . id end module V1 = struct type ( ' u , ' s ) ' s t = Signed_command of ' u | Snapp_command of... |
type ( ' u , ' s ) ' s t_ = ( ' u , ' s ) ' s Poly . Stable . Latest . t = | Signed_command of ' u | Parties of ' s |
module Gen_make ( C : Signed_command_intf . Gen_intf ) Gen_intf = struct let to_signed_command f = Quickcheck . Generator . map f ~ f ( : fun c -> Signed_command c ) c open C . Gen let payment ? sign_type ~ key_gen ? nonce ~ max_amount ~ fee_range ( ) = to_signed_command ( payment ? sign_type ~ key_gen ? nonce ~ max_am... |
module Gen = Gen_make ( Signed_command ) Signed_command |
module Valid = struct [ %% versioned module Stable = struct module V2 = struct type t = ( Signed_command . With_valid_signature . Stable . V2 . t , Parties . Valid . Stable . V1 . t ) Poly . Stable . V2 . t [ @@ deriving sexp , compare , equal , hash , yojson ] yojson let to_latest = Fn . id end end ] end module Gen = ... |
module Stable = struct module V2 = struct type t = ( Signed_command . Stable . V2 . t , Parties . Stable . V1 . t ) t Poly . Stable . V2 . t [ @@ deriving sexp , compare , equal , hash , yojson ] yojson let to_latest = Fn . id end end ] end |
module Zero_one_or_two = struct [ %% versioned module Stable = struct module V1 = struct type ' a t = [ ` Zero | ` One of ' a | ` Two of ' a * ' a ] [ @@ deriving sexp , compare , equal , hash , yojson ] yojson end end ] end end |
module Verifiable = struct [ %% versioned module Stable = struct module V2 = struct type t = ( Signed_command . Stable . V2 . t , Parties . Verifiable . Stable . V1 . t ) Poly . Stable . V2 . t [ @@ deriving sexp , compare , equal , hash , yojson ] yojson let to_latest = Fn . id end end ] end let fee_payer ( t : t ) t ... |
let to_verifiable ( t : t ) t ~ ledger ~ get ~ location_of_account : Verifiable . t = let find_vk ( p : Party . t ) t = let ( ! ) x = Option . value_exn x in let id = Party . account_id p in Option . try_with ( fun ( ) -> let account : Account . t = ( ! get ledger ( ! location_of_account ledger id ) id ) id in ( ( !! a... |
let of_verifiable ( t : Verifiable . t ) t : t = match t with | Signed_command x -> Signed_command x | Parties p -> Parties ( Parties . of_verifiable p ) p |
let fee : t -> Currency . Fee . t = function | Signed_command x -> Signed_command . fee x | Parties p -> Parties . fee p |
let has_insufficient_fee t = Currency . Fee ( . fee t < minimum_fee ) minimum_fee |
let accounts_accessed ( t : t ) t = match t with | Signed_command x -> Signed_command . accounts_accessed x | Parties ps -> Parties . accounts_accessed ps |
let to_base58_check ( t : t ) t = match t with | Signed_command x -> Signed_command . to_base58_check x | Parties ps -> Parties . to_base58_check ps |
let fee_payer ( t : t ) t = match t with | Signed_command x -> Signed_command . fee_payer x | Parties p -> Parties . fee_payer p |
let nonce_exn ( t : t ) t = match t with | Signed_command x -> Signed_command . nonce x | Parties p -> Parties . nonce p |
let check ( t : t ) t : Valid . t option = match t with | Signed_command x -> Option . map ( Signed_command . check x ) x ~ f ( : fun c -> Signed_command c ) c | Parties p -> Some ( Parties ( p :> Parties . Valid . t ) t ) t |
let fee_token ( t : t ) t = match t with | Signed_command x -> Signed_command . fee_token x | Parties x -> Parties . fee_token x |
let valid_until ( t : t ) t = match t with | Signed_command x -> Signed_command . valid_until x | Parties _ -> Mina_numbers . Global_slot . max_value |
let forget_check ( t : Valid . t ) t : t = ( t :> t ) t |
let to_valid_unsafe ( t : t ) t = ` If_this_is_used_it_should_have_a_comment_justifying_it ( match t with | Parties x -> Parties x | Signed_command x -> let ( ` If_this_is_used_it_should_have_a_comment_justifying_it x ) x = Signed_command . to_valid_unsafe x in Signed_command x ) |
let filter_by_participant ( commands : t list ) list public_key = List . filter commands ~ f ( : fun user_command -> Core_kernel . List . exists ( accounts_accessed user_command ) user_command ~ f : ( Fn . compose ( Signature_lib . Public_key . Compressed . equal public_key ) public_key Account_id . public_key ) ) |
let weight : Stable . Latest . t -> int = function | Signed_command signed_command -> Signed_command . payload signed_command |> Signed_command_payload . weight | Parties parties -> Parties . weight parties |
let fee_per_wu ( user_command : Stable . Latest . t ) t : Currency . Fee_rate . t = Currency . Fee_rate . make_exn ( fee user_command ) user_command ( weight user_command ) user_command |
module Query_first_seen = [ % graphql { | query query ( $ hashes : [ String ] ) !! { user_commands ( user_commandswhere : { hash : { _in : $ hashes } hashes } hashes ) { hash @ bsDecoder ( bsDecoderfn : " Transaction_hash . of_base58_check_exn ) " first_seen @ bsDecoder ( bsDecoderfn : " Base_types . deserialize_option... |
module Query_participants = [ % graphql { | query query ( $ hashes : [ String ] ) !! { user_commands ( user_commandswhere : { hash : { _in : $ hashes } hashes } hashes ) { receiver { id value @ bsDecoder ( fn : " Public_key . Compressed . of_base58_check_exn ) " } sender { id value @ bsDecoder ( fn : " Public_key . Com... |
module Query = [ % graphql { | query query ( $ hash : String ) ! { user_commands ( user_commandswhere : { hash : { _eq : $ hash } hash } hash ) { fee @ bsDecoder ( fn : " Base_types . Fee . deserialize ) " hash @ bsDecoder ( bsDecoderfn : " Transaction_hash . of_base58_check_exn ) " memo @ bsDecoder ( bsDecoderfn : " S... |
module Insert = [ % graphql { | mutation insert ( $ user_commands : [ user_commands_insert_input ] ) !! { insert_user_commands ( insert_user_commandsobjects : $ user_commands , on_conflict : { constraint : user_commands_hash_key , update_columns : first_seen } first_seen ) { returning { hash @ bsDecoder ( bsDecoderfn :... |
let parties_with_ledger ( ) = let open Quickcheck . Let_syntax in let open Signature_lib in let num_keypairs = ( Parties_generators . max_other_parties * 2 ) 2 + 2 in let keypairs = List . init num_keypairs ~ f ( : fun _ -> Keypair . create ( ) ) in let keymap = List . fold keypairs ~ init : Public_key . Compressed . M... |
let sequence_parties_with_ledger ? length ( ) = let open Quickcheck . Let_syntax in let % bind length = match length with | Some n -> return n | None -> Quickcheck . Generator . small_non_negative_int in let merge_ledger source_ledger target_ledger = Ledger . iteri source_ledger ~ f ( : fun _ndx acct -> let acct_id = A... |
let pk_to_public_key ~ context ( ` Pk pk ) pk = Public_key . Compressed . of_base58_check pk |> Result . map_error ~ f ( : fun _ -> Errors . create ~ context ` Public_key_format_not_valid ) |
let account_id ( ` Pk pk ) pk ( ` Token_id token_id ) token_id = { Account_identifier . address = pk ; sub_account = None ; metadata = Some ( Amount_of . Token_id . encode token_id ) token_id } |
let token_id_of_account ( account : Account_identifier . t ) t = let module Decoder = Amount_of . Token_id . T ( Result ) Result in Decoder . decode account . metadata |> Result . map ~ f ( : Option . value ~ default : Amount_of . Token_id . default ) default |> Result . ok |
module Op = struct type ' a t = { label : ' a ; related_to : ' a option } [ @@ deriving equal ] equal module T ( M : Monad . S2 ) S2 = struct let build ~ a_eq ~ plan ~ f = let open M . Let_syntax in let % map _ , rev_data = List . fold plan ~ init ( : M . return ( 0 , [ ] ) ) ~ f ( : fun macc op -> let open M . Let_syn... |
module Kind = struct type t = [ ` Payment | ` Delegation ] [ @@ deriving yojson , equal , sexp , compare ] compare end |
module Account_creation_fees_paid = struct type t = | By_no_one | By_fee_payer of Unsigned_extended . UInt64 . t | By_receiver of Unsigned_extended . UInt64 . t [ @@ deriving equal , to_yojson , sexp , compare ] compare end |
module Failure_status = struct type t = [ ` Applied of Account_creation_fees_paid . t | ` Failed of string ] [ @@ deriving equal , to_yojson , sexp , compare ] compare end |
type t = { kind : Kind . t ; fee_payer : [ ` Pk of string ] ; source : [ ` Pk of string ] ; receiver : [ ` Pk of string ] ; fee_token : [ ` Token_id of string ] ; token : [ ` Token_id of string ] ; fee : Unsigned_extended . UInt64 . t ; nonce : Unsigned_extended . UInt32 . t ; amount : Unsigned_extended . UInt64 . t op... |
module Partial = struct type t = { kind : Kind . t ; fee_payer : [ ` Pk of string ] ; source : [ ` Pk of string ] ; receiver : [ ` Pk of string ] ; fee_token : [ ` Token_id of string ] ; token : [ ` Token_id of string ] ; fee : Unsigned_extended . UInt64 . t ; amount : Unsigned_extended . UInt64 . t option ; valid_unti... |
let forget ( t : t ) t : Partial . t = { kind = t . kind ; fee_payer = t . fee_payer ; source = t . source ; receiver = t . receiver ; fee_token = t . fee_token ; token = t . token ; fee = t . fee ; amount = t . amount ; valid_until = t . valid_until ; memo = t . memo } |
let remember ~ nonce ~ hash t = { kind = t . kind ; fee_payer = t . fee_payer ; source = t . source ; receiver = t . receiver ; fee_token = t . fee_token ; token = t . token ; fee = t . fee ; amount = t . amount ; valid_until = t . valid_until ; memo = t . memo ; hash ; nonce ; failure_status = None } |
let of_operations ? memo ? valid_until ( ops : Operation . t list ) list : ( Partial . t , Partial . Reason . t ) t Validation . t = let find_kind k ( ops : Operation . t list ) list = let name = Operation_types . name k in List . find ops ~ f ( : fun op -> String . equal op . Operation . _type name ) name |> Result . ... |
let to_operations ~ failure_status ( t : Partial . t ) t : Operation . t list = let plan : ' a Op . t list = ( if not Unsigned . UInt64 ( . equal t . fee zero ) zero then [ { Op . label = ` Fee_payment ; related_to = None } ] else [ ] ) @ ( match failure_status with | Some ( ` Applied ( Account_creation_fees_paid . By_... |
let to_operations ' ( t : t ) t : Operation . t list = to_operations ~ failure_status : t . failure_status ( forget t ) t let start = { kind = ` Payment ; fee_payer = ` Pk " Alice " ; source = ` Pk " Alice " ; token = ` Token_id Amount_of . Token_id . default ; fee = Unsigned . UInt64 . of_int 2_000_000_000 ; receiver ... |
let non_default_token = ` Token_id ( Token_id . to_string ( Quickcheck . random_value Token_id . gen_non_default ) gen_non_default ) gen_non_default |
let dummies = [ { kind = ` Payment ; fee_payer = ` Pk " Alice " ; source = ` Pk " Alice " ; token = ` Token_id Amount_of . Token_id . default ; fee_token = ` Token_id Amount_of . Token_id . default ; fee = Unsigned . UInt64 . of_int 2_000_000_000 ; receiver = ` Pk " Bob " ; nonce = Unsigned . UInt32 . of_int 3 ; amount... |
module Payload = struct module Common = struct [ %% versioned module Stable = struct module V2 = struct type t = ( Currency . Fee . Stable . V1 . t , Public_key . Compressed . Stable . V1 . t , Account_nonce . Stable . V1 . t option , Global_slot . Stable . V1 . t , Signed_command_memo . Stable . V1 . t ) Signed_comman... |
module Sign_choice = struct [ %% versioned module Stable = struct module V1 = struct type t = | Signature of Signature . Stable . V1 . t | Hd_index of Unsigned_extended . UInt32 . Stable . V1 . t | Keypair of Keypair . Stable . V1 . t [ @@ deriving sexp , to_yojson ] to_yojson let to_latest = Fn . id end end ] end end ... |
module Stable = struct module V2 = struct type t = ( Payload . Stable . V2 . t , Public_key . Compressed . Stable . V1 . t , Sign_choice . Stable . V1 . t ) Signed_command . Poly . Stable . V1 . t [ @@ deriving sexp , to_yojson ] to_yojson let to_latest = Fn . id end end ] end |
let fee_payer ( { payload ; _ } : t ) t = Payload . fee_payer payload |
let create ? nonce ~ fee ~ fee_payer_pk ~ valid_until ~ memo ~ body ~ signer ~ sign_choice ( ) : t = let valid_until = Option . value valid_until ~ default : Global_slot . max_value in let payload = Payload . create ~ fee ~ fee_payer_pk ? nonce ~ valid_until ~ memo ~ body in { payload ; signer ; signature = sign_choice... |
let sign ~ signer ( ~ user_command_payload : Signed_command_payload . t ) t = function | Sign_choice . Signature signature -> Option . value_map ~ default ( : Deferred . return ( Error " Invalid_signature ) ) " ( Signed_command . create_with_signature_checked signature signer user_command_payload ) ~ f : Deferred . Res... |
let inferred_nonce ~ get_current_nonce ( ~ fee_payer : Account_id . t ) t ~ nonce_map = let open Result . Let_syntax in let update_map = Map . set nonce_map ~ key : fee_payer in match Map . find nonce_map fee_payer with | Some ( min_nonce , nonce ) nonce -> let next_nonce = Account_nonce . succ nonce in let updated_map... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.