godprotocol 1.2.35 → 1.2.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Objects/Manager.js +8 -29
- package/Objects/Oracle.js +1 -1
- package/package.json +1 -1
package/Objects/Manager.js
CHANGED
|
@@ -379,10 +379,14 @@ class Manager {
|
|
|
379
379
|
this.served = true;
|
|
380
380
|
this.oracle = this.options.oracle;
|
|
381
381
|
if (this.options.init_account) {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
382
|
+
console.log(
|
|
383
|
+
"Initiate manager account...",
|
|
384
|
+
this.options.init_account.name
|
|
385
|
+
);
|
|
386
|
+
// await this.add_account(this.options.init_account.name, {
|
|
387
|
+
// password: this.options.init_account.password,
|
|
388
|
+
// init: true,
|
|
389
|
+
// });
|
|
386
390
|
|
|
387
391
|
cb && cb();
|
|
388
392
|
}
|
|
@@ -406,18 +410,6 @@ class Manager {
|
|
|
406
410
|
return acc;
|
|
407
411
|
};
|
|
408
412
|
|
|
409
|
-
get_from_repo = async (address, options = {}) => {
|
|
410
|
-
let acc = this.get_acc(options);
|
|
411
|
-
|
|
412
|
-
address = `.storage/${acc}/${address}/__literal__`;
|
|
413
|
-
let content = await this.oracle.get_from_repos(address, {
|
|
414
|
-
count: 1,
|
|
415
|
-
args: options,
|
|
416
|
-
});
|
|
417
|
-
|
|
418
|
-
return content && JSON.parse(content);
|
|
419
|
-
};
|
|
420
|
-
|
|
421
413
|
get_acc = (options) => {
|
|
422
414
|
let acc = options.account;
|
|
423
415
|
if (!acc) {
|
|
@@ -429,19 +421,6 @@ class Manager {
|
|
|
429
421
|
return acc;
|
|
430
422
|
};
|
|
431
423
|
|
|
432
|
-
set_to_repo = async (address, content, options = {}) => {
|
|
433
|
-
let acc = this.get_acc(options);
|
|
434
|
-
|
|
435
|
-
address = `.storage/${acc}/${address}/__literal__`;
|
|
436
|
-
let response = await this.oracle.set_to_repos(
|
|
437
|
-
address,
|
|
438
|
-
JSON.stringify(content),
|
|
439
|
-
{ count: 1, args: options }
|
|
440
|
-
);
|
|
441
|
-
|
|
442
|
-
return response;
|
|
443
|
-
};
|
|
444
|
-
|
|
445
424
|
get_account = async (name) => {
|
|
446
425
|
let acc = this.accounts[name];
|
|
447
426
|
if (!acc) {
|
package/Objects/Oracle.js
CHANGED
package/package.json
CHANGED