Struct ibc::test_utils::DummyTransferModule
source · [−]pub struct DummyTransferModule { /* private fields */ }
Implementations
sourceimpl DummyTransferModule
impl DummyTransferModule
pub fn new(ibc_store: Arc<Mutex<MockIbcStore>>) -> Self
Trait Implementations
sourceimpl BankKeeper for DummyTransferModule
impl BankKeeper for DummyTransferModule
type AccountId = Signer
sourcefn send_coins(
&mut self,
_from: &Self::AccountId,
_to: &Self::AccountId,
_amt: &PrefixedCoin
) -> Result<(), Ics20Error>
fn send_coins(
&mut self,
_from: &Self::AccountId,
_to: &Self::AccountId,
_amt: &PrefixedCoin
) -> Result<(), Ics20Error>
This function should enable sending ibc fungible tokens from one account to another
sourcefn mint_coins(
&mut self,
_account: &Self::AccountId,
_amt: &PrefixedCoin
) -> Result<(), Ics20Error>
fn mint_coins(
&mut self,
_account: &Self::AccountId,
_amt: &PrefixedCoin
) -> Result<(), Ics20Error>
This function to enable minting ibc tokens to a user account
sourcefn burn_coins(
&mut self,
_account: &Self::AccountId,
_amt: &PrefixedCoin
) -> Result<(), Ics20Error>
fn burn_coins(
&mut self,
_account: &Self::AccountId,
_amt: &PrefixedCoin
) -> Result<(), Ics20Error>
This function should enable burning of minted tokens in a user account
sourceimpl ChannelKeeper for DummyTransferModule
impl ChannelKeeper for DummyTransferModule
fn store_packet_commitment(
&mut self,
key: (PortId, ChannelId, Sequence),
commitment: PacketCommitment
) -> Result<(), Error>
fn delete_packet_commitment(
&mut self,
_key: (PortId, ChannelId, Sequence)
) -> Result<(), Error>
fn store_packet_receipt(
&mut self,
_key: (PortId, ChannelId, Sequence),
_receipt: Receipt
) -> Result<(), Error>
fn store_packet_acknowledgement(
&mut self,
_key: (PortId, ChannelId, Sequence),
_ack: AcknowledgementCommitment
) -> Result<(), Error>
fn delete_packet_acknowledgement(
&mut self,
_key: (PortId, ChannelId, Sequence)
) -> Result<(), Error>
fn store_connection_channels(
&mut self,
_conn_id: ConnectionId,
_port_channel_id: &(PortId, ChannelId)
) -> Result<(), Error>
sourcefn store_channel(
&mut self,
_port_channel_id: (PortId, ChannelId),
_channel_end: &ChannelEnd
) -> Result<(), Error>
fn store_channel(
&mut self,
_port_channel_id: (PortId, ChannelId),
_channel_end: &ChannelEnd
) -> Result<(), Error>
Stores the given channel_end at a path associated with the port_id and channel_id.
fn store_next_sequence_send(
&mut self,
port_channel_id: (PortId, ChannelId),
seq: Sequence
) -> Result<(), Error>
fn store_next_sequence_recv(
&mut self,
_port_channel_id: (PortId, ChannelId),
_seq: Sequence
) -> Result<(), Error>
fn store_next_sequence_ack(
&mut self,
_port_channel_id: (PortId, ChannelId),
_seq: Sequence
) -> Result<(), Error>
sourcefn increase_channel_counter(&mut self)
fn increase_channel_counter(&mut self)
Called upon channel identifier creation (Init or Try message processing). Increases the counter which keeps track of how many channels have been created. Should never fail. Read more
fn store_channel_result(&mut self, result: ChannelResult) -> Result<(), Error>
fn store_packet_result(
&mut self,
general_result: PacketResult
) -> Result<(), Error>
sourceimpl ChannelReader for DummyTransferModule
impl ChannelReader for DummyTransferModule
sourcefn channel_end(&self, pcid: &(PortId, ChannelId)) -> Result<ChannelEnd, Error>
fn channel_end(&self, pcid: &(PortId, ChannelId)) -> Result<ChannelEnd, Error>
Returns the ChannelEnd for the given port_id
and chan_id
.
sourcefn connection_end(&self, cid: &ConnectionId) -> Result<ConnectionEnd, Error>
fn connection_end(&self, cid: &ConnectionId) -> Result<ConnectionEnd, Error>
Returns the ConnectionState for the given identifier connection_id
.
fn connection_channels(
&self,
_cid: &ConnectionId
) -> Result<Vec<(PortId, ChannelId)>, Error>
sourcefn client_state(&self, client_id: &ClientId) -> Result<AnyClientState, Error>
fn client_state(&self, client_id: &ClientId) -> Result<AnyClientState, Error>
Returns the ClientState for the given identifier client_id
. Necessary dependency towards
proof verification. Read more
fn client_consensus_state(
&self,
client_id: &ClientId,
height: Height
) -> Result<AnyConsensusState, Error>
fn get_next_sequence_send(
&self,
port_channel_id: &(PortId, ChannelId)
) -> Result<Sequence, Error>
fn get_next_sequence_recv(
&self,
_port_channel_id: &(PortId, ChannelId)
) -> Result<Sequence, Error>
fn get_next_sequence_ack(
&self,
_port_channel_id: &(PortId, ChannelId)
) -> Result<Sequence, Error>
fn get_packet_commitment(
&self,
_key: &(PortId, ChannelId, Sequence)
) -> Result<PacketCommitment, Error>
fn get_packet_receipt(
&self,
_key: &(PortId, ChannelId, Sequence)
) -> Result<Receipt, Error>
fn get_packet_acknowledgement(
&self,
_key: &(PortId, ChannelId, Sequence)
) -> Result<AcknowledgementCommitment, Error>
sourcefn hash(&self, value: Vec<u8>) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn hash(&self, value: Vec<u8>) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
A hashing function for packet commitments
sourcefn host_height(&self) -> Height
fn host_height(&self) -> Height
Returns the current height of the local chain.
sourcefn host_consensus_state(
&self,
_height: Height
) -> Result<AnyConsensusState, Error>
fn host_consensus_state(
&self,
_height: Height
) -> Result<AnyConsensusState, Error>
Returns the ConsensusState
of the host (local) chain at a specific height.
sourcefn pending_host_consensus_state(&self) -> Result<AnyConsensusState, Error>
fn pending_host_consensus_state(&self) -> Result<AnyConsensusState, Error>
Returns the pending ConsensusState
of the host (local) chain.
sourcefn client_update_time(
&self,
_client_id: &ClientId,
_height: Height
) -> Result<Timestamp, Error>
fn client_update_time(
&self,
_client_id: &ClientId,
_height: Height
) -> Result<Timestamp, Error>
sourcefn client_update_height(
&self,
_client_id: &ClientId,
_height: Height
) -> Result<Height, Error>
fn client_update_height(
&self,
_client_id: &ClientId,
_height: Height
) -> Result<Height, Error>
sourcefn channel_counter(&self) -> Result<u64, Error>
fn channel_counter(&self) -> Result<u64, Error>
Returns a counter on the number of channel ids have been created thus far.
The value of this counter should increase only via method
ChannelKeeper::increase_channel_counter
. Read more
sourcefn max_expected_time_per_block(&self) -> Duration
fn max_expected_time_per_block(&self) -> Duration
Returns the maximum expected time per block
sourcefn packet_commitment(
&self,
packet_data: Vec<u8>,
timeout_height: TimeoutHeight,
timeout_timestamp: Timestamp
) -> PacketCommitment
fn packet_commitment(
&self,
packet_data: Vec<u8>,
timeout_height: TimeoutHeight,
timeout_timestamp: Timestamp
) -> PacketCommitment
Compute the commitment for a packet.
Note that the absence of timeout_height
is treated as
{revision_number: 0, revision_height: 0}
to be consistent with ibc-go,
where this value is used to mean “no timeout height”:
https://github.com/cosmos/ibc-go/blob/04791984b3d6c83f704c4f058e6ca0038d155d91/modules/core/04-channel/keeper/packet.go#L206 Read more
fn ack_commitment(&self, ack: Acknowledgement) -> AcknowledgementCommitment
sourcefn host_timestamp(&self) -> Timestamp
fn host_timestamp(&self) -> Timestamp
Returns the current timestamp of the local chain.
sourcefn block_delay(&self, delay_period_time: Duration) -> u64
fn block_delay(&self, delay_period_time: Duration) -> u64
Calculates the block delay period using the connection’s delay period and the maximum expected time per block. Read more
sourceimpl Debug for DummyTransferModule
impl Debug for DummyTransferModule
sourceimpl Ics20Context for DummyTransferModule
impl Ics20Context for DummyTransferModule
sourceimpl Ics20Keeper for DummyTransferModule
impl Ics20Keeper for DummyTransferModule
sourceimpl Ics20Reader for DummyTransferModule
impl Ics20Reader for DummyTransferModule
type AccountId = Signer
sourcefn get_port(&self) -> Result<PortId, Ics20Error>
fn get_port(&self) -> Result<PortId, Ics20Error>
get_port returns the portID for the transfer module.
sourcefn get_channel_escrow_address(
&self,
port_id: &PortId,
channel_id: &ChannelId
) -> Result<<Self as Ics20Reader>::AccountId, Ics20Error>
fn get_channel_escrow_address(
&self,
port_id: &PortId,
channel_id: &ChannelId
) -> Result<<Self as Ics20Reader>::AccountId, Ics20Error>
Returns the escrow account id for a port and channel combination
sourcefn is_send_enabled(&self) -> bool
fn is_send_enabled(&self) -> bool
Returns true iff send is enabled.
sourcefn is_receive_enabled(&self) -> bool
fn is_receive_enabled(&self) -> bool
Returns true iff receive is enabled.
sourcefn denom_hash_string(&self, _denom: &PrefixedDenom) -> Option<String>
fn denom_hash_string(&self, _denom: &PrefixedDenom) -> Option<String>
Returns a hash of the prefixed denom. Implement only if the host chain supports hashed denominations. Read more
sourceimpl Module for DummyTransferModule
impl Module for DummyTransferModule
fn on_chan_open_try(
&mut self,
_output: &mut ModuleOutputBuilder,
_order: Order,
_connection_hops: &[ConnectionId],
_port_id: &PortId,
_channel_id: &ChannelId,
_counterparty: &Counterparty,
_version: &Version,
counterparty_version: &Version
) -> Result<Version, Error>
fn on_chan_open_init(
&mut self,
_output: &mut ModuleOutputBuilder,
_order: Order,
_connection_hops: &[ConnectionId],
_port_id: &PortId,
_channel_id: &ChannelId,
_counterparty: &Counterparty,
_version: &Version
) -> Result<(), Error>
fn on_chan_open_ack(
&mut self,
_output: &mut ModuleOutputBuilder,
_port_id: &PortId,
_channel_id: &ChannelId,
_counterparty_version: &Version
) -> Result<(), Error>
fn on_chan_open_confirm(
&mut self,
_output: &mut ModuleOutputBuilder,
_port_id: &PortId,
_channel_id: &ChannelId
) -> Result<(), Error>
fn on_chan_close_init(
&mut self,
_output: &mut ModuleOutputBuilder,
_port_id: &PortId,
_channel_id: &ChannelId
) -> Result<(), Error>
fn on_chan_close_confirm(
&mut self,
_output: &mut ModuleOutputBuilder,
_port_id: &PortId,
_channel_id: &ChannelId
) -> Result<(), Error>
fn on_recv_packet(
&self,
_output: &mut ModuleOutputBuilder,
_packet: &Packet,
_relayer: &Signer
) -> OnRecvPacketAck
fn on_acknowledgement_packet(
&mut self,
_output: &mut ModuleOutputBuilder,
_packet: &Packet,
_acknowledgement: &GenericAcknowledgement,
_relayer: &Signer
) -> Result<(), Error>
fn on_timeout_packet(
&mut self,
_output: &mut ModuleOutputBuilder,
_packet: &Packet,
_relayer: &Signer
) -> Result<(), Error>
sourceimpl PortReader for DummyTransferModule
impl PortReader for DummyTransferModule
Auto Trait Implementations
impl RefUnwindSafe for DummyTransferModule
impl Send for DummyTransferModule
impl Sync for DummyTransferModule
impl Unpin for DummyTransferModule
impl UnwindSafe for DummyTransferModule
Blanket Implementations
sourceimpl<M> AsAnyMut for M where
M: Any + Module,
impl<M> AsAnyMut for M where
M: Any + Module,
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more