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

Introduce running of protocol substrate node and dkg node via the test-utils package #278

Merged
merged 33 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e3106bf
substrate package util
dharjeezy Sep 2, 2022
616b68b
Merge branch 'master' of https://github.com/webb-tools/webb.js into d…
dharjeezy Sep 2, 2022
129031d
local dkg setup
dharjeezy Sep 6, 2022
ef8d287
stable
dharjeezy Sep 6, 2022
b1bf36e
make use of substrate nodes in the mixer
dharjeezy Sep 6, 2022
89bb8bb
make use of test util substrate node for the mixer
dharjeezy Sep 6, 2022
0e2f7c6
lint
dharjeezy Sep 6, 2022
10f986c
other tests use test-util
dharjeezy Sep 6, 2022
b2f2f78
fetch leaves
dharjeezy Sep 6, 2022
110be28
unskip tests
dharjeezy Sep 6, 2022
0c7f007
startWebbNode()
dharjeezy Sep 6, 2022
2fbc9b9
introduce rpc properties
dharjeezy Sep 7, 2022
d5dd729
fix lint
dharjeezy Sep 7, 2022
a813013
Merge branch 'master' into dami/consolidate-test-util
dharjeezy Sep 7, 2022
b4d2f4c
Update tests/utils/backend-utils.ts
dharjeezy Sep 7, 2022
a4ee85d
Update tests/utils/backend-utils.ts
dharjeezy Sep 7, 2022
6f232ba
start webb nodes
dharjeezy Sep 8, 2022
17a311e
fix lint
dharjeezy Sep 8, 2022
3f2ee45
Merge branch 'master' of https://github.com/webb-tools/webb.js into d…
dharjeezy Sep 8, 2022
01b9926
lock
dharjeezy Sep 8, 2022
6e5188e
missing dependency
dharjeezy Sep 8, 2022
01dc288
Merge branch 'master' into dami/consolidate-test-util
dharjeezy Sep 8, 2022
27e111b
Update packages/test-utils/src/substrate/substrateNodeBase.ts
dharjeezy Sep 12, 2022
1fff4ca
remove unwanted configs
dharjeezy Sep 12, 2022
60fade2
Merge remote-tracking branch 'origin/dami/consolidate-test-util' into…
dharjeezy Sep 12, 2022
5a5daa6
remove unwanted configs
dharjeezy Sep 12, 2022
d5be3d6
lint fix
dharjeezy Sep 12, 2022
1c75253
changes
dharjeezy Sep 16, 2022
a2de406
Merge branch 'master' of https://github.com/webb-tools/webb.js into d…
dharjeezy Sep 16, 2022
f03d8af
unskip
dharjeezy Sep 16, 2022
357fe9f
remove any type
dharjeezy Sep 19, 2022
f17a6f7
Merge branch 'master' of https://github.com/webb-tools/webb.js into d…
dharjeezy Sep 28, 2022
2f678cc
merge changes
dharjeezy Sep 28, 2022
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
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
"ts-node": "10.8.0",
"tsconfig-paths": "^3.14.1",
"typedoc": "^0.23.13",
"typescript": "4.7.2"
"typescript": "4.7.2",
"get-port": "6.1.2",
"is-ci": "^3.0.1"
}
}
24 changes: 12 additions & 12 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
"type": "module",
"author": "Webb Developers <[email protected]>",
"license": "Apache-2.0",
"main": "./cjs/index.js",
"module": "./index.js",
"types": "./index.d.ts",
"main": "./build/cjs/index.js",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC @nepoche to check these since he would know best if this is how we should point to the files. Have a feeling we shouldn't have this. Any reason why its added @dharjeezy ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yh, so i was having issue trying to use the package in the integration tests. So, i had to point to the files like that just as it is being done here https://github.com/webb-tools/webb.js/blob/master/packages/sdk-core/package.json

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is consistent with the way we are building packages for the monorepo, esm, and cjs.

"module": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": {
"types": "./index.d.ts",
"require": "./cjs/index.js",
"default": "./index.js"
"types": "./build/index.d.ts",
"require": "./build/cjs/index.js",
"default": "./build/index.js"
},
"./index.js": {
"types": "./index.d.ts",
"require": "./cjs/index.js",
"default": "./index.js"
"types": "./build/index.d.ts",
"require": "./build/cjs/index.js",
"default": "./build/index.js"
},
"./src/index.js": {
"types": "./src/index.d.ts",
"require": "./src/cjs/index.js",
"default": "./src/index.js"
"types": "./build/src/index.d.ts",
"require": "./build/src/cjs/index.js",
"default": "./build/src/index.js"
},
"./cjs/index.js": "./cjs/index.js"
},
Expand Down
130 changes: 66 additions & 64 deletions packages/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,71 @@ import { derive as webbDerives } from '@webb-tools/api-derive/index.js';

import { ApiOptions } from '@polkadot/api/types';

