LCOV - code coverage report
Current view: top level - flamenco - fd_flamenco_base.h (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 4 6 66.7 %
Date: 2026-02-07 05:30:15 Functions: 7 748 0.9 %

          Line data    Source code
       1             : #ifndef HEADER_fd_src_flamenco_fd_flamenco_base_h
       2             : #define HEADER_fd_src_flamenco_fd_flamenco_base_h
       3             : 
       4             : #include "../ballet/base58/fd_base58.h"
       5             : #include "types/fd_cast.h"
       6             : 
       7             : #define FD_DEFAULT_SLOTS_PER_EPOCH   ( 432000UL )
       8             : #define FD_DEFAULT_SHREDS_PER_EPOCH  ( ( 1 << 15UL ) * FD_DEFAULT_SLOTS_PER_EPOCH )
       9         141 : #define FD_SLOT_NULL                 ( ULONG_MAX )
      10             : #define FD_SHRED_IDX_NULL            ( UINT_MAX )
      11             : 
      12             : /* Forward declarations */
      13             : 
      14             : struct fd_bank;
      15             : typedef struct fd_bank fd_bank_t;
      16             : 
      17             : struct fd_banks;
      18             : typedef struct fd_banks fd_banks_t;
      19             : 
      20             : struct fd_bank_data;
      21             : typedef struct fd_bank_data fd_bank_data_t;
      22             : 
      23             : struct fd_banks_locks;
      24             : typedef struct fd_banks_locks fd_banks_locks_t;
      25             : 
      26             : struct fd_exec_instr_ctx;
      27             : typedef struct fd_exec_instr_ctx fd_exec_instr_ctx_t;
      28             : 
      29             : struct fd_acc_mgr;
      30             : typedef struct fd_acc_mgr fd_acc_mgr_t;
      31             : 
      32             : struct fd_capture_ctx;
      33             : typedef struct fd_capture_ctx fd_capture_ctx_t;
      34             : 
      35             : struct fd_dump_proto_ctx;
      36             : typedef struct fd_dump_proto_ctx fd_dump_proto_ctx_t;
      37             : 
      38             : struct fd_borrowed_account;
      39             : typedef struct fd_borrowed_account fd_borrowed_account_t;
      40             : 
      41             : union fd_features;
      42             : typedef union fd_features fd_features_t;
      43             : 
      44             : struct fd_progcache;
      45             : typedef struct fd_progcache fd_progcache_t;
      46             : 
      47             : union fd_runtime_stack;
      48             : typedef union fd_runtime_stack fd_runtime_stack_t;
      49             : 
      50             : struct fd_runtime;
      51             : typedef struct fd_runtime fd_runtime_t;
      52             : 
      53             : struct fd_txn_in;
      54             : typedef struct fd_txn_in fd_txn_in_t;
      55             : 
      56             : struct fd_txn_out;
      57             : typedef struct fd_txn_out fd_txn_out_t;
      58             : 
      59             : struct fd_log_collector;
      60             : typedef struct fd_log_collector fd_log_collector_t;
      61             : 
      62             : struct fd_acc_pool;
      63             : typedef struct fd_acc_pool fd_acc_pool_t;
      64             : 
      65             : struct fd_genesis;
      66             : typedef struct fd_genesis fd_genesis_t;
      67             : 
      68             : struct fd_account_meta {
      69             :   uchar owner[32];
      70             :   ulong lamports;
      71             :   ulong slot;
      72             :   uint  dlen;
      73             :   uchar executable;
      74             :   uchar padding[3];
      75             : };
      76             : typedef struct fd_account_meta fd_account_meta_t;
      77             : 
      78             : FD_FN_PURE static inline uchar *
      79        1797 : fd_account_data( fd_account_meta_t const * acc ) {
      80        1797 :   return (uchar *)( acc+1 );
      81        1797 : }
      82             : 
      83             : FD_PROTOTYPES_BEGIN
      84             : 
      85             : /* fd_acct_addr_cstr converts the given Solana address into a base58-
      86             :    encoded cstr.  Returns cstr.  On return cstr contains a string with
      87             :    length in [32,44] (excluding NULL terminator). */
      88             : 
      89             : static inline char *
      90             : fd_acct_addr_cstr( char        cstr[ FD_BASE58_ENCODED_32_SZ ],
      91           0 :                    uchar const addr[ 32 ] ) {
      92             :   return fd_base58_encode_32( addr, NULL, cstr );
      93           0 : }
      94             : 
      95             : FD_PROTOTYPES_END
      96             : 
      97             : #endif /* HEADER_fd_src_flamenco_fd_flamenco_base_h */

Generated by: LCOV version 1.14