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 : /* Forward declarations */ 8 : 9 : struct fd_bank; 10 : typedef struct fd_bank fd_bank_t; 11 : 12 : struct fd_banks; 13 : typedef struct fd_banks fd_banks_t; 14 : 15 : struct fd_exec_instr_ctx; 16 : typedef struct fd_exec_instr_ctx fd_exec_instr_ctx_t; 17 : 18 : struct fd_acc_mgr; 19 : typedef struct fd_acc_mgr fd_acc_mgr_t; 20 : 21 : struct fd_capture_ctx; 22 : typedef struct fd_capture_ctx fd_capture_ctx_t; 23 : 24 : struct fd_dump_proto_ctx; 25 : typedef struct fd_dump_proto_ctx fd_dump_proto_ctx_t; 26 : 27 : struct fd_txn_dump_ctx; 28 : typedef struct fd_txn_dump_ctx fd_txn_dump_ctx_t; 29 : 30 : struct fd_borrowed_account; 31 : typedef struct fd_borrowed_account fd_borrowed_account_t; 32 : 33 : union fd_features; 34 : typedef union fd_features fd_features_t; 35 : 36 : struct fd_progcache; 37 : typedef struct fd_progcache fd_progcache_t; 38 : 39 : struct fd_runtime_stack; 40 : typedef struct fd_runtime_stack fd_runtime_stack_t; 41 : 42 : struct fd_vote_stakes; 43 : typedef struct fd_vote_stakes fd_vote_stakes_t; 44 : 45 : struct fd_runtime; 46 : typedef struct fd_runtime fd_runtime_t; 47 : 48 : struct fd_txn_in; 49 : typedef struct fd_txn_in fd_txn_in_t; 50 : 51 : struct fd_txn_out; 52 : typedef struct fd_txn_out fd_txn_out_t; 53 : 54 : struct fd_log_collector; 55 : typedef struct fd_log_collector fd_log_collector_t; 56 : 57 : struct fd_acc_pool; 58 : typedef struct fd_acc_pool fd_acc_pool_t; 59 : 60 : struct fd_genesis; 61 : typedef struct fd_genesis fd_genesis_t; 62 : 63 : struct fd_stake_rewards; 64 : typedef struct fd_stake_rewards fd_stake_rewards_t; 65 : 66 : struct fd_top_votes; 67 : typedef struct fd_top_votes fd_top_votes_t; 68 : 69 : #define FD_EPOCH_CREDITS_MAX (64UL) 70 : struct fd_epoch_credits { 71 : uchar pubkey[32]; 72 : ulong cnt; 73 : ulong base_credits; 74 : ushort epoch [ FD_EPOCH_CREDITS_MAX ]; 75 : uint credits_delta [ FD_EPOCH_CREDITS_MAX ]; 76 : uint prev_credits_delta[ FD_EPOCH_CREDITS_MAX ]; 77 : }; 78 : typedef struct fd_epoch_credits fd_epoch_credits_t; 79 : 80 : struct fd_stashed_commission { 81 : uchar pubkey[32]; 82 : uchar commission; 83 : }; 84 : typedef struct fd_stashed_commission fd_stashed_commission_t; 85 : 86 : struct fd_account_meta { 87 : uchar owner[32]; 88 : ulong lamports; 89 : ulong slot; 90 : uint dlen; 91 : uchar executable; 92 : uchar padding[3]; 93 : }; 94 : typedef struct fd_account_meta fd_account_meta_t; 95 : 96 : FD_FN_PURE static inline uchar * 97 15345 : fd_account_data( fd_account_meta_t const * acc ) { 98 15345 : return (uchar *)( acc+1 ); 99 15345 : } 100 : 101 : FD_PROTOTYPES_BEGIN 102 : 103 : /* fd_acct_addr_cstr converts the given Solana address into a base58- 104 : encoded cstr. Returns cstr. On return cstr contains a string with 105 : length in [32,44] (excluding NULL terminator). */ 106 : 107 : static inline char * 108 : fd_acct_addr_cstr( char cstr[ FD_BASE58_ENCODED_32_SZ ], 109 0 : uchar const addr[ 32 ] ) { 110 : return fd_base58_encode_32( addr, NULL, cstr ); 111 0 : } 112 : 113 : FD_PROTOTYPES_END 114 : 115 : #endif /* HEADER_fd_src_flamenco_fd_flamenco_base_h */