Skip to content

Commit ab8bbf3

Browse files
runtime: remove unused fd types
1 parent a334e51 commit ab8bbf3

File tree

5 files changed

+140
-3476
lines changed

5 files changed

+140
-3476
lines changed

src/flamenco/types/fd_fuzz_types.h

Lines changed: 0 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -209,25 +209,6 @@ void *fd_stake_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
209209
return mem;
210210
}
211211

212-
void *fd_reward_type_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
213-
fd_reward_type_t *self = (fd_reward_type_t *) mem;
214-
*alloc_mem = (uchar *) *alloc_mem + sizeof(fd_reward_type_t);
215-
fd_reward_type_new(mem);
216-
self->discriminant = fd_rng_uint( rng ) % 4;
217-
return mem;
218-
}
219-
220-
void *fd_reward_info_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
221-
fd_reward_info_t *self = (fd_reward_info_t *) mem;
222-
*alloc_mem = (uchar *) *alloc_mem + sizeof(fd_reward_info_t);
223-
fd_reward_info_new(mem);
224-
fd_reward_type_generate( &self->reward_type, alloc_mem, rng );
225-
self->lamports = fd_rng_ulong( rng );
226-
self->post_balance = fd_rng_ulong( rng );
227-
self->commission = fd_rng_ulong( rng );
228-
return mem;
229-
}
230-
231212
void *fd_rust_duration_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
232213
fd_rust_duration_t *self = (fd_rust_duration_t *) mem;
233214
*alloc_mem = (uchar *) *alloc_mem + sizeof(fd_rust_duration_t);
@@ -787,31 +768,6 @@ void *fd_slot_meta_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
787768
return mem;
788769
}
789770

790-
void *fd_clock_timestamp_vote_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
791-
fd_clock_timestamp_vote_t *self = (fd_clock_timestamp_vote_t *) mem;
792-
*alloc_mem = (uchar *) *alloc_mem + sizeof(fd_clock_timestamp_vote_t);
793-
fd_clock_timestamp_vote_new(mem);
794-
fd_pubkey_generate( &self->pubkey, alloc_mem, rng );
795-
self->timestamp = fd_rng_long( rng );
796-
self->slot = fd_rng_ulong( rng );
797-
return mem;
798-
}
799-
800-
void *fd_clock_timestamp_votes_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
801-
fd_clock_timestamp_votes_t *self = (fd_clock_timestamp_votes_t *) mem;
802-
*alloc_mem = (uchar *) *alloc_mem + sizeof(fd_clock_timestamp_votes_t);
803-
fd_clock_timestamp_votes_new(mem);
804-
ulong votes_len = fd_rng_ulong( rng ) % 8;
805-
self->votes_pool = fd_clock_timestamp_vote_t_map_join_new( alloc_mem, fd_ulong_max( votes_len, 15000 ) );
806-
self->votes_root = NULL;
807-
for( ulong i=0; i < votes_len; i++ ) {
808-
fd_clock_timestamp_vote_t_mapnode_t * node = fd_clock_timestamp_vote_t_map_acquire( self->votes_pool );
809-
fd_clock_timestamp_vote_generate( &node->elem, alloc_mem, rng );
810-
fd_clock_timestamp_vote_t_map_insert( self->votes_pool, &self->votes_root, node );
811-
}
812-
return mem;
813-
}
814-
815771
void *fd_sysvar_fees_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
816772
fd_sysvar_fees_t *self = (fd_sysvar_fees_t *) mem;
817773
*alloc_mem = (uchar *) *alloc_mem + sizeof(fd_sysvar_fees_t);
@@ -1232,14 +1188,6 @@ void *fd_system_program_instruction_generate( void *mem, void **alloc_mem, fd_rn
12321188
return mem;
12331189
}
12341190

1235-
void *fd_system_error_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
1236-
fd_system_error_t *self = (fd_system_error_t *) mem;
1237-
*alloc_mem = (uchar *) *alloc_mem + sizeof(fd_system_error_t);
1238-
fd_system_error_new(mem);
1239-
self->discriminant = fd_rng_uint( rng ) % 9;
1240-
return mem;
1241-
}
1242-
12431191
void *fd_stake_authorized_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
12441192
fd_stake_authorized_t *self = (fd_stake_authorized_t *) mem;
12451193
*alloc_mem = (uchar *) *alloc_mem + sizeof(fd_stake_authorized_t);
@@ -1980,87 +1928,6 @@ void *fd_addrlut_instruction_generate( void *mem, void **alloc_mem, fd_rng_t * r
19801928
return mem;
19811929
}
19821930

