Skip to content
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

MipStoreRaw::update_with now return enum #3675

Merged
merged 2 commits into from
Mar 10, 2023

Conversation

sydhds
Copy link
Contributor

@sydhds sydhds commented Mar 10, 2023

  • document all added functions
  • try in sandbox /simulation/labnet
  • unit tests on the added/changed features
    • make tests compile
    • make tests pass
  • add logs allowing easy debugging in case the changes caused problems
  • if the API has changed, update the API specification

Copy link
Collaborator

@Leo-Besancon Leo-Besancon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You really don't like the Result<> Rust enum :p.
Good addition!

Success(Vec<MipInfo>, Vec<MipInfo>),
Fail,
}

/// Store of all versioning info
#[derive(Debug, Clone, Default)]
pub struct MipStoreRaw(pub(crate) BTreeMap<MipInfo, MipState>);

impl MipStoreRaw {
/// Update our store with another (usually after a bootstrap where we received another store)
/// Return true if update is successful, false if something is wrong on given store raw
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change doc comments for return value

@@ -461,18 +461,27 @@ impl<const N: usize> TryFrom<[(MipInfo, MipState); N]> for MipStore {
}
}

#[derive(Debug, PartialEq)]
pub enum UpdateWithResult {
Success(Vec<MipInfo>, Vec<MipInfo>),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment to understand the "update"/"added" order here (otherwise we don't understand what the two Vec are).

@sydhds sydhds merged commit 0ee2713 into testnet_21 Mar 10, 2023
@sydhds sydhds deleted the feature/base_versioning_models_update_1 branch March 10, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants