LCOV - code coverage report
Current view: top level - flamenco/runtime/sysvar - fd_sysvar_rent.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 3 16 18.8 %
Date: 2026-07-10 05:48:38 Functions: 1 3 33.3 %

          Line data    Source code
       1             : #include "fd_sysvar_rent.h"
       2             : #include "fd_sysvar.h"
       3             : #include "../fd_system_ids.h"
       4             : 
       5             : void
       6             : fd_sysvar_rent_write( fd_bank_t *        bank,
       7             :                       fd_accdb_t *       accdb,
       8             :                       fd_capture_ctx_t * capture_ctx,
       9           6 :                       fd_rent_t const *  rent ) {
      10           6 :   fd_sysvar_account_update( bank, accdb, capture_ctx, &fd_sysvar_rent_id, rent, FD_SYSVAR_RENT_BINCODE_SZ );
      11           6 : }
      12             : 
      13             : void
      14             : fd_sysvar_rent_init( fd_bank_t *        bank,
      15             :                      fd_accdb_t *       accdb,
      16           0 :                      fd_capture_ctx_t * capture_ctx ) {
      17           0 :   fd_sysvar_rent_write( bank, accdb, capture_ctx, &bank->f.rent );
      18           0 : }
      19             : 
      20             : fd_rent_t const *
      21             : fd_sysvar_rent_read( fd_accdb_t *       accdb,
      22             :                      fd_accdb_fork_id_t fork_id,
      23           0 :                      fd_rent_t *        rent ) {
      24           0 :   fd_acc_t acc = fd_accdb_read_one( accdb, fork_id, fd_sysvar_rent_id.uc );
      25           0 :   if( FD_UNLIKELY( !acc.lamports || acc.data_len<FD_SYSVAR_RENT_BINCODE_SZ ) ) {
      26           0 :     fd_accdb_unread_one( accdb, &acc );
      27           0 :     return NULL;
      28           0 :   }
      29             : 
      30           0 :   fd_memcpy( rent, acc.data, FD_SYSVAR_RENT_BINCODE_SZ );
      31           0 :   fd_accdb_unread_one( accdb, &acc );
      32           0 :   return rent;
      33           0 : }

Generated by: LCOV version 1.14