@rosen-bridge/evm-observation-extractor 5.1.4 → 5.1.6
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @rosen-bridge/evm-observation-extractor
|
|
2
2
|
|
|
3
|
+
## 5.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Update package license to MIT
|
|
8
|
+
- Update dependencies
|
|
9
|
+
- @rosen-bridge/observation-extractor@7.1.4
|
|
10
|
+
- @rosen-bridge/scanner-interfaces@0.1.1
|
|
11
|
+
|
|
12
|
+
## 5.1.5
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Downgrade ethers version
|
|
17
|
+
- Update dependencies
|
|
18
|
+
- @rosen-bridge/evm-rpc-scanner@4.0.1
|
|
19
|
+
- @rosen-bridge/observation-extractor@7.1.3
|
|
20
|
+
|
|
3
21
|
## 5.1.4
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rosen-bridge/evm-observation-extractor",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.6",
|
|
4
4
|
"description": "Event observation data extractor for EVM-compatible chains",
|
|
5
5
|
"repository": "https://github.com/rosen-bridge/scanner",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "MIT",
|
|
7
7
|
"author": "Rosen Team",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "dist/index.js",
|
|
@@ -19,10 +19,12 @@
|
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@rosen-bridge/json-bigint": "^0.1.0",
|
|
22
|
+
"@rosen-bridge/scanner": "^8.0.1",
|
|
22
23
|
"@types/node": "^20.11.9",
|
|
23
24
|
"@typescript-eslint/eslint-plugin": "^6.19.1",
|
|
24
25
|
"@typescript-eslint/parser": "^6.19.1",
|
|
25
26
|
"@vitest/coverage-istanbul": "^1.2.2",
|
|
27
|
+
"ergo-lib-wasm-nodejs": "^0.24.1",
|
|
26
28
|
"eslint": "^8.56.0",
|
|
27
29
|
"eslint-config-prettier": "^9.1.0",
|
|
28
30
|
"extensionless": "^1.9.6",
|
|
@@ -35,12 +37,12 @@
|
|
|
35
37
|
},
|
|
36
38
|
"dependencies": {
|
|
37
39
|
"@rosen-bridge/abstract-logger": "^2.0.1",
|
|
38
|
-
"@rosen-bridge/
|
|
39
|
-
"@rosen-bridge/
|
|
40
|
-
"@rosen-bridge/
|
|
41
|
-
"@rosen-bridge/scanner-interfaces": "^0.1.0",
|
|
40
|
+
"@rosen-bridge/observation-extractor": "^7.1.4",
|
|
41
|
+
"@rosen-bridge/rosen-extractor": "^8.0.1",
|
|
42
|
+
"@rosen-bridge/scanner-interfaces": "^0.1.1",
|
|
42
43
|
"@rosen-bridge/tokens": "^3.1.1",
|
|
43
44
|
"blakejs": "^1.2.1",
|
|
44
|
-
"
|
|
45
|
+
"typeorm": "^0.3.20",
|
|
46
|
+
"ethers": "6.13.2"
|
|
45
47
|
}
|
|
46
48
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
|
|
1
3
|
import { vi } from 'vitest';
|
|
2
4
|
import { DataSource } from 'typeorm';
|
|
3
|
-
import { blake2b } from 'blakejs';
|
|
4
5
|
import { ObservationEntity } from '@rosen-bridge/observation-extractor';
|
|
5
6
|
import { createDatabase, generateBlockEntity } from './utils.mock';
|
|
6
7
|
import { expectedObservation, rosenData, tx, txRes } from './testData';
|
|
@@ -11,7 +12,7 @@ vi.mock('ethers', async (importOriginal) => {
|
|
|
11
12
|
const ref = await importOriginal<typeof import('ethers')>();
|
|
12
13
|
return {
|
|
13
14
|
...ref,
|
|
14
|
-
JsonRpcProvider: vi.fn().mockImplementation((
|
|
15
|
+
JsonRpcProvider: vi.fn().mockImplementation(() => {
|
|
15
16
|
return {};
|
|
16
17
|
}),
|
|
17
18
|
};
|
|
@@ -82,7 +83,7 @@ describe('EvmRpcObservationExtractor', () => {
|
|
|
82
83
|
it('should return true but insert no tx when transaction is failed', async () => {
|
|
83
84
|
vi.spyOn(extractor.getRosenExtractor(), 'get').mockReturnValue(rosenData);
|
|
84
85
|
|
|
85
|
-
vi.spyOn(txRes, 'wait').mockImplementation((
|
|
86
|
+
vi.spyOn(txRes, 'wait').mockImplementation(() => {
|
|
86
87
|
throw {
|
|
87
88
|
code: 'CALL_EXCEPTION',
|
|
88
89
|
};
|
|
@@ -99,7 +100,7 @@ describe('EvmRpcObservationExtractor', () => {
|
|
|
99
100
|
|
|
100
101
|
// check database
|
|
101
102
|
const repository = dataSource.getRepository(ObservationEntity);
|
|
102
|
-
const [
|
|
103
|
+
const [, rowsCount] = await repository.findAndCount();
|
|
103
104
|
expect(rowsCount).toEqual(0);
|
|
104
105
|
}, 100000);
|
|
105
106
|
|
|
@@ -129,7 +130,7 @@ describe('EvmRpcObservationExtractor', () => {
|
|
|
129
130
|
|
|
130
131
|
// check database
|
|
131
132
|
const repository = dataSource.getRepository(ObservationEntity);
|
|
132
|
-
const [
|
|
133
|
+
const [, rowsCount] = await repository.findAndCount();
|
|
133
134
|
expect(rowsCount).toEqual(0);
|
|
134
135
|
}, 100000);
|
|
135
136
|
});
|
package/tests/testData.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { blake2b } from 'blakejs';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
JsonRpcProvider,
|
|
4
|
+
Transaction,
|
|
5
|
+
TransactionResponse,
|
|
6
|
+
TransactionResponseParams,
|
|
7
|
+
} from 'ethers';
|
|
3
8
|
|
|
4
9
|
export const tx = Transaction.from({
|
|
5
10
|
type: 2,
|
|
@@ -20,7 +25,10 @@ export const tx = Transaction.from({
|
|
|
20
25
|
},
|
|
21
26
|
hash: '0x3b194eea7cf9507e745806265738ca19213be209885534161ec0fa9c232c9fea',
|
|
22
27
|
});
|
|
23
|
-
export const txRes = new TransactionResponse(
|
|
28
|
+
export const txRes = new TransactionResponse(
|
|
29
|
+
tx as unknown as TransactionResponseParams,
|
|
30
|
+
new JsonRpcProvider()
|
|
31
|
+
);
|
|
24
32
|
|
|
25
33
|
export const rosenData = {
|
|
26
34
|
toChain: 'to-chain',
|