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

extend GistInfo with Proof object #97

Merged
merged 11 commits into from
Nov 25, 2024
25 changes: 19 additions & 6 deletions verifiable/did_doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,25 @@ type StateInfo struct {

// GistInfo representation state of gist root.
type GistInfo struct {
Root string `json:"root"`
ReplacedByRoot string `json:"replacedByRoot"`
CreatedAtTimestamp string `json:"createdAtTimestamp"`
ReplacedAtTimestamp string `json:"replacedAtTimestamp"`
CreatedAtBlock string `json:"createdAtBlock"`
ReplacedAtBlock string `json:"replacedAtBlock"`
Root string `json:"root"`
ReplacedByRoot string `json:"replacedByRoot"`
CreatedAtTimestamp string `json:"createdAtTimestamp"`
ReplacedAtTimestamp string `json:"replacedAtTimestamp"`
CreatedAtBlock string `json:"createdAtBlock"`
ReplacedAtBlock string `json:"replacedAtBlock"`
Proof *GistProof `json:"proof"`
Copy link
Contributor

Choose a reason for hiding this comment

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

we need to make it optional in json, because teoretically some objects could be saved by someone. (put omitEmpty)

}

// GistProof representation proof of gist root.
type GistProof struct {
Root string `json:"root"`
Existence bool `json:"existence"`
Siblings []string `json:"siblings"`
Index string `json:"index"`
Value string `json:"value"`
AuxExistence bool `json:"auxExistence"`
Copy link
Contributor

Choose a reason for hiding this comment

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

we should create regular type here
with nodeAux, h_index, h_value.

root is already on upper level. Use merkletree.Proof object

Copy link
Contributor

Choose a reason for hiding this comment

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

ah. maybe it should also contain type property with equality to SparseMerkleTreeProof and other fiellds from mtp

struct {
type : ProofType
merkeTree.Proof
}

AuxIndex string `json:"auxIndex"`
AuxValue string `json:"auxValue"`
}

// IdentityState representation all info about identity.
Expand Down
Loading