11/* eslint-disable @typescript-eslint/naming-convention */
2- import { ContainerType , fromHexString , toHexString , Type , ValueOf } from "@chainsafe/ssz" ;
2+ import { ContainerType , fromHexString , Type , ValueOf } from "@chainsafe/ssz" ;
33import { ChainForkConfig } from "@lodestar/config" ;
44import { isForkBlobs , isForkPostElectra } from "@lodestar/params" ;
55import {
@@ -20,6 +20,7 @@ import {
2020 Attestation ,
2121 sszTypesFor ,
2222} from "@lodestar/types" ;
23+ import { toHex , toRootHex } from "@lodestar/utils" ;
2324import { Endpoint , RouteDefinitions , Schema } from "../../utils/index.js" ;
2425import { fromGraffitiHex , toBoolean , toGraffitiHex } from "../../utils/serdes.js" ;
2526import { getExecutionForkTypes , toForkName } from "../../utils/fork.js" ;
@@ -623,7 +624,7 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
623624 writeReq : ( { slot, randaoReveal, graffiti, feeRecipient, builderSelection, strictFeeRecipientCheck} ) => ( {
624625 params : { slot} ,
625626 query : {
626- randao_reveal : toHexString ( randaoReveal ) ,
627+ randao_reveal : toHex ( randaoReveal ) ,
627628 graffiti : toGraffitiHex ( graffiti ) ,
628629 fee_recipient : feeRecipient ,
629630 builder_selection : builderSelection ,
@@ -674,7 +675,7 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
674675 } ) => ( {
675676 params : { slot} ,
676677 query : {
677- randao_reveal : toHexString ( randaoReveal ) ,
678+ randao_reveal : toHex ( randaoReveal ) ,
678679 graffiti : toGraffitiHex ( graffiti ) ,
679680 skip_randao_verification : writeSkipRandaoVerification ( skipRandaoVerification ) ,
680681 fee_recipient : feeRecipient ,
@@ -765,7 +766,7 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
765766 req : {
766767 writeReq : ( { slot, randaoReveal, graffiti} ) => ( {
767768 params : { slot} ,
768- query : { randao_reveal : toHexString ( randaoReveal ) , graffiti : toGraffitiHex ( graffiti ) } ,
769+ query : { randao_reveal : toHex ( randaoReveal ) , graffiti : toGraffitiHex ( graffiti ) } ,
769770 } ) ,
770771 parseReq : ( { params, query} ) => ( {
771772 slot : params . slot ,
@@ -805,7 +806,7 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
805806 method : "GET" ,
806807 req : {
807808 writeReq : ( { slot, subcommitteeIndex, beaconBlockRoot} ) => ( {
808- query : { slot, subcommittee_index : subcommitteeIndex , beacon_block_root : toHexString ( beaconBlockRoot ) } ,
809+ query : { slot, subcommittee_index : subcommitteeIndex , beacon_block_root : toRootHex ( beaconBlockRoot ) } ,
809810 } ) ,
810811 parseReq : ( { query} ) => ( {
811812 slot : query . slot ,
@@ -830,7 +831,7 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
830831 method : "GET" ,
831832 req : {
832833 writeReq : ( { attestationDataRoot, slot} ) => ( {
833- query : { attestation_data_root : toHexString ( attestationDataRoot ) , slot} ,
834+ query : { attestation_data_root : toRootHex ( attestationDataRoot ) , slot} ,
834835 } ) ,
835836 parseReq : ( { query} ) => ( {
836837 attestationDataRoot : fromHexString ( query . attestation_data_root ) ,
@@ -853,7 +854,7 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
853854 method : "GET" ,
854855 req : {
855856 writeReq : ( { attestationDataRoot, slot, committeeIndex} ) => ( {
856- query : { attestation_data_root : toHexString ( attestationDataRoot ) , slot, committee_index : committeeIndex } ,
857+ query : { attestation_data_root : toHex ( attestationDataRoot ) , slot, committee_index : committeeIndex } ,
857858 } ) ,
858859 parseReq : ( { query} ) => ( {
859860 attestationDataRoot : fromHexString ( query . attestation_data_root ) ,
0 commit comments