1
- use std:: collections:: VecDeque ;
2
1
// Copyright (C) 2013-2020 Blockstack PBC, a public benefit corporation
3
2
// Copyright (C) 2020-2024 Stacks Open Internet Foundation
4
3
//
@@ -14,6 +13,7 @@ use std::collections::VecDeque;
14
13
//
15
14
// You should have received a copy of the GNU General Public License
16
15
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ use std:: collections:: VecDeque ;
17
17
use std:: net:: SocketAddr ;
18
18
19
19
use blockstack_lib:: burnchains:: Txid ;
@@ -534,47 +534,6 @@ impl StacksClient {
534
534
} )
535
535
}
536
536
537
- /// Get the sortition information for the latest sortition
538
- pub fn get_latest_sortition ( & self ) -> Result < SortitionInfo , ClientError > {
539
- debug ! ( "stacks_node_client: Getting latest sortition..." ) ;
540
- let path = self . sortition_info_path ( ) ;
541
- let timer = crate :: monitoring:: new_rpc_call_timer ( & path, & self . http_origin ) ;
542
- let send_request = || {
543
- self . stacks_node_client . get ( & path) . send ( ) . map_err ( |e| {
544
- warn ! ( "Signer failed to request latest sortition" ; "err" => ?e) ;
545
- e
546
- } )
547
- } ;
548
- let response = send_request ( ) ?;
549
- timer. stop_and_record ( ) ;
550
- if !response. status ( ) . is_success ( ) {
551
- return Err ( ClientError :: RequestFailure ( response. status ( ) ) ) ;
552
- }
553
- let sortition_info = response. json ( ) ?;
554
- Ok ( sortition_info)
555
- }
556
-
557
- /// Get the sortition information for a given sortition
558
- pub fn get_sortition ( & self , ch : & ConsensusHash ) -> Result < SortitionInfo , ClientError > {
559
- debug ! ( "stacks_node_client: Getting sortition with consensus hash {ch}..." ) ;
560
- let path = format ! ( "{}/consensus/{}" , self . sortition_info_path( ) , ch. to_hex( ) ) ;
561
- let timer_label = format ! ( "{}/consensus/:consensus_hash" , self . sortition_info_path( ) ) ;
562
- let timer = crate :: monitoring:: new_rpc_call_timer ( & timer_label, & self . http_origin ) ;
563
- let send_request = || {
564
- self . stacks_node_client . get ( & path) . send ( ) . map_err ( |e| {
565
- warn ! ( "Signer failed to request sortition" ; "consensus_hash" => %ch, "err" => ?e) ;
566
- e
567
- } )
568
- } ;
569
- let response = send_request ( ) ?;
570
- timer. stop_and_record ( ) ;
571
- if !response. status ( ) . is_success ( ) {
572
- return Err ( ClientError :: RequestFailure ( response. status ( ) ) ) ;
573
- }
574
- let sortition_info = response. json ( ) ?;
575
- Ok ( sortition_info)
576
- }
577
-
578
537
/// Get the current peer info data from the stacks node
579
538
pub fn get_peer_info ( & self ) -> Result < PeerInfo , ClientError > {
580
539
debug ! ( "stacks_node_client: Getting peer info..." ) ;
0 commit comments