We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is your feature request related to a problem? Please describe. In almost all our contracts we have this code:
pub fn init(env: Env, some: Params) { let storage = env.storage().persistent(); if storage.get::<_, ()>(&DataKey::Initialized).is_some() { panic_with_error!(&env, Error::AlreadyInitialized); } }
pub fn callable_method(env: Env, some: Params) { let storage = env.storage().persistent(); if storage.get::<_, ()>(&DataKey::Initialized).is_none() { panic_with_error!(&env, Error::NotInitialized); }
Describe the solution you'd like We could have some utilities macros:
#[init] pub fn init(env: Env, some: Params) { ... } #[must_init] pub fn callable_method(env: Env, some: Params) { ... }
Additional context Of course the naming can be different but hopefully this gets the point home.
The text was updated successfully, but these errors were encountered:
This looks great ! My vote for moving this forward.
Sorry, something went wrong.
No branches or pull requests
Is your feature request related to a problem? Please describe.
In almost all our contracts we have this code:
Describe the solution you'd like
We could have some utilities macros:
Additional context
Of course the naming can be different but hopefully this gets the point home.
The text was updated successfully, but these errors were encountered: