Skip to content

Commit 5d5c340

Browse files
lserra-iovalexjavabraz
authored andcommitted
Use node 18 (lts)
1 parent e6721d0 commit 5d5c340

8 files changed

+10487
-8399
lines changed

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.17.0

package-lock.json

+10,464-8,377
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+15-15
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@
5353
"!*/__tests__"
5454
],
5555
"dependencies": {
56-
"@loopback/boot": "^3.1.2",
57-
"@loopback/core": "^2.13.1",
58-
"@loopback/repository": "^3.3.0",
59-
"@loopback/rest": "^9.1.1",
60-
"@loopback/rest-explorer": "^5.0.9",
61-
"@loopback/service-proxy": "^3.0.5",
56+
"@loopback/boot": "^6.1.3",
57+
"@loopback/core": "^5.1.3",
58+
"@loopback/repository": "^6.1.3",
59+
"@loopback/rest": "^13.1.3",
60+
"@loopback/rest-explorer": "^6.1.3",
61+
"@loopback/service-proxy": "^6.1.3",
6262
"@rsksmart/bridge-state-data-parser": "git+https://github.com/rsksmart/bridge-state-data-parser.git#allow-block-argument",
6363
"@rsksmart/rsk-precompiled-abis": "git+https://github.com/rsksmart/precompiled-abis.git#5.0.0-FINGERROOT",
6464
"@types/mongoose": "^5.11.97",
@@ -81,20 +81,20 @@
8181
"web3-utils": "^1.3.4"
8282
},
8383
"devDependencies": {
84-
"@loopback/build": "^6.2.8",
85-
"@loopback/eslint-config": "^10.0.4",
86-
"@loopback/testlab": "^3.2.10",
84+
"@loopback/build": "^10.1.3",
85+
"@loopback/eslint-config": "^14.0.4",
86+
"@loopback/testlab": "^6.1.3",
8787
"@types/big.js": "^6.1.2",
8888
"@types/bs58": "^4.0.1",
89-
"@types/node": "^10.17.48",
90-
"@typescript-eslint/eslint-plugin": "^5.30.5",
91-
"@typescript-eslint/parser": "^5.30.5",
92-
"eslint": "^8.19.0",
89+
"@types/node": "^16.18.50",
90+
"@typescript-eslint/eslint-plugin": "^6.4.1",
91+
"@typescript-eslint/parser": "^6.4.1",
92+
"eslint": "^8.48.0",
9393
"eslint-config-airbnb-base": "^15.0.0",
9494
"eslint-plugin-import": "^2.26.0",
9595
"sinon": "^11.1.2",
9696
"sonarqube-scanner": "^3.0.1",
97-
"source-map-support": "^0.5.19",
98-
"typescript": "~4.1.2"
97+
"source-map-support": "^0.5.21",
98+
"typescript": "~5.2.2"
9999
}
100100
}

src/__tests__/unit/services/rsk-chain-sync.service.unit.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ describe('Service: RskChainSyncService', () => {
382382

383383
// RSK is contacted with these blocks (latest and 3 to 5)
384384
sinon.assert.callCount(mockedRskNodeService.getBlock, 4);
385-
sinon.assert.calledWithExactly(mockedRskNodeService.getBlock, 'latest', false);
385+
sinon.assert.calledWithExactly(mockedRskNodeService.getBlock, 'latest');
386386
sinon.assert.calledWithExactly(mockedRskNodeService.getBlock, 3);
387387
sinon.assert.calledWithExactly(mockedRskNodeService.getBlock, 4);
388388
sinon.assert.calledWithExactly(mockedRskNodeService.getBlock, 5);

src/__tests__/unit/services/rsk-node.services.unit.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const getInitialBlock = () => new RskBlock(2863627, '0xba5e', '0x');
99
describe('Service: RskNodeService', () => {
1010
it('Searches the block using initial block conf', async () => {
1111
const thisService = new RskNodeService();
12-
const block = await thisService.getBlock(getInitialBlock().height, false);
12+
const block = await thisService.getBlock(getInitialBlock().height);
1313
sinon.assert.match(block.number, getInitialBlock().height);
1414
});
1515
it('Verify ${process.env.RSK_NODE_HOST} configuration', async () => {
@@ -42,7 +42,7 @@ describe('Service: RskNodeService', () => {
4242
});
4343
it('Searches the block', async () => {
4444
const thisService = new RskNodeService();
45-
const block = await thisService.getBlock(getInitialBlock().height, false);
45+
const block = await thisService.getBlock(getInitialBlock().height);
4646
expect(block).to.not.be.null;
4747
});
4848
it('Searches the block number', async () => {

src/__tests__/unit/tx-fee.controller.unit.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ describe('tx Fee controller', () => {
324324
}))).to.be.true();
325325
});
326326
it('Should ensure the change output has a higher value than dust environment variable ', async () => {
327-
const dustValue = process.env.BURN_DUST_VALUE ?? 2000;
327+
const dustValue = Number(process.env.BURN_DUST_VALUE) || 2000;
328328
const minFastFee = new SatoshiBig(process.env.FEE_PER_KB_FAST_MIN ?? 100, 'satoshi');
329329
const minAverageFee = new SatoshiBig(process.env.FEE_PER_KB_AVERAGE_MIN ?? 100, 'satoshi');
330330
const minSlowFee = new SatoshiBig(process.env.FEE_PER_KB_SLOW_MIN ?? 100, 'satoshi');

src/services/rsk-chain-sync.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class RskChainSyncService {
114114

115115
public async sync(): Promise<void> {
116116
let dbBestBlock = await this.getSyncStatus();
117-
const rskBestBlock = RskBlock.fromWeb3Block(await this.rskNodeService.getBlock('latest', false));
117+
const rskBestBlock = RskBlock.fromWeb3Block(await this.rskNodeService.getBlock('latest'));
118118
// In case the db is synced with a forked chain and that forked chain is longer than the main chain,
119119
// remove all extra forked blocks from the db + 1 as an offset so the following logic handles it appropriately.
120120
if(rskBestBlock.height < dbBestBlock.rskBlockHeight) {

src/services/rsk-node.service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export class RskNodeService {
99
constructor() {
1010
this.web3 = new Web3(`${process.env.RSK_NODE_HOST}`);
1111
}
12-
getBlock(block: string | number, withTransactions = true): Promise<BlockTransactionObject> {
13-
return this.web3.eth.getBlock(block, withTransactions);
12+
getBlock(block: string | number): Promise<BlockTransactionObject> {
13+
return this.web3.eth.getBlock(block, true);
1414
}
1515
getTransactionReceipt(txHash: string): Promise<any> {
1616
return this.web3.eth.getTransactionReceipt(txHash);

0 commit comments

Comments
 (0)