forked from OpenST/platform-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_sieze.js
93 lines (92 loc) · 3.11 KB
/
test_sieze.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// /****
// GetTokenWorkingProcess = require('./lib/executeTransactionManagement/GetTokenWorkingProcess')
// new GetTokenWorkingProcess({ tokenId: 1012 }).perform().then(console.log)
//
//
// InitProcessKlass = require('./lib/executeTransactionManagement/initProcess')
// InitProcess = new InitProcessKlass({processId: 15})
// InitProcess.perform().then(console.log)
//
// ****/
//
// rootPrefix = '.';
// connectionTimeoutConst = require(rootPrefix + '/lib/globalConstant/connectionTimeout');
// coreConstants = require(rootPrefix + '/config/coreConstants');
// basicHelper = require(rootPrefix + '/helpers/basic');
// ByChainIdKlass = require(rootPrefix + '/helpers/configStrategy/ByChainId');
// rabbitmqProvider = require(rootPrefix + '/lib/providers/rabbitmq');
// rabbitmqConstant = require(rootPrefix + '/lib/globalConstant/rabbitmq'),
// OSTBase = require('@ostdotcom/base');
//
// require(rootPrefix + '/lib/executeTransactionManagement/GetPublishDetails');
//
// chainId = 2000;
// ic = null;
//
// async function getConfig() {
// if (ic) return ic;
//
// let b = new ByChainIdKlass(chainId);
// let config = await b.getComplete();
//
// let InstanceComposer = OSTBase.InstanceComposer;
// ic = new InstanceComposer(config.data);
// return ic;
// }
// function getEpheAddr() {
// var addresses = [
// '0x416a20d9339ab77582252a4d398269d0710f5c12',
// '0xb45d7ec6199c347374332c60fe3a2f20c6d7da91',
// '0x9266f942c4674b9471b8eb903478eb325056dd30',
// '0x48803484991537a70aa376b4239029cd7787a37b',
// '0x0340b352ecdb23992e65d8296d66ac99f1e3e269'
// ];
//
// let min = 0;
// let max = addresses.length;
// let randomNo = Math.floor(Math.random() * (+max - +min) + +min);
//
// return addresses[randomNo];
// }
//
// function getNotiInstance() {
// return rabbitmqProvider.getInstance(rabbitmqConstant.globalRabbitmqKind, {
// chainId: chainId,
// connectionWaitSeconds: connectionTimeoutConst.crons,
// switchConnectionWaitSeconds: connectionTimeoutConst.switchConnectionCrons
// });
// }
//
// async function getPublishDetails() {
// await getConfig();
// let GetTopicNameToPublishObj = ic.getShadowedClassFor(coreConstants.icNameSpace, 'ExTxGetPublishDetails');
// return new GetTopicNameToPublishObj({ tokenId: 1001, ephemeralAddress: getEpheAddr() }).perform();
// }
//
// async function publish() {
// let ostNotification = await getNotiInstance();
// for (let i = 0; i < 1; i++) {
// let publishDetails = await getPublishDetails();
// let messageParams = {
// topics: [publishDetails.topicName],
// publisher: 'abcd',
// message: {
// kind: 'execute_transaction',
// payload: {
// chainId: 2000,
// tokenAddressId: publishDetails.tokenAddressId,
// sequence: i,
// transactionMetaId: 1
// }
// }
// };
// await basicHelper.sleep(100);
// let setToRMQ = await ostNotification.publishEvent.perform(messageParams);
// console.log('topicName-----', publishDetails.topicName, 'setToRMQ----', setToRMQ);
// }
// return true;
// }
//
// publish().then(function() {
// //process.exit(0);
// });