-
Notifications
You must be signed in to change notification settings - Fork 4
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 473 change edit metadata extrinsic to edit the whole metadata #207
Feature/plmc 473 change edit metadata extrinsic to edit the whole metadata #207
Conversation
# Conflicts: # integration-tests/src/tests/vest.rs # pallets/funding/src/instantiator.rs # pallets/funding/src/lib.rs # pallets/funding/src/types.rs # runtimes/politest/src/lib.rs
Co-authored-by: Leonardo Razovic <4128940+lrazovic@users.noreply.github.com>
…-limit-multipliers-based-on-credential-type # Conflicts: # pallets/funding/src/functions.rs # pallets/funding/src/lib.rs # pallets/funding/src/tests.rs # pallets/funding/src/types.rs
…credential-type # Conflicts: # Cargo.lock # Cargo.toml # integration-tests/Cargo.toml # integration-tests/src/constants.rs # integration-tests/src/lib.rs # integration-tests/src/tests/basic_comms.rs # integration-tests/src/tests/credentials.rs # integration-tests/src/tests/ct_migration.rs # integration-tests/src/tests/defaults.rs # integration-tests/src/tests/e2e.rs # integration-tests/src/tests/governance.rs # integration-tests/src/tests/oracle.rs # integration-tests/src/tests/reserve_backed_transfers.rs # integration-tests/src/tests/vest.rs # justfile # nodes/parachain/Cargo.toml # nodes/parachain/src/chain_spec.rs # nodes/parachain/src/chain_spec/polimec.rs # nodes/parachain/src/chain_spec/politest.rs # nodes/parachain/src/command.rs # nodes/parachain/src/rpc.rs # nodes/parachain/src/service.rs # pallets/funding/src/tests.rs # runtimes/polimec/Cargo.toml # runtimes/politest/Cargo.toml
…type' into feature/plmc-473-change-edit_metadata-extrinsic-to-edit-the-whole-metadata
…sic-to-edit-the-whole-metadata # Conflicts: # pallets/funding/src/functions.rs # pallets/funding/src/mock.rs # pallets/funding/src/tests.rs # pallets/funding/src/types.rs
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.
Why have this completely new OptionalMetadata? Why not do the "initial metadata" struct over again for editing and just replace metadata instead of this difficult "updating". I think you are also missing the updates to project_details and bucket based on metadata, so create and edit could be quite similar. So:
- Validating metadata and updating bucket based on metadata and inserting metadata in storage could be single function that is used by both create and edit.
- Create details in create, update details in edit.
- Create does all the transfers and deposits and updating project_id counter etc, while create only takes in Project_id
|
For the last point, a lot of the logic between do_create and edit_metadata will be similar if you just use ProjectMetadataOf as input. So you can probably move a lot of the logic to a seperate function call that function for both create and edit |
…sic-to-edit-the-whole-metadata # Conflicts: # pallets/funding/src/tests.rs
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.
Lgtm, just single comment
What?
edit_metadata
extrinsic to be able to change all of the fields ofProjectMetadata
Why?
How?
ProjectMetadata
that contains optional fields. Each some field constitutes a replacement on the stored metadata. This new struct is calledOptionalProjectMetadata
.Testing?
edit_metadata()