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

release: 0.0.1 #11

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
550 changes: 0 additions & 550 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

This file was deleted.

874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.1.cjs

This file was deleted.

894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.2.2.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .yarn/versions/61829e3e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declined:
- "@kiltprotocol/dip-sdk"
10 changes: 5 additions & 5 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules

npmPublishAccess: public

npmPublishRegistry: "https://registry.npmjs.org"

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"

yarnPath: .yarn/releases/yarn-3.6.1.cjs
yarnPath: .yarn/releases/yarn-4.2.2.cjs
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
"license": "BSD-4-Clause",
"main": "./dist/cjs/index.js",
"name": "@kiltprotocol/dip-sdk",
"packageManager": "yarn@3.6.1",
"packageManager": "yarn@4.2.2",
"repository": "github:kiltprotocol/dip-sdk",
"scripts": {
"build": "yarn build:cjs && yarn build:esm",
"build:cjs": "run -T tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json",
"build:docs": "typedoc --theme default --out docs/api --tsconfig tsconfig.docs.json && touch docs/.nojekyll",
"build:esm": "run -T tsc -p tsconfig.esm.json && echo '{\"type\": \"module\"}' > ./dist/esm/package.json",
"check": "tsc -p tsconfig.json",
"check": "tsc -p tsconfig.json --noEmit",
"clean": "yarn rimraf -g */{cjs,esm}",
"clean:docs": "rimraf docs/api",
"lint": "eslint --ext .ts .",
Expand All @@ -59,5 +59,5 @@
},
"type": "module",
"types": "./dist/cjs/index.d.ts",
"version": "0.0.0"
}
"version": "0.0.1"
}
2 changes: 0 additions & 2 deletions src/dipProof/extensions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@
* found in the LICENSE file in the root directory of this source tree.
*/

export type * from "./types.js"

export * as timeBoundDidSignature from "./timeBoundDidSignature.js"
7 changes: 6 additions & 1 deletion src/dipProof/extensions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
* found in the LICENSE file in the root directory of this source tree.
*/

export type * from "./timeBoundDidSignature.js"
export type {
TimeBoundDidSignatureConsumerOpts,
TimeBoundDidSignatureOpts,
TimeBoundDidSignatureProviderOpts,
TimeBoundDidSignatureRes,
} from "./timeBoundDidSignature.js"
2 changes: 0 additions & 2 deletions src/dipProof/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@
* found in the LICENSE file in the root directory of this source tree.
*/

export type * from "./types.js"

export * from "./subjectIdentity.js"
export * as extensions from "./extensions/index.js"
5 changes: 4 additions & 1 deletion src/dipProof/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
* found in the LICENSE file in the root directory of this source tree.
*/

export type * from "./subjectIdentity.js"
export type {
DipIdentityProofOpts,
DipIdentityProofRes,
} from "./subjectIdentity.js"
export type * from "./extensions/types.js"
2 changes: 0 additions & 2 deletions src/stateProof/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@
* found in the LICENSE file in the root directory of this source tree.
*/

export type * from "./types.js"

export * from "./providerStateRoot.js"
export * from "./subjectDipCommitment.js"
10 changes: 8 additions & 2 deletions src/stateProof/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@
* found in the LICENSE file in the root directory of this source tree.
*/

export type * from "./providerStateRoot.js"
export type * from "./subjectDipCommitment.js"
export type {
ProviderStateRootProofOpts,
ProviderStateRootProofRes,
} from "./providerStateRoot.js"
export type {
DipCommitmentProofOpts,
DipCommitmentProofRes,
} from "./subjectDipCommitment.js"
10 changes: 7 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
* found in the LICENSE file in the root directory of this source tree.
*/

export type * from "./stateProof/index.js"
export type * from "./dipProof/index.js"
export type * from "./sibling.js"
export type * from "./stateProof/types.js"
export type * from "./dipProof/types.js"
export type {
DipSiblingBaseProofInput,
DipSiblingBaseProofRes,
GenerateDipSubmittableExtrinsicInput,
} from "./sibling.js"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RELAY_IMAGE=parity/polkadot:v1.0.0
RELAY_ALICE_RPC=20001
PROVIDER_IMAGE=kiltprotocol/dip-provider-node-template:1.13.0
PROVIDER_IMAGE=kiltprotocol/dip-provider-node-template:1.14.3
PROVIDER_ALICE_RPC=20011
CONSUMER_IMAGE=kiltprotocol/dip-consumer-node-template:1.13.0
CONSUMER_IMAGE=kiltprotocol/dip-consumer-node-template:1.14.3
CONSUMER_ALICE_RPC=20021
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import type { Call } from "@polkadot/types/interfaces"
import type { Codec } from "@polkadot/types/types"
import type { u32 } from '@polkadot/types-codec'

