@@ -267,11 +267,11 @@ module Node = struct
267
267
module Account =
268
268
[% graphql
269
269
{|
270
- query ($ public_key: PublicKey, $token: UInt64 ) {
270
+ query ($ public_key: PublicKey! , $token: UInt64 ) {
271
271
account (publicKey : $public_key, token : $token ) {
272
- balance { liquid @ bsDecoder(fn : "Decoders.optional_balance " )
273
- locked @ bsDecoder(fn : "Decoders.optional_balance " )
274
- total @ bsDecoder(fn : "Decoders.balance " )
272
+ balance { liquid @ ppxCustom( module : "Serializing.Balance " )
273
+ locked @ ppxCustom( module : "Serializing.Balance " )
274
+ total @ ppxCustom( module : "Serializing.Balance " )
275
275
}
276
276
delegate
277
277
nonce
@@ -426,10 +426,12 @@ module Node = struct
426
426
( (" pub_key" , Signature_lib.Public_key.Compressed. to_yojson pk)
427
427
:: logger_metadata t ) ;
428
428
let get_account_obj =
429
- Graphql.Account. make
430
- ~public_key: (Graphql_lib.Encoders. public_key pk)
431
- ~token: (Graphql_lib.Encoders. token token)
432
- ()
429
+ Graphql.Account. (
430
+ make
431
+ @@ makeVariables
432
+ ~public_key: (Graphql_lib.Encoders. public_key pk)
433
+ ~token: (Graphql_lib.Encoders. token token)
434
+ () )
433
435
in
434
436
exec_graphql_request ~logger ~node: t ~query_name: " get_account_graphql"
435
437
get_account_obj
@@ -491,19 +493,20 @@ module Node = struct
491
493
| `Signature ->
492
494
Signature
493
495
in
496
+ let open Graphql.Account in
494
497
{ edit_sequence_state =
495
- to_auth_required account_permissions# editSequenceState
496
- ; edit_state = to_auth_required account_permissions# editState
497
- ; increment_nonce = to_auth_required account_permissions# incrementNonce
498
- ; receive = to_auth_required account_permissions# receive
499
- ; send = to_auth_required account_permissions# send
500
- ; set_delegate = to_auth_required account_permissions# setDelegate
501
- ; set_permissions = to_auth_required account_permissions# setPermissions
502
- ; set_zkapp_uri = to_auth_required account_permissions# setZkappUri
503
- ; set_token_symbol = to_auth_required account_permissions# setTokenSymbol
498
+ to_auth_required account_permissions. editSequenceState
499
+ ; edit_state = to_auth_required account_permissions. editState
500
+ ; increment_nonce = to_auth_required account_permissions. incrementNonce
501
+ ; receive = to_auth_required account_permissions. receive
502
+ ; send = to_auth_required account_permissions. send
503
+ ; set_delegate = to_auth_required account_permissions. setDelegate
504
+ ; set_permissions = to_auth_required account_permissions. setPermissions
505
+ ; set_zkapp_uri = to_auth_required account_permissions. setZkappUri
506
+ ; set_token_symbol = to_auth_required account_permissions. setTokenSymbol
504
507
; set_verification_key =
505
- to_auth_required account_permissions# setVerificationKey
506
- ; set_voting_for = to_auth_required account_permissions# setVotingFor
508
+ to_auth_required account_permissions. setVerificationKey
509
+ ; set_voting_for = to_auth_required account_permissions. setVotingFor
507
510
}
508
511
509
512
let graphql_uri node = Graphql. ingress_uri node |> Uri. to_string
@@ -512,9 +515,9 @@ module Node = struct
512
515
let open Deferred.Or_error in
513
516
let open Let_syntax in
514
517
let % bind account_obj = get_account ~logger t ~account_id in
515
- match account_obj# account with
518
+ match account_obj. account with
516
519
| Some account -> (
517
- match account# permissions with
520
+ match account. permissions with
518
521
| Some ledger_permissions ->
519
522
return @@ permissions_of_account_permissions ledger_permissions
520
523
| None ->
@@ -532,11 +535,11 @@ module Node = struct
532
535
let open Deferred.Or_error in
533
536
let open Let_syntax in
534
537
let % bind account_obj = get_account ~logger t ~account_id in
535
- match account_obj# account with
538
+ match account_obj. account with
536
539
| Some account ->
537
540
let open Mina_base.Zkapp_basic.Set_or_keep in
538
541
let % bind app_state =
539
- match account# zkappState with
542
+ match account. zkappState with
540
543
| Some strs ->
541
544
let fields =
542
545
Array. to_list strs
@@ -554,7 +557,7 @@ module Node = struct
554
557
(Mina_base.Account_id. public_key account_id) ) ) )
555
558
in
556
559
let % bind delegate =
557
- match account# delegate with
560
+ match account. delegate with
558
561
| Some (`String s ) ->
559
562
return
560
563
(Set (Signature_lib.Public_key.Compressed. of_base58_check_exn s))
@@ -567,13 +570,13 @@ module Node = struct
567
570
fail (Error. of_string " Expected delegate in account" )
568
571
in
569
572
let % bind verification_key =
570
- match account# verificationKey with
573
+ match account. verificationKey with
571
574
| Some vk_obj ->
572
575
let data =
573
576
Pickles.Side_loaded.Verification_key. of_base58_check_exn
574
- vk_obj# verificationKey
577
+ vk_obj. verificationKey
575
578
in
576
- let hash = Pickles.Backend.Tick.Field. of_string vk_obj# hash in
579
+ let hash = Pickles.Backend.Tick.Field. of_string vk_obj. hash in
577
580
return (Set ({ data; hash } : _ With_hash.t ))
578
581
| None ->
579
582
fail
@@ -585,33 +588,33 @@ module Node = struct
585
588
(Mina_base.Account_id. public_key account_id) ) ) )
586
589
in
587
590
let % bind permissions =
588
- match account# permissions with
591
+ match account. permissions with
589
592
| Some perms ->
590
593
return @@ Set (permissions_of_account_permissions perms)
591
594
| None ->
592
595
fail (Error. of_string " Expected permissions in account" )
593
596
in
594
597
let % bind zkapp_uri =
595
- match account# zkappUri with
598
+ match account. zkappUri with
596
599
| Some s ->
597
600
return @@ Set s
598
601
| None ->
599
602
fail (Error. of_string " Expected zkApp URI in account" )
600
603
in
601
604
let % bind token_symbol =
602
- match account# tokenSymbol with
605
+ match account. tokenSymbol with
603
606
| Some s ->
604
607
return @@ Set s
605
608
| None ->
606
609
fail (Error. of_string " Expected token symbol in account" )
607
610
in
608
611
let % bind timing =
609
- let timing = account# timing in
610
- let cliff_amount = timing# cliffAmount in
611
- let cliff_time = timing# cliffTime in
612
- let vesting_period = timing# vestingPeriod in
613
- let vesting_increment = timing# vestingIncrement in
614
- let initial_minimum_balance = timing# initialMinimumBalance in
612
+ let timing = account. timing in
613
+ let cliff_amount = timing. cliffAmount in
614
+ let cliff_time = timing. cliffTime in
615
+ let vesting_period = timing. vestingPeriod in
616
+ let vesting_increment = timing. vestingIncrement in
617
+ let initial_minimum_balance = timing. initialMinimumBalance in
615
618
match
616
619
( cliff_amount
617
620
, cliff_time
@@ -682,7 +685,7 @@ module Node = struct
682
685
fail (Error. of_string " Some pieces of account timing are missing" )
683
686
in
684
687
let % bind voting_for =
685
- match account# votingFor with
688
+ match account. votingFor with
686
689
| Some s ->
687
690
return @@ Set (Mina_base.State_hash. of_base58_check_exn s)
688
691
| None ->
@@ -776,14 +779,14 @@ module Node = struct
776
779
in
777
780
let send_zkapp_graphql () =
778
781
let send_zkapp_obj =
779
- Graphql.Send_test_zkapp. make ~parties: parties_json ()
782
+ Graphql.Send_test_zkapp. ( make @@ makeVariables ~parties: parties_json () )
780
783
in
781
784
exec_graphql_request ~logger ~node: t ~query_name: " send_zkapp_graphql"
782
785
send_zkapp_obj
783
786
in
784
787
let % bind sent_zkapp_obj = send_zkapp_graphql () in
785
788
let % bind () =
786
- match sent_zkapp_obj# internalSendZkapp# zkapp# failureReason with
789
+ match sent_zkapp_obj. internalSendZkapp. zkapp. failureReason with
787
790
| None ->
788
791
return ()
789
792
| Some s ->
@@ -793,18 +796,18 @@ module Node = struct
793
796
| None ->
794
797
acc
795
798
| Some f ->
796
- ( Int. of_string (Option. value_exn f# index)
799
+ ( Int. of_string (Option. value_exn f. index)
797
800
, Array. map
798
801
~f: (fun s ->
799
802
Mina_base.Transaction_status.Failure. of_string s
800
803
|> Result. ok_or_failwith )
801
- f# failures
804
+ f. failures
802
805
|> Array. to_list |> List. rev )
803
806
:: acc )
804
807
|> Mina_base.Transaction_status.Failure.Collection. display_to_yojson
805
808
|> Yojson.Safe. to_string )
806
809
in
807
- let zkapp_id = sent_zkapp_obj# internalSendZkapp# zkapp# id in
810
+ let zkapp_id = sent_zkapp_obj. internalSendZkapp. zkapp. id in
808
811
[% log info] " Sent zkapp" ~metadata: [ (" zkapp_id" , `String zkapp_id) ] ;
809
812
return zkapp_id
810
813
0 commit comments