LCOV - code coverage report
Current view: top level - flamenco/runtime/tests/generated - cost.pb.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 0 120 0.0 %
Date: 2026-11-12 04:25:03 Functions: 0 6 0.0 %

          Line data    Source code
       1             : /* Automatically generated by fd_pb_gen.py.  Do not edit. */
       2             : 
       3             : #include "cost.pb.h"
       4             : 
       5             : static int
       6             : fd_exec_test_cost_context_encode( fd_pb_encoder_t * enc,
       7           0 :                                   void const *      msg_ ) {
       8           0 :   fd_exec_test_cost_context_t const * msg = msg_;
       9           0 :   if( msg->has_tx && FD_UNLIKELY( !fd_pb_enc_submsg( enc, 1U, &fd_exec_test_sanitized_transaction_desc, &msg->tx ) ) ) return 0;
      10           0 :   if( msg->has_features && FD_UNLIKELY( !fd_pb_enc_submsg( enc, 2U, &fd_exec_test_feature_set_desc, &msg->features ) ) ) return 0;
      11           0 :   if( msg->mode && FD_UNLIKELY( !fd_pb_push_int64( enc, 3U, (long)msg->mode ) ) ) return 0;
      12           0 :   if( msg->actual_programs_execution_cost && FD_UNLIKELY( !fd_pb_push_uint32( enc, 4U, msg->actual_programs_execution_cost ) ) ) return 0;
      13           0 :   if( msg->actual_loaded_accounts_data_size_bytes && FD_UNLIKELY( !fd_pb_push_uint32( enc, 5U, msg->actual_loaded_accounts_data_size_bytes ) ) ) return 0;
      14           0 :   return 1;
      15           0 : }
      16             : 
      17             : static int
      18             : fd_exec_test_cost_context_decode( fd_pb_inbuf_t * in,
      19             :                                   void *          msg_,
      20           0 :                                   fd_spad_t *     spad ) {
      21           0 :   fd_exec_test_cost_context_t * msg = msg_;
      22           0 :   while( fd_pb_inbuf_sz( in ) ) {
      23           0 :     fd_pb_tlv_t tlv[1];
      24           0 :     if( FD_UNLIKELY( !fd_pb_dec_tlv( in, tlv ) ) ) return 0;
      25           0 :     switch( tlv->field_id ) {
      26           0 :     case 1:
      27           0 :       if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_sanitized_transaction_desc, &msg->tx ) ) ) return 0;
      28           0 :       msg->has_tx = 1;
      29           0 :       break;
      30           0 :     case 2:
      31           0 :       if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_feature_set_desc, &msg->features ) ) ) return 0;
      32           0 :       msg->has_features = 1;
      33           0 :       break;
      34           0 :     case 3:
      35           0 :       if( FD_UNLIKELY( !fd_pb_dec_int32( tlv, (int *)&msg->mode ) ) ) return 0;
      36           0 :       break;
      37           0 :     case 4:
      38           0 :       if( FD_UNLIKELY( !fd_pb_dec_uint32( tlv, &msg->actual_programs_execution_cost ) ) ) return 0;
      39           0 :       break;
      40           0 :     case 5:
      41           0 :       if( FD_UNLIKELY( !fd_pb_dec_uint32( tlv, &msg->actual_loaded_accounts_data_size_bytes ) ) ) return 0;
      42           0 :       break;
      43           0 :     default:
      44           0 :       if( FD_UNLIKELY( !fd_pb_dec_skip( in, tlv ) ) ) return 0;
      45           0 :       break;
      46           0 :     }
      47           0 :   }
      48           0 :   return 1;
      49           0 : }
      50             : 
      51             : fd_pb_msgdesc_t const fd_exec_test_cost_context_desc = {
      52             :   .encode = fd_exec_test_cost_context_encode,
      53             :   .decode = fd_exec_test_cost_context_decode
      54             : };
      55             : 
      56             : static int
      57             : fd_exec_test_cost_result_encode( fd_pb_encoder_t * enc,
      58           0 :                                  void const *      msg_ ) {
      59           0 :   fd_exec_test_cost_result_t const * msg = msg_;
      60           0 :   if( msg->has_cost && FD_UNLIKELY( !fd_pb_push_bool( enc, 1U, msg->has_cost ) ) ) return 0;
      61           0 :   if( msg->signature_cost && FD_UNLIKELY( !fd_pb_push_uint64( enc, 2U, msg->signature_cost ) ) ) return 0;
      62           0 :   if( msg->write_lock_cost && FD_UNLIKELY( !fd_pb_push_uint64( enc, 3U, msg->write_lock_cost ) ) ) return 0;
      63           0 :   if( msg->data_bytes_cost && FD_UNLIKELY( !fd_pb_push_uint64( enc, 4U, msg->data_bytes_cost ) ) ) return 0;
      64           0 :   if( msg->programs_execution_cost && FD_UNLIKELY( !fd_pb_push_uint64( enc, 5U, msg->programs_execution_cost ) ) ) return 0;
      65           0 :   if( msg->loaded_accounts_data_size_cost && FD_UNLIKELY( !fd_pb_push_uint64( enc, 6U, msg->loaded_accounts_data_size_cost ) ) ) return 0;
      66           0 :   if( msg->allocated_accounts_data_size && FD_UNLIKELY( !fd_pb_push_uint64( enc, 7U, msg->allocated_accounts_data_size ) ) ) return 0;
      67           0 :   if( msg->total_cost && FD_UNLIKELY( !fd_pb_push_uint64( enc, 8U, msg->total_cost ) ) ) return 0;
      68           0 :   return 1;
      69           0 : }
      70             : 
      71             : static int
      72             : fd_exec_test_cost_result_decode( fd_pb_inbuf_t * in,
      73             :                                  void *          msg_,
      74           0 :                                  fd_spad_t *     spad FD_PARAM_UNUSED ) {
      75           0 :   fd_exec_test_cost_result_t * msg = msg_;
      76           0 :   while( fd_pb_inbuf_sz( in ) ) {
      77           0 :     fd_pb_tlv_t tlv[1];
      78           0 :     if( FD_UNLIKELY( !fd_pb_dec_tlv( in, tlv ) ) ) return 0;
      79           0 :     switch( tlv->field_id ) {
      80           0 :     case 1:
      81           0 :       if( FD_UNLIKELY( !fd_pb_dec_bool( tlv, &msg->has_cost ) ) ) return 0;
      82           0 :       break;
      83           0 :     case 2:
      84           0 :       if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->signature_cost ) ) ) return 0;
      85           0 :       break;
      86           0 :     case 3:
      87           0 :       if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->write_lock_cost ) ) ) return 0;
      88           0 :       break;
      89           0 :     case 4:
      90           0 :       if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->data_bytes_cost ) ) ) return 0;
      91           0 :       break;
      92           0 :     case 5:
      93           0 :       if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->programs_execution_cost ) ) ) return 0;
      94           0 :       break;
      95           0 :     case 6:
      96           0 :       if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->loaded_accounts_data_size_cost ) ) ) return 0;
      97           0 :       break;
      98           0 :     case 7:
      99           0 :       if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->allocated_accounts_data_size ) ) ) return 0;
     100           0 :       break;
     101           0 :     case 8:
     102           0 :       if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->total_cost ) ) ) return 0;
     103           0 :       break;
     104           0 :     default:
     105           0 :       if( FD_UNLIKELY( !fd_pb_dec_skip( in, tlv ) ) ) return 0;
     106           0 :       break;
     107           0 :     }
     108           0 :   }
     109           0 :   return 1;
     110           0 : }
     111             : 
     112             : fd_pb_msgdesc_t const fd_exec_test_cost_result_desc = {
     113             :   .encode = fd_exec_test_cost_result_encode,
     114             :   .decode = fd_exec_test_cost_result_decode
     115             : };
     116             : 
     117             : static int
     118             : fd_exec_test_cost_fixture_encode( fd_pb_encoder_t * enc,
     119           0 :                                   void const *      msg_ ) {
     120           0 :   fd_exec_test_cost_fixture_t const * msg = msg_;
     121           0 :   if( msg->has_metadata && FD_UNLIKELY( !fd_pb_enc_submsg( enc, 1U, &fd_exec_test_fixture_metadata_desc, &msg->metadata ) ) ) return 0;
     122           0 :   if( msg->has_input && FD_UNLIKELY( !fd_pb_enc_submsg( enc, 2U, &fd_exec_test_cost_context_desc, &msg->input ) ) ) return 0;
     123           0 :   if( msg->has_output && FD_UNLIKELY( !fd_pb_enc_submsg( enc, 3U, &fd_exec_test_cost_result_desc, &msg->output ) ) ) return 0;
     124           0 :   return 1;
     125           0 : }
     126             : 
     127             : static int
     128             : fd_exec_test_cost_fixture_decode( fd_pb_inbuf_t * in,
     129             :                                   void *          msg_,
     130           0 :                                   fd_spad_t *     spad ) {
     131           0 :   fd_exec_test_cost_fixture_t * msg = msg_;
     132           0 :   while( fd_pb_inbuf_sz( in ) ) {
     133           0 :     fd_pb_tlv_t tlv[1];
     134           0 :     if( FD_UNLIKELY( !fd_pb_dec_tlv( in, tlv ) ) ) return 0;
     135           0 :     switch( tlv->field_id ) {
     136           0 :     case 1:
     137           0 :       if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_fixture_metadata_desc, &msg->metadata ) ) ) return 0;
     138           0 :       msg->has_metadata = 1;
     139           0 :       break;
     140           0 :     case 2:
     141           0 :       if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_cost_context_desc, &msg->input ) ) ) return 0;
     142           0 :       msg->has_input = 1;
     143           0 :       break;
     144           0 :     case 3:
     145           0 :       if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_cost_result_desc, &msg->output ) ) ) return 0;
     146           0 :       msg->has_output = 1;
     147           0 :       break;
     148           0 :     default:
     149           0 :       if( FD_UNLIKELY( !fd_pb_dec_skip( in, tlv ) ) ) return 0;
     150           0 :       break;
     151           0 :     }
     152           0 :   }
     153           0 :   return 1;
     154           0 : }
     155             : 
     156             : fd_pb_msgdesc_t const fd_exec_test_cost_fixture_desc = {
     157             :   .encode = fd_exec_test_cost_fixture_encode,
     158             :   .decode = fd_exec_test_cost_fixture_decode
     159             : };
     160             : 

Generated by: LCOV version 1.14