pub struct StubChainApiBuilder {
pub(crate) me: Option<Address>,
pub(crate) key_addr_map: BiMap<OffchainPublicKey, Address>,
pub(crate) key_id_map: BiMap<OffchainPublicKey, HoprKeyIdent>,
pub(crate) channels: Vec<ChannelEntry>,
pub(crate) ticket_price: HoprBalance,
pub(crate) win_prob: WinningProbability,
pub(crate) next_key_id: u32,
}Expand description
Builder for StubChainApi.
Fields§
§me: Option<Address>§key_addr_map: BiMap<OffchainPublicKey, Address>§key_id_map: BiMap<OffchainPublicKey, HoprKeyIdent>§channels: Vec<ChannelEntry>§ticket_price: HoprBalance§win_prob: WinningProbability§next_key_id: u32Implementations§
Source§impl StubChainApiBuilder
impl StubChainApiBuilder
Sourcepub fn peer(self, offchain: &OffchainPublicKey, chain_addr: Address) -> Self
pub fn peer(self, offchain: &OffchainPublicKey, chain_addr: Address) -> Self
Registers a single peer (offchain key ↔ chain address + key-id mapping).
Sourcepub fn ticket_price(self, price: HoprBalance) -> Self
pub fn ticket_price(self, price: HoprBalance) -> Self
Sets the default outgoing ticket price.
Sourcepub fn build(self) -> StubChainApi
pub fn build(self) -> StubChainApi
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StubChainApiBuilder
impl RefUnwindSafe for StubChainApiBuilder
impl Send for StubChainApiBuilder
impl Sync for StubChainApiBuilder
impl Unpin for StubChainApiBuilder
impl UnwindSafe for StubChainApiBuilder
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more