Struct RelayerContext

Source
pub struct RelayerContext<A, B>{ /* private fields */ }
Expand description

A relayer context that allows interaction between two TestContext instances.

Implementations§

Source§

impl<A, B> RelayerContext<A, B>

Source

pub fn new(ctx_a: TestContext<A>, ctx_b: TestContext<B>) -> Self

Creates a new relayer context with the given TestContext instances.

Source

pub fn get_ctx_a(&self) -> &TestContext<A>

Returns an immutable reference to the first context.

Source

pub fn get_ctx_b(&self) -> &TestContext<B>

Returns an immutable reference to the second context.

Source

pub fn get_ctx_a_mut(&mut self) -> &mut TestContext<A>

Returns a mutable reference to the first context.

Source

pub fn get_ctx_b_mut(&mut self) -> &mut TestContext<B>

Returns a mutable reference to the second context.

Source

pub fn create_client_on_a(&mut self, signer: Signer) -> ClientId

Creates a light client of second context on the first context. Returns the client identifier of the created client.

Source

pub fn create_client_on_b(&mut self, signer: Signer) -> ClientId

Creates a light client of first context on the second context. Returns the client identifier of the created client.

Source

pub fn update_client_on_a_with_sync( &mut self, client_id_on_a: ClientId, signer: Signer, )

Updates the client on the first context with the latest header of the second context.

Source

pub fn update_client_on_b_with_sync( &mut self, client_id_on_b: ClientId, signer: Signer, )

Updates the client on the second context with the latest header of the first context.

Source

pub fn create_connection_on_a( &mut self, client_id_on_a: ClientId, client_id_on_b: ClientId, signer: Signer, ) -> (ConnectionId, ConnectionId)

Creates a connection between the two contexts starting from the first context. Returns the connection identifiers of the created connection ends.

Source

pub fn create_connection_on_b( &mut self, client_id_on_b: ClientId, client_id_on_a: ClientId, signer: Signer, ) -> (ConnectionId, ConnectionId)

Creates a connection between the two contexts starting from the second context. Returns the connection identifiers of the created connection ends.

Source

pub fn create_channel_on_a( &mut self, conn_id_on_a: ConnectionId, port_id_on_a: PortId, conn_id_on_b: ConnectionId, port_id_on_b: PortId, signer: Signer, ) -> (ChannelId, ChannelId)

Creates a channel between the two contexts starting from the first context. Returns the channel identifiers of the created channel ends.

Source

pub fn create_channel_on_b( &mut self, conn_id_on_b: ConnectionId, port_id_on_b: PortId, conn_id_on_a: ConnectionId, port_id_on_a: PortId, signer: Signer, ) -> (ChannelId, ChannelId)

Creates a channel between the two contexts starting from the second context. Returns the channel identifiers of the created channel ends.

Source

pub fn close_channel_on_a( &mut self, chan_id_on_a: ChannelId, port_id_on_a: PortId, chan_id_on_b: ChannelId, port_id_on_b: PortId, signer: Signer, )

Closes a channel between the two contexts starting from the first context.

Source

pub fn close_channel_on_b( &mut self, chan_id_on_b: ChannelId, port_id_on_b: PortId, chan_id_on_a: ChannelId, port_id_on_a: PortId, signer: Signer, )

Closes a channel between the two contexts starting from the second context.

Source

pub fn submit_packet_on_b(&mut self, packet: Packet, signer: Signer)

Sends a packet from the first context to the second context by submitting on receive packet on the second context.

The IBC packet is created by an IBC application on the first context.

Source

pub fn timeout_packet_from_a(&mut self, packet: Packet, signer: Signer)

Times out a packet from the first context to the second context by waiting for the timeout period and then sending a timeout packet to the first context.

The IBC packet is created by an IBC application on the first context.

Source

pub fn timeout_packet_from_a_on_channel_close( &mut self, packet: Packet, signer: Signer, )

Timeouts a packet from the first context to the second context by closing the corresponding channel is closed and then sending a timeout packet to the first context.

The IBC packet is created by an IBC application on the first context.

Source

pub fn send_dummy_transfer_packet_on_a( &mut self, chan_id_on_a: ChannelId, signer: Signer, ) -> Packet

Submit a DummyTransferModule packet on the first context.

Requires serde feature because of ibc::apps::transfer::handler::send_transfer.

Auto Trait Implementations§

§

impl<A, B> Freeze for RelayerContext<A, B>
where <B as TestHost>::ClientState: Sized, <A as TestHost>::ClientState: Sized, A: Freeze, B: Freeze,

§

impl<A, B> !RefUnwindSafe for RelayerContext<A, B>

§

impl<A, B> !Send for RelayerContext<A, B>

§

impl<A, B> !Sync for RelayerContext<A, B>

§

impl<A, B> Unpin for RelayerContext<A, B>
where <B as TestHost>::ClientState: Sized, <A as TestHost>::ClientState: Sized, A: Unpin, B: Unpin,

§

impl<A, B> !UnwindSafe for RelayerContext<A, B>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T, Raw> IntoResponse<Raw> for T
where T: Into<Raw>,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T, C> Convertible<C> for T
where T: TryFrom<C> + Into<C>,

Source§

impl<T> JsonSchemaMaybe for T