godprotocol 1.0.74 → 1.0.751

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.
@@ -124,6 +124,11 @@ class Account extends Filesystem {
124
124
  obj.servers = this.servers;
125
125
  obj.name = this.name;
126
126
  obj.data_tracks = this.data_tracks;
127
+ obj.hash = this.hash;
128
+ obj.chain = this.chain.stringify();
129
+ obj.physical_address = this.physical_address;
130
+
131
+ return obj;
127
132
  };
128
133
 
129
134
  distribute = (data) => {
@@ -66,6 +66,8 @@ class Virtual_machine extends Opcodes {
66
66
 
67
67
  let context = this.get_context();
68
68
 
69
+ if (!context) return;
70
+
69
71
  context.add_tx(instruction);
70
72
 
71
73
  let chain;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "godprotocol",
3
- "version": "1.0.74",
3
+ "version": "1.0.751",
4
4
  "description": "A data mediator.",
5
5
  "main": "Index.js",
6
6
  "types": "index.d.ts",
@@ -7,7 +7,7 @@ let PORT = 1901,
7
7
  const cb = (res, data) => {
8
8
  if (typeof data !== "string") data = JSON.stringify(data);
9
9
 
10
- res.end(data);
10
+ res(data);
11
11
  };
12
12
 
13
13
  const create_server = async (initiator, serve) => {
@@ -43,11 +43,11 @@ const create_server = async (initiator, serve) => {
43
43
  let account = initiator.create_account(data.name, data.server);
44
44
  res.end(account.stringify(true));
45
45
  } else if (req.url === "/load") {
46
- initiator.load(data, (datagram) => cb(res, datagram));
46
+ initiator.load(data, (datagram) => cb(res.end, datagram));
47
47
  } else if (req.url === "/parse") {
48
- initiator.parse(data, (datagram) => cb(res, datagram));
48
+ initiator.parse(data, (datagram) => cb(res.end, datagram));
49
49
  } else if (req.url === "/run") {
50
- initiator.run(data, (datagram) => cb(res, datagram));
50
+ initiator.run(data, (datagram) => cb(res.end, datagram));
51
51
  }
52
52
  if (serve && req.headers.host !== `${serve.domain}:${serve.port}`)
53
53
  console.log(`services:${req.url}`);