godprotocol 1.2.16 → 1.2.18

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.
@@ -178,6 +178,10 @@ class Account extends Utils{
178
178
 
179
179
  await register(this)
180
180
 
181
+ if (res){
182
+ console.log(`Account:${this.name} initiation successful!`)
183
+ } else console.log(`Account:${this.name} initiation failed!`)
184
+
181
185
  return res;
182
186
  }
183
187
  }
package/Objects/Utils.js CHANGED
@@ -12,14 +12,14 @@ class Utils{
12
12
  }
13
13
 
14
14
  get_from_repo = async(address, options) =>{
15
- address = `./storage/${this.physical_address}/${address}/__literal__`
15
+ address = `.storage/${this.physical_address}/${address}/__literal__`
16
16
  let content = await this.manager.oracle.get_from_repos(address, {count: 1, args: options})
17
17
 
18
18
  return content && JSON.parse(content)
19
19
  }
20
20
 
21
21
  set_to_repo = async(address, content, options) =>{
22
- address = `./storage/${this.physical_address}/${address}/__literal__`
22
+ address = `.storage/${this.physical_address}/${address}/__literal__`
23
23
  let response = await this.manager.oracle.set_to_repos(address, JSON.stringify(content), {count: 1, args: options})
24
24
 
25
25
  return response
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "godprotocol",
3
- "version": "1.2.16",
3
+ "version": "1.2.18",
4
4
  "description": "A distributed computing environment",
5
5
  "main": "Index.js",
6
6
  "scripts": {
@@ -7,8 +7,8 @@ export const handle_routes = async (req, res, manager, app) => {
7
7
  try {
8
8
  // CORS
9
9
  res.setHeader('Access-Control-Allow-Origin', '*');
10
- res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
11
- res.setHeader('Access-Control-Allow-Methods', 'POST, GET, OPTIONS');
10
+ res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
11
+ res.setHeader('Access-Control-Allow-Headers', '*');
12
12
 
13
13
  if (req.method === 'OPTIONS') {
14
14
  res.writeHead(204);