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

add concordium to cli, common and validator #2078

Merged
merged 6 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Added
- Support building and publishing Concordium projects (#2078)
- ts-manifest compatibility with `codegen:generate` command (#2111)

## [4.1.0] - 2023-10-25
Expand Down
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@oclif/core": "^2.15.0",
"@subql/common": "workspace:*",
"@subql/common-algorand": "^3.0.0",
"@subql/common-concordium": "^3.1.3",
"@subql/common-cosmos": "^3.0.1",
"@subql/common-ethereum": "^3.0.2",
"@subql/common-flare": "^3.0.1",
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/controller/add-chain-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const nodeToDockerImage: Record<string, string> = {
'@subql/node-algorand': 'onfinality/subql-node-algorand',
'@subql/node-near': 'onfinality/subql-node-near',
'@subql/node-stellar': 'subquerynetwork/subql-node-stellar',
'@subql/node-concordium': 'subquerynetwork/subql-node-concordium',
};

type DockerComposeDependsOn = {
Expand Down
13 changes: 7 additions & 6 deletions packages/cli/src/controller/codegen-controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
import rimraf from 'rimraf';
import {codegen, processFields, validateEntityName} from './codegen-controller';


jest.mock('fs', () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const fsMock = jest.createMockFromModule('fs') as any;
fsMock.promises = {
mkdir: jest.fn(),
const fs = jest.requireActual('fs');
return {
...fs,
promises: {
...fs.promises,
mkdir: jest.fn(),
},
};
return fsMock;
});

jest.mock('rimraf', () => {
Expand Down Expand Up @@ -48,7 +49,7 @@
'TypeNotSupported',
[
// Ignoring to test unsupported scalar type
// @ts-ignore

Check warning on line 52 in packages/cli/src/controller/codegen-controller.spec.ts

View workflow job for this annotation

GitHub Actions / pr

Do not use "@ts-ignore" because it alters compilation errors
{
name: 'notSupported',
type: 'UnsupportedScalar',
Expand Down
13 changes: 11 additions & 2 deletions packages/cli/src/controller/codegen-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// SPDX-License-Identifier: GPL-3.0

import path from 'path';
import {DEFAULT_MANIFEST, extensionIsTs, getManifestPath, getSchemaPath, loadFromJsonOrYaml} from '@subql/common';

Check warning on line 5 in packages/cli/src/controller/codegen-controller.ts

View workflow job for this annotation

GitHub Actions / pr

'extensionIsTs' is defined but never used
import {isCustomDs as isCustomConcordiumDs, isRuntimeDs as isRuntimeConcordiumDs} from '@subql/common-concordium';
import {
isCustomCosmosDs,
isRuntimeCosmosDs,
Expand All @@ -25,6 +26,10 @@
RuntimeDatasourceTemplate as SubstrateDsTemplate,
CustomDatasourceTemplate as SubstrateCustomDsTemplate,
} from '@subql/types';
import {
RuntimeDatasourceTemplate as ConcordiumDsTemplate,
CustomDatasourceTemplate as ConcordiumCustomDsTemplate,
} from '@subql/types-concordium';
import {TemplateBase} from '@subql/types-core';
import {
RuntimeDatasourceTemplate as CosmosDsTemplate,
Expand Down Expand Up @@ -67,7 +72,9 @@
| NearDsTemplate
| NearCustomDsTemplate
| StellarDsTemplate
| StellarCustomDsTemplate;
| StellarCustomDsTemplate
| ConcordiumDsTemplate
| ConcordiumCustomDsTemplate;

export type DatasourceKind = SubstrateCustomDataSource | EthereumDs | EthereumCustomDs;

Expand Down Expand Up @@ -240,7 +247,7 @@
return Object.keys(plainManifest)
.filter((key) => !expectKeys.includes(key))
.map((dsKey) => {
const value = (plainManifest as any)[dsKey];

Check warning on line 250 in packages/cli/src/controller/codegen-controller.ts

View workflow job for this annotation

GitHub Actions / pr

Unexpected any. Specify a different type
if (typeof value === 'object' && value) {
return !!Object.keys(value).find((d) => d === 'assets') && value;
}
Expand Down Expand Up @@ -410,6 +417,8 @@
isRuntimeNearDs(t as NearDsTemplate) ||
isCustomNearDs(t as NearDsTemplate) ||
isRuntimeStellarDs(t as StellarDsTemplate) ||
isCustomStellarDs(t as StellarDsTemplate)
isCustomStellarDs(t as StellarDsTemplate) ||
isRuntimeConcordiumDs(t as ConcordiumDsTemplate) ||
isCustomConcordiumDs(t as ConcordiumDsTemplate)
);
}
2 changes: 2 additions & 0 deletions packages/cli/src/controller/publish-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
mapToObject,
} from '@subql/common';
import {parseAlgorandProjectManifest} from '@subql/common-algorand';
import {parseConcordiumProjectManifest} from '@subql/common-concordium';
import {parseCosmosProjectManifest} from '@subql/common-cosmos';
import {parseEthereumProjectManifest} from '@subql/common-ethereum';
import {parseEthereumProjectManifest as parseFlareProjectManifest} from '@subql/common-flare';
Expand Down Expand Up @@ -69,6 +70,7 @@ export async function uploadToIpfs(
parseFlareProjectManifest,
parseNearProjectManifest,
parseStellarProjectManifest,
parseConcordiumProjectManifest,
];

let manifest = null;
Expand Down
2 changes: 2 additions & 0 deletions packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Add Concordium to network family (#2078)

## [3.2.0] - 2023-10-25
### Added
Expand Down
2 changes: 2 additions & 0 deletions packages/common/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export enum NETWORK_FAMILY {
flare = 'Flare',
near = 'Near',
stellar = 'Stellar',
concordium = 'Concordium',
}

export const runnerMapping = {
Expand All @@ -37,6 +38,7 @@ export const runnerMapping = {
'@subql/node-flare': NETWORK_FAMILY.flare,
'@subql/node-near': NETWORK_FAMILY.near,
'@subql/node-stellar': NETWORK_FAMILY.stellar,
'@subql/node-concordium': NETWORK_FAMILY.concordium,
};

// DATABASE TYPE
Expand Down
Loading
Loading