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

External evaluation of Dotflow Milestone 1 #888

Merged
merged 6 commits into from
Jun 23, 2023

Conversation

dastansam
Copy link
Contributor

@dastansam dastansam commented Jun 20, 2023

External evaluation for the Dotflow Milestone 1

@dastansam dastansam changed the title External evaluation of DotFlow milestone 1 External evaluation of Dotflow Milestone 1 Jun 20, 2023
@dastansam dastansam marked this pull request as ready for review June 20, 2023 18:57
@keeganquigley keeganquigley self-assigned this Jun 20, 2023
@Szegoo
Copy link
Contributor

Szegoo commented Jun 21, 2023

@dastansam Thanks a lot for your evaluation! I have added instructions regarding contract deployment and frontend environment variable.

I have also resolved all the clippy errors, thanks for pointing that out.

Regarding e2e-tests, yes we were planning to add them once we have all the pieces of the logic.

The reason why we use assert or unwrap in some parts of the code is because we have ensured earlier that the unwrap will be successful(like here).
Also, using assert and unwrap in the constructor is in my opinion ok since it is not a problem if the code panics during the contract deployment, but if that is a problem we can update the code.

@dastansam
Copy link
Contributor Author

dastansam commented Jun 21, 2023

hey @Szegoo,

thanks for the swift feedback.

The reason why we use assert or unwrap in some parts of the code is because we have ensured earlier that the unwrap will be successful(like here).

yeah, I went through it again and you are right, unwrap calls are safe. I only have one suggestion for a clearer syntax, then:

// instead of this
ensure!(self.number_to_identity.get(receiver).is_some(), Error::IdentityDoesntExist);

let receiver_identity = self.number_to_identity.get(receiver).unwrap();

// do this: it's one line and one storage read less :)
let receiver_identity = self.number_to_identity.get().map_or(Error::IdentityDoesntExist, |v| Ok(v))?;

Also, using assert and unwrap in the constructor is in my opinion ok since it is not a problem if the code panics during the contract deployment, but if that is a problem we can update the code.

I think in general, it's not that critical to use unwrap and assert in the contract env, compared to runtime or client env, where it is unacceptable. But it's still better to avoid it, IMO.

But overall, again, I don't see any critical issues that needs to be addressed.

UPDATE: updated the code to use map_or instead of map_err, since get() returns an Option

@Szegoo
Copy link
Contributor

Szegoo commented Jun 21, 2023

@dastansam Yes, you are right. It is a good idea to refactor the code the way you described. Thanks for your suggestion. TheDotflow/dotflow-ink#38

@dastansam
Copy link
Contributor Author

dastansam commented Jun 22, 2023

It's good to go for me, let's wait for @keeganquigley's evaluation

@keeganquigley
Copy link
Contributor

Thanks for the evaluation @dastansam excellent work! @Szegoo I agree, everything looks great and I am able to reproduce the results. A couple of comments:

  • I agree that it's nice to have the process of deploying the contract on a local testnet included for those who may not have done it before. Thanks for adding it and improving the docs overall.
  • I agree, no worries about the e2e tests until the next milestone.
  • @dastansam could you change the status to accepted? Once that is done I will merge it along with the delivery.

Thanks!

@keeganquigley keeganquigley mentioned this pull request Jun 23, 2023
6 tasks
@dastansam
Copy link
Contributor Author

@keeganquigley changed the status of the evaluation to Accepted

@keeganquigley
Copy link
Contributor

Thanks a bunch @dastansam I also made a minor title fix to adhere to our naming convention. I will forward your KSM address to our operations team to process your payment.

@keeganquigley keeganquigley merged commit fee2226 into w3f:master Jun 23, 2023
3 checks passed
@RouvenP
Copy link

RouvenP commented Jun 30, 2023

hi @dastansam we just transferred the KSM

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.

4 participants