1983-
void fd_instr_error_enum_inner_generate( fd_instr_error_enum_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
1984-
switch (discriminant) {
1985-
case 25: {
1986-
self->custom = fd_rng_uint( rng );
1987-
break;
1988-
}
1989-
case 44: {
1990-
ulong slen = fd_rng_ulong( rng ) % 256;
1991-
char *buffer = (char *) *alloc_mem;
1992-
*alloc_mem = (uchar *) *alloc_mem + slen;
1993-
self->borsh_io_error = buffer;
1994-
LLVMFuzzerMutate( (uchar *)self->borsh_io_error, slen, slen );
1995-
self->borsh_io_error[slen] = '\0';
1996-
break;
1997-
}
1998-
}
1999-
}
2000-
void *fd_instr_error_enum_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
2001-
fd_instr_error_enum_t *self = (fd_instr_error_enum_t *) mem;
2002-
*alloc_mem = (uchar *) *alloc_mem + sizeof(fd_instr_error_enum_t);
2003-
fd_instr_error_enum_new(mem);
2004-
self->discriminant = fd_rng_uint( rng ) % 54;
2005-
fd_instr_error_enum_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
2006-
return mem;
2007-
}
2008-
2009-
void *fd_txn_instr_error_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
2010-
fd_txn_instr_error_t *self = (fd_txn_instr_error_t *) mem;
2011-
*alloc_mem = (uchar *) *alloc_mem + sizeof(fd_txn_instr_error_t);
2012-
fd_txn_instr_error_new(mem);
2013-
self->instr_idx = fd_rng_uchar( rng );
2014-
fd_instr_error_enum_generate( &self->error, alloc_mem, rng );
2015-
return mem;
2016-
}
2017-
2018-
void fd_txn_error_enum_inner_generate( fd_txn_error_enum_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
2019-
switch (discriminant) {
2020-
case 8: {
2021-
fd_txn_instr_error_generate( &self->instruction_error, alloc_mem, rng );
2022-
break;
2023-
}
2024-
case 30: {
2025-
self->duplicate_instruction = fd_rng_uchar( rng );
2026-
break;
2027-
}
2028-
case 31: {
2029-
self->insufficient_funds_for_rent = fd_rng_uchar( rng );
2030-
break;
2031-
}
2032-
case 35: {
2033-
self->program_execution_temporarily_restricted = fd_rng_uchar( rng );
2034-
break;
2035-
}
2036-
}
2037-
}
2038-
void *fd_txn_error_enum_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
2039-
fd_txn_error_enum_t *self = (fd_txn_error_enum_t *) mem;
2040-
*alloc_mem = (uchar *) *alloc_mem + sizeof(fd_txn_error_enum_t);
2041-
fd_txn_error_enum_new(mem);
2042-
self->discriminant = fd_rng_uint( rng ) % 37;
2043-
fd_txn_error_enum_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
2044-
return mem;
2045-
}
2046-
2047-
void fd_txn_result_inner_generate( fd_txn_result_inner_t * self, void **alloc_mem, uint discriminant, fd_rng_t * rng ) {
2048-
switch (discriminant) {
2049-
case 1: {
2050-
fd_txn_error_enum_generate( &self->error, alloc_mem, rng );
2051-
break;
2052-
}
2053-
}
2054-
}
2055-
void *fd_txn_result_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
2056-
fd_txn_result_t *self = (fd_txn_result_t *) mem;
2057-
*alloc_mem = (uchar *) *alloc_mem + sizeof(fd_txn_result_t);
2058-
fd_txn_result_new(mem);
2059-
self->discriminant = fd_rng_uint( rng ) % 2;
2060-
fd_txn_result_inner_generate( &self->inner, alloc_mem, self->discriminant, rng );
2061-
return mem;
2062-
}
2063-
20641931
void *fd_calculated_stake_points_generate( void *mem, void **alloc_mem, fd_rng_t * rng ) {
20651932
fd_calculated_stake_points_t *self = (fd_calculated_stake_points_t *) mem;
20661933
*alloc_mem = (uchar *) *alloc_mem + sizeof(fd_calculated_stake_points_t);

0 commit comments

Comments
 (0)