@@ -918,135 +918,6 @@ void fd_solana_account_stored_meta_walk( void * w, fd_solana_account_stored_meta
918918 fun( w, self->pubkey, "pubkey", FD_FLAMENCO_TYPE_HASH256, "uchar[32]", level, 0 );
919919 fun( w, self, name, FD_FLAMENCO_TYPE_MAP_END, "fd_solana_account_stored_meta", level--, 0 );
920920}
921- int fd_solana_account_meta_encode( fd_solana_account_meta_t const * self, fd_bincode_encode_ctx_t * ctx ) {
922- int err;
923- err = fd_bincode_uint64_encode( self->lamports, ctx );
924- if( FD_UNLIKELY( err ) ) return err;
925- err = fd_bincode_uint64_encode( self->rent_epoch, ctx );
926- if( FD_UNLIKELY( err ) ) return err;
927- err = fd_bincode_bytes_encode( self->owner, sizeof(self->owner), ctx );
928- if( FD_UNLIKELY( err ) ) return err;
929- err = fd_bincode_bool_encode( (uchar)(self->executable), ctx );
930- if( FD_UNLIKELY( err ) ) return err;
931- err = fd_bincode_bytes_encode( self->padding, 3, ctx );
932- if( FD_UNLIKELY( err ) ) return err;
933- return FD_BINCODE_SUCCESS;
934- }
935- static int fd_solana_account_meta_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
936- if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
937- int err = 0;
938- err = fd_bincode_uint64_decode_footprint( ctx );
939- if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
940- err = fd_bincode_uint64_decode_footprint( ctx );
941- if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
942- err = fd_bincode_bytes_decode_footprint( 32, ctx );
943- if( FD_UNLIKELY( err ) ) return err;
944- err = fd_bincode_bool_decode_footprint( ctx );
945- if( FD_UNLIKELY( err ) ) return err;
946- err = fd_bincode_bytes_decode_footprint( 3, ctx );
947- if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
948- return 0;
949- }
950- int fd_solana_account_meta_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
951- *total_sz += sizeof(fd_solana_account_meta_t);
952- void const * start_data = ctx->data;
953- int err = fd_solana_account_meta_decode_footprint_inner( ctx, total_sz );
954- if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
955- ctx->data = start_data;
956- return err;
957- }
958- static void fd_solana_account_meta_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
959- fd_solana_account_meta_t * self = (fd_solana_account_meta_t *)struct_mem;
960- fd_bincode_uint64_decode_unsafe( &self->lamports, ctx );
961- fd_bincode_uint64_decode_unsafe( &self->rent_epoch, ctx );
962- fd_bincode_bytes_decode_unsafe( &self->owner[0], sizeof(self->owner), ctx );
963- fd_bincode_bool_decode_unsafe( &self->executable, ctx );
964- fd_bincode_bytes_decode_unsafe( self->padding, 3, ctx );
965- }
966- void * fd_solana_account_meta_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
967- fd_solana_account_meta_t * self = (fd_solana_account_meta_t *)mem;
968- fd_solana_account_meta_new( self );
969- void * alloc_region = (uchar *)mem + sizeof(fd_solana_account_meta_t);
970- void * * alloc_mem = &alloc_region;
971- fd_solana_account_meta_decode_inner( mem, alloc_mem, ctx );
972- return self;
973- }
974- void fd_solana_account_meta_new(fd_solana_account_meta_t * self) {
975- fd_memset( self, 0, sizeof(fd_solana_account_meta_t) );
976- }
977- void fd_solana_account_meta_walk( void * w, fd_solana_account_meta_t const * self, fd_types_walk_fn_t fun, const char *name, uint level, uint varint ) {
978- (void) varint;
979- fun( w, self, name, FD_FLAMENCO_TYPE_MAP, "fd_solana_account_meta", level++, 0 );
980- fun( w, &self->lamports, "lamports", FD_FLAMENCO_TYPE_ULONG, "ulong", level, 0 );
981- fun( w, &self->rent_epoch, "rent_epoch", FD_FLAMENCO_TYPE_ULONG, "ulong", level, 0 );
982- fun( w, self->owner, "owner", FD_FLAMENCO_TYPE_HASH256, "uchar[32]", level, 0 );
983- fun( w, &self->executable, "executable", FD_FLAMENCO_TYPE_BOOL, "bool", level, 0 );
984- fun(w, self->padding, "padding", FD_FLAMENCO_TYPE_UCHAR, "uchar", level, 0 );
985- fun( w, self, name, FD_FLAMENCO_TYPE_MAP_END, "fd_solana_account_meta", level--, 0 );
986- }
987- int fd_solana_account_hdr_encode( fd_solana_account_hdr_t const * self, fd_bincode_encode_ctx_t * ctx ) {
988- int err;
989- err = fd_solana_account_stored_meta_encode( &self->meta, ctx );
990- if( FD_UNLIKELY( err ) ) return err;
991- err = fd_solana_account_meta_encode( &self->info, ctx );
992- if( FD_UNLIKELY( err ) ) return err;
993- err = fd_bincode_bytes_encode( self->padding, 4, ctx );
994- if( FD_UNLIKELY( err ) ) return err;
995- err = fd_hash_encode( &self->hash, ctx );
996- if( FD_UNLIKELY( err ) ) return err;
997- return FD_BINCODE_SUCCESS;
998- }
999- static int fd_solana_account_hdr_decode_footprint_inner( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
1000- if( ctx->data>=ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
1001- int err = 0;
1002- err = fd_solana_account_stored_meta_decode_footprint_inner( ctx, total_sz );
1003- if( FD_UNLIKELY( err ) ) return err;
1004- err = fd_solana_account_meta_decode_footprint_inner( ctx, total_sz );
1005- if( FD_UNLIKELY( err ) ) return err;
1006- err = fd_bincode_bytes_decode_footprint( 4, ctx );
1007- if( FD_UNLIKELY( err!=FD_BINCODE_SUCCESS ) ) return err;
1008- err = fd_hash_decode_footprint_inner( ctx, total_sz );
1009- if( FD_UNLIKELY( err ) ) return err;
1010- return 0;
1011- }
1012- int fd_solana_account_hdr_decode_footprint( fd_bincode_decode_ctx_t * ctx, ulong * total_sz ) {
1013- *total_sz += sizeof(fd_solana_account_hdr_t);
1014- void const * start_data = ctx->data;
1015- int err = fd_solana_account_hdr_decode_footprint_inner( ctx, total_sz );
1016- if( ctx->data>ctx->dataend ) { return FD_BINCODE_ERR_OVERFLOW; };
1017- ctx->data = start_data;
1018- return err;
1019- }
1020- static void fd_solana_account_hdr_decode_inner( void * struct_mem, void * * alloc_mem, fd_bincode_decode_ctx_t * ctx ) {
1021- fd_solana_account_hdr_t * self = (fd_solana_account_hdr_t *)struct_mem;
1022- fd_solana_account_stored_meta_decode_inner( &self->meta, alloc_mem, ctx );
1023- fd_solana_account_meta_decode_inner( &self->info, alloc_mem, ctx );
1024- fd_bincode_bytes_decode_unsafe( self->padding, 4, ctx );
1025- fd_hash_decode_inner( &self->hash, alloc_mem, ctx );
1026- }
1027- void * fd_solana_account_hdr_decode( void * mem, fd_bincode_decode_ctx_t * ctx ) {
1028- fd_solana_account_hdr_t * self = (fd_solana_account_hdr_t *)mem;
1029- fd_solana_account_hdr_new( self );
1030- void * alloc_region = (uchar *)mem + sizeof(fd_solana_account_hdr_t);
1031- void * * alloc_mem = &alloc_region;
1032- fd_solana_account_hdr_decode_inner( mem, alloc_mem, ctx );
1033- return self;
1034- }
1035- void fd_solana_account_hdr_new(fd_solana_account_hdr_t * self) {
1036- fd_memset( self, 0, sizeof(fd_solana_account_hdr_t) );
1037- fd_solana_account_stored_meta_new( &self->meta );
1038- fd_solana_account_meta_new( &self->info );
1039- fd_hash_new( &self->hash );
1040- }
1041- void fd_solana_account_hdr_walk( void * w, fd_solana_account_hdr_t const * self, fd_types_walk_fn_t fun, const char *name, uint level, uint varint ) {
1042- (void) varint;
1043- fun( w, self, name, FD_FLAMENCO_TYPE_MAP, "fd_solana_account_hdr", level++, 0 );
1044- fd_solana_account_stored_meta_walk( w, &self->meta, fun, "meta", level, 0 );
1045- fd_solana_account_meta_walk( w, &self->info, fun, "info", level, 0 );
1046- fun(w, self->padding, "padding", FD_FLAMENCO_TYPE_UCHAR, "uchar", level, 0 );
1047- fd_hash_walk( w, &self->hash, fun, "hash", level, 0 );
1048- fun( w, self, name, FD_FLAMENCO_TYPE_MAP_END, "fd_solana_account_hdr", level--, 0 );
1049- }
1050921int fd_delegation_encode( fd_delegation_t const * self, fd_bincode_encode_ctx_t * ctx ) {
1051922 int err;
1052923 err = fd_pubkey_encode( &self->voter_pubkey, ctx );
0 commit comments