Quote protocol asb/cli instead of alice/bob

The quote protocol has no relation to the protocol roles but to the application hence the rename.
cleanup-module-boundaries
Daniel Karzel 3 years ago
parent c87af7bf84
commit 52e2e7e489
No known key found for this signature in database
GPG Key ID: 30C3FC2E438ADB6E

@ -94,7 +94,7 @@ where
env_config: env::Config,
) -> Self {
Self {
quote: quote::alice(),
quote: quote::asb(),
swap_setup: alice::Behaviour::new(
min_buy,
max_buy,

@ -80,7 +80,7 @@ impl Behaviour {
bitcoin_wallet: Arc<bitcoin::Wallet>,
) -> Self {
Self {
quote: quote::bob(),
quote: quote::cli(),
swap_setup: bob::Behaviour::new(env_config, bitcoin_wallet),
transfer_proof: transfer_proof::bob(),
encrypted_signature: encrypted_signature::bob(),

@ -37,10 +37,11 @@ pub struct BidQuote {
pub max_quantity: bitcoin::Amount,
}
/// Constructs a new instance of the `quote` behaviour to be used by Alice.
/// Constructs a new instance of the `quote` behaviour to be used by the ASB.
///
/// Alice only supports inbound connections, i.e. handing out quotes.
pub fn alice() -> Behaviour {
/// The ASB is always listening and only supports inbound connections, i.e.
/// handing out quotes.
pub fn asb() -> Behaviour {
Behaviour::new(
JsonPullCodec::default(),
vec![(BidQuoteProtocol, ProtocolSupport::Inbound)],
@ -48,10 +49,11 @@ pub fn alice() -> Behaviour {
)
}
/// Constructs a new instance of the `quote` behaviour to be used by Bob.
/// Constructs a new instance of the `quote` behaviour to be used by the CLI.
///
/// Bob only supports outbound connections, i.e. requesting quotes.
pub fn bob() -> Behaviour {
/// The CLI is always dialing and only supports outbound connections, i.e.
/// requesting quotes.
pub fn cli() -> Behaviour {
Behaviour::new(
JsonPullCodec::default(),
vec![(BidQuoteProtocol, ProtocolSupport::Outbound)],

Loading…
Cancel
Save