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

Issues found trying to implement usage of P8EMemorializeContract. #256

Closed
20 of 24 tasks
dwedul-figure opened this issue Apr 19, 2021 · 0 comments · Fixed by #257
Closed
20 of 24 tasks

Issues found trying to implement usage of P8EMemorializeContract. #256

dwedul-figure opened this issue Apr 19, 2021 · 0 comments · Fixed by #257
Assignees
Labels
metadata Metadata Module
Milestone

Comments

@dwedul-figure
Copy link
Contributor

dwedul-figure commented Apr 19, 2021

Summary

Some updates are needed due to issues uncovered while trying to use WriteP8EContractSpec and P8EMemorializeContract.

Problem Definition

Some fields aren't being mapped correctly, and some validation points are missing.

Proposal

  • Add a comment to the p8e.proto Contract.considerations field indicating that it is deprecated and ignored.
  • Update getContractSpecID to use contract.Spec.DataLocation.Ref.Hash for the contract spec id.
  • Add original_output_hashes to the MsgWriteRecordRequest and validate them against the existing record.
  • Use contract.Definition.ResourceLocation.Ref.Hash for the ProcessId.
    • Set the ProcessId inside ConvertP8eMemorializeContractRequest.
    • Update the comment on ConvertP8eMemorializeContractRequest to remove the note that the ProcessId field needs setting still.
    • Remove setting of that field from the msg_server.P8EMemorializeContract func.
  • Update how ConvertP8eMemorializeContractRequest creates a record's inputs.
    • Update P8EData struct to include the signers (instead of them being a separate return value).
    • Update P8EData struct to allow expected existing output hashes to returned.
    • Get the Process ID from the provided info (instead of a looked up spec).
    • Update creation of inputs to determine record vs proposed from provided input, and get records from provided facts.
    • Get ancestor hashes and provide them as original output hashes.
  • Update ValidateRecordUpdate
    • Check for existence of records for inputs that are record ids.
    • Check that session parties have signed (instead of scope owners).
    • Check that original output hashes match the existing records output hashes.
    • Do not compare input spec hash to record spec hash for an exact match.
    • Allow the SessionId to change if all parties of the original session are signers.
  • Fix setting of record.SpecificationId when not provided.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
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.

2 participants