@sentio/sdk 1.4.2 → 1.5.2

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.
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cleanTest = void 0;
4
+ var clean_test_1 = require("./clean-test");
5
+ Object.defineProperty(exports, "cleanTest", { enumerable: true, get: function () { return clean_test_1.cleanTest; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAA/B,uGAAA,SAAS,OAAA"}
@@ -7,23 +7,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const chai_1 = require("chai");
8
8
  const __1 = require("..");
9
9
  const long_1 = __importDefault(require("long"));
10
- const clean_test_1 = require("./clean-test");
11
10
  const numberish_1 = require("../numberish");
12
11
  const util_1 = require("util");
12
+ const test_processor_server_1 = require("./test-processor-server");
13
13
  describe('Test Solana Example', () => {
14
- const service = new __1.ProcessorServiceImpl(undefined);
15
- const testContext = {};
16
- before(async () => {
17
- (0, clean_test_1.cleanTest)();
18
- require('./mirrorworld');
19
- require('./wormhole-token-bridge');
20
- await service.start({ templateInstances: [] }, testContext);
14
+ const service = new test_processor_server_1.TestProcessorServer();
15
+ beforeAll(async () => {
16
+ service.setup(['./mirrorworld', './wormhole-token-bridge']);
17
+ await service.start({ templateInstances: [] });
21
18
  });
22
- it('check configuration ', async () => {
23
- const config = await service.getConfig({}, testContext);
19
+ test('check configuration ', async () => {
20
+ const config = await service.getConfig({});
24
21
  (0, chai_1.expect)(config.contractConfigs).length(3);
25
22
  });
26
- it('Check mirrorworld instruction dispatch', async () => {
23
+ test('Check mirrorworld instruction dispatch', async () => {
27
24
  const request = {
28
25
  instructions: [
29
26
  {
@@ -33,12 +30,12 @@ describe('Test Solana Example', () => {
33
30
  },
34
31
  ],
35
32
  };
36
- const res = await service.processInstructions(request, testContext);
33
+ const res = await service.processInstructions(request);
37
34
  (0, chai_1.expect)(res.result?.counters).length(3);
38
35
  (0, chai_1.expect)(res.result?.gauges).length(0);
39
36
  (0, chai_1.expect)((0, numberish_1.MetricValueToNumber)(res.result?.counters[0].metricValue)).equal(5000000000n);
40
37
  });
41
- it('Check wormhole token bridge instruction dispatch', async () => {
38
+ test('Check wormhole token bridge instruction dispatch', async () => {
42
39
  const request = {
43
40
  instructions: [
44
41
  {
@@ -53,14 +50,14 @@ describe('Test Solana Example', () => {
53
50
  },
54
51
  ],
55
52
  };
56
- const res = await service.processInstructions(request, testContext);
53
+ const res = await service.processInstructions(request);
57
54
  (0, chai_1.expect)(res.result?.counters).length(2);
58
55
  (0, chai_1.expect)(res.result?.gauges).length(0);
59
56
  (0, chai_1.expect)(res.result?.counters[0].metadata?.blockNumber.toInt()).equal(0);
60
- (0, chai_1.expect)((0, numberish_1.MetricValueToNumber)(res.result?.counters[0].metricValue)).equal(1000000);
57
+ (0, chai_1.expect)((0, numberish_1.MetricValueToNumber)(res.result?.counters[0].metricValue)).equal(1000000n);
61
58
  (0, chai_1.expect)(res.result?.counters[0].runtimeInfo?.from).equals(__1.HandlerType.INSTRUCTION);
62
59
  });
63
- it('Check SPLToken parsed instruction dispatch', async () => {
60
+ test('Check SPLToken parsed instruction dispatch', async () => {
64
61
  const parsedIns = {
65
62
  info: {
66
63
  account: '2SDN4vEJdCdW3pGyhx2km9gB3LeHzMGLrG2j4uVNZfrx',
@@ -80,7 +77,7 @@ describe('Test Solana Example', () => {
80
77
  },
81
78
  ],
82
79
  };
83
- const res = await service.processInstructions(request, testContext);
80
+ const res = await service.processInstructions(request);
84
81
  (0, chai_1.expect)(res.result?.counters).length(1);
85
82
  (0, chai_1.expect)(res.result?.gauges).length(0);
86
83
  (0, chai_1.expect)(res.result?.counters[0].metadata?.blockNumber.toInt()).equal(0);
@@ -1 +1 @@
1
- {"version":3,"file":"solana.test.js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,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACtE,IAAA,aAAM,EAAC,IAAA,+BAAmB,EAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QACtF,IAAA,aAAM,EAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,eAAW,CAAC,WAAW,CAAC,CAAA;IACnF,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { ProcessBlocksRequest, ProcessBlocksResponse, ProcessConfigRequest, ProcessConfigResponse, ProcessInstructionsRequest, ProcessInstructionsResponse, ProcessLogsRequest, ProcessLogsResponse, ProcessorServiceImpl, ProcessorServiceImplementation, ProcessTransactionsRequest, ProcessTransactionsResponse, StartRequest } from '@sentio/sdk';
2
+ import { CallContext } from 'nice-grpc-common';
3
+ import { Empty } from '../gen/google/protobuf/empty';
4
+ export declare class TestProcessorServer implements ProcessorServiceImplementation {
5
+ service: ProcessorServiceImpl;
6
+ setup(processorPath?: string | string[]): void;
7
+ start(request?: StartRequest, context?: CallContext): Promise<Empty>;
8
+ stop(request: Empty, context?: CallContext): Promise<Empty>;
9
+ getConfig(request: ProcessConfigRequest, context?: CallContext): Promise<ProcessConfigResponse>;
10
+ processBlocks(request: ProcessBlocksRequest, context?: CallContext): Promise<ProcessBlocksResponse>;
11
+ processInstructions(request: ProcessInstructionsRequest, context?: CallContext): Promise<ProcessInstructionsResponse>;
12
+ processLogs(request: ProcessLogsRequest, context?: CallContext): Promise<ProcessLogsResponse>;
13
+ processTransactions(request: ProcessTransactionsRequest, context?: CallContext): Promise<ProcessTransactionsResponse>;
14
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.TestProcessorServer = void 0;
30
+ const sdk_1 = require("@sentio/sdk");
31
+ const clean_test_1 = require("./clean-test");
32
+ const path_1 = __importDefault(require("path"));
33
+ const fs = __importStar(require("fs-extra"));
34
+ const TEST_CONTEXT = {};
35
+ class TestProcessorServer {
36
+ service = new sdk_1.ProcessorServiceImpl();
37
+ setup(processorPath = []) {
38
+ (0, clean_test_1.cleanTest)();
39
+ const fullPath = path_1.default.resolve('chains-config.json');
40
+ const chainsConfig = fs.readJsonSync(fullPath);
41
+ (0, sdk_1.setProvider)(chainsConfig);
42
+ if (!Array.isArray(processorPath)) {
43
+ processorPath = [processorPath];
44
+ }
45
+ for (const path of processorPath) {
46
+ require(path);
47
+ }
48
+ }
49
+ start(request = { templateInstances: [] }, context = TEST_CONTEXT) {
50
+ return this.service.start(request, context);
51
+ }
52
+ stop(request, context = TEST_CONTEXT) {
53
+ return this.service.stop(request, context);
54
+ }
55
+ getConfig(request, context = TEST_CONTEXT) {
56
+ return this.service.getConfig(request, context);
57
+ }
58
+ processBlocks(request, context = TEST_CONTEXT) {
59
+ return this.service.processBlocks(request, context);
60
+ }
61
+ processInstructions(request, context = TEST_CONTEXT) {
62
+ return this.service.processInstructions(request, context);
63
+ }
64
+ processLogs(request, context = TEST_CONTEXT) {
65
+ return this.service.processLogs(request, context);
66
+ }
67
+ processTransactions(request, context = TEST_CONTEXT) {
68
+ return this.service.processTransactions(request, context);
69
+ }
70
+ }
71
+ exports.TestProcessorServer = TestProcessorServer;
72
+ //# sourceMappingURL=test-processor-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-processor-server.js","sourceRoot":"","sources":["../../src/test/test-processor-server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAeoB;AACpB,6CAAwC;AACxC,gDAAuB;AACvB,6CAA8B;AAK9B,MAAM,YAAY,GAA6B,EAAE,CAAA;AAEjD,MAAa,mBAAmB;IAC9B,OAAO,GAAG,IAAI,0BAAoB,EAAE,CAAA;IAEpC,KAAK,CAAC,gBAAmC,EAAE;QACzC,IAAA,sBAAS,GAAE,CAAA;QACX,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAA;QACnD,MAAM,YAAY,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAA;QAC9C,IAAA,iBAAW,EAAC,YAAY,CAAC,CAAA;QACzB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;YACjC,aAAa,GAAG,CAAC,aAAa,CAAC,CAAA;SAChC;QACD,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE;YAChC,OAAO,CAAC,IAAI,CAAC,CAAA;SACd;IACH,CAAC;IAED,KAAK,CAAC,UAAwB,EAAE,iBAAiB,EAAE,EAAE,EAAE,EAAE,OAAO,GAAG,YAAY;QAC7E,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC7C,CAAC;IAED,IAAI,CAAC,OAAc,EAAE,OAAO,GAAG,YAAY;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC5C,CAAC;IAED,SAAS,CAAC,OAA6B,EAAE,OAAO,GAAG,YAAY;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACjD,CAAC;IAED,aAAa,CAAC,OAA6B,EAAE,OAAO,GAAG,YAAY;QACjE,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACrD,CAAC;IAED,mBAAmB,CACjB,OAAmC,EACnC,OAAO,GAAG,YAAY;QAEtB,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC3D,CAAC;IAED,WAAW,CAAC,OAA2B,EAAE,OAAO,GAAG,YAAY;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACnD,CAAC;IAED,mBAAmB,CACjB,OAAmC,EACnC,OAAO,GAAG,YAAY;QAEtB,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC3D,CAAC;CACF;AAjDD,kDAiDC"}
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "start_js": "node dist/processor.js ../examples/x2y2/dist/lib.js",
12
12
  "ts-start": "ts-node --files src/processor-runner.ts ./src/anyswap/src/processor.ts",
13
13
  "cli": "yarn build && node dist/cli/cli.js",
14
- "test": "ts-mocha --paths src/**/*.test.ts src/*.test.ts",
14
+ "test": "jest src/**/*.test.ts",
15
15
  "gen_test_abi": "yarn gen_solana_abi",
16
16
  "gen_bultin_evm": "typechain --target dist/target-ethers-sentio --out-dir src/builtin/internal 'src/abis/*.json'",
17
17
  "gen_solana_abi": "ts-node src/cli/solana-code-gen.ts src/test types"
@@ -20,7 +20,7 @@
20
20
  "processor-runner": "./dist/processor-runner.js",
21
21
  "sentio": "./dist/cli/cli.js"
22
22
  },
23
- "version": "1.4.2",
23
+ "version": "1.5.2",
24
24
  "dependencies": {
25
25
  "@ethersproject/providers": "~5.7.0",
26
26
  "@project-serum/anchor": "^0.25.0",
@@ -28,6 +28,7 @@
28
28
  "@typechain/ethers-v5": "^10.0.0",
29
29
  "@types/bn.js": "^5.1.0",
30
30
  "@types/node-fetch": "^2.6.2",
31
+ "bignumber.js": "^9.1.0",
31
32
  "bn.js": "^5.2.1",
32
33
  "bs58": "^5.0.0",
33
34
  "command-line-args": "^5.2.1",
@@ -52,14 +53,14 @@
52
53
  "@types/expect": "^24.3.0",
53
54
  "@types/fs-extra": "^9.0.13",
54
55
  "@types/google-protobuf": "^3.15.6",
56
+ "@types/jest": "^29.0.0",
55
57
  "@types/js-yaml": "^4.0.5",
56
58
  "@types/mkdirp": "^1.0.2",
57
- "@types/mocha": "^9.1.1",
58
59
  "@types/node": "^18.0.4",
59
60
  "chai": "^4.3.6",
60
- "mocha": "^10.0.0",
61
+ "jest": "^28.0.1",
61
62
  "semantic-release": "^19.0.5",
62
- "ts-mocha": "^10.0.0",
63
+ "ts-jest": "^28.0.8",
63
64
  "ts-node": "^10.8.0",
64
65
  "tsconfig-paths": "^4.0.0",
65
66
  "typescript": "^4.8.0"