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.
This commit is contained in:
Daniel Karzel 2021-06-25 16:10:25 +10:00
parent c0070f8fa7
commit c2c9e975ef
No known key found for this signature in database
GPG key ID: 30C3FC2E438ADB6E
3 changed files with 10 additions and 8 deletions

View file

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

View file

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

View file

@ -37,10 +37,11 @@ pub struct BidQuote {
pub max_quantity: bitcoin::Amount, 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. /// The ASB is always listening and only supports inbound connections, i.e.
pub fn alice() -> Behaviour { /// handing out quotes.
pub fn asb() -> Behaviour {
Behaviour::new( Behaviour::new(
JsonPullCodec::default(), JsonPullCodec::default(),
vec![(BidQuoteProtocol, ProtocolSupport::Inbound)], 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. /// The CLI is always dialing and only supports outbound connections, i.e.
pub fn bob() -> Behaviour { /// requesting quotes.
pub fn cli() -> Behaviour {
Behaviour::new( Behaviour::new(
JsonPullCodec::default(), JsonPullCodec::default(),
vec![(BidQuoteProtocol, ProtocolSupport::Outbound)], vec![(BidQuoteProtocol, ProtocolSupport::Outbound)],