export const rpcProperties = {
lt: {
getNeighborEdges: {
description: 'Query for the neighbor edges',
params: [
{
isOptional: false,
name: 'tree_id',
type: 'u32'
},
{
isOptional: true,
name: 'at',
type: 'Hash'
}
],
type: 'Vec<PalletLinkableTreeEdgeMetadata>'
},
getNeighborRoots: {
description: 'Query for the neighbor roots',
params: [
{
isOptional: false,
name: 'tree_id',
type: 'u32'
},
{
isOptional: true,
name: 'at',
type: 'Hash'
}
],
type: 'Vec<[u8; 32]>'
}
},
mt: {
getLeaves: {
description: 'Query for the tree leaves',
params: [
{
isOptional: false,
name: 'tree_id',
type: 'u32'
},
{
isOptional: false,
name: 'from',
type: 'u32'
},
{
isOptional: false,
name: 'to',
type: 'u32'
},
{
isOptional: true,
name: 'at',
type: 'Hash'
}
],
type: 'Vec<[u8; 32]>'
}
}
};

/**
*
* @returns Returns the `ApiOptions` for a Webb `protocol-substrate` node.
Expand All @@ -20,70 +85,7 @@ export const options = ({ types = {},
...webbDerives,
...derives
},
rpc: {
lt: {
getNeighborEdges: {
description: 'Query for the neighbor edges',
params: [
{
isOptional: false,
name: 'tree_id',
type: 'u32'
},
{
isOptional: true,
name: 'at',
type: 'Hash'
}
],
type: 'Vec<PalletLinkableTreeEdgeMetadata>'
},
getNeighborRoots: {
description: 'Query for the neighbor roots',
params: [
{
isOptional: false,
name: 'tree_id',
type: 'u32'
},
{
isOptional: true,
name: 'at',
type: 'Hash'
}
],
type: 'Vec<[u8; 32]>'
}
},
mt: {
getLeaves: {
description: 'Query for the tree leaves',
params: [
{
isOptional: false,
name: 'tree_id',
type: 'u32'
},
{
isOptional: false,
name: 'from',
type: 'u32'
},
{
isOptional: false,
name: 'to',
type: 'u32'
},
{
isOptional: true,
name: 'at',
type: 'Hash'
}
],
type: 'Vec<[u8; 32]>'
}
}
},
rpc: rpcProperties,
types: {
...types
},
Expand Down
46 changes: 29 additions & 17 deletions packages/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@
"description": "Utilities to work with Webb in test environments",
"author": "Webb Developers <[email protected]>",
"type": "module",
"main": "./cjs/index.js",
"module": "./index.js",
"types": "./index.d.ts",
"main": "./build/cjs/index.js",
"module": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": {
"types": "./index.d.ts",
"require": "./cjs/index.js",
"default": "./index.js"
"types": "./build/index.d.ts",
"require": "./build/cjs/index.js",
"default": "./build/index.js"
},
"./index.js": {
"types": "./index.d.ts",
"require": "./cjs/index.js",
"default": "./index.js"
"types": "./build/index.d.ts",
"require": "./build/cjs/index.js",
"default": "./build/index.js"
},
"./src/index.js": {
"types": "./src/index.d.ts",
"require": "./src/cjs/index.js",
"default": "./src/index.js"
"types": "./build/src/index.d.ts",
"require": "./build/src/cjs/index.js",
"default": "./build/src/index.js"
}
},
"license": "Apache-2.0",
Expand All @@ -30,16 +30,28 @@
"registry": "https://registry.npmjs.org"
},
"repository": "https://github.com/webb-tools/webb.js.git",
"resolutions": {
"@webb-tools/api": "0.1.4-106",
"@webb-tools/sdk-core": "0.1.4-106"
},
"dependencies": {
"@polkadot/api": "9.2.4",
"@polkadot/keyring": "10.1.7",
"@webb-tools/api": "0.1.4-106",
"@webb-tools/protocol-solidity": "0.2.7",
"@webb-tools/sdk-core": "0.1.4-106",
"@webb-tools/tokens": "0.2.7",
"@webb-tools/utils": "0.2.7",
"@webb-tools/vbridge": "0.2.7",
"@webb-tools/tokens": "0.2.6",
"@webb-tools/utils": "0.2.6",
"@webb-tools/vbridge": "0.2.6",
"@webb-tools/protocol-solidity": "0.2.6",
"ecpair": "^2.0.1",
"ethers": "5.7.0",
"ganache": "7.4.1"
"ganache": "7.4.1",
"get-port": "6.1.2",
"is-ci": "^3.0.1",
"tiny-secp256k1": "^2.2.1",
"prettier": "^2.2.1"
},
"devDependencies": {
"@types/is-ci": "^3.0.0"
}
}
2 changes: 2 additions & 0 deletions packages/test-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
export * from './utils.js';
export * from './startGanacheServer.js';
export * from './localEvmChain.js';
export * from './substrate/localProtocolSubstrate.js';
export * from './substrate/substrateNodeBase.js';
Loading