@instadapp/interop-x 0.0.0-dev.28f049d → 0.0.0-dev.326bdca

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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instadapp/interop-x",
3
- "version": "0.0.0-dev.28f049d",
3
+ "version": "0.0.0-dev.326bdca",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -7,7 +7,7 @@ exports.buildGnosisAction = void 0;
7
7
  const ethers_multisend_1 = require("ethers-multisend");
8
8
  const actions_1 = __importDefault(require("./actions"));
9
9
  const buildGnosisAction = async (transaction, type) => {
10
- type = type || transaction.sourceStatus === 'pending' ? 'source' : 'target';
10
+ type = type || transaction.sourceStatus === 'success' ? 'target' : 'source';
11
11
  if (actions_1.default.hasOwnProperty(transaction.action)) {
12
12
  const { transactions, logs } = await actions_1.default[transaction.action](transaction, type);
13
13
  return {
package/dist/src/index.js CHANGED
@@ -13,7 +13,7 @@ const package_json_1 = __importDefault(require("../package.json"));
13
13
  dotenv_1.default.config();
14
14
  const logger_1 = __importDefault(require("@/logger"));
15
15
  const logger = new logger_1.default('Process');
16
- const GIT_SHORT_HASH = '28f049d';
16
+ const GIT_SHORT_HASH = '326bdca';
17
17
  const printUsage = () => {
18
18
  console.log();
19
19
  console.log(`Interop X Node (v${package_json_1.default.version} - rev.${GIT_SHORT_HASH})`);
@@ -72,7 +72,9 @@ const utils_1 = require("./utils");
72
72
  async function main() {
73
73
  (0, net_1.startPeer)({});
74
74
  const tasks = new tasks_1.Tasks();
75
- tasks.start();
75
+ setTimeout(() => {
76
+ tasks.start();
77
+ }, 10000);
76
78
  (0, api_1.startApiServer)();
77
79
  net_1.protocol.on('TransactionStatus', async (payload) => {
78
80
  if (!net_1.peerPool.isLeadNode(payload.peerId)) {
@@ -30,7 +30,7 @@ class ProccessBridgeRequestEvents extends BaseTask_1.BaseTask {
30
30
  where: {
31
31
  status: 'pending',
32
32
  sourceStatus: 'uninitialised',
33
- sourceCreatedAt: {
33
+ createdAt: {
34
34
  [sequelize_1.Op.gte]: new Date(Date.now() - 12 * 60 * 60 * 1000),
35
35
  },
36
36
  sourceDelayUntil: {
@@ -39,7 +39,7 @@ class ProccessBridgeRequestEvents extends BaseTask_1.BaseTask {
39
39
  [sequelize_1.Op.lt]: new Date(),
40
40
  }
41
41
  },
42
- sourceBlockNumber: {
42
+ requestBlockNumber: {
43
43
  [sequelize_1.Op.lt]: blockNumber - 12,
44
44
  },
45
45
  sourceChainId: this.chainId,
@@ -7,6 +7,7 @@ exports.Tasks = void 0;
7
7
  const AutoUpdateTask_1 = __importDefault(require("./AutoUpdateTask"));
8
8
  const SyncBridgeRequestEvents_1 = __importDefault(require("./InteropXContract/SyncBridgeRequestEvents"));
9
9
  const ProcessBridgeRequestEvents_1 = __importDefault(require("./InteropXContract/ProcessBridgeRequestEvents"));
10
+ const waait_1 = __importDefault(require("waait"));
10
11
  class Tasks {
11
12
  constructor() {
12
13
  this.tasks = [
@@ -23,6 +24,7 @@ class Tasks {
23
24
  for (const task of this.tasks) {
24
25
  try {
25
26
  task.start();
27
+ await (0, waait_1.default)(1000);
26
28
  }
27
29
  catch (error) {
28
30
  console.error(`Error starting task: ${task.constructor.name}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instadapp/interop-x",
3
- "version": "0.0.0-dev.28f049d",
3
+ "version": "0.0.0-dev.326bdca",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -3,7 +3,7 @@ import { encodeMulti } from "ethers-multisend";
3
3
  import actions from "./actions";
4
4
 
5
5
  export const buildGnosisAction = async (transaction: Transaction, type?: 'source' | 'target') => {
6
- type = type || transaction.sourceStatus === 'pending' ? 'source' : 'target';
6
+ type = type || transaction.sourceStatus === 'success' ? 'target' : 'source';
7
7
 
8
8
  if (actions.hasOwnProperty(transaction.action)) {
9
9
 
package/src/index.ts CHANGED
@@ -89,7 +89,9 @@ async function main() {
89
89
 
90
90
  const tasks = new Tasks()
91
91
 
92
- tasks.start();
92
+ setTimeout(() => {
93
+ tasks.start();
94
+ }, 10000)
93
95
 
94
96
  startApiServer()
95
97
 
@@ -39,7 +39,7 @@ class ProccessBridgeRequestEvents extends BaseTask {
39
39
  where: {
40
40
  status: 'pending',
41
41
  sourceStatus: 'uninitialised',
42
- sourceCreatedAt: {
42
+ createdAt: {
43
43
  [Op.gte]: new Date(Date.now() - 12 * 60 * 60 * 1000),
44
44
  },
45
45
  sourceDelayUntil: {
@@ -48,7 +48,7 @@ class ProccessBridgeRequestEvents extends BaseTask {
48
48
  [Op.lt]: new Date(),
49
49
  }
50
50
  },
51
- sourceBlockNumber: {
51
+ requestBlockNumber: {
52
52
  [Op.lt]: blockNumber - 12,
53
53
  },
54
54
  sourceChainId: this.chainId,
@@ -5,9 +5,10 @@ import AutoUpdateTask from "./AutoUpdateTask";
5
5
 
6
6
  import SyncBridgeRequestEvents from "./InteropXContract/SyncBridgeRequestEvents";
7
7
  import ProccessBridgeRequestEvents from "./InteropXContract/ProcessBridgeRequestEvents";
8
+ import wait from "waait";
8
9
 
9
10
  export class Tasks {
10
-
11
+
11
12
  tasks: BaseTask[] = [
12
13
  // new SyncTransactionStatusTask(),
13
14
  new AutoUpdateTask(),
@@ -25,6 +26,7 @@ export class Tasks {
25
26
  for (const task of this.tasks) {
26
27
  try {
27
28
  task.start();
29
+ await wait(1000)
28
30
  } catch (error) {
29
31
  console.error(`Error starting task: ${task.constructor.name}`);
30
32
  }