Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Dzikowski <[email protected]>
  • Loading branch information
dzikowski committed Oct 15, 2024
1 parent a55d135 commit 44c9e44
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
3 changes: 2 additions & 1 deletion e2e/fabloCommands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,11 @@ describe("validate", () => {
// Given
const sourceConfigPath = require.resolve("../samples/fablo-config-hlf2-1org-1chaincode-raft-explorer.json");
const samplesDir = sourceConfigPath.replace("/fablo-config-hlf2-1org-1chaincode-raft-explorer.json", "");
// eslint-disable-next-line @typescript-eslint/no-var-requires
const sourceConfig = require(sourceConfigPath) as FabloConfigJson;

// old schema
sourceConfig.$schema = "https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json"
sourceConfig.$schema = "https://github.com/hyperledger-labs/fablo/releases/download/1.2.0/schema.json";

// invalid org
sourceConfig.orgs[0].organization.mspName = "some-org1";
Expand Down
5 changes: 2 additions & 3 deletions src/extend-config/extendGlobal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import { GlobalJson } from "../types/FabloConfigJson";
import defaults from "./defaults";

const getNetworkCapabilities = (fabricVersion: string): Capabilities => {

if (version(fabricVersion).isGreaterOrEqual("2.5.0") && !version(fabricVersion).isGreaterOrEqual("3.0.0"))
return { channel: "V2_0", orderer: "V2_0", application: "V2_5", isV2: true, isV3: false };

if (version(fabricVersion).isGreaterOrEqual("3.0.0"))
return { channel: "V3_0", orderer: "V2_0", application: "V2_5", isV2: false, isV3: true};
return { channel: "V3_0", orderer: "V2_0", application: "V2_5", isV2: false, isV3: true };

return { channel: "V2_0", orderer: "V2_0", application: "V2_0", isV2: true , isV3: false};
return { channel: "V2_0", orderer: "V2_0", application: "V2_0", isV2: true, isV3: false };
};

const getVersions = (fabricVersion: string): FabricVersions => {
Expand Down
2 changes: 0 additions & 2 deletions src/types/FabloConfigExtended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ interface CapabilitiesV2 {
isV3: false;
}


interface CapabilitiesV_2_5 {
application: "V2_5";
channel: "V2_0";
Expand All @@ -33,7 +32,6 @@ interface CapabilitiesV3_0 {
isV3: true;
}


export type Capabilities = CapabilitiesV2 | CapabilitiesV_2_5 | CapabilitiesV3_0;

export interface Global extends FabricVersions {
Expand Down
6 changes: 3 additions & 3 deletions src/validate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,12 @@ class ValidateGenerator extends Generator {

_validateDevMode(global: GlobalJson): void {
if (global.peerDevMode && global.tls) {
const message = `TLS needs to be disabled when running peers in dev mode`;
this.emit(validationErrorType.ERROR, { category: validationCategories.GENERAL, message });
const message = `TLS needs to be disabled when running peers in dev mode`;
this.emit(validationErrorType.ERROR, { category: validationCategories.GENERAL, message });
}
}

_verifyFabricVersion(global:GlobalJson){
_verifyFabricVersion(global: GlobalJson) {
if (!version(global.fabricVersion).isGreaterOrEqual("2.0.0")) {
const message = `Fablo supports Fabric in version 2.0.0 and higher`;
this.emit(validationErrorType.ERROR, { category: validationCategories.GENERAL, message });
Expand Down

0 comments on commit 44c9e44

Please sign in to comment.