Struct jormungandr_automation::jormungandr::grpc::client::JormungandrClient
source · pub struct JormungandrClient {
addr: SocketAddr,
inner_client: NodeClient<Channel>,
rt: Runtime,
}
Fields§
§addr: SocketAddr
§inner_client: NodeClient<Channel>
§rt: Runtime
Implementations§
source§impl JormungandrClient
impl JormungandrClient
pub fn from_address(address: &str) -> Result<Self, MockClientError>
pub fn new(addr: SocketAddr) -> Self
fn client(&self) -> NodeClient<Channel>
pub fn wait_for_chain_length(&self, lenght: ChainLength, timeout: Duration)
pub fn handshake(&self, nonce: &[u8]) -> HandshakeResponse
pub fn tip(&self) -> LibHeader
pub fn headers( &self, block_ids: &[Hash] ) -> Result<Vec<LibHeader>, MockClientError>
fn hashes_to_bin_vec(&self, blocks_id: &[Hash]) -> Vec<Vec<u8>>
fn hash_to_bin(&self, block_id: &Hash) -> Vec<u8> ⓘ
pub fn get_blocks( &self, blocks_id: &[Hash] ) -> Result<Vec<LibBlock>, MockClientError>
pub fn get_genesis_block_hash(&self) -> Hash
pub fn pull_blocks( &self, from: &[Hash], to: Hash ) -> Result<Vec<LibBlock>, MockClientError>
pub fn pull_blocks_to_tip( &self, from: Hash ) -> Result<Vec<LibBlock>, MockClientError>
async fn headers_stream_to_vec( &self, stream: Streaming<Header> ) -> Result<Vec<LibHeader>, MockClientError>
async fn block_stream_to_vec( &self, stream: Streaming<Block> ) -> Result<Vec<LibBlock>, MockClientError>
async fn fragment_stream_to_vec( &self, stream: Streaming<Fragment> ) -> Result<Vec<LibFragment>, MockClientError>
pub fn pull_headers( &self, from: &[Hash], to: Hash ) -> Result<Vec<LibHeader>, MockClientError>
pub fn upload_blocks(&self, lib_block: LibBlock) -> Result<(), MockClientError>
pub fn push_headers(&self, lib_header: LibHeader) -> Result<(), MockClientError>
pub fn get_fragments( &self, ids: Vec<Hash> ) -> Result<Vec<LibFragment>, MockClientError>
Trait Implementations§
source§impl Clone for JormungandrClient
impl Clone for JormungandrClient
Auto Trait Implementations§
impl !RefUnwindSafe for JormungandrClient
impl Send for JormungandrClient
impl Sync for JormungandrClient
impl Unpin for JormungandrClient
impl !UnwindSafe for JormungandrClient
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request