pub struct RelayerContext<A, B>where
A: TestHost,
B: TestHost,
HostClientState<A>: ClientStateValidation<DefaultIbcStore>,
HostClientState<B>: ClientStateValidation<DefaultIbcStore>,{ /* private fields */ }
Expand description
A relayer context that allows interaction between two TestContext
instances.
Implementations§
Source§impl<A, B> RelayerContext<A, B>where
A: TestHost,
B: TestHost,
HostClientState<A>: ClientStateValidation<DefaultIbcStore>,
HostClientState<B>: ClientStateValidation<DefaultIbcStore>,
impl<A, B> RelayerContext<A, B>where
A: TestHost,
B: TestHost,
HostClientState<A>: ClientStateValidation<DefaultIbcStore>,
HostClientState<B>: ClientStateValidation<DefaultIbcStore>,
Sourcepub fn new(ctx_a: TestContext<A>, ctx_b: TestContext<B>) -> Self
pub fn new(ctx_a: TestContext<A>, ctx_b: TestContext<B>) -> Self
Creates a new relayer context with the given TestContext
instances.
Sourcepub fn get_ctx_a(&self) -> &TestContext<A>
pub fn get_ctx_a(&self) -> &TestContext<A>
Returns an immutable reference to the first context.
Sourcepub fn get_ctx_b(&self) -> &TestContext<B>
pub fn get_ctx_b(&self) -> &TestContext<B>
Returns an immutable reference to the second context.
Sourcepub fn get_ctx_a_mut(&mut self) -> &mut TestContext<A>
pub fn get_ctx_a_mut(&mut self) -> &mut TestContext<A>
Returns a mutable reference to the first context.
Sourcepub fn get_ctx_b_mut(&mut self) -> &mut TestContext<B>
pub fn get_ctx_b_mut(&mut self) -> &mut TestContext<B>
Returns a mutable reference to the second context.
Sourcepub fn create_client_on_a(&mut self, signer: Signer) -> ClientId
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.
Sourcepub fn create_client_on_b(&mut self, signer: Signer) -> ClientId
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.
Sourcepub fn update_client_on_a_with_sync(
&mut self,
client_id_on_a: ClientId,
signer: Signer,
)
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.
Sourcepub fn update_client_on_b_with_sync(
&mut self,
client_id_on_b: ClientId,
signer: Signer,
)
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.
Sourcepub fn create_connection_on_a(
&mut self,
client_id_on_a: ClientId,
client_id_on_b: ClientId,
signer: Signer,
) -> (ConnectionId, ConnectionId)
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.
Sourcepub fn create_connection_on_b(
&mut self,
client_id_on_b: ClientId,
client_id_on_a: ClientId,
signer: Signer,
) -> (ConnectionId, ConnectionId)
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.
Sourcepub 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)
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.
Sourcepub 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)
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.
Sourcepub 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,
)
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.
Sourcepub 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,
)
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.
Sourcepub fn submit_packet_on_b(&mut self, packet: Packet, signer: Signer)
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.
Sourcepub fn timeout_packet_from_a(&mut self, packet: Packet, signer: Signer)
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.
Sourcepub fn timeout_packet_from_a_on_channel_close(
&mut self,
packet: Packet,
signer: Signer,
)
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.
Sourcepub fn send_dummy_transfer_packet_on_a(
&mut self,
chan_id_on_a: ChannelId,
signer: Signer,
) -> Packet
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>
impl<A, B> !UnwindSafe for RelayerContext<A, B>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
T
in a tonic::Request