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 392024 : fd_spad_t * spad FD_PARAM_UNUSED ) {
19 392024 : fd_exec_test_instr_acct_t * msg = msg_;
20 1165828 : while( fd_pb_inbuf_sz( in ) ) {
21 782716 : fd_pb_tlv_t tlv[1];
22 782716 : if( FD_UNLIKELY( !fd_pb_dec_tlv( in, tlv ) ) ) return 0;
23 782716 : switch( tlv->field_id ) {
24 355404 : case 1:
25 355404 : if( FD_UNLIKELY( !fd_pb_dec_uint32( tlv, &msg->index ) ) ) return 0;
26 355404 : break;
27 355404 : case 2:
28 274209 : if( FD_UNLIKELY( !fd_pb_dec_bool( tlv, &msg->is_writable ) ) ) return 0;
29 274209 : break;
30 274209 : case 3:
31 188410 : if( FD_UNLIKELY( !fd_pb_dec_bool( tlv, &msg->is_signer ) ) ) return 0;
32 188410 : break;
33 188410 : default:
34 0 : if( FD_UNLIKELY( !fd_pb_dec_skip( in, tlv ) ) ) return 0;
35 0 : break;
36 782716 : }
37 782716 : }
38 383112 : return 1;
39 392024 : }
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 55548 : fd_spad_t * spad ) {
67 55548 : fd_exec_test_instr_context_t * msg = msg_;
68 1200083 : while( fd_pb_inbuf_sz( in ) ) {
69 1151551 : fd_pb_tlv_t tlv[1];
70 1151551 : if( FD_UNLIKELY( !fd_pb_dec_tlv( in, tlv ) ) ) return 0;
71 1151551 : switch( tlv->field_id ) {
72 55524 : case 1:
73 55524 : if( FD_UNLIKELY( !fd_pb_dec_bytes_fixed( in, tlv, msg->program_id, 32UL ) ) ) return 0;
74 55524 : break;
75 579364 : case 3:
76 579364 : {
77 579364 : 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 579364 : if( FD_UNLIKELY( !ele ) ) return 0;
79 579364 : if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_acct_state_desc, ele ) ) ) return 0;
80 579364 : }
81 579364 : break;
82 579364 : case 4:
83 386881 : {
84 386881 : 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 386881 : if( FD_UNLIKELY( !ele ) ) return 0;
86 386881 : if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_instr_acct_desc, ele ) ) ) return 0;
87 386881 : }
88 386881 : break;
89 386881 : case 5:
90 47805 : if( FD_UNLIKELY( !fd_pb_dec_bytes_ptr( in, tlv, spad, &msg->data ) ) ) return 0;
91 47805 : break;
92 54078 : case 6:
93 54078 : if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->cu_avail ) ) ) return 0;
94 54078 : break;
95 55666 : case 10:
96 55666 : if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_feature_set_desc, &msg->features ) ) ) return 0;
97 55666 : msg->has_features = 1;
98 55666 : break;
99 0 : default:
100 0 : if( FD_UNLIKELY( !fd_pb_dec_skip( in, tlv ) ) ) return 0;
101 0 : break;
102 1151551 : }
103 1151551 : }
104 48532 : return 1;
105 55548 : }
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 94214 : void const * msg_ ) {
115 94214 : fd_exec_test_instr_effects_t const * msg = msg_;
116 94214 : if( msg->result && FD_UNLIKELY( !fd_pb_push_int32( enc, 1U, msg->result ) ) ) return 0;
117 94214 : if( msg->custom_err && FD_UNLIKELY( !fd_pb_push_uint32( enc, 2U, msg->custom_err ) ) ) return 0;
118 1044230 : for( ulong i=0UL; i<msg->modified_accounts_count; i++ ) {
119 950016 : if( FD_UNLIKELY( !fd_pb_enc_submsg( enc, 3U, &fd_exec_test_acct_state_desc, &msg->modified_accounts[ i ] ) ) ) return 0;
120 950016 : }
121 94214 : if( msg->cu_avail && FD_UNLIKELY( !fd_pb_push_uint64( enc, 4U, msg->cu_avail ) ) ) return 0;
122 94214 : if( msg->return_data_hash && FD_UNLIKELY( !fd_pb_push_fixed64( enc, 6U, msg->return_data_hash ) ) ) return 0;
123 94214 : return 1;
124 94214 : }
125 :
126 : static int
127 : fd_exec_test_instr_effects_decode( fd_pb_inbuf_t * in,
128 : void * msg_,
129 46983 : fd_spad_t * spad ) {
130 46983 : fd_exec_test_instr_effects_t * msg = msg_;
131 594843 : while( fd_pb_inbuf_sz( in ) ) {
132 547326 : fd_pb_tlv_t tlv[1];
133 547326 : if( FD_UNLIKELY( !fd_pb_dec_tlv( in, tlv ) ) ) return 0;
134 547326 : switch( tlv->field_id ) {
135 30592 : case 1:
136 30592 : if( FD_UNLIKELY( !fd_pb_dec_int32( tlv, &msg->result ) ) ) return 0;
137 30592 : break;
138 30592 : case 2:
139 919 : if( FD_UNLIKELY( !fd_pb_dec_uint32( tlv, &msg->custom_err ) ) ) return 0;
140 919 : break;
141 468299 : case 3:
142 468299 : {
143 468299 : 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 468299 : if( FD_UNLIKELY( !ele ) ) return 0;
145 468299 : if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_acct_state_desc, ele ) ) ) return 0;
146 468299 : }
147 468299 : break;
148 468299 : case 4:
149 45174 : if( FD_UNLIKELY( !fd_pb_dec_uint64( tlv, &msg->cu_avail ) ) ) return 0;
150 45174 : break;
151 45174 : 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 547326 : }
158 547326 : }
159 47517 : return 1;
160 46983 : }
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 47083 : fd_spad_t * spad ) {
181 47083 : fd_exec_test_instr_fixture_t * msg = msg_;
182 187323 : while( fd_pb_inbuf_sz( in ) ) {
183 140187 : fd_pb_tlv_t tlv[1];
184 140187 : if( FD_UNLIKELY( !fd_pb_dec_tlv( in, tlv ) ) ) return 0;
185 140187 : switch( tlv->field_id ) {
186 47020 : case 1:
187 47020 : if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_fixture_metadata_desc, &msg->metadata ) ) ) return 0;
188 47020 : msg->has_metadata = 1;
189 47020 : break;
190 46967 : case 2:
191 46967 : if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_instr_context_desc, &msg->input ) ) ) return 0;
192 46967 : msg->has_input = 1;
193 46967 : break;
194 47002 : case 3:
195 47002 : if( FD_UNLIKELY( !fd_pb_dec_submsg( in, tlv, spad, &fd_exec_test_instr_effects_desc, &msg->output ) ) ) return 0;
196 47002 : msg->has_output = 1;
197 47002 : break;
198 0 : default:
199 0 : if( FD_UNLIKELY( !fd_pb_dec_skip( in, tlv ) ) ) return 0;
200 0 : break;
201 140187 : }
202 140187 : }
203 47136 : return 1;
204 47083 : }
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 :
|