@@ -13,7 +13,7 @@ use linera_base::{
1313 crypto:: { BcsHashable , CryptoHash } ,
1414 data_types:: { Blob , BlockHeight , Epoch , Event , OracleResponse , Timestamp } ,
1515 hashed:: Hashed ,
16- identifiers:: { AccountOwner , BlobId , BlobType , ChainId , MessageId } ,
16+ identifiers:: { AccountOwner , BlobId , BlobType , ChainId } ,
1717} ;
1818use linera_execution:: { BlobState , Operation , OutgoingMessage } ;
1919use serde:: { ser:: SerializeStruct , Deserialize , Serialize } ;
@@ -437,60 +437,6 @@ impl Block {
437437 } )
438438 }
439439
440- /// Returns the `message_index`th outgoing message created by the `operation_index`th operation,
441- /// or `None` if there is no such operation or message.
442- pub fn message_id_for_operation (
443- & self ,
444- operation_index : usize ,
445- message_index : u32 ,
446- ) -> Option < MessageId > {
447- let block = & self . body ;
448- let transaction_index = block. incoming_bundles . len ( ) . checked_add ( operation_index) ?;
449- if message_index >= u32:: try_from ( self . body . messages . get ( transaction_index) ?. len ( ) ) . ok ( ) ? {
450- return None ;
451- }
452- let first_message_index = u32:: try_from (
453- self . body
454- . messages
455- . iter ( )
456- . take ( transaction_index)
457- . map ( Vec :: len)
458- . sum :: < usize > ( ) ,
459- )
460- . ok ( ) ?;
461- let index = first_message_index. checked_add ( message_index) ?;
462- Some ( self . message_id ( index) )
463- }
464-
465- /// Returns the message ID belonging to the `index`th outgoing message in this block.
466- pub fn message_id ( & self , index : u32 ) -> MessageId {
467- MessageId {
468- chain_id : self . header . chain_id ,
469- height : self . header . height ,
470- index,
471- }
472- }
473-
474- /// Returns the outgoing message with the specified id, or `None` if there is no such message.
475- pub fn message_by_id ( & self , message_id : & MessageId ) -> Option < & OutgoingMessage > {
476- let MessageId {
477- chain_id,
478- height,
479- index,
480- } = message_id;
481- if self . header . chain_id != * chain_id || self . header . height != * height {
482- return None ;
483- }
484- let mut index = usize:: try_from ( * index) . ok ( ) ?;
485- for messages in self . messages ( ) {
486- if let Some ( message) = messages. get ( index) {
487- return Some ( message) ;
488- }
489- index -= messages. len ( ) ;
490- }
491- None
492- }
493-
494440 /// Returns all the blob IDs required by this block.
495441 /// Either as oracle responses or as published blobs.
496442 pub fn required_blob_ids ( & self ) -> BTreeSet < BlobId > {
0 commit comments