Skip to content

Commit a1dda7b

Browse files
remove the use of web3-core and update version
1 parent dc7409f commit a1dda7b

File tree

8 files changed

+368
-370
lines changed

8 files changed

+368
-370
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@chainsafe/web3.js-chainlink-plugin",
3-
"version": "0.1.0-alpha.0",
3+
"version": "9.9.9",
44
"description": "A Web3.js 4.x Plugin for Interacting With Chainlink Smart Contracts",
55
"main": "lib/index.js",
66
"repository": {
@@ -31,7 +31,8 @@
3131
"test:e2e:chrome": "npx cypress run --headless --browser chrome",
3232
"test:e2e:firefox": "npx cypress run --headless --browser firefox",
3333
"test:e2e:electron": "npx cypress run --headless --browser electron",
34-
"test:unit": "jest --config=./test/unit/jest.config.js"
34+
"test:unit": "jest --config=./test/unit/jest.config.js",
35+
"test:all": "yarn && yarn build && yarn test && yarn run test:e2e:firefox && yarn run test:black-box"
3536
},
3637
"devDependencies": {
3738
"@babel/core": "^7.20.2",
@@ -69,12 +70,11 @@
6970
"ts-loader": "^9.4.1",
7071
"ts-node": "^10.9.1",
7172
"typescript": "^4.7.4",
72-
"web3": "4.0.1-rc.2",
73+
"web3": "^4.0.2-dev.af57eae.0",
7374
"webpack": "^5.75.0",
7475
"webpack-cli": "^5.0.1"
7576
},
7677
"peerDependencies": {
77-
"web3": ">= 4.0.1-rc.2 < 5",
78-
"web3-core": ">= 4.0.1-rc.2 < 5"
78+
"web3": ">= 4.0.2-dev.af57eae.0 < 5"
7979
}
8080
}

src/chainlink_plugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Address, Contract, ContractAbi, core as web3Core, validator } from 'web3';
1+
import { Address, Contract, ContractAbi, Web3PluginBase, validator } from 'web3';
22
import { AggregatorV3InterfaceABI } from './aggregator_v3_interface_abi';
33
import { GoerliPriceFeeds, MainnetPriceFeeds } from './types';
44

5-
export class ChainlinkPlugin extends web3Core.Web3PluginBase {
5+
export class ChainlinkPlugin extends Web3PluginBase {
66
public pluginNamespace: string;
77
public defaultAggregatorInterfaceAbi: ContractAbi;
88

@@ -51,7 +51,7 @@ export class ChainlinkPlugin extends web3Core.Web3PluginBase {
5151
}
5252

5353
// Module Augmentation
54-
declare module 'web3-core' {
54+
declare module 'web3' {
5555
interface Web3Context {
5656
chainlink: ChainlinkPlugin;
5757
}

test/black_box/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"devDependencies": {
1414
"jest": "^28.1.3",
1515
"ts-jest": "^28.0.7",
16-
"web3": "^4.0.1-rc.2",
17-
"web3-core": "^4.0.1-rc.2"
16+
"web3": "^4.0.2-dev.af57eae.0"
1817
}
1918
}

test/black_box/test/chainlink_plugin.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import { Web3, core as web3Core, Web3Eth } from 'web3';
2-
import { Web3Context } from 'web3-core';
1+
import { Web3, Web3Context, Web3Eth } from 'web3';
32

43
// https://github.com/ChainSafe/web3.js-plugin-chainlink/issues/15
54
// @ts-ignore
65
import { ChainlinkPlugin, MainnetPriceFeeds } from '@chainsafe/web3.js-chainlink-plugin';
76

87
describe('ChainlinkPlugin Tests', () => {
9-
it('should register ChainlinkPlugin plugin on web3Core.Web3Context instance', () => {
10-
const web3Context = new web3Core.Web3Context('http://127.0.0.1:8545');
8+
it('should register ChainlinkPlugin plugin on Web3Context instance', () => {
9+
const web3Context = new Web3Context('http://127.0.0.1:8545');
1110
web3Context.registerPlugin(new ChainlinkPlugin());
1211
expect(web3Context.chainlink).toBeDefined();
1312
});

0 commit comments

Comments
 (0)