1
1
mod body;
2
+ mod code_info;
2
3
mod decode_helpers;
3
4
mod header;
4
5
pub mod printer;
5
- mod types_section;
6
6
pub mod verification;
7
7
8
8
pub use body:: EofBody ;
9
+ pub use code_info:: CodeInfo ;
9
10
pub use header:: EofHeader ;
10
- pub use types_section:: TypesSection ;
11
11
pub use verification:: * ;
12
12
13
13
use core:: cmp:: min;
@@ -39,7 +39,7 @@ impl Default for Eof {
39
39
fn default ( ) -> Self {
40
40
let body = EofBody {
41
41
// Types section with zero inputs, zero outputs and zero max stack size.
42
- types_section : vec ! [ TypesSection :: default ( ) ] ,
42
+ code_info : vec ! [ CodeInfo :: default ( ) ] ,
43
43
code_section : vec ! [ 1 ] ,
44
44
// One code section with a STOP byte.
45
45
code : Bytes :: from_static ( & [ 0x00 ] ) ,
@@ -136,10 +136,10 @@ pub enum EofDecodeError {
136
136
MissingBodyWithoutData ,
137
137
/// Body size is more than specified in the header
138
138
DanglingData ,
139
- /// Invalid types section data
140
- InvalidTypesSection ,
141
- /// Invalid types section size
142
- InvalidTypesSectionSize ,
139
+ /// Invalid code info data
140
+ InvalidCodeInfo ,
141
+ /// Invalid code info size
142
+ InvalidCodeInfoSize ,
143
143
/// Invalid EOF magic number
144
144
InvalidEOFMagicNumber ,
145
145
/// Invalid EOF version
@@ -154,8 +154,8 @@ pub enum EofDecodeError {
154
154
InvalidDataKind ,
155
155
/// Invalid kind after code
156
156
InvalidKindAfterCode ,
157
- /// Mismatch of code and types sizes
158
- MismatchCodeAndTypesSize ,
157
+ /// Mismatch of code and info sizes
158
+ MismatchCodeAndInfoSize ,
159
159
/// There should be at least one size
160
160
NonSizes ,
161
161
/// Missing size
@@ -178,16 +178,16 @@ impl fmt::Display for EofDecodeError {
178
178
Self :: MissingInput => "Short input while processing EOF" ,
179
179
Self :: MissingBodyWithoutData => "Short body while processing EOF" ,
180
180
Self :: DanglingData => "Body size is more than specified in the header" ,
181
- Self :: InvalidTypesSection => "Invalid types section data" ,
182
- Self :: InvalidTypesSectionSize => "Invalid types section size" ,
181
+ Self :: InvalidCodeInfo => "Invalid types section data" ,
182
+ Self :: InvalidCodeInfoSize => "Invalid types section size" ,
183
183
Self :: InvalidEOFMagicNumber => "Invalid EOF magic number" ,
184
184
Self :: InvalidEOFVersion => "Invalid EOF version" ,
185
185
Self :: InvalidTypesKind => "Invalid number for types kind" ,
186
186
Self :: InvalidCodeKind => "Invalid number for code kind" ,
187
187
Self :: InvalidTerminalByte => "Invalid terminal code" ,
188
188
Self :: InvalidDataKind => "Invalid data kind" ,
189
189
Self :: InvalidKindAfterCode => "Invalid kind after code" ,
190
- Self :: MismatchCodeAndTypesSize => "Mismatch of code and types sizes" ,
190
+ Self :: MismatchCodeAndInfoSize => "Mismatch of code and types sizes" ,
191
191
Self :: NonSizes => "There should be at least one size" ,
192
192
Self :: ShortInputForSizes => "Missing size" ,
193
193
Self :: ZeroSize => "Size cant be zero" ,
0 commit comments