Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Revoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ function Main(props) {
</div>

<div
class="ui input success"
className="ui input success"
style={{
width: "600px",
}}
Expand All @@ -314,7 +314,7 @@ function Main(props) {

<div>
<button
class="ui primary button"
className="ui primary button"
onClick={onSearchDID}
style={{
marginTop: "20px",
Expand All @@ -323,7 +323,7 @@ function Main(props) {
Search
</button>
<button
class="ui primary button"
className="ui primary button"
onClick={onRevokeDID}
style={{
marginTop: "20px",
Expand Down Expand Up @@ -464,7 +464,7 @@ function Main(props) {
</div>
<div>
<button
class="ui primary button"
className="ui primary button"
onClick={onUpdateDID}
style={{
marginTop: "20px",
Expand Down
31 changes: 30 additions & 1 deletion src/TemplateModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export function Main(props) {
const [didRef, setDIDRef] = useState("");
const [publicKeys, setPublicKeys] = useState("");

const [signatures, setSignatures] = useState("");

const [block, setBlock] = useState(0);

// Our `FileReader()` which is accessible from our functions below.
Expand Down Expand Up @@ -82,6 +84,33 @@ export function Main(props) {
"IX+Er8hGzerTzB1g2Ufxu2dQP/9fDR4kKe1Q0BaUgWk=",
];

let sigList = [];

// Create a proof for DID
let proof = account.sign(new Uint8Array(didDocument));
// let public_key = account.addressRaw;
let public_key = keyring.encodeAddress(account.publicKey, 32);


console.log(public_key);


let active = true;
let created_time_stamp = 0;
let updated_timestamp = 0

const didSignature = new Object();

didSignature.proof = proof;
didSignature.active = active;
didSignature.public_key = public_key;
didSignature.created_time_stamp = created_time_stamp;
didSignature.updated_timestamp = updated_timestamp;
sigList.push(didSignature);
setSignatures(sigList);

console.log("_____________________________\n" + sigList + "___________________________________")

setPublicKeys(pks);

setDIDRef(
Expand Down Expand Up @@ -197,7 +226,7 @@ export function Main(props) {
senderAccountId,
didHash,
didRef,
publicKeys,
signatures,
],
paramFields: [true, true, true, true, true, true, true],
}}
Expand Down
14 changes: 10 additions & 4 deletions src/config/types.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
"DID": {
"did_resolution_metadata": "Option<Vec<u8>>",
"did_document_metadata": "Option<Vec<u8>>",
"did_document": "Vec<u8>",
"block_number": "BlockNumber",
"block_time_stamp": "u64",
"updated_timestamp": "u64",
"updated_time_stamp": "u64",
"did_ref": "Option<Vec<u8>>",
"sender_account_id": "Vec<u8>",
"public_keys": "Option<Vec<Vec<u8>>>"
"sender_account_id": "Vec<u8>"
},

"DIDSignature": {
"public_key": "Vec<u8>",
"proof": "Signature",
"active": "bool",
"created_time_stamp": "u64",
"updated_time_stamp": "u64"
},
"VerifiableCredential": {
"account_id": "AccountId",
"public_key": "Vec<u8>",
Expand Down