import { signAndSubmitTx, withCrossModuleSystemImport } from "../utils.js"
import { createProviderApi, signAndSubmitTx, withCrossModuleSystemImport } from "../utils.js"

dotenv.config({
path: "tests/dip-provider-template-dip-consumer-template/.env.develop.test",
Expand Down Expand Up @@ -71,7 +71,7 @@ describe("V0", () => {
beforeAll(async () => {
const [relayApi, providerApi, consumerApi] = await Promise.all([
ApiPromise.create({ provider: new WsProvider(relayAddress) }),
Kilt.connect(providerAddress),
createProviderApi(providerAddress),
ApiPromise.create({ provider: new WsProvider(consumerAddress) }),
])
Kilt.ConfigService.set({ api: providerApi })
Expand Down Expand Up @@ -106,11 +106,11 @@ describe("V0", () => {
)
const providerUnit = "0".repeat(13)
const consumerUnit = "0".repeat(13)
const balanceTransferTxOnProviderChain = providerApi.tx.balances.transfer(
const balanceTransferTxOnProviderChain = providerApi.tx.balances.transferAllowDeath(
newSubmitterKeypair.address,
`1${providerUnit}`,
)
const balanceTransferTxOnConsumerChain = consumerApi.tx.balances.transfer(
const balanceTransferTxOnConsumerChain = consumerApi.tx.balances.transferAllowDeath(
newSubmitterKeypair.address,
`1${consumerUnit}`,
)
Expand Down
4 changes: 2 additions & 2 deletions tests/peregrine-dip-consumer-template/.env.develop.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RELAY_IMAGE=parity/polkadot:v1.0.0
RELAY_ALICE_RPC=50001
PROVIDER_IMAGE=kiltprotocol/kilt-node:1.13.0
PROVIDER_IMAGE=kiltprotocol/kilt-node:1.14.3
PROVIDER_ALICE_RPC=50010
CONSUMER_IMAGE=kiltprotocol/dip-consumer-node-template:1.13.0
CONSUMER_IMAGE=kiltprotocol/dip-consumer-node-template:1.14.3
CONSUMER_ALICE_RPC=50060
4 changes: 2 additions & 2 deletions tests/peregrine-dip-consumer-template/develop.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ describe("V0", () => {
)
const providerUnit = "0".repeat(16)
const consumerUnit = "0".repeat(13)
const balanceTransferTxOnProviderChain = providerApi.tx.balances.transfer(
const balanceTransferTxOnProviderChain = providerApi.tx.balances.transferAllowDeath(
newSubmitterKeypair.address,
`1${providerUnit}`,
)
const balanceTransferTxOnConsumerChain = consumerApi.tx.balances.transfer(
const balanceTransferTxOnConsumerChain = consumerApi.tx.balances.transferAllowDeath(
newSubmitterKeypair.address,
`1${consumerUnit}`,
)
Expand Down
17 changes: 13 additions & 4 deletions tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,24 @@
*/

import * as Kilt from "@kiltprotocol/sdk-js"
import { SubmittableResult } from "@polkadot/api"
import { dipProviderCalls, didCalls, types } from "@kiltprotocol/type-definitions"
import { ApiPromise, SubmittableResult, WsProvider } from "@polkadot/api"
import { describe } from "vitest"

import type { KeyringPair, SubmittableExtrinsic } from "@kiltprotocol/types"
import type { ApiPromise } from "@polkadot/api"
import type { AnyNumber, ISubmittableResult } from "@polkadot/types/types"
import type { AnyNumber, DefinitionsCall, ISubmittableResult } from "@polkadot/types/types"

const dipProviderTemplateRuntimeCalls: DefinitionsCall = {
...dipProviderCalls,
...didCalls,
}

export async function createProviderApi(address: string): Promise<ApiPromise> {
return Kilt.connect(address)
return ApiPromise.create({
provider: new WsProvider(address),
runtime: dipProviderTemplateRuntimeCalls,
types,
})
}

// Taken from the KILT SDK: https://github.com/KILTprotocol/sdk-js/blob/c4ab492812d19169532a399b57dd1bd013a61570/packages/chain-helpers/src/blockchain/Blockchain.ts#L179
Expand Down
17 changes: 0 additions & 17 deletions tsconfig.base.json

This file was deleted.

3 changes: 1 addition & 2 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "dist/cjs",
"module": "CommonJS",
"declaration": true
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
}
3 changes: 1 addition & 2 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "dist/esm",
"module": "Node16",
"declaration": true
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
}
16 changes: 13 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"module": "Node16",
"moduleResolution": "Node16",
"noEmit": true
"target": "ES2020",
"strict": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"sourceMap": false,
"declarationMap": false,
"esModuleInterop": false,
"skipLibCheck": true
},
"exclude": ["node_modules", "dist"],
"include": ["tests/**/*.ts", "src/**/*.ts"]
}
Loading