@@ -424,6 +424,7 @@ impl<Env: Environment> Client<Env> {
424424 Ok ( self . make_nodes ( & committee) ?)
425425 }
426426
427+ /// Creates a [`RemoteNode`] for each validator in the committee.
427428 fn make_nodes (
428429 & self ,
429430 committee : & Committee ,
@@ -472,7 +473,7 @@ impl<Env: Environment> Client<Env> {
472473
473474 /// Handles the certificate in the local node and the resulting notifications.
474475 #[ instrument( level = "trace" , skip_all) ]
475- pub async fn process_certificate < T : ProcessableCertificate > (
476+ async fn process_certificate < T : ProcessableCertificate > (
476477 & self ,
477478 certificate : Box < GenericCertificate < T > > ,
478479 ) -> Result < ( ) , LocalNodeError > {
@@ -1079,7 +1080,7 @@ impl<Env: Environment> Client<Env> {
10791080
10801081 /// Downloads and processes confirmed block certificates that use the given blobs.
10811082 /// If this succeeds, the blobs will be in our storage.
1082- pub async fn receive_certificates_for_blobs (
1083+ async fn receive_certificates_for_blobs (
10831084 & self ,
10841085 blob_ids : Vec < BlobId > ,
10851086 ) -> Result < ( ) , ChainClientError > {
@@ -1696,7 +1697,7 @@ impl<Env: Environment> ChainClient<Env> {
16961697 }
16971698
16981699 #[ instrument( level = "trace" ) ]
1699- pub async fn chain_info_with_committees ( & self ) -> Result < Box < ChainInfo > , LocalNodeError > {
1700+ async fn chain_info_with_committees ( & self ) -> Result < Box < ChainInfo > , LocalNodeError > {
17001701 self . client . chain_info_with_committees ( self . chain_id ) . await
17011702 }
17021703
@@ -1705,10 +1706,7 @@ impl<Env: Environment> ChainClient<Env> {
17051706 async fn epoch_and_committees (
17061707 & self ,
17071708 ) -> Result < ( Epoch , BTreeMap < Epoch , Committee > ) , LocalNodeError > {
1708- let info = self
1709- . client
1710- . chain_info_with_committees ( self . chain_id )
1711- . await ?;
1709+ let info = self . chain_info_with_committees ( ) . await ?;
17121710 let epoch = info. epoch ;
17131711 let committees = info. into_committees ( ) ?;
17141712 Ok ( ( epoch, committees) )
@@ -1728,12 +1726,6 @@ impl<Env: Environment> ChainClient<Env> {
17281726 self . client . admin_committee ( ) . await
17291727 }
17301728
1731- /// Obtains the current epoch of the local chain.
1732- #[ instrument( level = "trace" ) ]
1733- async fn epoch ( & self ) -> Result < Epoch , LocalNodeError > {
1734- Ok ( self . chain_info ( ) . await ?. epoch )
1735- }
1736-
17371729 /// Obtains the identity of the current owner of the chain.
17381730 ///
17391731 /// Returns an error if we don't have the private key for the identity.
@@ -2277,7 +2269,7 @@ impl<Env: Environment> ChainClient<Env> {
22772269 let info = self . chain_info ( ) . await ?;
22782270 let timestamp = self . next_timestamp ( & incoming_bundles, info. timestamp ) ;
22792271 let proposed_block = ProposedBlock {
2280- epoch : self . epoch ( ) . await ? ,
2272+ epoch : info . epoch ,
22812273 chain_id : self . chain_id ,
22822274 incoming_bundles,
22832275 operations,
@@ -2357,11 +2349,7 @@ impl<Env: Environment> ChainClient<Env> {
23572349 let QueryOutcome {
23582350 response,
23592351 operations,
2360- } = self
2361- . client
2362- . local_node
2363- . query_application ( self . chain_id , Query :: System ( query) )
2364- . await ?;
2352+ } = self . query_application ( Query :: System ( query) ) . await ?;
23652353 match response {
23662354 QueryResponse :: System ( response) => Ok ( QueryOutcome {
23672355 response,
@@ -2384,11 +2372,7 @@ impl<Env: Environment> ChainClient<Env> {
23842372 let QueryOutcome {
23852373 response,
23862374 operations,
2387- } = self
2388- . client
2389- . local_node
2390- . query_application ( self . chain_id , query)
2391- . await ?;
2375+ } = self . query_application ( query) . await ?;
23922376 match response {
23932377 QueryResponse :: User ( response_bytes) => {
23942378 let response = serde_json:: from_slice ( & response_bytes) ?;
@@ -2459,7 +2443,7 @@ impl<Env: Environment> ChainClient<Env> {
24592443 let info = self . chain_info ( ) . await ?;
24602444 let timestamp = self . next_timestamp ( & incoming_bundles, info. timestamp ) ;
24612445 let block = ProposedBlock {
2462- epoch : self . epoch ( ) . await ? ,
2446+ epoch : info . epoch ,
24632447 chain_id : self . chain_id ,
24642448 incoming_bundles,
24652449 operations : Vec :: new ( ) ,
@@ -2852,21 +2836,6 @@ impl<Env: Environment> ChainClient<Env> {
28522836 . await
28532837 }
28542838
2855- /// Processes confirmed operation for which this chain is a recipient.
2856- #[ instrument(
2857- level = "trace" ,
2858- skip( certificate) ,
2859- fields( certificate_hash = ?certificate. hash( ) ) ,
2860- ) ]
2861- pub async fn receive_certificate (
2862- & self ,
2863- certificate : ConfirmedBlockCertificate ,
2864- ) -> Result < ( ) , ChainClientError > {
2865- self . client
2866- . receive_certificate ( certificate, ReceiveCertificateMode :: NeedsCheck , None )
2867- . await
2868- }
2869-
28702839 /// Rotates the key of the chain.
28712840 ///
28722841 /// Replaces current owners of the chain with the new key pair.
@@ -3175,7 +3144,7 @@ impl<Env: Environment> ChainClient<Env> {
31753144 ClientOutcome :: Committed ( _) => { }
31763145 outcome @ ClientOutcome :: WaitForTimeout ( _) => return Ok ( outcome) ,
31773146 }
3178- let epoch = self . epoch ( ) . await ?. try_add_one ( ) ?;
3147+ let epoch = self . chain_info ( ) . await ?. epoch . try_add_one ( ) ?;
31793148 self . execute_operation ( SystemOperation :: Admin ( AdminOperation :: CreateCommittee {
31803149 epoch,
31813150 blob_hash,
0 commit comments