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

Add RecordSpecification implementation to the metadata module #59

Closed
9 of 13 tasks
iramiller opened this issue Feb 10, 2021 · 0 comments · Fixed by #118
Closed
9 of 13 tasks

Add RecordSpecification implementation to the metadata module #59

iramiller opened this issue Feb 10, 2021 · 0 comments · Fixed by #118
Assignees
Labels
metadata Metadata Module
Milestone

Comments

@iramiller
Copy link
Member

iramiller commented Feb 10, 2021

Summary

Implement basic metadata structure for RecordSpecification

Example

The following example is taken from a migrated v39 contract specification.

    {
      "inputs": [
        {
          "hash": "Adv+huolGTKofYCR0dw5GHm/R7sUWOwF32XR8r8r9kDy4il5U/LApxOWYHb05jhK4+eY4YzRMRiWcxU3Lx0+Mw==",
          "name": "perform_input_checks",
          "type_name": "io.provenance.Common$BooleanResult"
        },
        {
          "hash": "Adv+huolGTKofYCR0dw5GHm/R7sUWOwF32XR8r8r9kDy4il5U/LApxOWYHb05jhK4+eY4YzRMRiWcxU3Lx0+Mw==",
          "name": "additional_parties",
          "type_name": "io.provenance.loan.LoanProtos$PartiesList"
        }
      ],
      "name": "additional_parties",
      "responsible_party": "PARTY_TYPE_ORIGINATOR",
      "result_type": "DEFINITION_TYPE_PROPOSED",
      "specification_id": "contractspec1qvfha8nex5j0qeshr9uvsmv5um3q7sghss",
      "type_name": "io.provenance.loan.LoanProtos$PartiesList"
    },

Problem Definition

  • Create proto message for RecordSpecification with appropriate identifiers and structure. Record Specifications are based on ConsiderationSpecs. The ID for a RecordSpecification should be a MetadataAddress (see Add support for RecordSpecification identifiers to the metadata address class. #58)
  • Implement ValidateBasic for object
  • Add NewRecordSpecification functions for creating an instance of [Object]
  • Create test suite to cover basic validation logic
  • Implement appropriate Stringer interface method, add test case
  • Use associated specification keeper file for state read/write methods.
    • Get/Set/Remove methods for object in state store (include events and instrumentation publishing). Ensure remove method fails if there are any existing references to object. Update any indexes that might be useful for rapidly querying/accessing data for queries. Example: all scopes with a given value_owner
    • Stateful validation of object (pull existing, verify any updates are allowed, etc)
  • Wire up msg_server and query_server endpoints to new keeper methods.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@iramiller iramiller added this to the Metadata Module Release milestone Feb 10, 2021
@iramiller iramiller self-assigned this Feb 16, 2021
@jdfigure jdfigure added the metadata Metadata Module label Feb 17, 2021
@jdfigure jdfigure modified the milestones: Metadata Module Release, Testnet Beta Feb 22, 2021
@iramiller iramiller modified the milestones: 1.0.0, 0.1.5 Feb 24, 2021
@dwedul-figure dwedul-figure self-assigned this Mar 1, 2021
@iramiller iramiller moved this from Todo to Done in Provenance Core Protocol Team Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metadata Metadata Module
Projects
Development

Successfully merging a pull request may close this issue.

3 participants