wao 0.31.2 → 0.32.0

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/cjs/hb.js CHANGED
@@ -942,14 +942,13 @@ var HB = /*#__PURE__*/function () {
942
942
  pid,
943
943
  from,
944
944
  to,
945
- limit,
946
945
  params,
947
946
  res,
948
947
  _args27 = arguments;
949
948
  return _regeneratorRuntime().wrap(function _callee26$(_context26) {
950
949
  while (1) switch (_context26.prev = _context26.next) {
951
950
  case 0:
952
- _ref11 = _args27.length > 0 && _args27[0] !== undefined ? _args27[0] : {}, pid = _ref11.pid, from = _ref11.from, to = _ref11.to, limit = _ref11.limit;
951
+ _ref11 = _args27.length > 0 && _args27[0] !== undefined ? _args27[0] : {}, pid = _ref11.pid, from = _ref11.from, to = _ref11.to;
953
952
  params = "target=".concat(pid);
954
953
  if ((0, _ramda.isNotNil)(from)) params += "&from=".concat(from);
955
954
  if ((0, _ramda.isNotNil)(to)) params += "&to=".concat(to);
@@ -971,8 +970,7 @@ var HB = /*#__PURE__*/function () {
971
970
  return _this.messages({
972
971
  pid: pid,
973
972
  from: from2,
974
- to: to,
975
- limit: limit
973
+ to: to
976
974
  });
977
975
  case 3:
978
976
  return _context25.abrupt("return", _context25.sent);
package/cjs/hyperbeam.js CHANGED
@@ -36,8 +36,6 @@ var HyperBEAM = exports["default"] = /*#__PURE__*/function () {
36
36
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
37
37
  _ref$port = _ref.port,
38
38
  port = _ref$port === void 0 ? 10001 : _ref$port,
39
- _ref$cu = _ref.cu,
40
- cu = _ref$cu === void 0 ? 6363 : _ref$cu,
41
39
  _ref$as = _ref.as,
42
40
  as = _ref$as === void 0 ? [] : _ref$as,
43
41
  bundler = _ref.bundler,
@@ -95,7 +93,7 @@ var HyperBEAM = exports["default"] = /*#__PURE__*/function () {
95
93
  _iterator.f();
96
94
  }
97
95
  }
98
- this.cu = cu;
96
+ //this.cu = cu
99
97
  this.store_prefix = store_prefix ? "cache-mainnet-" + Math.floor(Math.random() * 10000000) : "cache-mainnet";
100
98
  this.p4_lua = p4_lua;
101
99
  this.simple_pay = simple_pay;
@@ -1,3 +1,4 @@
1
+
1
2
  #### 1. Create an APP
2
3
 
3
4
  ```bash
@@ -17,7 +18,7 @@ Go to [the web app](https://preview.wao.eco) and open `Networks`, then click `Pr
17
18
  #### 4. Run Test
18
19
 
19
20
  ```bash
20
- yarn test test/test.js
21
+ yarn test test/hyperbeam.test.js
21
22
  ```
22
23
 
23
24
  #### 5. Deploy a Process to AO Testnet
@@ -9,6 +9,6 @@
9
9
  "deploy": "node scripts/deploy.js"
10
10
  },
11
11
  "dependencies": {
12
- "wao": "^0.31.2"
12
+ "wao": "^0.32.0"
13
13
  }
14
14
  }
@@ -0,0 +1,23 @@
1
+ import assert from "assert"
2
+ import { describe, it } from "node:test"
3
+ import { readFileSync } from "fs"
4
+ import { resolve } from "path"
5
+
6
+ import { AO, acc } from "wao/test" // in-memory test
7
+
8
+ const src_data = readFileSync(
9
+ resolve(import.meta.dirname, "../src/counter.lua"),
10
+ "utf8"
11
+ )
12
+
13
+ describe("WAO Legacynet", function () {
14
+ // lightning-fast testing in memory
15
+ it("should spawn a process and send messages in memory", async () => {
16
+ const ao = await new AO().init(acc[0])
17
+ const { p, pid } = await ao.deploy({ src_data, scheduler: acc[0].addr })
18
+
19
+ assert.equal(await p.d("Hello", false), "Hello, World!")
20
+ assert.equal(await p.m("Inc", false), "Incremented!")
21
+ assert.equal(await p.d("Get", false), "1")
22
+ })
23
+ })
@@ -11,17 +11,7 @@ const src_data = readFileSync(
11
11
  "utf8"
12
12
  )
13
13
 
14
- describe("WAO", function () {
15
- // lightning-fast testing in memory
16
- it("should spawn a process and send messages in memory", async () => {
17
- const ao = await new AO().init(acc[0])
18
- const { p, pid } = await ao.deploy({ src_data, scheduler: acc[0].addr })
19
-
20
- assert.equal(await p.d("Hello", false), "Hello, World!")
21
- assert.equal(await p.m("Inc", false), "Incremented!")
22
- assert.equal(await p.d("Get", false), "1")
23
- })
24
-
14
+ describe("WAO the Web", function () {
25
15
  // WAO Proxy must be running on your computer => "npx wao proxy"
26
16
  it("should spawn a process and send messages to the browser", async () => {
27
17
  // connect with 4000 - 4004 ports
package/esm/hb.js CHANGED
@@ -264,7 +264,7 @@ class HB {
264
264
  return await this.getJSON({ path: `/${pid}/slot${path}` })
265
265
  }
266
266
 
267
- async messages({ pid, from, to, limit } = {}) {
267
+ async messages({ pid, from, to } = {}) {
268
268
  let params = `target=${pid}`
269
269
  if (isNotNil(from)) params += `&from=${from}`
270
270
  if (isNotNil(to)) params += `&to=${to}`
@@ -275,7 +275,7 @@ class HB {
275
275
  if (res.page_info.has_next_page) {
276
276
  res.next = async () => {
277
277
  const from2 = last(res.edges).cursor + 1
278
- return await this.messages({ pid, from: from2, to, limit })
278
+ return await this.messages({ pid, from: from2, to })
279
279
  }
280
280
  }
281
281
  return res
package/esm/hyperbeam.js CHANGED
@@ -12,7 +12,7 @@ export default class HyperBEAM {
12
12
  static OPERATOR = Symbol("operator")
13
13
  constructor({
14
14
  port = 10001,
15
- cu = 6363,
15
+ //cu = 6363,
16
16
  as = [],
17
17
  bundler,
18
18
  gateway,
@@ -52,7 +52,7 @@ export default class HyperBEAM {
52
52
  }
53
53
  }
54
54
  }
55
- this.cu = cu
55
+ //this.cu = cu
56
56
  this.store_prefix = store_prefix
57
57
  ? "cache-mainnet-" + Math.floor(Math.random() * 10000000)
58
58
  : "cache-mainnet"
@@ -1,3 +1,4 @@
1
+
1
2
  #### 1. Create an APP
2
3
 
3
4
  ```bash
@@ -17,7 +18,7 @@ Go to [the web app](https://preview.wao.eco) and open `Networks`, then click `Pr
17
18
  #### 4. Run Test
18
19
 
19
20
  ```bash
20
- yarn test test/test.js
21
+ yarn test test/hyperbeam.test.js
21
22
  ```
22
23
 
23
24
  #### 5. Deploy a Process to AO Testnet
@@ -9,6 +9,6 @@
9
9
  "deploy": "node scripts/deploy.js"
10
10
  },
11
11
  "dependencies": {
12
- "wao": "^0.31.2"
12
+ "wao": "^0.32.0"
13
13
  }
14
14
  }
@@ -0,0 +1,23 @@
1
+ import assert from "assert"
2
+ import { describe, it } from "node:test"
3
+ import { readFileSync } from "fs"
4
+ import { resolve } from "path"
5
+
6
+ import { AO, acc } from "wao/test" // in-memory test
7
+
8
+ const src_data = readFileSync(
9
+ resolve(import.meta.dirname, "../src/counter.lua"),
10
+ "utf8"
11
+ )
12
+
13
+ describe("WAO Legacynet", function () {
14
+ // lightning-fast testing in memory
15
+ it("should spawn a process and send messages in memory", async () => {
16
+ const ao = await new AO().init(acc[0])
17
+ const { p, pid } = await ao.deploy({ src_data, scheduler: acc[0].addr })
18
+
19
+ assert.equal(await p.d("Hello", false), "Hello, World!")
20
+ assert.equal(await p.m("Inc", false), "Incremented!")
21
+ assert.equal(await p.d("Get", false), "1")
22
+ })
23
+ })
@@ -11,17 +11,7 @@ const src_data = readFileSync(
11
11
  "utf8"
12
12
  )
13
13
 
14
- describe("WAO", function () {
15
- // lightning-fast testing in memory
16
- it("should spawn a process and send messages in memory", async () => {
17
- const ao = await new AO().init(acc[0])
18
- const { p, pid } = await ao.deploy({ src_data, scheduler: acc[0].addr })
19
-
20
- assert.equal(await p.d("Hello", false), "Hello, World!")
21
- assert.equal(await p.m("Inc", false), "Incremented!")
22
- assert.equal(await p.d("Get", false), "1")
23
- })
24
-
14
+ describe("WAO the Web", function () {
25
15
  // WAO Proxy must be running on your computer => "npx wao proxy"
26
16
  it("should spawn a process and send messages to the browser", async () => {
27
17
  // connect with 4000 - 4004 ports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wao",
3
- "version": "0.31.2",
3
+ "version": "0.32.0",
4
4
  "bin": {
5
5
  "wao": "./cjs/cli.js",
6
6
  "wao-esm": "./esm/cli.js"