Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caliper-ethereum : Add new tests for connectorFactory and ethereum-connector #1560

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update EthereumConnector.js suites
Signed-off-by: Abhinav Pandey <[email protected]>
  • Loading branch information
Sweetdevil144 committed May 9, 2024
commit 52f90b3f18ebdb751277feea67f32145e8f6bbc5
17 changes: 0 additions & 17 deletions packages/caliper-ethereum/test/connectorFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,3 @@ describe('ConnectorFactory', function () {
expect(connector.workerIndex).to.equal(workerIndex);
});
});

describe('ConnectorFactory', function () {
beforeEach(() => {
const invalidConfig = path.resolve(
__dirname,
'./utils/invalidconfig.json'
);
ConfigUtil.set(ConfigUtil.keys.NetworkConfig, invalidConfig);
});
it('should throw an error for an incorrect network configuration', function () {
const invalidConfig = path.resolve(
__dirname,
'./utils/invalidconfig.json'
);
expect(() => new EthereumConnector(invalidConfig)).to.throw();
});
});
17 changes: 17 additions & 0 deletions packages/caliper-ethereum/test/ethereum-connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,20 @@ describe('EthereumConnector', function() {
});
});
});

describe('EthereumConnector', function () {
beforeEach(() => {
const invalidConfig = path.resolve(
__dirname,
'./utils/invalidconfig.json'
);
ConfigUtil.set(ConfigUtil.keys.NetworkConfig, invalidConfig);
});
it('should throw an error for an incorrect url path', function () {
const invalidConfig = path.resolve(
__dirname,
'./utils/invalidUrlConfig.json'
);
expect(() => new EthereumConnector(invalidConfig)).to.throw();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
},
"ethereum": {
"url": 123,
"contractDeployerAddress": "",
"contractDeployerAddress": "0xc0A8e4D217eB85b812aeb1226fAb6F588943C2C2",
"contractDeployerAddressPassword": "password",
"fromAddress": "0xc0A8e4D217eB85b812aeb1226fAb6F588943C2C2",
"fromAddressPassword": "password",
"transactionConfirmationBlocks": "two",
"transactionConfirmationBlocks": 2,
"contracts": {
"simple": {
"path": "src/simple/simple.json"
Expand Down