refactor: rename Assertion to Account and update related code

This commit is contained in:
Prad Nukala
2024-11-26 00:07:45 -05:00
parent 9e7f70c455
commit 179a69df1c
47 changed files with 2781 additions and 25381 deletions
+4 -60
View File
@@ -7,7 +7,7 @@ import "did/v1/genesis.proto";
option go_package = "github.com/onsonr/sonr/x/did/types";
message Assertion {
message Account {
option (cosmos.orm.v1.table) = {
id: 1
primary_key: {fields: "did"}
@@ -40,66 +40,10 @@ message Assertion {
int64 creation_block = 7;
}
message Authentication {
// PublicKey represents a public key
message PublicKey {
option (cosmos.orm.v1.table) = {
id: 2
primary_key: {fields: "did"}
index: {
id: 1
fields: "controller,subject"
unique: true
}
};
// The unique identifier of the authentication
string did = 1;
// The authentication of the DID
string controller = 2;
// Origin of the authentication
string subject = 3;
// string is the verification method
string public_key_hex = 4;
// CredentialID is the byte representation of the credential ID
bytes credential_id = 5;
// Metadata of the authentication
map<string, string> metadata = 6;
// CreationBlock is the block number of the creation of the authentication
int64 creation_block = 7;
}
// Macaroon is a Macaroon message type.
message Biscuit {
option (cosmos.orm.v1.table) = {
id: 5
primary_key: {
fields: "id"
auto_increment: true
}
index: {
id: 1
fields: "subject,origin"
unique: true
}
};
uint64 id = 1;
string controller = 2;
string subject = 3;
string origin = 4;
int64 expiry_height = 5;
string macaroon = 6;
}
// Controller represents a Sonr DWN Vault
message Controller {
option (cosmos.orm.v1.table) = {
id: 3
primary_key: {
fields: "number"
auto_increment: true
@@ -157,7 +101,7 @@ message Controller {
// Verification represents a verification method
message Verification {
option (cosmos.orm.v1.table) = {
id: 6
id: 3
primary_key: {fields: "did"}
index: {
id: 1
+13 -2
View File
@@ -7,7 +7,7 @@ option go_package = "github.com/onsonr/sonr/x/dwn/types";
// https://github.com/cosmos/cosmos-sdk/blob/main/orm/README.md
message ExampleData {
message Credential {
option (cosmos.orm.v1.table) = {
id: 1;
primary_key: { fields: "account" }
@@ -16,4 +16,15 @@ message ExampleData {
bytes account = 1;
uint64 amount = 2;
}
}
message Profile {
option (cosmos.orm.v1.table) = {
id: 2;
primary_key: { fields: "account" }
index: { id: 1 fields: "amount" }
};
bytes account = 1;
uint64 amount = 2;
}
+3 -3
View File
@@ -8,7 +8,7 @@ option go_package = "github.com/onsonr/sonr/x/svc/types";
// https://github.com/cosmos/cosmos-sdk/blob/main/orm/README.md
message Metadata {
message Domain {
option (cosmos.orm.v1.table) = {
id: 1
primary_key: {
@@ -31,8 +31,8 @@ message Metadata {
repeated string tags = 7;
}
// Profile represents a DID alias
message Profile {
// Metadata represents a DID alias
message Metadata {
option (cosmos.orm.v1.table) = {
id: 2
primary_key: {fields: "id"}