-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update init command to allow specifying spec version
- Loading branch information
Showing
3 changed files
with
55 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
// Copyright 2020-2021 OnFinality Limited authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export interface ProjectSpec { | ||
export interface ProjectSpecBase { | ||
name: string; | ||
repository?: string; | ||
endpoint: string; | ||
author: string; | ||
description?: string; | ||
version: string; | ||
license: string; | ||
} | ||
|
||
export interface ProjectSpecV0_0_1 extends ProjectSpecBase { | ||
endpoint: string; | ||
} | ||
|
||
export interface ProjectSpecV0_2_0 extends ProjectSpecBase { | ||
genesisHash: string; | ||
} | ||
|
||
export function isProjectSpecV0_0_1(projectSpec: ProjectSpecBase): projectSpec is ProjectSpecV0_0_1 { | ||
return !!(projectSpec as ProjectSpecV0_0_1).endpoint; | ||
} | ||
|
||
export function isProjectSpecV0_2_0(projectSpec: ProjectSpecBase): projectSpec is ProjectSpecV0_2_0 { | ||
return !!(projectSpec as ProjectSpecV0_2_0).genesisHash; | ||
} |