Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fe6c432de | ||
|
|
37c2f5897f | ||
|
|
225aa2a6aa | ||
|
|
81dbf57fc2 | ||
|
|
a3b78fd363 | ||
|
|
52cab23c70 |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@cerc-io/registry-sdk",
|
"name": "@cerc-io/registry-sdk",
|
||||||
"version": "0.2.51",
|
"version": "0.2.6",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"repository": "git@github.com:cerc-io/registry-sdk.git",
|
"repository": "git@github.com:cerc-io/registry-sdk.git",
|
||||||
|
|||||||
@@ -60,10 +60,10 @@ const nameserviceExpiryTests = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Wait for expiry duration', (done) => {
|
test('Wait for expiry duration', (done) => {
|
||||||
// Wait for expiry time + time for a block to be executed
|
|
||||||
const expiryTime = 60 * 1000;
|
const expiryTime = 60 * 1000;
|
||||||
const waitTime = expiryTime + (3 * 1000);
|
|
||||||
|
|
||||||
|
// Wait some more time for block to be executed
|
||||||
|
const waitTime = expiryTime + (3 * 1000);
|
||||||
setTimeout(done, waitTime);
|
setTimeout(done, waitTime);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -88,10 +88,10 @@ const nameserviceExpiryTests = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Wait for expiry duration', (done) => {
|
test('Wait for expiry duration', (done) => {
|
||||||
// Wait for expiry time + time for a block to be executed
|
|
||||||
const expiryTime = 60 * 1000;
|
const expiryTime = 60 * 1000;
|
||||||
const waitTime = expiryTime + (3 * 1000);
|
|
||||||
|
|
||||||
|
// Wait some more time for block to be executed
|
||||||
|
const waitTime = expiryTime + (3 * 1000);
|
||||||
setTimeout(done, waitTime);
|
setTimeout(done, waitTime);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -183,11 +183,13 @@ const namingTests = () => {
|
|||||||
expect(authorities.length).toEqual(4);
|
expect(authorities.length).toEqual(4);
|
||||||
expectedEntryKeys.forEach(key => {
|
expectedEntryKeys.forEach(key => {
|
||||||
authorities.forEach((authority: any) => {
|
authorities.forEach((authority: any) => {
|
||||||
expect(authority).toHaveProperty('name');
|
|
||||||
expect(authority.entry).toHaveProperty(key);
|
expect(authority.entry).toHaveProperty(key);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
authorities.forEach((authority: any, index: number) => {
|
authorities.forEach((authority: any, index: number) => {
|
||||||
|
expect(authority).toHaveProperty('name');
|
||||||
|
expect(authority.entry).toHaveProperty('ownerAddress');
|
||||||
|
expect(authority.entry).toHaveProperty('status');
|
||||||
expect(authority).toMatchObject(reservedAuthorities[index]);
|
expect(authority).toMatchObject(reservedAuthorities[index]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1162,7 +1162,7 @@ export const RecordsList = {
|
|||||||
declare var self: any | undefined;
|
declare var self: any | undefined;
|
||||||
declare var window: any | undefined;
|
declare var window: any | undefined;
|
||||||
declare var global: any | undefined;
|
declare var global: any | undefined;
|
||||||
var _globalThis: any = (() => {
|
var globalThis: any = (() => {
|
||||||
if (typeof globalThis !== "undefined") return globalThis;
|
if (typeof globalThis !== "undefined") return globalThis;
|
||||||
if (typeof self !== "undefined") return self;
|
if (typeof self !== "undefined") return self;
|
||||||
if (typeof window !== "undefined") return window;
|
if (typeof window !== "undefined") return window;
|
||||||
@@ -1171,10 +1171,10 @@ var _globalThis: any = (() => {
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
function bytesFromBase64(b64: string): Uint8Array {
|
function bytesFromBase64(b64: string): Uint8Array {
|
||||||
if (_globalThis.Buffer) {
|
if (globalThis.Buffer) {
|
||||||
return Uint8Array.from(_globalThis.Buffer.from(b64, "base64"));
|
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
||||||
} else {
|
} else {
|
||||||
const bin = _globalThis.atob(b64);
|
const bin = globalThis.atob(b64);
|
||||||
const arr = new Uint8Array(bin.length);
|
const arr = new Uint8Array(bin.length);
|
||||||
for (let i = 0; i < bin.length; ++i) {
|
for (let i = 0; i < bin.length; ++i) {
|
||||||
arr[i] = bin.charCodeAt(i);
|
arr[i] = bin.charCodeAt(i);
|
||||||
@@ -1184,14 +1184,14 @@ function bytesFromBase64(b64: string): Uint8Array {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function base64FromBytes(arr: Uint8Array): string {
|
function base64FromBytes(arr: Uint8Array): string {
|
||||||
if (_globalThis.Buffer) {
|
if (globalThis.Buffer) {
|
||||||
return _globalThis.Buffer.from(arr).toString("base64");
|
return globalThis.Buffer.from(arr).toString("base64");
|
||||||
} else {
|
} else {
|
||||||
const bin: string[] = [];
|
const bin: string[] = [];
|
||||||
arr.forEach((byte) => {
|
arr.forEach((byte) => {
|
||||||
bin.push(String.fromCharCode(byte));
|
bin.push(String.fromCharCode(byte));
|
||||||
});
|
});
|
||||||
return _globalThis.btoa(bin.join(""));
|
return globalThis.btoa(bin.join(""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ export const PageResponse = {
|
|||||||
declare var self: any | undefined;
|
declare var self: any | undefined;
|
||||||
declare var window: any | undefined;
|
declare var window: any | undefined;
|
||||||
declare var global: any | undefined;
|
declare var global: any | undefined;
|
||||||
var _globalThis: any = (() => {
|
var globalThis: any = (() => {
|
||||||
if (typeof globalThis !== "undefined") return globalThis;
|
if (typeof globalThis !== "undefined") return globalThis;
|
||||||
if (typeof self !== "undefined") return self;
|
if (typeof self !== "undefined") return self;
|
||||||
if (typeof window !== "undefined") return window;
|
if (typeof window !== "undefined") return window;
|
||||||
@@ -260,10 +260,10 @@ var _globalThis: any = (() => {
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
function bytesFromBase64(b64: string): Uint8Array {
|
function bytesFromBase64(b64: string): Uint8Array {
|
||||||
if (_globalThis.Buffer) {
|
if (globalThis.Buffer) {
|
||||||
return Uint8Array.from(_globalThis.Buffer.from(b64, "base64"));
|
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
||||||
} else {
|
} else {
|
||||||
const bin = _globalThis.atob(b64);
|
const bin = globalThis.atob(b64);
|
||||||
const arr = new Uint8Array(bin.length);
|
const arr = new Uint8Array(bin.length);
|
||||||
for (let i = 0; i < bin.length; ++i) {
|
for (let i = 0; i < bin.length; ++i) {
|
||||||
arr[i] = bin.charCodeAt(i);
|
arr[i] = bin.charCodeAt(i);
|
||||||
@@ -273,14 +273,14 @@ function bytesFromBase64(b64: string): Uint8Array {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function base64FromBytes(arr: Uint8Array): string {
|
function base64FromBytes(arr: Uint8Array): string {
|
||||||
if (_globalThis.Buffer) {
|
if (globalThis.Buffer) {
|
||||||
return _globalThis.Buffer.from(arr).toString("base64");
|
return globalThis.Buffer.from(arr).toString("base64");
|
||||||
} else {
|
} else {
|
||||||
const bin: string[] = [];
|
const bin: string[] = [];
|
||||||
arr.forEach((byte) => {
|
arr.forEach((byte) => {
|
||||||
bin.push(String.fromCharCode(byte));
|
bin.push(String.fromCharCode(byte));
|
||||||
});
|
});
|
||||||
return _globalThis.btoa(bin.join(""));
|
return globalThis.btoa(bin.join(""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4324,7 +4324,7 @@ export const GeneratedCodeInfo_Annotation = {
|
|||||||
declare var self: any | undefined;
|
declare var self: any | undefined;
|
||||||
declare var window: any | undefined;
|
declare var window: any | undefined;
|
||||||
declare var global: any | undefined;
|
declare var global: any | undefined;
|
||||||
var _globalThis: any = (() => {
|
var globalThis: any = (() => {
|
||||||
if (typeof globalThis !== "undefined") return globalThis;
|
if (typeof globalThis !== "undefined") return globalThis;
|
||||||
if (typeof self !== "undefined") return self;
|
if (typeof self !== "undefined") return self;
|
||||||
if (typeof window !== "undefined") return window;
|
if (typeof window !== "undefined") return window;
|
||||||
@@ -4333,10 +4333,10 @@ var _globalThis: any = (() => {
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
function bytesFromBase64(b64: string): Uint8Array {
|
function bytesFromBase64(b64: string): Uint8Array {
|
||||||
if (_globalThis.Buffer) {
|
if (globalThis.Buffer) {
|
||||||
return Uint8Array.from(_globalThis.Buffer.from(b64, "base64"));
|
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
||||||
} else {
|
} else {
|
||||||
const bin = _globalThis.atob(b64);
|
const bin = globalThis.atob(b64);
|
||||||
const arr = new Uint8Array(bin.length);
|
const arr = new Uint8Array(bin.length);
|
||||||
for (let i = 0; i < bin.length; ++i) {
|
for (let i = 0; i < bin.length; ++i) {
|
||||||
arr[i] = bin.charCodeAt(i);
|
arr[i] = bin.charCodeAt(i);
|
||||||
@@ -4346,14 +4346,14 @@ function bytesFromBase64(b64: string): Uint8Array {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function base64FromBytes(arr: Uint8Array): string {
|
function base64FromBytes(arr: Uint8Array): string {
|
||||||
if (_globalThis.Buffer) {
|
if (globalThis.Buffer) {
|
||||||
return _globalThis.Buffer.from(arr).toString("base64");
|
return globalThis.Buffer.from(arr).toString("base64");
|
||||||
} else {
|
} else {
|
||||||
const bin: string[] = [];
|
const bin: string[] = [];
|
||||||
arr.forEach((byte) => {
|
arr.forEach((byte) => {
|
||||||
bin.push(String.fromCharCode(byte));
|
bin.push(String.fromCharCode(byte));
|
||||||
});
|
});
|
||||||
return _globalThis.btoa(bin.join(""));
|
return globalThis.btoa(bin.join(""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user