dash 3.21.4 → 3.21.8
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/build/src/test/mocks/createAndAttachTransportMocksToClient.js +5 -2
- package/build/src/test/mocks/createAndAttachTransportMocksToClient.js.map +1 -1
- package/dist/src/SDK/SDK.d.ts +12 -12
- package/karma.conf.js +14 -7
- package/package.json +18 -15
- package/src/test/mocks/createAndAttachTransportMocksToClient.ts +25 -21
- package/webpack.base.config.js +5 -2
- package/webpack.config.js +3 -24
- package/dist/dash.min.js +0 -8
- package/dist/dash.min.js.LICENSE.txt +0 -47
|
@@ -58,10 +58,13 @@ function makeTxStreamEmitISLocksForTransactions(transportMock, txStreamMock) {
|
|
|
58
58
|
transportMock.sendTransaction.callsFake(function (txString) {
|
|
59
59
|
var transaction = new dashcore_lib_1.Transaction(txString);
|
|
60
60
|
var isLock = createFakeIntantLock_1.createFakeInstantLock(transaction.hash);
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
setImmediate(function () {
|
|
62
|
+
// Emit IS lock for the transaction
|
|
63
|
+
txStreamMock.emit(TxStreamMock.EVENTS.data, new TxStreamDataResponseMock({ instantSendLockMessages: [isLock.toBuffer()] }));
|
|
64
|
+
});
|
|
63
65
|
// Emit the same transaction back to the client so it will know about the change transaction
|
|
64
66
|
txStreamMock.emit(TxStreamMock.EVENTS.data, new TxStreamDataResponseMock({ rawTransactions: [transaction.toBuffer()] }));
|
|
67
|
+
return transaction.hash;
|
|
65
68
|
});
|
|
66
69
|
}
|
|
67
70
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAndAttachTransportMocksToClient.js","sourceRoot":"","sources":["../../../../src/test/mocks/createAndAttachTransportMocksToClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAoD;AACpD,+GAAyF;AACzF,gFAA0D;AAE1D,yEAAyE;AACzE,sGAAgF;AAChF,+DAA8D;AAE9D,yCAAwC;AACxC,IAAM,mBAAmB,GAAG,OAAO,CAAC,2EAA2E,CAAC,CAAC;AAEjH,aAAa;AACb,IAAM,YAAY,GAAG,OAAO,CAAC,iDAAiD,CAAC,CAAC;AAChF,aAAa;AACb,IAAM,wBAAwB,GAAG,OAAO,CAAC,6DAA6D,CAAC,CAAC;AACxG,aAAa;AACb,IAAM,aAAa,GAAG,OAAO,CAAC,kDAAkD,CAAC,CAAC;AAElF,SAAS,sCAAsC,CAAC,aAAa,EAAE,YAAY;
|
|
1
|
+
{"version":3,"file":"createAndAttachTransportMocksToClient.js","sourceRoot":"","sources":["../../../../src/test/mocks/createAndAttachTransportMocksToClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAoD;AACpD,+GAAyF;AACzF,gFAA0D;AAE1D,yEAAyE;AACzE,sGAAgF;AAChF,+DAA8D;AAE9D,yCAAwC;AACxC,IAAM,mBAAmB,GAAG,OAAO,CAAC,2EAA2E,CAAC,CAAC;AAEjH,aAAa;AACb,IAAM,YAAY,GAAG,OAAO,CAAC,iDAAiD,CAAC,CAAC;AAChF,aAAa;AACb,IAAM,wBAAwB,GAAG,OAAO,CAAC,6DAA6D,CAAC,CAAC;AACxG,aAAa;AACb,IAAM,aAAa,GAAG,OAAO,CAAC,kDAAkD,CAAC,CAAC;AAElF,SAAS,sCAAsC,CAAC,aAAa,EAAE,YAAY;IACzE,aAAa,CAAC,eAAe,CAAC,SAAS,CAAC,UAAC,QAAQ;QAC/C,IAAM,WAAW,GAAG,IAAI,0BAAW,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAM,MAAM,GAAG,4CAAqB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAEvD,YAAY,CAAC;YACX,mCAAmC;YACnC,YAAY,CAAC,IAAI,CACf,YAAY,CAAC,MAAM,CAAC,IAAI,EACxB,IAAI,wBAAwB,CAC1B,EAAE,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|
plugins: {
|
|
102
|
-
StandardPlugin: typeof import("@dashevo/wallet-
|
|
103
|
-
Worker: typeof import("@dashevo/wallet-
|
|
102
|
+
StandardPlugin: typeof import("@dashevo/wallet-libsrc/plugins/StandardPlugin");
|
|
103
|
+
Worker: typeof import("@dashevo/wallet-libsrc/plugins/Worker");
|
|
104
104
|
};
|
|
105
105
|
utils: {
|
|
106
106
|
extendTransactionsWithMetadata: (transactions: any, transactionsMetadata: any) => any[];
|
|
107
107
|
varIntSizeBytesFromLength: (length: any) => number;
|
|
108
|
-
calculateTransactionFees: typeof import("@dashevo/wallet-
|
|
109
|
-
categorizeTransactions: typeof import("@dashevo/wallet-
|
|
108
|
+
calculateTransactionFees: typeof import("@dashevo/wallet-libsrc/utils/calculateTransactionFees");
|
|
109
|
+
categorizeTransactions: typeof import("@dashevo/wallet-libsrc/utils/categorizeTransactions");
|
|
110
110
|
mnemonicToHDPrivateKey: (mnemonic: any, network?: any, passphrase?: string) => any;
|
|
111
111
|
generateNewMnemonic: () => any;
|
|
112
112
|
seedToHDPrivateKey: (seed: any, network?: string) => any;
|
|
113
113
|
mnemonicToWalletId: (mnemonic: any) => string;
|
|
114
|
-
filterTransactions: typeof import("@dashevo/wallet-
|
|
115
|
-
classifyAddresses: typeof import("@dashevo/wallet-
|
|
114
|
+
filterTransactions: typeof import("@dashevo/wallet-libsrc/utils/filterTransactions");
|
|
115
|
+
classifyAddresses: typeof import("@dashevo/wallet-libsrc/utils/classifyAddresses");
|
|
116
116
|
mnemonicToSeed: (mnemonic: any, password?: string) => any;
|
|
117
117
|
feeCalculation: (type?: string) => {
|
|
118
118
|
type: null;
|
|
@@ -132,12 +132,12 @@ export declare namespace SDK {
|
|
|
132
132
|
utxosValue: number;
|
|
133
133
|
};
|
|
134
134
|
doubleSha256: (data: any) => Buffer;
|
|
135
|
-
dashToDuffs: typeof import("@dashevo/wallet-
|
|
136
|
-
duffsToDash: typeof import("@dashevo/wallet-
|
|
137
|
-
fundWallet: typeof import("@dashevo/wallet-
|
|
138
|
-
getBytesOf: typeof import("@dashevo/wallet-
|
|
139
|
-
hasMethod: typeof import("@dashevo/wallet-
|
|
140
|
-
hasProp: typeof import("@dashevo/wallet-
|
|
135
|
+
dashToDuffs: typeof import("@dashevo/wallet-libsrc/utils/dashToDuffs");
|
|
136
|
+
duffsToDash: typeof import("@dashevo/wallet-libsrc/utils/duffsToDash");
|
|
137
|
+
fundWallet: typeof import("@dashevo/wallet-libsrc/utils/fundWallet");
|
|
138
|
+
getBytesOf: typeof import("@dashevo/wallet-libsrc/utils/getBytesOf");
|
|
139
|
+
hasMethod: typeof import("@dashevo/wallet-libsrc/utils/hasMethod");
|
|
140
|
+
hasProp: typeof import("@dashevo/wallet-libsrc/utils/hasProp");
|
|
141
141
|
sha256: (data: any) => Buffer;
|
|
142
142
|
hash: (alg: any, data: any) => Buffer;
|
|
143
143
|
is: {
|
package/karma.conf.js
CHANGED
|
@@ -4,13 +4,20 @@ const dotenvResult = require('dotenv-safe').config();
|
|
|
4
4
|
|
|
5
5
|
const webpackBaseConfig = require("./webpack.base.config");
|
|
6
6
|
|
|
7
|
+
const karmaMocha = require('karma-mocha');
|
|
8
|
+
const karmaMochaReporter = require('karma-mocha-reporter');
|
|
9
|
+
const karmaChai = require('karma-chai');
|
|
10
|
+
const karmaChromeLauncher = require('karma-chrome-launcher');
|
|
11
|
+
const karmaFirefoxLauncher = require('karma-firefox-launcher');
|
|
12
|
+
const karmaWebpack = require('karma-webpack');
|
|
13
|
+
|
|
7
14
|
if (dotenvResult.error) {
|
|
8
15
|
throw dotenvResult.error;
|
|
9
16
|
}
|
|
10
17
|
|
|
11
18
|
module.exports = (config) => {
|
|
12
19
|
config.set({
|
|
13
|
-
frameworks: ['mocha', 'chai'],
|
|
20
|
+
frameworks: ['mocha', 'chai', 'webpack'],
|
|
14
21
|
files: [
|
|
15
22
|
'src/**/*.spec.ts',
|
|
16
23
|
'src/test/karma/bootstrap.ts',
|
|
@@ -43,12 +50,12 @@ module.exports = (config) => {
|
|
|
43
50
|
browserDisconnectTimeout: 3 * 2000, // 2000 default
|
|
44
51
|
pingTimeout: 3 * 5000, // 5000 default
|
|
45
52
|
plugins: [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
karmaMocha,
|
|
54
|
+
karmaMochaReporter,
|
|
55
|
+
karmaChai,
|
|
56
|
+
karmaChromeLauncher,
|
|
57
|
+
karmaFirefoxLauncher,
|
|
58
|
+
karmaWebpack,
|
|
52
59
|
],
|
|
53
60
|
customLaunchers: {
|
|
54
61
|
FirefoxHeadless: {
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dash",
|
|
3
|
-
"version": "3.21.
|
|
3
|
+
"version": "3.21.8",
|
|
4
4
|
"description": "Dash library for JavaScript/TypeScript ecosystem (Wallet, DAPI, Primitives, BLS, ...)",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"unpkg": "dist/dash.min.js",
|
|
7
7
|
"types": "dist/src/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"start:dev": "nodemon --exec '
|
|
10
|
-
"build": "
|
|
11
|
-
"build:web": "
|
|
9
|
+
"start:dev": "nodemon --exec 'yarn run build && yarn run test:unit'",
|
|
10
|
+
"build": "yarn run build:ts",
|
|
11
|
+
"build:web": "yarn run build:ts && webpack --stats-error-details",
|
|
12
12
|
"build:ts": "tsc",
|
|
13
13
|
"lint": "",
|
|
14
|
-
"test": "
|
|
14
|
+
"test": "yarn run test:unit && yarn run test:functional && yarn run test:browsers",
|
|
15
15
|
"test:browsers": "karma start ./karma.conf.js --single-run",
|
|
16
|
-
"test:unit": "TS_NODE_COMPILER_OPTIONS={\"target\":\"es6\"}
|
|
17
|
-
"test:functional": "
|
|
18
|
-
"prepublishOnly": "
|
|
19
|
-
"prepare": "
|
|
16
|
+
"test:unit": "TS_NODE_COMPILER_OPTIONS={\"target\":\"es6\"} ts-mocha \"src/**/*.spec.ts\"",
|
|
17
|
+
"test:functional": "yarn run build && mocha --recursive tests/functional/**/*.js",
|
|
18
|
+
"prepublishOnly": "yarn run build:web",
|
|
19
|
+
"prepare": "yarn run build"
|
|
20
20
|
},
|
|
21
21
|
"ultra": {
|
|
22
22
|
"concurrent": [
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://github.com/dashevo/DashJS#readme",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@dashevo/dapi-client": "~0.21.
|
|
38
|
-
"@dashevo/dashcore-lib": "~0.19.
|
|
39
|
-
"@dashevo/dpp": "~0.21.
|
|
40
|
-
"@dashevo/grpc-common": "~0.21.
|
|
41
|
-
"@dashevo/wallet-lib": "~7.21.
|
|
37
|
+
"@dashevo/dapi-client": "~0.21.8",
|
|
38
|
+
"@dashevo/dashcore-lib": "~0.19.30",
|
|
39
|
+
"@dashevo/dpp": "~0.21.8",
|
|
40
|
+
"@dashevo/grpc-common": "~0.21.8",
|
|
41
|
+
"@dashevo/wallet-lib": "~7.21.8",
|
|
42
42
|
"bs58": "^4.0.1",
|
|
43
43
|
"node-inspect-extracted": "^1.0.8"
|
|
44
44
|
},
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"crypto-browserify": "^3.12.0",
|
|
59
59
|
"dirty-chai": "^2.0.1",
|
|
60
60
|
"dotenv-safe": "^8.2.0",
|
|
61
|
+
"events": "^3.3.0",
|
|
61
62
|
"https-browserify": "^1.0.0",
|
|
62
63
|
"karma": "^6.3.4",
|
|
63
64
|
"karma-chai": "^0.1.0",
|
|
@@ -76,7 +77,9 @@
|
|
|
76
77
|
"sinon-chai": "^3.7.0",
|
|
77
78
|
"stream-browserify": "^3.0.0",
|
|
78
79
|
"stream-http": "^3.2.0",
|
|
80
|
+
"string_decoder": "^1.3.0",
|
|
79
81
|
"ts-loader": "^8.0.2",
|
|
82
|
+
"ts-mocha": "^8.0.0",
|
|
80
83
|
"ts-mock-imports": "^1.3.0",
|
|
81
84
|
"ts-node": "^10.4.0",
|
|
82
85
|
"typescript": "^3.9.5",
|
|
@@ -85,4 +88,4 @@
|
|
|
85
88
|
"webpack": "^5.59.1",
|
|
86
89
|
"webpack-cli": "^4.9.1"
|
|
87
90
|
}
|
|
88
|
-
}
|
|
91
|
+
}
|
|
@@ -17,26 +17,30 @@ const TxStreamDataResponseMock = require('@dashevo/wallet-lib/src/test/mocks/TxS
|
|
|
17
17
|
const TransportMock = require('@dashevo/wallet-lib/src/test/mocks/TransportMock');
|
|
18
18
|
|
|
19
19
|
function makeTxStreamEmitISLocksForTransactions(transportMock, txStreamMock) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
)
|
|
39
|
-
|
|
20
|
+
transportMock.sendTransaction.callsFake((txString) => {
|
|
21
|
+
const transaction = new Transaction(txString);
|
|
22
|
+
const isLock = createFakeInstantLock(transaction.hash);
|
|
23
|
+
|
|
24
|
+
setImmediate(() => {
|
|
25
|
+
// Emit IS lock for the transaction
|
|
26
|
+
txStreamMock.emit(
|
|
27
|
+
TxStreamMock.EVENTS.data,
|
|
28
|
+
new TxStreamDataResponseMock(
|
|
29
|
+
{ instantSendLockMessages: [isLock.toBuffer()] }
|
|
30
|
+
)
|
|
31
|
+
);
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
// Emit the same transaction back to the client so it will know about the change transaction
|
|
35
|
+
txStreamMock.emit(
|
|
36
|
+
TxStreamMock.EVENTS.data,
|
|
37
|
+
new TxStreamDataResponseMock(
|
|
38
|
+
{ rawTransactions: [transaction.toBuffer()] }
|
|
39
|
+
)
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
return transaction.hash;
|
|
43
|
+
});
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
/**
|
|
@@ -88,4 +92,4 @@ export async function createAndAttachTransportMocksToClient(client, sinon) {
|
|
|
88
92
|
makeGetIdentityRespondWithIdentity(client, dapiClientMock);
|
|
89
93
|
|
|
90
94
|
return { txStreamMock, transportMock, dapiClientMock };
|
|
91
|
-
}
|
|
95
|
+
}
|
package/webpack.base.config.js
CHANGED
|
@@ -20,18 +20,21 @@ const baseConfig = {
|
|
|
20
20
|
crypto: require.resolve('crypto-browserify'),
|
|
21
21
|
http: require.resolve('stream-http'),
|
|
22
22
|
https: require.resolve('https-browserify'),
|
|
23
|
+
buffer: require.resolve('buffer/'),
|
|
23
24
|
url: require.resolve('url/'),
|
|
24
25
|
assert: require.resolve('assert/'),
|
|
25
26
|
stream: require.resolve('stream-browserify'),
|
|
26
27
|
path: require.resolve('path-browserify'),
|
|
27
28
|
os: require.resolve('os-browserify/browser'),
|
|
28
29
|
zlib: require.resolve('browserify-zlib'),
|
|
30
|
+
events: require.resolve('events/'),
|
|
31
|
+
string_decoder: require.resolve('string_decoder/'),
|
|
29
32
|
},
|
|
30
33
|
},
|
|
31
34
|
plugins: [
|
|
32
35
|
new webpack.ProvidePlugin({
|
|
33
|
-
Buffer: ['buffer', 'Buffer'],
|
|
34
|
-
process: 'process/browser',
|
|
36
|
+
Buffer: [require.resolve('buffer/'), 'Buffer'],
|
|
37
|
+
process: require.resolve('process/browser'),
|
|
35
38
|
}),
|
|
36
39
|
],
|
|
37
40
|
output: {
|
package/webpack.config.js
CHANGED
|
@@ -1,31 +1,10 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
const
|
|
2
|
+
const webpackBaseConfig = require("./webpack.base.config");
|
|
3
3
|
|
|
4
4
|
const webConfig = {
|
|
5
|
+
...webpackBaseConfig,
|
|
5
6
|
entry: './build/src/index.js',
|
|
6
|
-
mode:
|
|
7
|
-
resolve: {
|
|
8
|
-
extensions: ['.js', '.json'],
|
|
9
|
-
fallback: {
|
|
10
|
-
fs: false,
|
|
11
|
-
util: require.resolve('util/'),
|
|
12
|
-
crypto: require.resolve('crypto-browserify'),
|
|
13
|
-
http: require.resolve('stream-http'),
|
|
14
|
-
https: require.resolve('https-browserify'),
|
|
15
|
-
url: require.resolve('url/'),
|
|
16
|
-
assert: require.resolve('assert/'),
|
|
17
|
-
stream: require.resolve('stream-browserify'),
|
|
18
|
-
path: require.resolve('path-browserify'),
|
|
19
|
-
os: require.resolve('os-browserify/browser'),
|
|
20
|
-
zlib: require.resolve('browserify-zlib'),
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
plugins: [
|
|
24
|
-
new webpack.ProvidePlugin({
|
|
25
|
-
Buffer: ['buffer', 'Buffer'],
|
|
26
|
-
process: 'process/browser',
|
|
27
|
-
}),
|
|
28
|
-
],
|
|
7
|
+
mode: 'production',
|
|
29
8
|
output: {
|
|
30
9
|
path: path.resolve(__dirname, 'dist'),
|
|
31
10
|
libraryTarget: 'umd',
|