File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
rust/immutable-ledger/src Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -158,11 +158,15 @@ impl Block {
158158 encoder. bytes ( & sig) ?;
159159 }
160160
161- Ok ( [
161+ let signatures = encoder. writer ( ) . clone ( ) ;
162+
163+ let block_encoding = [
162164 [ encoded_block_hdr, self . block_data . 0 . clone ( ) ] . concat ( ) ,
163- encoder . writer ( ) . to_vec ( ) ,
165+ signatures ,
164166 ]
165- . concat ( ) )
167+ . concat ( ) ;
168+
169+ Ok ( block_encoding)
166170 }
167171
168172 /// Decode block
@@ -480,7 +484,7 @@ impl BlockHeader {
480484 let metadata = cbor_decoder
481485 . bytes ( )
482486 . map_err ( |e| anyhow:: anyhow!( format!( "Invalid cbor for metadata : {e}" ) ) ) ?
483- . try_into ( ) ? ;
487+ . into ( ) ;
484488
485489 let block_header = BlockHeader {
486490 chain_id,
@@ -590,6 +594,8 @@ impl GenesisPreviousHash {
590594}
591595
592596#[ cfg( test) ]
597+ #[ allow( clippy:: zero_prefixed_literal) ]
598+ #[ allow( clippy:: items_after_statements) ]
593599mod tests {
594600
595601 use ed25519_dalek:: { SigningKey , SECRET_KEY_LENGTH } ;
You can’t perform that action at this time.
0 commit comments