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_bank_data; 16 : typedef struct fd_bank_data fd_bank_data_t; 17 : 18 : struct fd_banks_locks; 19 : typedef struct fd_banks_locks fd_banks_locks_t; 20 : 21 : struct fd_exec_instr_ctx; 22 : typedef struct fd_exec_instr_ctx fd_exec_instr_ctx_t; 23 : 24 : struct fd_acc_mgr; 25 : typedef struct fd_acc_mgr fd_acc_mgr_t; 26 : 27 : struct fd_capture_ctx; 28 : typedef struct fd_capture_ctx fd_capture_ctx_t; 29 : 30 : struct fd_dump_proto_ctx; 31 : typedef struct fd_dump_proto_ctx fd_dump_proto_ctx_t; 32 : 33 : struct fd_txn_dump_ctx; 34 : typedef struct fd_txn_dump_ctx fd_txn_dump_ctx_t; 35 : 36 : struct fd_borrowed_account; 37 : typedef struct fd_borrowed_account fd_borrowed_account_t; 38 : 39 : union fd_features; 40 : typedef union fd_features fd_features_t; 41 : 42 : struct fd_progcache; 43 : typedef struct fd_progcache fd_progcache_t; 44 : 45 : struct fd_runtime_stack; 46 : typedef struct fd_runtime_stack fd_runtime_stack_t; 47 : 48 : struct fd_vote_stakes; 49 : typedef struct fd_vote_stakes fd_vote_stakes_t; 50 : 51 : struct fd_runtime; 52 : typedef struct fd_runtime fd_runtime_t; 53 : 54 : struct fd_txn_in; 55 : typedef struct fd_txn_in fd_txn_in_t; 56 : 57 : struct fd_txn_out; 58 : typedef struct fd_txn_out fd_txn_out_t; 59 : 60 : struct fd_log_collector; 61 : typedef struct fd_log_collector fd_log_collector_t; 62 : 63 : struct fd_acc_pool; 64 : typedef struct fd_acc_pool fd_acc_pool_t; 65 : 66 : struct fd_genesis; 67 : typedef struct fd_genesis fd_genesis_t; 68 : 69 : struct fd_stake_rewards; 70 : typedef struct fd_stake_rewards fd_stake_rewards_t; 71 : 72 : struct fd_account_meta { 73 : uchar owner[32]; 74 : ulong lamports; 75 : ulong slot; 76 : uint dlen; 77 : uchar executable; 78 : uchar padding[3]; 79 : }; 80 : typedef struct fd_account_meta fd_account_meta_t; 81 : 82 : FD_FN_PURE static inline uchar * 83 2367 : fd_account_data( fd_account_meta_t const * acc ) { 84 2367 : return (uchar *)( acc+1 ); 85 2367 : } 86 : 87 : FD_PROTOTYPES_BEGIN 88 : 89 : /* fd_acct_addr_cstr converts the given Solana address into a base58- 90 : encoded cstr. Returns cstr. On return cstr contains a string with 91 : length in [32,44] (excluding NULL terminator). */ 92 : 93 : static inline char * 94 : fd_acct_addr_cstr( char cstr[ FD_BASE58_ENCODED_32_SZ ], 95 0 : uchar const addr[ 32 ] ) { 96 : return fd_base58_encode_32( addr, NULL, cstr ); 97 0 : } 98 : 99 : FD_PROTOTYPES_END 100 : 101 : #endif /* HEADER_fd_src_flamenco_fd_flamenco_base_h */