Skip to content

Commit

Permalink
Extract api definitions (#2101)
Browse files Browse the repository at this point in the history
* move parachain-api out(build fail)

* extract parachain/sidechain api folder

* api dependencies

* used in ts-tests

* fix export issue

* format

* yarn.lock

* modified package.json

* remove yarn.lock

* format

* add lock file

* update lockfile

* update client-api yarn.lock

* lock file

* file-filter file

* modified api devDependencies

* package.json format

* lockfile

* modified file-filter.yml

* added ci steps

* update yarn.lock

* update file-filter.yml

* try native yarn debugging

* lock file

* module path

* add missing volumes path; praying for success

* missed a few

* fix export issue

* uncomment

* rebuild&&format&&lockfile

* add prettier rules

* rebuild

* lockfile

* rebuild && lockfile

* add client-api build

* rebuild && reinstall

* fix api folder && rebuild

* fix package.json

* replace yarn

* order of adjustment

* remove build-context

* fix build issue

* update lit-resume-worker.yml

* pnpm-lock

* fix resume-worker issue

* lockfile

* update metadata

* build api

* update pnpm-lock.yaml

* update identity definitions

* README

* remove format

* remove commet && remove duplicate steps

* remove client-api in file-filter.yml

* fix ts-test shell

* remove yarn.lock

* add pnpm exec and rebuild

---------

Co-authored-by: Kasper Ziemianek <[email protected]>
Co-authored-by: Ariel Birnbaum <[email protected]>
  • Loading branch information
3 people authored Oct 9, 2023
1 parent 417d09b commit f82a6d0
Show file tree
Hide file tree
Showing 212 changed files with 1,966 additions and 3,262 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,15 @@ jobs:
- name: Enable corepack and pnpm
run: corepack enable && corepack enable pnpm

- name: Tee-worker install npm deps
- name: Tee-worker client-api install npm deps
working-directory: ./tee-worker/client-api
run: pnpm install

- name: Tee-worker client-api build
working-directory: ./tee-worker/client-api
run: pnpm run build

- name: Tee-worker ts-tests install npm deps
working-directory: ./tee-worker/ts-tests
run: pnpm install

Expand Down Expand Up @@ -478,8 +486,6 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
build-contexts: local-stash=docker-image://localhost:5000/local-stash:latest
load: true
file: tee-worker/build.Dockerfile
tags: litentry/litentry-worker:latest
target: deployed-worker
Expand All @@ -489,8 +495,6 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
build-contexts: local-stash=docker-image://localhost:5000/local-stash:latest
load: true
file: tee-worker/build.Dockerfile
tags: litentry/litentry-cli:latest
target: deployed-client
Expand Down
4 changes: 4 additions & 0 deletions tee-worker/cli/lit_ts_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ function usage() {
[ $# -ne 1 ] && (usage; exit 1)
TEST=$1

cd /client-api
pnpm install
pnpm run build

cd /ts-tests

pnpm install
Expand Down
Empty file.
12 changes: 12 additions & 0 deletions tee-worker/client-api/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "module",
"license": "ISC",
"scripts": {
"update": "pnpm --filter parachain-api run update-metadata && pnpm --filter sidechain-api run update-metadata",
"build": "pnpm --filter parachain-api run build && pnpm --filter sidechain-api run build",
"update-build": "pnpm run update && pnpm run build",
"format": "pnpm run --recursive format",
"check-format": "pnpm run --recursive check-format"
},
"packageManager": "[email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import "@polkadot/api-base/types/consts";

import type { ApiTypes, AugmentedConst } from "@polkadot/api-base/types";
import type { Option, U8aFixed, bool, u128, u16, u32, u64, u8 } from "@polkadot/types-codec";
import type { Codec } from "@polkadot/types-codec/types";
import type { Perbill, Percent, Permill } from "@polkadot/types/interfaces/runtime";
import type {
FrameSupportPalletId,
Expand Down Expand Up @@ -37,10 +36,6 @@ declare module "@polkadot/api-base/types/consts" {
* The maximum number of named reserves that can exist on an account.
**/
maxReserves: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
bounties: {
/**
Expand Down Expand Up @@ -84,19 +79,11 @@ declare module "@polkadot/api-base/types/consts" {
* Benchmarks depend on this value, be sure to update weights file when changing this value
**/
maximumReasonLength: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
bridgeTransfer: {
defaultMaximumIssuance: u128 & AugmentedConst<ApiType>;
externalTotalIssuance: u128 & AugmentedConst<ApiType>;
nativeTokenResourceId: U8aFixed & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
chainBridge: {
/**
Expand All @@ -106,10 +93,6 @@ declare module "@polkadot/api-base/types/consts" {
**/
bridgeChainId: u8 & AugmentedConst<ApiType>;
proposalLifetime: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
democracy: {
/**
Expand Down Expand Up @@ -172,10 +155,6 @@ declare module "@polkadot/api-base/types/consts" {
* How often (in blocks) to check for new votes.
**/
votingPeriod: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
drop3: {
/**
Expand All @@ -186,10 +165,6 @@ declare module "@polkadot/api-base/types/consts" {
* percent of the total amount slashed when proposal gets rejected
**/
slashPercent: Percent & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
multisig: {
/**
Expand All @@ -211,10 +186,6 @@ declare module "@polkadot/api-base/types/consts" {
* The maximum amount of signatories allowed in the multisig.
**/
maxSignatories: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
parachainIdentity: {
/**
Expand Down Expand Up @@ -245,10 +216,6 @@ declare module "@polkadot/api-base/types/consts" {
* be another trie item whose value is the size of an account ID plus 32 bytes.
**/
subAccountDeposit: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
parachainStaking: {
/**
Expand Down Expand Up @@ -323,10 +290,6 @@ declare module "@polkadot/api-base/types/consts" {
* Number of rounds after which block authors are rewarded
**/
rewardPaymentDelay: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
proxy: {
/**
Expand Down Expand Up @@ -366,10 +329,6 @@ declare module "@polkadot/api-base/types/consts" {
* into account `32 + proxy_type.encode().len()` bytes of data.
**/
proxyDepositFactor: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
scheduler: {
/**
Expand All @@ -380,10 +339,6 @@ declare module "@polkadot/api-base/types/consts" {
* The maximum number of scheduled calls in the queue for a single block.
**/
maxScheduledPerBlock: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
system: {
/**
Expand Down Expand Up @@ -414,21 +369,13 @@ declare module "@polkadot/api-base/types/consts" {
* Get the chain's current version.
**/
version: SpVersionRuntimeVersion & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
teeracle: {
maxOracleBlobLen: u32 & AugmentedConst<ApiType>;
/**
* Max number of whitelisted oracle's releases allowed
**/
maxWhitelistedReleases: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
timestamp: {
/**
Expand All @@ -438,10 +385,6 @@ declare module "@polkadot/api-base/types/consts" {
* double this period on default settings.
**/
minimumPeriod: u64 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
tips: {
/**
Expand All @@ -466,21 +409,13 @@ declare module "@polkadot/api-base/types/consts" {
* The amount held on deposit for placing a tip report.
**/
tipReportDepositBase: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
tokens: {
maxLocks: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of named reserves that can exist on an account.
**/
maxReserves: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
transactionPayment: {
/**
Expand All @@ -507,10 +442,6 @@ declare module "@polkadot/api-base/types/consts" {
* transactions.
**/
operationalFeeMultiplier: u8 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
treasury: {
/**
Expand Down Expand Up @@ -544,31 +475,19 @@ declare module "@polkadot/api-base/types/consts" {
* Period between successive spends.
**/
spendPeriod: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
utility: {
/**
* The limit on the number of batched calls.
**/
batchedCallsLimit: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
vesting: {
maxVestingSchedules: u32 & AugmentedConst<ApiType>;
/**
* The minimum amount transferred to call `vested_transfer`.
**/
minVestedTransfer: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
xTokens: {
/**
Expand All @@ -582,10 +501,6 @@ declare module "@polkadot/api-base/types/consts" {
* Self chain location.
**/
selfLocation: XcmV3MultiLocation & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
} // AugmentedConsts
} // declare module
Loading

0 comments on commit f82a6d0

Please sign in to comment.