File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -120,12 +120,12 @@ impl CardanoTransactionParser {
120
120
CardanoTransactionParser :: cardano_blocks_reader ( immutable_file) ?;
121
121
122
122
let mut blocks = Vec :: new ( ) ;
123
- for block in cardano_blocks_reader {
124
- let block = block . map_err ( |e | {
125
- anyhow ! ( e ) . context ( format ! (
123
+ for parsed_block in cardano_blocks_reader {
124
+ let block = parsed_block . with_context ( | | {
125
+ format ! (
126
126
"Error while reading block in immutable file: '{:?}'" ,
127
127
immutable_file. path
128
- ) )
128
+ )
129
129
} ) ?;
130
130
blocks. push ( CardanoTransactionParser :: convert_to_block (
131
131
& block,
@@ -136,11 +136,11 @@ impl CardanoTransactionParser {
136
136
}
137
137
138
138
fn convert_to_block ( block : & [ u8 ] , immutable_file : & ImmutableFile ) -> StdResult < Block > {
139
- let multi_era_block = MultiEraBlock :: decode ( block) . map_err ( |e | {
140
- anyhow ! ( e ) . context ( format ! (
139
+ let multi_era_block = MultiEraBlock :: decode ( block) . with_context ( | | {
140
+ format ! (
141
141
"Error while decoding block in immutable file: '{:?}'" ,
142
142
immutable_file. path
143
- ) )
143
+ )
144
144
} ) ?;
145
145
146
146
Block :: try_convert ( multi_era_block, immutable_file. number ) . with_context ( || {
You can’t perform that action at this time.
0 commit comments