@@ -21,7 +21,7 @@ use http_default::{AsyncWebSocketStream, WebSocketStream};
2121use iroha_config:: { client:: Configuration , torii:: uri, GetConfiguration , PostConfiguration } ;
2222use iroha_crypto:: { HashOf , KeyPair } ;
2323use iroha_data_model:: {
24- block:: VersionedCommittedBlock ,
24+ block:: VersionedSignedBlock ,
2525 http:: VersionedBatchedResponse ,
2626 isi:: Instruction ,
2727 predicate:: PredicateBox ,
@@ -654,7 +654,7 @@ impl Client {
654654 PipelineStatus :: Rejected ( ref reason) => {
655655 return Err ( reason. clone ( ) . into ( ) ) ;
656656 }
657- PipelineStatus :: Committed => return Ok ( hash. transmute ( ) ) ,
657+ PipelineStatus :: Committed => return Ok ( hash) ,
658658 }
659659 }
660660 }
@@ -1036,7 +1036,7 @@ impl Client {
10361036 pub fn listen_for_blocks (
10371037 & self ,
10381038 height : NonZeroU64 ,
1039- ) -> Result < impl Iterator < Item = Result < VersionedCommittedBlock > > > {
1039+ ) -> Result < impl Iterator < Item = Result < VersionedSignedBlock > > > {
10401040 blocks_api:: BlockIterator :: new ( self . blocks_handler ( height) ?)
10411041 }
10421042
@@ -1448,10 +1448,7 @@ pub mod events_api {
14481448 url,
14491449 } = self ;
14501450
1451- let msg =
1452- VersionedEventSubscriptionRequest :: from ( EventSubscriptionRequest :: new ( filter) )
1453- . encode_versioned ( ) ;
1454-
1451+ let msg = EventSubscriptionRequest :: new ( filter) . encode ( ) ;
14551452 InitData :: new ( R :: new ( HttpMethod :: GET , url) . headers ( headers) , msg, Events )
14561453 }
14571454 }
@@ -1464,8 +1461,7 @@ pub mod events_api {
14641461 type Event = iroha_data_model:: prelude:: Event ;
14651462
14661463 fn message ( & self , message : Vec < u8 > ) -> Result < Self :: Event > {
1467- let event_socket_message =
1468- VersionedEventMessage :: decode_all_versioned ( & message) ?. into_v1 ( ) ;
1464+ let event_socket_message = EventMessage :: decode_all ( & mut message. as_slice ( ) ) ?;
14691465 Ok ( event_socket_message. into ( ) )
14701466 }
14711467 }
@@ -1532,10 +1528,7 @@ mod blocks_api {
15321528 url,
15331529 } = self ;
15341530
1535- let msg =
1536- VersionedBlockSubscriptionRequest :: from ( BlockSubscriptionRequest :: new ( height) )
1537- . encode_versioned ( ) ;
1538-
1531+ let msg = BlockSubscriptionRequest :: new ( height) . encode ( ) ;
15391532 InitData :: new ( R :: new ( HttpMethod :: GET , url) . headers ( headers) , msg, Events )
15401533 }
15411534 }
@@ -1545,11 +1538,10 @@ mod blocks_api {
15451538 pub struct Events ;
15461539
15471540 impl FlowEvents for Events {
1548- type Event = iroha_data_model:: block:: VersionedCommittedBlock ;
1541+ type Event = iroha_data_model:: block:: VersionedSignedBlock ;
15491542
15501543 fn message ( & self , message : Vec < u8 > ) -> Result < Self :: Event > {
1551- let block_msg = VersionedBlockMessage :: decode_all_versioned ( & message) ?. into_v1 ( ) ;
1552- Ok ( block_msg. into ( ) )
1544+ Ok ( BlockMessage :: decode_all ( & mut message. as_slice ( ) ) . map ( Into :: into) ?)
15531545 }
15541546 }
15551547 }
@@ -1610,7 +1602,7 @@ pub mod asset {
16101602 }
16111603
16121604 /// Construct a query to get an asset by its id
1613- pub fn by_id ( asset_id : impl Into < EvaluatesTo < < Asset as Identifiable > :: Id > > ) -> FindAssetById {
1605+ pub fn by_id ( asset_id : impl Into < EvaluatesTo < AssetId > > ) -> FindAssetById {
16141606 FindAssetById :: new ( asset_id)
16151607 }
16161608}
@@ -1632,7 +1624,7 @@ pub mod block {
16321624
16331625 /// Construct a query to find block header by hash
16341626 pub fn header_by_hash (
1635- hash : impl Into < EvaluatesTo < HashOf < VersionedCommittedBlock > > > ,
1627+ hash : impl Into < EvaluatesTo < HashOf < VersionedSignedBlock > > > ,
16361628 ) -> FindBlockHeaderByHash {
16371629 FindBlockHeaderByHash :: new ( hash)
16381630 }
0 commit comments