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,
) -> Self {
Self {
quote: quote::alice(),
quote: quote::asb(),
swap_setup: alice::Behaviour::new(
min_buy,
max_buy,

View File

@ -78,7 +78,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(),

View File

@ -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)],