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

Feature/plmc 466 research if storage layers dont get dropped when calling #209

Conversation

JuaniRios
Copy link
Contributor

@JuaniRios JuaniRios commented Mar 25, 2024

What?

  • Make sure our inner logic functions don't affect storage if they return an error

Why?

  • We call those functions directly in on_initialize, and so if they failed, the changes to storage would have been permanent

How?

  • add #[transactional] to all do_functions that returned a DispatchResult

Testing?

transactional_on_initialize()

@JuaniRios JuaniRios changed the base branch from main to feature/plmc-468-limit-multipliers-based-on-credential-type March 25, 2024 11:32
@JuaniRios JuaniRios requested a review from lrazovic March 25, 2024 13:04
@JuaniRios JuaniRios self-assigned this Mar 25, 2024
@JuaniRios JuaniRios requested a review from vstam1 March 25, 2024 13:05
@JuaniRios JuaniRios marked this pull request as ready for review March 25, 2024 13:05
@JuaniRios JuaniRios changed the base branch from feature/plmc-468-limit-multipliers-based-on-credential-type to main March 25, 2024 14:42
…dont-get-dropped-when-calling

# Conflicts:
#	pallets/funding/src/functions.rs
#	pallets/funding/src/mock.rs
#	pallets/funding/src/types.rs
@JuaniRios JuaniRios changed the base branch from main to feature/plmc-474-add-extrinsic-to-remove-project-before-evaluation-started March 25, 2024 15:01
@JuaniRios JuaniRios marked this pull request as draft March 25, 2024 15:05
Copy link
Collaborator

@vstam1 vstam1 left a comment

Choose a reason for hiding this comment

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

Don't think we need the #[transactional] for settlement functions as they will be called directly via extrinsics.

@JuaniRios
Copy link
Contributor Author

Don't think we need the #[transactional] for settlement functions as they will be called directly via extrinsics.

We don't know if in the future our automated system will call inner functions directly. And if whoever does it doesn't know about this transactional stuff, they can fuck up bad.
I don't see an issue on having everything transactional

@JuaniRios JuaniRios marked this pull request as ready for review March 25, 2024 15:31
@JuaniRios JuaniRios merged commit d46ce8f into feature/plmc-474-add-extrinsic-to-remove-project-before-evaluation-started Mar 25, 2024
@JuaniRios JuaniRios deleted the feature/plmc-466-research-if-storage-layers-dont-get-dropped-when-calling branch March 25, 2024 15:36
@lrazovic lrazovic restored the feature/plmc-466-research-if-storage-layers-dont-get-dropped-when-calling branch March 25, 2024 15:40
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.

3 participants