-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapt to new Market Api 1.6.1 #775
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -87,15 +87,25 @@ impl Negotiator for LimitAgreementsNegotiator { | |||||
"Negotiator: Reject proposal [{:?}] due to expiration limits.", | ||||||
demand.proposal_id | ||||||
); | ||||||
Ok(ProposalResponse::RejectProposal) | ||||||
Ok(ProposalResponse::RejectProposal { | ||||||
reason: Some(format!( | ||||||
"proposal expired at: {} which is less than 5 min or more than 30 min from now", | ||||||
expiration | ||||||
)), | ||||||
}) | ||||||
} else if self.has_free_slot() { | ||||||
Ok(ProposalResponse::AcceptProposal) | ||||||
} else { | ||||||
log::info!( | ||||||
"Negotiator: Reject proposal [{:?}] due to limit.", | ||||||
demand.proposal_id | ||||||
); | ||||||
Ok(ProposalResponse::RejectProposal) | ||||||
Ok(ProposalResponse::RejectProposal { | ||||||
reason: Some(format!( | ||||||
"available agreements limit: {} reached", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
self.max_agreements | ||||||
)), | ||||||
}) | ||||||
} | ||||||
} | ||||||
|
||||||
|
@@ -109,7 +119,12 @@ impl Negotiator for LimitAgreementsNegotiator { | |||||
"Negotiator: Reject agreement proposal [{}] due to limit.", | ||||||
agreement.agreement_id | ||||||
); | ||||||
Ok(AgreementResponse::RejectAgreement) | ||||||
Ok(AgreementResponse::RejectAgreement { | ||||||
reason: Some(format!( | ||||||
"available agreements limit: {} reached", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
self.max_agreements | ||||||
)), | ||||||
}) | ||||||
} | ||||||
} | ||||||
} | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,10 @@ pub enum ProposalResponse { | |
offer: DemandOfferBase, | ||
}, | ||
AcceptProposal, | ||
RejectProposal, | ||
#[display(fmt = "RejectProposal( reason: {:?})", reason)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It will be awfull message with Some() There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's cover it in other PR, as this is blocking others. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reported as #776 |
||
RejectProposal { | ||
reason: Option<String>, | ||
}, | ||
///< Don't send any message to requestor. Could be useful to wait for other offers. | ||
IgnoreProposal, | ||
} | ||
|
@@ -26,7 +29,10 @@ pub enum ProposalResponse { | |
#[allow(dead_code)] | ||
pub enum AgreementResponse { | ||
ApproveAgreement, | ||
RejectAgreement, | ||
#[display(fmt = "RejectAgreement( reason: {:?})", reason)] | ||
RejectAgreement { | ||
reason: Option<String>, | ||
}, | ||
} | ||
|
||
/// Result of agreement execution. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.