Line data Source code
1 : /* Automatically generated by fd_pb_gen.py. Do not edit. */
2 :
3 : #include "instr.pb.h"
4 :
5 : static int
6 : fd_exec_test_instr_acct_encode( fd_pb_encoder_t * enc,
7 0 : void const * msg_ ) {
8 0 : fd_exec_test_instr_acct_t const * msg = msg_;
9 0 : if( msg->index && FD_UNLIKELY( !fd_pb_push_uint32( enc, 1U, msg->index ) ) ) return 0;
10 0 : if( msg->is_writable && FD_UNLIKELY( !fd_pb_push_bool( enc, 2U, msg->is_writable ) ) ) return 0;
11 0 : if( msg->is_signer && FD_UNLIKELY( !fd_pb_push_bool( enc, 3U, msg->is_signer ) ) ) return 0;
12 0 : return 1;
13 0 : }
14 :
15 : static int
16 : fd_exec_test_instr_acct_decode( fd_pb_inbuf_t * in,
17 : void * msg_,
18 392129 : fd_spad_t * spad FD_PARAM_UNUSED ) {
19 392129 : fd_exec_test_instr_acct_t * msg = msg_;
20 1171597 : while( fd_pb_inbuf_sz( in ) ) {
21 786428 : fd_pb_tlv_t tlv[1];
22 786428 : if( FD_UNLIKELY( !fd_pb_dec_tlv( in, tlv ) ) ) return 0;
23 786428 : switch( tlv->field_id ) {
24 357569 : case 1:
25 357569 : if( FD_UNLIKELY( !fd_pb_dec_uint32( tlv, &msg->index ) ) ) return 0;
26 357569 : break;
27 357569 : case 2:
28 275869 : if( FD_UNLIKELY( !fd_pb_dec_bool( tlv, &msg->is_writable ) ) ) return 0;
29 275869 : break;
30 275869 : case 3:
31 188647 : if( FD_UNLIKELY( !fd_pb_dec_bool( tlv, &msg->is_signer ) ) ) return 0;
32 188647 : break;
33 188647 : default:
34 0 : if( FD_UNLIKELY( !fd_pb_dec_skip( in, tlv ) ) ) return 0;
35 0 : break;
36 786428 : }
37 786428 : }
38 385169 : return 1;
39 392129 : }
40 :
41 : fd_pb_msgdesc_t const fd_exec_test_instr_acct_desc = {
42 : .encode = fd_exec_test_instr_acct_encode,
43 : .decode = fd_exec_test_instr_acct_decode
44 : };
45 :
46 : static int
47 : fd_exec_test_instr_context_encode( fd_pb_encoder_t * enc,
48 0 : void const * msg_ ) {
49 0 : fd_exec_test_instr_context_t const * msg = msg_;
50 0 : if( FD_UNLIKELY( !fd_pb_push_bytes( enc, 1U, msg->program_id, 32UL ) ) ) return 0;
51 0 : for( ulong i=0UL; i<msg->accounts_count; i++ ) {
52 0 : if( FD_UNLIKELY( !fd_pb_enc_submsg( enc, 3U, &fd_exec_test_acct_state_desc, &msg->accounts[ i ] ) ) ) return 0;
53 0 : }
54 0 : for( ulong i=0UL; i<msg->instr_accounts_count; i++ ) {
55 0 : if( FD_UNLIKELY( !fd_pb_enc_submsg( enc, 4U, &fd_exec_test_instr_acct_desc, &msg->instr_accounts[ i ] ) ) ) return 0;
56 0 : }
57 0 : if( msg->data && msg->data->size && FD_UNLIKELY( !fd_pb_push_bytes( enc, 5U, msg->data->bytes, msg->data->size ) ) ) return 0;
58 0 : if( msg->cu_avail && FD_UNLIKELY( !fd_pb_push_uint64( enc, 6U, msg->cu_avail ) ) ) return 0;
59 0 : if( msg->has_features && FD_UNLIKELY( !fd_pb_enc_submsg( enc, 10U, &fd_exec_test_feature_set_desc, &msg->features ) ) ) return 0;
60 0 : return 1;
61 0 : }
62 :
63 : static int
64 : fd_exec_test_instr_context_decode( fd_pb_inbuf_t * in,
65 : void * msg_,
66 54451 : fd_spad_t * spad ) {
67 54451 : fd_exec_test_instr_context_t * msg = msg_;
68 1192966 : while( fd_pb_inbuf_sz( in ) ) {
69 1141732 : fd_pb_tlv_t tlv[1];
70 1141732 : if( FD_UNLIKELY( !fd_pb_dec_tlv( in, tlv ) ) ) return 0;
71 1141732 : switch( tlv->field_id ) {
72 54376 : case 1:
73 54376 : if( FD_UNLIKELY( !fd_pb_dec_bytes_fixed( in, tlv, msg->program_id, 32UL ) ) ) return 0;
74 54376 : break;
75 573370 : case 3:
76 573370 : {
77 573370 : void * ele = fd_pb_dec_grow( spad, &msg->accounts, &msg->accounts_count, alignof(fd_exec_test_acct_state_t), sizeof(fd_exec_test_acct_state_t) );
78 573370 : if( FD_UNLIKELY( !ele ) ) return 0;
79 573370 : if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_acct_state_desc, ele ) ) ) return 0;
80 573370 : }
81 573370 : break;
82 573370 : case 4:
83 390264 : {
84 390264 : void * ele = fd_pb_dec_grow( spad, &msg->instr_accounts, &msg->instr_accounts_count, alignof(fd_exec_test_instr_acct_t), sizeof(fd_exec_test_instr_acct_t) );
85 390264 : if( FD_UNLIKELY( !ele ) ) return 0;
86 390264 : if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_instr_acct_desc, ele ) ) ) return 0;
87 390264 : }
88 390264 : break;
89 390264 : case 5:
90 47561 : if( FD_UNLIKELY( !fd_pb_dec_bytes_ptr( in, tlv, spad, &msg->data ) ) ) return 0;
91 47561 : break;
92 53814 : case 6:
93 53814 : if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->cu_avail ) ) ) return 0;
94 53814 : break;
95 55403 : case 10:
96 55403 : if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_feature_set_desc, &msg->features ) ) ) return 0;
97 55403 : msg->has_features = 1;
98 55403 : break;
99 0 : default:
100 0 : if( FD_UNLIKELY( !fd_pb_dec_skip( in, tlv ) ) ) return 0;
101 0 : break;
102 1141732 : }
103 1141732 : }
104 51234 : return 1;
105 54451 : }
106 :
107 : fd_pb_msgdesc_t const fd_exec_test_instr_context_desc = {
108 : .encode = fd_exec_test_instr_context_encode,
109 : .decode = fd_exec_test_instr_context_decode
110 : };
111 :
112 : static int
113 : fd_exec_test_instr_effects_encode( fd_pb_encoder_t * enc,
114 94116 : void const * msg_ ) {
115 94116 : fd_exec_test_instr_effects_t const * msg = msg_;
116 94116 : if( msg->result && FD_UNLIKELY( !fd_pb_push_int32( enc, 1U, msg->result ) ) ) return 0;
117 94116 : if( msg->custom_err && FD_UNLIKELY( !fd_pb_push_uint32( enc, 2U, msg->custom_err ) ) ) return 0;
118 1041315 : for( ulong i=0UL; i<msg->modified_accounts_count; i++ ) {
119 947199 : if( FD_UNLIKELY( !fd_pb_enc_submsg( enc, 3U, &fd_exec_test_acct_state_desc, &msg->modified_accounts[ i ] ) ) ) return 0;
120 947199 : }
121 94116 : if( msg->cu_avail && FD_UNLIKELY( !fd_pb_push_uint64( enc, 4U, msg->cu_avail ) ) ) return 0;
122 94116 : if( msg->return_data_hash && FD_UNLIKELY( !fd_pb_push_fixed64( enc, 6U, msg->return_data_hash ) ) ) return 0;
123 94116 : return 1;
124 94116 : }
125 :
126 : static int
127 : fd_exec_test_instr_effects_decode( fd_pb_inbuf_t * in,
128 : void * msg_,
129 46939 : fd_spad_t * spad ) {
130 46939 : fd_exec_test_instr_effects_t * msg = msg_;
131 591238 : while( fd_pb_inbuf_sz( in ) ) {
132 544447 : fd_pb_tlv_t tlv[1];
133 544447 : if( FD_UNLIKELY( !fd_pb_dec_tlv( in, tlv ) ) ) return 0;
134 544447 : switch( tlv->field_id ) {
135 30571 : case 1:
136 30571 : if( FD_UNLIKELY( !fd_pb_dec_int32( tlv, &msg->result ) ) ) return 0;
137 30571 : break;
138 30571 : case 2:
139 919 : if( FD_UNLIKELY( !fd_pb_dec_uint32( tlv, &msg->custom_err ) ) ) return 0;
140 919 : break;
141 468762 : case 3:
142 468762 : {
143 468762 : void * ele = fd_pb_dec_grow( spad, &msg->modified_accounts, &msg->modified_accounts_count, alignof(fd_exec_test_acct_state_t), sizeof(fd_exec_test_acct_state_t) );
144 468762 : if( FD_UNLIKELY( !ele ) ) return 0;
145 468762 : if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_acct_state_desc, ele ) ) ) return 0;
146 468762 : }
147 468762 : break;
148 468762 : case 4:
149 45041 : if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->cu_avail ) ) ) return 0;
150 45041 : break;
151 45041 : case 6:
152 70 : if( FD_UNLIKELY( !fd_pb_dec_fixed64( tlv, &msg->return_data_hash ) ) ) return 0;
153 70 : break;
154 70 : default:
155 0 : if( FD_UNLIKELY( !fd_pb_dec_skip( in, tlv ) ) ) return 0;
156 0 : break;
157 544447 : }
158 544447 : }
159 46791 : return 1;
160 46939 : }
161 :
162 : fd_pb_msgdesc_t const fd_exec_test_instr_effects_desc = {
163 : .encode = fd_exec_test_instr_effects_encode,
164 : .decode = fd_exec_test_instr_effects_decode
165 : };
166 :
167 : static int
168 : fd_exec_test_instr_fixture_encode( fd_pb_encoder_t * enc,
169 0 : void const * msg_ ) {
170 0 : fd_exec_test_instr_fixture_t const * msg = msg_;
171 0 : if( msg->has_metadata && FD_UNLIKELY( !fd_pb_enc_submsg( enc, 1U, &fd_exec_test_fixture_metadata_desc, &msg->metadata ) ) ) return 0;
172 0 : if( msg->has_input && FD_UNLIKELY( !fd_pb_enc_submsg( enc, 2U, &fd_exec_test_instr_context_desc, &msg->input ) ) ) return 0;
173 0 : if( msg->has_output && FD_UNLIKELY( !fd_pb_enc_submsg( enc, 3U, &fd_exec_test_instr_effects_desc, &msg->output ) ) ) return 0;
174 0 : return 1;
175 0 : }
176 :
177 : static int
178 : fd_exec_test_instr_fixture_decode( fd_pb_inbuf_t * in,
179 : void * msg_,
180 46229 : fd_spad_t * spad ) {
181 46229 : fd_exec_test_instr_fixture_t * msg = msg_;
182 185342 : while( fd_pb_inbuf_sz( in ) ) {
183 137968 : fd_pb_tlv_t tlv[1];
184 137968 : if( FD_UNLIKELY( !fd_pb_dec_tlv( in, tlv ) ) ) return 0;
185 137968 : switch( tlv->field_id ) {
186 45647 : case 1:
187 45647 : if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_fixture_metadata_desc, &msg->metadata ) ) ) return 0;
188 45647 : msg->has_metadata = 1;
189 45647 : break;
190 45688 : case 2:
191 45688 : if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_instr_context_desc, &msg->input ) ) ) return 0;
192 45688 : msg->has_input = 1;
193 45688 : break;
194 46950 : case 3:
195 46950 : if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_instr_effects_desc, &msg->output ) ) ) return 0;
196 46950 : msg->has_output = 1;
197 46950 : break;
198 0 : default:
199 0 : if( FD_UNLIKELY( !fd_pb_dec_skip( in, tlv ) ) ) return 0;
200 0 : break;
201 137968 : }
202 137968 : }
203 47374 : return 1;
204 46229 : }
205 :
206 : fd_pb_msgdesc_t const fd_exec_test_instr_fixture_desc = {
207 : .encode = fd_exec_test_instr_fixture_encode,
208 : .decode = fd_exec_test_instr_fixture_decode
209 : };
210 :
|