LCOV - code coverage report
Current view: top level - flamenco/runtime/tests/generated - cost.pb.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 97 120 80.8 %
Date: 2026-11-11 12:40:43 Functions: 4 6 66.7 %

          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         995 :                                   fd_spad_t *     spad ) {
      21         995 :   fd_exec_test_cost_context_t * msg = msg_;
      22        5369 :   while( fd_pb_inbuf_sz( in ) ) {
      23        4370 :     fd_pb_tlv_t tlv[1];
      24        4370 :     if( FD_UNLIKELY( !fd_pb_dec_tlv( in, tlv ) ) ) return 0;
      25        4370 :     switch( tlv->field_id ) {
      26         993 :     case 1:
      27         993 :       if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_sanitized_transaction_desc, &msg->tx ) ) ) return 0;
      28         993 :       msg->has_tx = 1;
      29         993 :       break;
      30         992 :     case 2:
      31         992 :       if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_feature_set_desc, &msg->features ) ) ) return 0;
      32         992 :       msg->has_features = 1;
      33         992 :       break;
      34         483 :     case 3:
      35         483 :       if( FD_UNLIKELY( !fd_pb_dec_int32( tlv, (int *)&msg->mode ) ) ) return 0;
      36         483 :       break;
      37         991 :     case 4:
      38         991 :       if( FD_UNLIKELY( !fd_pb_dec_uint32( tlv, &msg->actual_programs_execution_cost ) ) ) return 0;
      39         991 :       break;
      40         998 :     case 5:
      41         998 :       if( FD_UNLIKELY( !fd_pb_dec_uint32( tlv, &msg->actual_loaded_accounts_data_size_bytes ) ) ) return 0;
      42         998 :       break;
      43         998 :     default:
      44           0 :       if( FD_UNLIKELY( !fd_pb_dec_skip( in, tlv ) ) ) return 0;
      45           0 :       break;
      46        4370 :     }
      47        4370 :   }
      48         999 :   return 1;
      49         995 : }
      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        1984 :                                  void const *      msg_ ) {
      59        1984 :   fd_exec_test_cost_result_t const * msg = msg_;
      60        1984 :   if( msg->has_cost && FD_UNLIKELY( !fd_pb_push_bool( enc, 1U, msg->has_cost ) ) ) return 0;
      61        1984 :   if( msg->signature_cost && FD_UNLIKELY( !fd_pb_push_uint64( enc, 2U, msg->signature_cost ) ) ) return 0;
      62        1984 :   if( msg->write_lock_cost && FD_UNLIKELY( !fd_pb_push_uint64( enc, 3U, msg->write_lock_cost ) ) ) return 0;
      63        1984 :   if( msg->data_bytes_cost && FD_UNLIKELY( !fd_pb_push_uint64( enc, 4U, msg->data_bytes_cost ) ) ) return 0;
      64        1984 :   if( msg->programs_execution_cost && FD_UNLIKELY( !fd_pb_push_uint64( enc, 5U, msg->programs_execution_cost ) ) ) return 0;
      65        1996 :   if( msg->loaded_accounts_data_size_cost && FD_UNLIKELY( !fd_pb_push_uint64( enc, 6U, msg->loaded_accounts_data_size_cost ) ) ) return 0;
      66        1984 :   if( msg->allocated_accounts_data_size && FD_UNLIKELY( !fd_pb_push_uint64( enc, 7U, msg->allocated_accounts_data_size ) ) ) return 0;
      67        1993 :   if( msg->total_cost && FD_UNLIKELY( !fd_pb_push_uint64( enc, 8U, msg->total_cost ) ) ) return 0;
      68        1984 :   return 1;
      69        1984 : }
      70             : 
      71             : static int
      72             : fd_exec_test_cost_result_decode( fd_pb_inbuf_t * in,
      73             :                                  void *          msg_,
      74         998 :                                  fd_spad_t *     spad FD_PARAM_UNUSED ) {
      75         998 :   fd_exec_test_cost_result_t * msg = msg_;
      76        8194 :   while( fd_pb_inbuf_sz( in ) ) {
      77        7199 :     fd_pb_tlv_t tlv[1];
      78        7199 :     if( FD_UNLIKELY( !fd_pb_dec_tlv( in, tlv ) ) ) return 0;
      79        7199 :     switch( tlv->field_id ) {
      80         995 :     case 1:
      81         995 :       if( FD_UNLIKELY( !fd_pb_dec_bool( tlv, &msg->has_cost ) ) ) return 0;
      82         995 :       break;
      83         998 :     case 2:
      84         998 :       if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->signature_cost ) ) ) return 0;
      85         998 :       break;
      86         998 :     case 3:
      87         993 :       if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->write_lock_cost ) ) ) return 0;
      88         993 :       break;
      89         993 :     case 4:
      90         992 :       if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->data_bytes_cost ) ) ) return 0;
      91         992 :       break;
      92         992 :     case 5:
      93         983 :       if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->programs_execution_cost ) ) ) return 0;
      94         983 :       break;
      95         997 :     case 6:
      96         997 :       if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->loaded_accounts_data_size_cost ) ) ) return 0;
      97         997 :       break;
      98         997 :     case 7:
      99         452 :       if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->allocated_accounts_data_size ) ) ) return 0;
     100         452 :       break;
     101         995 :     case 8:
     102         995 :       if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->total_cost ) ) ) return 0;
     103         995 :       break;
     104         995 :     default:
     105           0 :       if( FD_UNLIKELY( !fd_pb_dec_skip( in, tlv ) ) ) return 0;
     106           0 :       break;
     107        7199 :     }
     108        7199 :   }
     109         995 :   return 1;
     110         998 : }
     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        1001 :                                   fd_spad_t *     spad ) {
     131        1001 :   fd_exec_test_cost_fixture_t * msg = msg_;
     132        3989 :   while( fd_pb_inbuf_sz( in ) ) {
     133        2976 :     fd_pb_tlv_t tlv[1];
     134        2976 :     if( FD_UNLIKELY( !fd_pb_dec_tlv( in, tlv ) ) ) return 0;
     135        2976 :     switch( tlv->field_id ) {
     136         997 :     case 1:
     137         997 :       if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_fixture_metadata_desc, &msg->metadata ) ) ) return 0;
     138         997 :       msg->has_metadata = 1;
     139         997 :       break;
     140         992 :     case 2:
     141         992 :       if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_cost_context_desc, &msg->input ) ) ) return 0;
     142         992 :       msg->has_input = 1;
     143         992 :       break;
     144         997 :     case 3:
     145         997 :       if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_cost_result_desc, &msg->output ) ) ) return 0;
     146         997 :       msg->has_output = 1;
     147         997 :       break;
     148           0 :     default:
     149           0 :       if( FD_UNLIKELY( !fd_pb_dec_skip( in, tlv ) ) ) return 0;
     150           0 :       break;
     151        2976 :     }
     152        2976 :   }
     153        1013 :   return 1;
     154        1001 : }
     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