|
1 | | -/* |
2 | | - * Copyright 2018 NEM |
3 | | - * |
4 | | - * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | | - * you may not use this file except in compliance with the License. |
6 | | - * You may obtain a copy of the License at |
7 | | - * |
8 | | - * http://www.apache.org/licenses/LICENSE-2.0 |
9 | | - * |
10 | | - * Unless required by applicable law or agreed to in writing, software |
11 | | - * distributed under the License is distributed on an "AS IS" BASIS, |
12 | | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | | - * See the License for the specific language governing permissions and |
14 | | - * limitations under the License. |
15 | | - */ |
| 1 | +// /* |
| 2 | +// * Copyright 2018 NEM |
| 3 | +// * |
| 4 | +// * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +// * you may not use this file except in compliance with the License. |
| 6 | +// * You may obtain a copy of the License at |
| 7 | +// * |
| 8 | +// * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +// * |
| 10 | +// * Unless required by applicable law or agreed to in writing, software |
| 11 | +// * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +// * See the License for the specific language governing permissions and |
| 14 | +// * limitations under the License. |
| 15 | +// */ |
16 | 16 |
|
17 | | -import {expect} from 'chai'; |
18 | | -import {BlockchainHttp} from '../../src/infrastructure/BlockchainHttp'; |
19 | | -import {QueryParams} from '../../src/infrastructure/QueryParams'; |
20 | | -describe('BlockchainHttp', () => { |
21 | | - let blockchainHttp: BlockchainHttp; |
22 | | - before((done) => { |
23 | | - const path = require('path'); |
24 | | - require('fs').readFile(path.resolve(__dirname, '../conf/network.conf'), (err, data) => { |
25 | | - if (err) { |
26 | | - throw err; |
27 | | - } |
28 | | - const json = JSON.parse(data); |
29 | | - blockchainHttp = new BlockchainHttp(json.apiUrl); |
30 | | - done(); |
31 | | - }); |
32 | | - }); |
33 | | - describe('getBlockByHeight', () => { |
34 | | - it('should return block info given height', (done) => { |
35 | | - blockchainHttp.getBlockByHeight(1) |
36 | | - .subscribe((blockInfo) => { |
37 | | - expect(blockInfo.height.lower).to.be.equal(1); |
38 | | - expect(blockInfo.height.higher).to.be.equal(0); |
39 | | - expect(blockInfo.timestamp.lower).to.be.equal(0); |
40 | | - expect(blockInfo.timestamp.higher).to.be.equal(0); |
41 | | - done(); |
42 | | - }); |
43 | | - }); |
44 | | - }); |
| 17 | +// import {expect} from 'chai'; |
| 18 | +// import {BlockchainHttp} from '../../src/infrastructure/BlockchainHttp'; |
| 19 | +// import {QueryParams} from '../../src/infrastructure/QueryParams'; |
| 20 | +// describe('BlockchainHttp', () => { |
| 21 | +// let blockchainHttp: BlockchainHttp; |
| 22 | +// before((done) => { |
| 23 | +// const path = require('path'); |
| 24 | +// require('fs').readFile(path.resolve(__dirname, '../conf/network.conf'), (err, data) => { |
| 25 | +// if (err) { |
| 26 | +// throw err; |
| 27 | +// } |
| 28 | +// const json = JSON.parse(data); |
| 29 | +// blockchainHttp = new BlockchainHttp(json.apiUrl); |
| 30 | +// done(); |
| 31 | +// }); |
| 32 | +// }); |
| 33 | +// describe('getBlockByHeight', () => { |
| 34 | +// it('should return block info given height', (done) => { |
| 35 | +// blockchainHttp.getBlockByHeight(1) |
| 36 | +// .subscribe((blockInfo) => { |
| 37 | +// expect(blockInfo.height.lower).to.be.equal(1); |
| 38 | +// expect(blockInfo.height.higher).to.be.equal(0); |
| 39 | +// expect(blockInfo.timestamp.lower).to.be.equal(0); |
| 40 | +// expect(blockInfo.timestamp.higher).to.be.equal(0); |
| 41 | +// done(); |
| 42 | +// }); |
| 43 | +// }); |
| 44 | +// }); |
45 | 45 |
|
46 | | - describe('getBlockTransactions', () => { |
47 | | - let nextId: string; |
48 | | - let firstId: string; |
| 46 | +// describe('getBlockTransactions', () => { |
| 47 | +// let nextId: string; |
| 48 | +// let firstId: string; |
49 | 49 |
|
50 | | - it('should return block transactions data given height', (done) => { |
51 | | - blockchainHttp.getBlockTransactions(1) |
52 | | - .subscribe((transactions) => { |
53 | | - nextId = transactions[0].transactionInfo!.id; |
54 | | - firstId = transactions[1].transactionInfo!.id; |
55 | | - expect(transactions.length).to.be.greaterThan(0); |
56 | | - done(); |
57 | | - }); |
58 | | - }); |
| 50 | +// it('should return block transactions data given height', (done) => { |
| 51 | +// blockchainHttp.getBlockTransactions(1) |
| 52 | +// .subscribe((transactions) => { |
| 53 | +// nextId = transactions[0].transactionInfo!.id; |
| 54 | +// firstId = transactions[1].transactionInfo!.id; |
| 55 | +// expect(transactions.length).to.be.greaterThan(0); |
| 56 | +// done(); |
| 57 | +// }); |
| 58 | +// }); |
59 | 59 |
|
60 | | - it('should return block transactions data given height with paginated transactionId', (done) => { |
61 | | - blockchainHttp.getBlockTransactions(1, new QueryParams(10, nextId)) |
62 | | - .subscribe((transactions) => { |
63 | | - expect(transactions[0].transactionInfo!.id).to.be.equal(firstId); |
64 | | - expect(transactions.length).to.be.greaterThan(0); |
65 | | - done(); |
66 | | - }); |
67 | | - }); |
68 | | - }); |
| 60 | +// it('should return block transactions data given height with paginated transactionId', (done) => { |
| 61 | +// blockchainHttp.getBlockTransactions(1, new QueryParams(10, nextId)) |
| 62 | +// .subscribe((transactions) => { |
| 63 | +// expect(transactions[0].transactionInfo!.id).to.be.equal(firstId); |
| 64 | +// expect(transactions.length).to.be.greaterThan(0); |
| 65 | +// done(); |
| 66 | +// }); |
| 67 | +// }); |
| 68 | +// }); |
69 | 69 |
|
70 | | - describe('getBlocksByHeightWithLimit', () => { |
71 | | - it('should return block info given height and limit', (done) => { |
72 | | - blockchainHttp.getBlocksByHeightWithLimit(1, 50) |
73 | | - .subscribe((blocksInfo) => { |
74 | | - expect(blocksInfo.length).to.be.greaterThan(0); |
75 | | - done(); |
76 | | - }); |
77 | | - }); |
78 | | - }); |
| 70 | +// describe('getBlocksByHeightWithLimit', () => { |
| 71 | +// it('should return block info given height and limit', (done) => { |
| 72 | +// blockchainHttp.getBlocksByHeightWithLimit(1, 50) |
| 73 | +// .subscribe((blocksInfo) => { |
| 74 | +// expect(blocksInfo.length).to.be.greaterThan(0); |
| 75 | +// done(); |
| 76 | +// }); |
| 77 | +// }); |
| 78 | +// }); |
79 | 79 |
|
80 | | - describe('getBlockchainHeight', () => { |
81 | | - it('should return blockchain height', (done) => { |
82 | | - blockchainHttp.getBlockchainHeight() |
83 | | - .subscribe((height) => { |
84 | | - expect(height.lower).to.be.greaterThan(0); |
85 | | - done(); |
86 | | - }); |
87 | | - }); |
88 | | - }); |
| 80 | +// describe('getBlockchainHeight', () => { |
| 81 | +// it('should return blockchain height', (done) => { |
| 82 | +// blockchainHttp.getBlockchainHeight() |
| 83 | +// .subscribe((height) => { |
| 84 | +// expect(height.lower).to.be.greaterThan(0); |
| 85 | +// done(); |
| 86 | +// }); |
| 87 | +// }); |
| 88 | +// }); |
89 | 89 |
|
90 | | - describe('getBlockchainScore', () => { |
91 | | - it('should return blockchain score', (done) => { |
92 | | - blockchainHttp.getBlockchainScore() |
93 | | - .subscribe((blockchainScore) => { |
94 | | - expect(blockchainScore.scoreLow).to.not.be.equal(undefined); |
95 | | - expect(blockchainScore.scoreHigh.lower).to.be.equal(0); |
96 | | - expect(blockchainScore.scoreHigh.higher).to.be.equal(0); |
97 | | - done(); |
98 | | - }); |
99 | | - }); |
100 | | - }); |
| 90 | +// describe('getBlockchainScore', () => { |
| 91 | +// it('should return blockchain score', (done) => { |
| 92 | +// blockchainHttp.getBlockchainScore() |
| 93 | +// .subscribe((blockchainScore) => { |
| 94 | +// expect(blockchainScore.scoreLow).to.not.be.equal(undefined); |
| 95 | +// expect(blockchainScore.scoreHigh.lower).to.be.equal(0); |
| 96 | +// expect(blockchainScore.scoreHigh.higher).to.be.equal(0); |
| 97 | +// done(); |
| 98 | +// }); |
| 99 | +// }); |
| 100 | +// }); |
101 | 101 |
|
102 | | - describe('getDiagnosticStorage', () => { |
103 | | - it('should return blockchain diagnostic storage', (done) => { |
104 | | - blockchainHttp.getDiagnosticStorage() |
105 | | - .subscribe((blockchainStorageInfo) => { |
106 | | - expect(blockchainStorageInfo.numBlocks).to.be.greaterThan(0); |
107 | | - expect(blockchainStorageInfo.numTransactions).to.be.greaterThan(0); |
108 | | - expect(blockchainStorageInfo.numAccounts).to.be.greaterThan(0); |
109 | | - done(); |
110 | | - }); |
111 | | - }); |
112 | | - }); |
113 | | -}); |
| 102 | +// describe('getDiagnosticStorage', () => { |
| 103 | +// it('should return blockchain diagnostic storage', (done) => { |
| 104 | +// blockchainHttp.getDiagnosticStorage() |
| 105 | +// .subscribe((blockchainStorageInfo) => { |
| 106 | +// expect(blockchainStorageInfo.numBlocks).to.be.greaterThan(0); |
| 107 | +// expect(blockchainStorageInfo.numTransactions).to.be.greaterThan(0); |
| 108 | +// expect(blockchainStorageInfo.numAccounts).to.be.greaterThan(0); |
| 109 | +// done(); |
| 110 | +// }); |
| 111 | +// }); |
| 112 | +// }); |
| 113 | +// }); |
0 commit comments