Line data Source code
1 : // This is an auto-generated file. To add entries, edit fd_types.json 2 : #ifndef HEADER_FD_RUNTIME_TYPES 3 : #define HEADER_FD_RUNTIME_TYPES 4 : 5 : #include "fd_bincode.h" 6 : #include "fd_types_custom.h" 7 : 8 : /* https://github.com/solana-program/stake/blob/330d89c6246ab3fd35d02803386fa700be0455d6/interface/src/stake_history.rs#L17 */ 9 : /* Encoded Size: Fixed (24 bytes) */ 10 : struct fd_stake_history_entry { 11 : ulong effective; 12 : ulong activating; 13 : ulong deactivating; 14 : }; 15 : typedef struct fd_stake_history_entry fd_stake_history_entry_t; 16 : #define FD_STAKE_HISTORY_ENTRY_ALIGN alignof(fd_stake_history_entry_t) 17 : 18 : /* https://github.com/solana-program/stake/blob/330d89c6246ab3fd35d02803386fa700be0455d6/interface/src/stake_history.rs#L66 */ 19 : /* Encoded Size: Fixed (32 bytes) */ 20 : struct fd_epoch_stake_history_entry_pair { 21 : ulong epoch; 22 : fd_stake_history_entry_t entry; 23 : }; 24 : typedef struct fd_epoch_stake_history_entry_pair fd_epoch_stake_history_entry_pair_t; 25 : #define FD_EPOCH_STAKE_HISTORY_ENTRY_PAIR_ALIGN alignof(fd_epoch_stake_history_entry_pair_t) 26 : 27 : /* https://github.com/solana-program/stake/blob/330d89c6246ab3fd35d02803386fa700be0455d6/interface/src/stake_history.rs#L66 */ 28 : /* Encoded Size: Fixed (16392 bytes) */ 29 : struct fd_stake_history { 30 : ulong fd_stake_history_len; 31 : ulong fd_stake_history_size; 32 : ulong fd_stake_history_offset; 33 : fd_epoch_stake_history_entry_pair_t fd_stake_history[512]; 34 : }; 35 : typedef struct fd_stake_history fd_stake_history_t; 36 3 : #define FD_STAKE_HISTORY_ALIGN alignof(fd_stake_history_t) 37 : 38 : 39 : FD_PROTOTYPES_BEGIN 40 : 41 0 : static inline void fd_stake_history_entry_new( fd_stake_history_entry_t * self ) { fd_memset( self, 0, sizeof(fd_stake_history_entry_t) ); } 42 : int fd_stake_history_entry_encode( fd_stake_history_entry_t const * self, fd_bincode_encode_ctx_t * ctx ); 43 0 : static inline ulong fd_stake_history_entry_size( fd_stake_history_entry_t const * self ) { (void)self; return 24UL; } 44 0 : static inline ulong fd_stake_history_entry_align( void ) { return FD_STAKE_HISTORY_ENTRY_ALIGN; } 45 0 : static inline int fd_stake_history_entry_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) { 46 0 : *total_sz += sizeof(fd_stake_history_entry_t); 47 0 : if( (ulong)ctx->data + 24UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; }; 48 0 : return 0; 49 0 : } 50 : void * fd_stake_history_entry_decode( void * mem, fd_bincode_decode_ctx_t * ctx ); 51 : 52 2182656 : static inline void fd_epoch_stake_history_entry_pair_new( fd_epoch_stake_history_entry_pair_t * self ) { fd_memset( self, 0, sizeof(fd_epoch_stake_history_entry_pair_t) ); } 53 : int fd_epoch_stake_history_entry_pair_encode( fd_epoch_stake_history_entry_pair_t const * self, fd_bincode_encode_ctx_t * ctx ); 54 0 : static inline ulong fd_epoch_stake_history_entry_pair_size( fd_epoch_stake_history_entry_pair_t const * self ) { (void)self; return 32UL; } 55 0 : static inline ulong fd_epoch_stake_history_entry_pair_align( void ) { return FD_EPOCH_STAKE_HISTORY_ENTRY_PAIR_ALIGN; } 56 0 : static inline int fd_epoch_stake_history_entry_pair_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) { 57 0 : *total_sz += sizeof(fd_epoch_stake_history_entry_pair_t); 58 0 : if( (ulong)ctx->data + 32UL > (ulong)ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; }; 59 0 : return 0; 60 0 : } 61 : void * fd_epoch_stake_history_entry_pair_decode( void * mem, fd_bincode_decode_ctx_t * ctx ); 62 : 63 : void fd_stake_history_new( fd_stake_history_t * self ); 64 : int fd_stake_history_encode( fd_stake_history_t const * self, fd_bincode_encode_ctx_t * ctx ); 65 0 : static inline ulong fd_stake_history_size( fd_stake_history_t const * self ) { (void)self; return 16392UL; } 66 3 : static inline ulong fd_stake_history_align( void ) { return FD_STAKE_HISTORY_ALIGN; } 67 : int fd_stake_history_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ); 68 : void * fd_stake_history_decode( void * mem, fd_bincode_decode_ctx_t * ctx ); 69 : 70 : FD_PROTOTYPES_END 71 : 72 : #endif // HEADER_FD_RUNTIME_TYPES