From cd7cd1e337d2367f9e742e3f4f7c573863c73873 Mon Sep 17 00:00:00 2001 From: Bill Barman Date: Tue, 20 Nov 2018 17:06:39 +0800 Subject: [PATCH] correct random did creation --- test/ddo_lib/DDO.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/ddo_lib/DDO.test.ts b/test/ddo_lib/DDO.test.ts index 029ea06..7641b27 100644 --- a/test/ddo_lib/DDO.test.ts +++ b/test/ddo_lib/DDO.test.ts @@ -110,7 +110,7 @@ describe("libDDO", () => { }) }) - describe('DDO validate proof', () => { + describe('DDO validate proof from JSON', () => { it("should have a valid ddo proof", async () => { var ddo = new DDO(jsonDDO) assert(ddo) @@ -128,8 +128,9 @@ describe("libDDO", () => { const privateKey = ddo.addSignature() assert(privateKey.match('-----BEGIN RSA PRIVATE KEY-----')) }) + it("should add a service", async () => { - const did = 'did:op:' + Web3.utils.randomHex(64) + const did = 'did:op:' + Web3.utils.randomHex(32).substr(2) var ddo = new DDO(did) assert(ddo) const service = ddo.addService({type: 'metatrippy', serviceEndpoint: 'http://localhost:5000'})