-
Notifications
You must be signed in to change notification settings - Fork 52
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
Feat upgradable smart contracts and updated quotation flow #2511
Conversation
@@ -77,6 +77,21 @@ impl ProofOfPayment { | |||
.any(|(_, quote)| quote.has_expired()) | |||
} | |||
|
|||
/// Returns all quotes by given peer id | |||
pub fn quotes_by_peer(&self, peer_id: &PeerId) -> Vec<&PaymentQuote> { |
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.
Should this also check that the quote is valid for the same peer id?
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.
I think this is caller responsibility? The name doesn't suggest a check is there
let put_cfg = PutRecordCfg { | ||
put_quorum: Quorum::All, | ||
retry_strategy: None, | ||
use_put_record_to: Some(vec![payee]), | ||
use_put_record_to: Some(payees), // CODE REVIEW: should we put to all or just one here? |
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.
All sounds good. Maybe in the future, to strain the network less we could put to 1 by 1 until the data is stored
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.
This can come as an optimization
@@ -146,19 +150,21 @@ impl Client { | |||
let put_cfg = PutRecordCfg { | |||
put_quorum: Quorum::One, | |||
retry_strategy: Some(RetryStrategy::Balanced), | |||
use_put_record_to: Some(vec![storing_node]), | |||
use_put_record_to: Some(storing_nodes), // CODE REVIEW: do we put to all payees or just one? |
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.
Same here, this would be a good optimization down the line but maybe in the put_record code layer?
// CODE REVIEW: should we fail on a single invalid payment? | ||
if !payment_verification.is_valid { | ||
return Err(error::Error::PaymentInvalid); | ||
} |
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.
For now yeah, I guess this will be a question again when we batch this
0279010
into
maidsafe:feat-upgradable-smart-contracts-and-updated-quotation-flow
autonomi
compiles!Still some tests to fix most likely though and need to have the final smart contract implementation to fix local deployment on Anvil.
Look for
@anselme
and// CODE REVIEW
for parts where I was a bit unsure!