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