mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2025-03-15 07:20:49 +00:00
Bump libp2p, reorganize projects
This commit is contained in:
parent
f89519941b
commit
8d5a4e8064
@ -1,6 +1,6 @@
|
||||
module Export
|
||||
|
||||
import SignResult, Sig from "./services.aqua"
|
||||
import SignResult, Sig from "../src/services.aqua"
|
||||
export Sig, DataProvider, callSig
|
||||
|
||||
service DataProvider("data"):
|
18
packages/@tests-integration/.gitignore
vendored
18
packages/@tests-integration/.gitignore
vendored
@ -1,18 +0,0 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
bundle/
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
/dist/
|
||||
|
||||
.idea
|
@ -1,6 +0,0 @@
|
||||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
testTimeout: 10000,
|
||||
testPathIgnorePatterns: ['/node_modules/', 'dist'],
|
||||
};
|
@ -1,34 +0,0 @@
|
||||
{
|
||||
"name": "integration-tests",
|
||||
"version": "0.0.0",
|
||||
"description": "Tests",
|
||||
"scripts": {
|
||||
"compile-aqua": "aqua -i ./aqua -o ./src/_aqua",
|
||||
"test": "jest",
|
||||
"prebuild": "compile-aqua",
|
||||
"build": "tsc"
|
||||
},
|
||||
"author": "Fluence Labs",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@fluencelabs/fluence": "workspace:*",
|
||||
"@fluencelabs/fluence-network-environment": "^1.0.13",
|
||||
"@multiformats/multiaddr": "^10.1.8",
|
||||
"bs58": "5.0.0",
|
||||
"js-base64": "^3.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fluencelabs/aqua": "^0.7.2-307",
|
||||
"@fluencelabs/aqua-lib": "^0.5.1",
|
||||
"@types/jest": "^27.5.1",
|
||||
"@types/node": "^17.0.36",
|
||||
"@types/platform": "^1.3.4",
|
||||
"@types/uuid": "^8.3.4",
|
||||
"add": "^2.0.6",
|
||||
"jest": "^28.1.0",
|
||||
"jest-each": "^28.1.0",
|
||||
"ts-jest": "^28.0.2",
|
||||
"ts-node": "^10.8.1",
|
||||
"typescript": "^4.0.0"
|
||||
}
|
||||
}
|
@ -1,139 +0,0 @@
|
||||
import { KeyPair, CallParams } from '@fluencelabs/fluence';
|
||||
import { Sig, defaultSigGuard, allowServiceFn } from '@fluencelabs/fluence/dist/internal/forTests';
|
||||
import { toUint8Array } from 'js-base64';
|
||||
|
||||
const key = '+cmeYlZKj+MfSa9dpHV+BmLPm6wq4inGlsPlQ1GvtPk=';
|
||||
|
||||
const context = (async () => {
|
||||
const keyBytes = toUint8Array(key);
|
||||
const kp = await KeyPair.fromEd25519SK(keyBytes);
|
||||
const res = {
|
||||
peerKeyPair: kp,
|
||||
peerId: kp.libp2pPeerId.toString(),
|
||||
};
|
||||
return res;
|
||||
})();
|
||||
|
||||
const testData = [1, 2, 3, 4, 5, 6, 7, 9, 10];
|
||||
|
||||
// signature produced by KeyPair created from key above (`key` variable)
|
||||
const testDataSig = [
|
||||
224, 104, 245, 206, 140, 248, 27, 72, 68, 133, 111, 10, 164, 197, 242, 132, 107, 77, 224, 67, 99, 106, 76, 29, 144,
|
||||
121, 122, 169, 36, 173, 58, 80, 170, 102, 137, 253, 157, 247, 168, 87, 162, 223, 188, 214, 203, 220, 52, 246, 29,
|
||||
86, 77, 71, 224, 248, 16, 213, 254, 75, 78, 239, 243, 222, 241, 15,
|
||||
];
|
||||
|
||||
// signature produced by KeyPair created from some random KeyPair
|
||||
const testDataWrongSig = [
|
||||
116, 247, 189, 118, 236, 53, 147, 123, 219, 75, 176, 105, 101, 108, 233, 137, 97, 14, 146, 132, 252, 70, 51, 153,
|
||||
237, 167, 156, 150, 36, 90, 229, 108, 166, 231, 255, 137, 8, 246, 125, 0, 213, 150, 83, 196, 237, 221, 131, 159,
|
||||
157, 159, 25, 109, 95, 160, 181, 65, 254, 238, 47, 156, 240, 151, 58, 14,
|
||||
];
|
||||
|
||||
const makeTetraplet = (initPeerId: string, serviceId?: string, fnName?: string): CallParams<'data'> => {
|
||||
return {
|
||||
initPeerId: initPeerId,
|
||||
tetraplets: {
|
||||
data: [
|
||||
{
|
||||
function_name: fnName,
|
||||
service_id: serviceId,
|
||||
},
|
||||
],
|
||||
},
|
||||
} as any;
|
||||
};
|
||||
|
||||
describe('Sig service tests', () => {
|
||||
it('sig.sign should create the correct signature', async () => {
|
||||
const ctx = await context;
|
||||
const sig = new Sig(ctx.peerKeyPair);
|
||||
|
||||
const res = await sig.sign(testData, makeTetraplet(ctx.peerId));
|
||||
|
||||
expect(res.success).toBe(true);
|
||||
expect(res.signature).toStrictEqual(testDataSig);
|
||||
});
|
||||
|
||||
it('sig.verify should return true for the correct signature', async () => {
|
||||
const ctx = await context;
|
||||
const sig = new Sig(ctx.peerKeyPair);
|
||||
|
||||
const res = await sig.verify(testDataSig, testData);
|
||||
|
||||
expect(res).toBe(true);
|
||||
});
|
||||
|
||||
it('sig.verify should return false for the incorrect signature', async () => {
|
||||
const ctx = await context;
|
||||
const sig = new Sig(ctx.peerKeyPair);
|
||||
|
||||
const res = await sig.verify(testDataWrongSig, testData);
|
||||
|
||||
expect(res).toBe(false);
|
||||
});
|
||||
|
||||
it('sign-verify call chain should work', async () => {
|
||||
const ctx = await context;
|
||||
const sig = new Sig(ctx.peerKeyPair);
|
||||
|
||||
const signature = await sig.sign(testData, makeTetraplet(ctx.peerId));
|
||||
const res = await sig.verify(signature.signature as number[], testData);
|
||||
|
||||
expect(res).toBe(true);
|
||||
});
|
||||
|
||||
it('sig.sign with defaultSigGuard should work for correct callParams', async () => {
|
||||
const ctx = await context;
|
||||
const sig = new Sig(ctx.peerKeyPair);
|
||||
sig.securityGuard = defaultSigGuard(ctx.peerId);
|
||||
|
||||
const signature = await sig.sign(testData, makeTetraplet(ctx.peerId, 'registry', 'get_route_bytes'));
|
||||
|
||||
await expect(signature).toBeDefined();
|
||||
});
|
||||
|
||||
it('sig.sign with defaultSigGuard should not allow particles initiated from incorrect service', async () => {
|
||||
const ctx = await context;
|
||||
const sig = new Sig(ctx.peerKeyPair);
|
||||
sig.securityGuard = defaultSigGuard(ctx.peerId);
|
||||
|
||||
const res = await sig.sign(testData, makeTetraplet(ctx.peerId, 'other_service', 'other_fn'));
|
||||
|
||||
await expect(res.success).toBe(false);
|
||||
await expect(res.error).toBe('Security guard validation failed');
|
||||
});
|
||||
|
||||
it('sig.sign with defaultSigGuard should not allow particles initiated from other peers', async () => {
|
||||
const ctx = await context;
|
||||
const sig = new Sig(ctx.peerKeyPair);
|
||||
sig.securityGuard = defaultSigGuard(ctx.peerId);
|
||||
|
||||
const res = await sig.sign(
|
||||
testData,
|
||||
makeTetraplet((await KeyPair.randomEd25519()).toB58String(), 'registry', 'get_key_bytes'),
|
||||
);
|
||||
|
||||
await expect(res.success).toBe(false);
|
||||
await expect(res.error).toBe('Security guard validation failed');
|
||||
});
|
||||
|
||||
it('changing securityGuard should work', async () => {
|
||||
const ctx = await context;
|
||||
const sig = new Sig(ctx.peerKeyPair);
|
||||
sig.securityGuard = allowServiceFn('test', 'test');
|
||||
|
||||
const successful1 = await sig.sign(testData, makeTetraplet(ctx.peerId, 'test', 'test'));
|
||||
const unSuccessful1 = await sig.sign(testData, makeTetraplet(ctx.peerId, 'wrong', 'wrong'));
|
||||
|
||||
sig.securityGuard = allowServiceFn('wrong', 'wrong');
|
||||
|
||||
const successful2 = await sig.sign(testData, makeTetraplet(ctx.peerId, 'wrong', 'wrong'));
|
||||
const unSuccessful2 = await sig.sign(testData, makeTetraplet(ctx.peerId, 'test', 'test'));
|
||||
|
||||
expect(successful1.success).toBe(true);
|
||||
expect(successful2.success).toBe(true);
|
||||
expect(unSuccessful1.success).toBe(false);
|
||||
expect(unSuccessful2.success).toBe(false);
|
||||
});
|
||||
});
|
@ -1,137 +0,0 @@
|
||||
/**
|
||||
*
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.7.2-314
|
||||
*
|
||||
*/
|
||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||
import { CallParams, callFunction, registerService } from '@fluencelabs/fluence/dist/internal/compilerSupport/v3';
|
||||
|
||||
// Services
|
||||
|
||||
export interface SigDef {
|
||||
get_pub_key: (callParams: CallParams<null>) => string | Promise<string>;
|
||||
sign: (
|
||||
data: number[],
|
||||
callParams: CallParams<'data'>,
|
||||
) =>
|
||||
| { error: string | null; signature: number[] | null; success: boolean }
|
||||
| Promise<{ error: string | null; signature: number[] | null; success: boolean }>;
|
||||
verify: (
|
||||
signature: number[],
|
||||
data: number[],
|
||||
callParams: CallParams<'signature' | 'data'>,
|
||||
) => boolean | Promise<boolean>;
|
||||
}
|
||||
export function registerSig(service: SigDef): void;
|
||||
export function registerSig(serviceId: string, service: SigDef): void;
|
||||
export function registerSig(peer: FluencePeer, service: SigDef): void;
|
||||
export function registerSig(peer: FluencePeer, serviceId: string, service: SigDef): void;
|
||||
|
||||
export function registerSig(...args: any) {
|
||||
registerService(args, {
|
||||
defaultServiceId: 'sig',
|
||||
functions: {
|
||||
tag: 'labeledProduct',
|
||||
fields: {
|
||||
get_pub_key: {
|
||||
tag: 'arrow',
|
||||
domain: {
|
||||
tag: 'nil',
|
||||
},
|
||||
codomain: {
|
||||
tag: 'unlabeledProduct',
|
||||
items: [
|
||||
{
|
||||
tag: 'scalar',
|
||||
name: 'string',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
sign: {
|
||||
tag: 'arrow',
|
||||
domain: {
|
||||
tag: 'labeledProduct',
|
||||
fields: {
|
||||
data: {
|
||||
tag: 'array',
|
||||
type: {
|
||||
tag: 'scalar',
|
||||
name: 'u8',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
codomain: {
|
||||
tag: 'unlabeledProduct',
|
||||
items: [
|
||||
{
|
||||
tag: 'struct',
|
||||
name: 'SignResult',
|
||||
fields: {
|
||||
error: {
|
||||
tag: 'option',
|
||||
type: {
|
||||
tag: 'scalar',
|
||||
name: 'string',
|
||||
},
|
||||
},
|
||||
signature: {
|
||||
tag: 'option',
|
||||
type: {
|
||||
tag: 'array',
|
||||
type: {
|
||||
tag: 'scalar',
|
||||
name: 'u8',
|
||||
},
|
||||
},
|
||||
},
|
||||
success: {
|
||||
tag: 'scalar',
|
||||
name: 'bool',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
verify: {
|
||||
tag: 'arrow',
|
||||
domain: {
|
||||
tag: 'labeledProduct',
|
||||
fields: {
|
||||
signature: {
|
||||
tag: 'array',
|
||||
type: {
|
||||
tag: 'scalar',
|
||||
name: 'u8',
|
||||
},
|
||||
},
|
||||
data: {
|
||||
tag: 'array',
|
||||
type: {
|
||||
tag: 'scalar',
|
||||
name: 'u8',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
codomain: {
|
||||
tag: 'unlabeledProduct',
|
||||
items: [
|
||||
{
|
||||
tag: 'scalar',
|
||||
name: 'bool',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// Functions
|
@ -1,18 +0,0 @@
|
||||
import { Fluence } from '@fluencelabs/fluence';
|
||||
import fs from 'fs';
|
||||
import { call } from './_aqua/marine-js';
|
||||
|
||||
const main = async () => {
|
||||
const wasm = await fs.promises.readFile(__dirname + '__test__/integration/greeting.wasm');
|
||||
await Fluence.registerMarineService(wasm, 'greeting');
|
||||
const res = await call('test');
|
||||
return res;
|
||||
};
|
||||
|
||||
main()
|
||||
.then((res) => {
|
||||
console.log('done', res);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist/",
|
||||
"target": "ES5",
|
||||
"module": "commonjs",
|
||||
},
|
||||
"extends": "../../tsconfig.json",
|
||||
"include": [
|
||||
"src/**/*",
|
||||
]
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
"author": "Fluence Labs",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"libp2p": "fluencelabs/js-libp2p#no-nat-manager",
|
||||
"libp2p": "fluencelabs/js-libp2p#ae99a9dcdf73461ca00642f9592e416b9c5fbd1f",
|
||||
"@chainsafe/libp2p-noise": "^6.1.1",
|
||||
"@libp2p/mplex": "^1.0.5",
|
||||
"@libp2p/peer-id": "^1.1.10",
|
||||
|
@ -1,42 +0,0 @@
|
||||
import * as bs58 from 'bs58';
|
||||
import { KeyPair } from '../internal/KeyPair';
|
||||
|
||||
describe('KeyPair tests', () => {
|
||||
it('generate keypair from seed', async function () {
|
||||
// arrange
|
||||
const random = await KeyPair.randomEd25519();
|
||||
const privateKey = random.toEd25519PrivateKey();
|
||||
|
||||
// act
|
||||
const keyPair = await KeyPair.fromEd25519SK(privateKey);
|
||||
const privateKey2 = keyPair.toEd25519PrivateKey();
|
||||
|
||||
// assert
|
||||
expect(privateKey).toStrictEqual(privateKey2);
|
||||
});
|
||||
|
||||
it('create keypair from ed25519 private key', async function () {
|
||||
// arrange
|
||||
const rustSK = 'jDaxLJzYtzgwTMrELJCAqavtmx85ktQNfB2rLcK7MhH';
|
||||
const sk = bs58.decode(rustSK);
|
||||
|
||||
// act
|
||||
const keyPair = await KeyPair.fromEd25519SK(sk);
|
||||
|
||||
// assert
|
||||
const expectedPeerId = '12D3KooWH1W3VznVZ87JH4FwABK4mkntcspTVWJDta6c2xg9Pzbp';
|
||||
expect(keyPair.libp2pPeerId.toString()).toStrictEqual(expectedPeerId);
|
||||
});
|
||||
|
||||
it('create keypair from a seed phrase', async function () {
|
||||
// arrange
|
||||
const seedArray = new Uint8Array(32).fill(1);
|
||||
|
||||
// act
|
||||
const keyPair = await KeyPair.fromEd25519SK(seedArray);
|
||||
|
||||
// assert
|
||||
const expectedPeerId = '12D3KooWK99VoVxNE7XzyBwXEzW7xhK7Gpv85r9F3V3fyKSUKPH5';
|
||||
expect(keyPair.libp2pPeerId.toString()).toStrictEqual(expectedPeerId);
|
||||
});
|
||||
});
|
@ -3,11 +3,11 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.7.2-314
|
||||
* Aqua version: 0.7.0-287
|
||||
*
|
||||
*/
|
||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||
import { CallParams, callFunction, registerService } from '@fluencelabs/fluence/dist/internal/compilerSupport/v3';
|
||||
import { Fluence, FluencePeer } from '../../index';
|
||||
import { CallParams, callFunction, registerService } from '../../internal/compilerSupport/v3';
|
||||
|
||||
// Services
|
||||
|
@ -3,11 +3,11 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.7.2-314
|
||||
* Aqua version: 0.7.0-285
|
||||
*
|
||||
*/
|
||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||
import { CallParams, callFunction, registerService } from '@fluencelabs/fluence/dist/internal/compilerSupport/v3';
|
||||
import { Fluence, FluencePeer } from '../../index';
|
||||
import { CallParams, callFunction, registerService } from '../../internal/compilerSupport/v3';
|
||||
|
||||
// Services
|
||||
|
@ -3,11 +3,11 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.7.2-314
|
||||
* Aqua version: 0.7.0-285
|
||||
*
|
||||
*/
|
||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||
import { CallParams, callFunction, registerService } from '@fluencelabs/fluence/dist/internal/compilerSupport/v3';
|
||||
import { Fluence, FluencePeer } from '../../index';
|
||||
import { CallParams, callFunction, registerService } from '../../internal/compilerSupport/v3';
|
||||
|
||||
// Services
|
||||
|
@ -1,5 +1,3 @@
|
||||
import { krasnodar } from '@fluencelabs/fluence-network-environment';
|
||||
|
||||
// Uncomment to test on dev nodes
|
||||
// export const nodes = [
|
||||
// {
|
||||
@ -18,4 +16,9 @@ import { krasnodar } from '@fluencelabs/fluence-network-environment';
|
||||
docker run --rm -e RUST_LOG="info" -p 1210:1210 -p 4310:4310 fluencelabs/fluence -t 1210 -w 4310 -k gKdiCSUr1TFGFEgu2t8Ch1XEUsrN5A2UfBLjSZvfci9SPR3NvZpACfcpPGC3eY4zma1pk7UvYv5zb1VjvPHwCjj --local
|
||||
|
||||
*/
|
||||
export const nodes = krasnodar;
|
||||
export const nodes = [
|
||||
{
|
||||
multiaddr: '/ip4/127.0.0.1/tcp/4310/ws/p2p/12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3',
|
||||
peerId: '12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3',
|
||||
},
|
||||
];
|
@ -1,5 +1,6 @@
|
||||
import { FluencePeer } from '@fluencelabs/fluence';
|
||||
import { registerHandlersHelper, handleTimeout } from '@fluencelabs/fluence/dist/internal/forTests';
|
||||
import { FluencePeer } from '../../index';
|
||||
import { handleTimeout } from '../../internal/utils';
|
||||
import { registerHandlersHelper } from '../util';
|
||||
|
||||
let peer: FluencePeer;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||
import { Fluence, FluencePeer } from '../../index';
|
||||
import fs from 'fs';
|
||||
import { call } from '../../_aqua/marine-js';
|
||||
import { call_info } from '../../_aqua/marine-js-logging';
|
||||
import { call } from '../_aqua/marine-js';
|
||||
import { call_info } from '../_aqua/marine-js-logging';
|
||||
|
||||
describe('Marine js tests', () => {
|
||||
beforeEach(async () => {
|
@ -1,13 +1,9 @@
|
||||
import { Multiaddr } from '@multiformats/multiaddr';
|
||||
// import { Multiaddr } from '@multiformats/multiaddr';
|
||||
|
||||
import { nodes } from '../../connection';
|
||||
import { FluencePeer } from '@fluencelabs/fluence';
|
||||
import {
|
||||
checkConnection,
|
||||
doNothing,
|
||||
handleTimeout,
|
||||
registerHandlersHelper,
|
||||
} from '@fluencelabs/fluence/dist/internal/forTests';
|
||||
import { nodes } from '../connection';
|
||||
import { FluencePeer } from '../../index';
|
||||
import { checkConnection, doNothing, handleTimeout } from '../../internal/utils';
|
||||
import { registerHandlersHelper } from '../util';
|
||||
|
||||
let peer: FluencePeer;
|
||||
|
||||
@ -189,12 +185,13 @@ describe('Typescript usage suite', () => {
|
||||
expect(isConnected).toBeTruthy();
|
||||
});
|
||||
|
||||
it('address as multiaddr', async () => {
|
||||
await peer.start({ connectTo: new Multiaddr(nodes[0].multiaddr) });
|
||||
const isConnected = await checkConnection(peer);
|
||||
|
||||
expect(isConnected).toBeTruthy();
|
||||
});
|
||||
// FIXME::
|
||||
//it('address as multiaddr', async () => {
|
||||
// await peer.start({ connectTo: new Multiaddr(nodes[0].multiaddr) });
|
||||
// const isConnected = await checkConnection(peer);
|
||||
//
|
||||
// expect(isConnected).toBeTruthy();
|
||||
//});
|
||||
|
||||
it('address as node', async () => {
|
||||
await peer.start({ connectTo: nodes[0] });
|
@ -1,6 +1,6 @@
|
||||
import { Fluence, FluencePeer, KeyPair, setLogLevel } from '@fluencelabs/fluence';
|
||||
import { allowServiceFn, Sig } from '@fluencelabs/fluence/dist/services';
|
||||
import { registerSig, registerDataProvider, callSig } from '../../_aqua/sig-tests';
|
||||
import { Fluence, FluencePeer, KeyPair, setLogLevel } from '../../index';
|
||||
import { allowServiceFn, Sig } from '../../services';
|
||||
import { registerSig, registerDataProvider, callSig } from '../_aqua/sig-tests';
|
||||
|
||||
let peer: FluencePeer;
|
||||
|
@ -1,5 +1,6 @@
|
||||
import * as bs58 from 'bs58';
|
||||
import { KeyPair } from '@fluencelabs/fluence';
|
||||
import * as base64 from 'base64-js';
|
||||
import { KeyPair } from '@fluencelabs/fluence-keypair';
|
||||
|
||||
describe('KeyPair tests', () => {
|
||||
it('generate keypair from seed', async function () {
|
||||
@ -18,7 +19,7 @@ describe('KeyPair tests', () => {
|
||||
it('create keypair from ed25519 private key', async function () {
|
||||
// arrange
|
||||
const rustSK = 'jDaxLJzYtzgwTMrELJCAqavtmx85ktQNfB2rLcK7MhH';
|
||||
const sk = bs58.decode(rustSK).slice(0, 32);
|
||||
const sk = bs58.decode(rustSK);
|
||||
|
||||
// act
|
||||
const keyPair = await KeyPair.fromEd25519SK(sk);
|
@ -1,6 +1,9 @@
|
||||
import { CallParams, CallServiceData } from '../internal/commonTypes';
|
||||
import { CallParams, CallServiceData } from '../../internal/commonTypes';
|
||||
import each from 'jest-each';
|
||||
import { builtInServices } from '../internal/builtins/common';
|
||||
import { builtInServices } from '../../internal/builtins/common';
|
||||
import { KeyPair } from '@fluencelabs/fluence-keypair';
|
||||
import { Sig, defaultSigGuard, allowServiceFn } from '../../internal/builtins/Sig';
|
||||
import { toUint8Array } from 'js-base64';
|
||||
|
||||
const a10b20 = `{
|
||||
"a": 10,
|
||||
@ -166,3 +169,139 @@ describe('Tests for default handler', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
const key = '+cmeYlZKj+MfSa9dpHV+BmLPm6wq4inGlsPlQ1GvtPk=';
|
||||
|
||||
const context = (async () => {
|
||||
const keyBytes = toUint8Array(key);
|
||||
const kp = await KeyPair.fromEd25519SK(keyBytes);
|
||||
const res = {
|
||||
peerKeyPair: kp,
|
||||
peerId: kp.libp2pPeerId.toString(),
|
||||
};
|
||||
return res;
|
||||
})();
|
||||
|
||||
const testData = [1, 2, 3, 4, 5, 6, 7, 9, 10];
|
||||
|
||||
// signature produced by KeyPair created from key above (`key` variable)
|
||||
const testDataSig = [
|
||||
224, 104, 245, 206, 140, 248, 27, 72, 68, 133, 111, 10, 164, 197, 242, 132, 107, 77, 224, 67, 99, 106, 76, 29, 144,
|
||||
121, 122, 169, 36, 173, 58, 80, 170, 102, 137, 253, 157, 247, 168, 87, 162, 223, 188, 214, 203, 220, 52, 246, 29,
|
||||
86, 77, 71, 224, 248, 16, 213, 254, 75, 78, 239, 243, 222, 241, 15,
|
||||
];
|
||||
|
||||
// signature produced by KeyPair created from some random KeyPair
|
||||
const testDataWrongSig = [
|
||||
116, 247, 189, 118, 236, 53, 147, 123, 219, 75, 176, 105, 101, 108, 233, 137, 97, 14, 146, 132, 252, 70, 51, 153,
|
||||
237, 167, 156, 150, 36, 90, 229, 108, 166, 231, 255, 137, 8, 246, 125, 0, 213, 150, 83, 196, 237, 221, 131, 159,
|
||||
157, 159, 25, 109, 95, 160, 181, 65, 254, 238, 47, 156, 240, 151, 58, 14,
|
||||
];
|
||||
|
||||
const makeTetraplet = (initPeerId: string, serviceId?: string, fnName?: string): CallParams<'data'> => {
|
||||
return {
|
||||
initPeerId: initPeerId,
|
||||
tetraplets: {
|
||||
data: [
|
||||
{
|
||||
function_name: fnName,
|
||||
service_id: serviceId,
|
||||
},
|
||||
],
|
||||
},
|
||||
} as any;
|
||||
};
|
||||
|
||||
describe('Sig service tests', () => {
|
||||
it('sig.sign should create the correct signature', async () => {
|
||||
const ctx = await context;
|
||||
const sig = new Sig(ctx.peerKeyPair);
|
||||
|
||||
const res = await sig.sign(testData, makeTetraplet(ctx.peerId));
|
||||
|
||||
expect(res.success).toBe(true);
|
||||
expect(res.signature).toStrictEqual(testDataSig);
|
||||
});
|
||||
|
||||
it('sig.verify should return true for the correct signature', async () => {
|
||||
const ctx = await context;
|
||||
const sig = new Sig(ctx.peerKeyPair);
|
||||
|
||||
const res = await sig.verify(testDataSig, testData);
|
||||
|
||||
expect(res).toBe(true);
|
||||
});
|
||||
|
||||
it('sig.verify should return false for the incorrect signature', async () => {
|
||||
const ctx = await context;
|
||||
const sig = new Sig(ctx.peerKeyPair);
|
||||
|
||||
const res = await sig.verify(testDataWrongSig, testData);
|
||||
|
||||
expect(res).toBe(false);
|
||||
});
|
||||
|
||||
it('sign-verify call chain should work', async () => {
|
||||
const ctx = await context;
|
||||
const sig = new Sig(ctx.peerKeyPair);
|
||||
|
||||
const signature = await sig.sign(testData, makeTetraplet(ctx.peerId));
|
||||
const res = await sig.verify(signature.signature as number[], testData);
|
||||
|
||||
expect(res).toBe(true);
|
||||
});
|
||||
|
||||
it('sig.sign with defaultSigGuard should work for correct callParams', async () => {
|
||||
const ctx = await context;
|
||||
const sig = new Sig(ctx.peerKeyPair);
|
||||
sig.securityGuard = defaultSigGuard(ctx.peerId);
|
||||
|
||||
const signature = await sig.sign(testData, makeTetraplet(ctx.peerId, 'registry', 'get_route_bytes'));
|
||||
|
||||
await expect(signature).toBeDefined();
|
||||
});
|
||||
|
||||
it('sig.sign with defaultSigGuard should not allow particles initiated from incorrect service', async () => {
|
||||
const ctx = await context;
|
||||
const sig = new Sig(ctx.peerKeyPair);
|
||||
sig.securityGuard = defaultSigGuard(ctx.peerId);
|
||||
|
||||
const res = await sig.sign(testData, makeTetraplet(ctx.peerId, 'other_service', 'other_fn'));
|
||||
|
||||
await expect(res.success).toBe(false);
|
||||
await expect(res.error).toBe('Security guard validation failed');
|
||||
});
|
||||
|
||||
it('sig.sign with defaultSigGuard should not allow particles initiated from other peers', async () => {
|
||||
const ctx = await context;
|
||||
const sig = new Sig(ctx.peerKeyPair);
|
||||
sig.securityGuard = defaultSigGuard(ctx.peerId);
|
||||
|
||||
const res = await sig.sign(
|
||||
testData,
|
||||
makeTetraplet((await KeyPair.randomEd25519()).toB58String(), 'registry', 'get_key_bytes'),
|
||||
);
|
||||
|
||||
await expect(res.success).toBe(false);
|
||||
await expect(res.error).toBe('Security guard validation failed');
|
||||
});
|
||||
|
||||
it('changing securityGuard should work', async () => {
|
||||
const ctx = await context;
|
||||
const sig = new Sig(ctx.peerKeyPair);
|
||||
sig.securityGuard = allowServiceFn('test', 'test');
|
||||
|
||||
const successful1 = await sig.sign(testData, makeTetraplet(ctx.peerId, 'test', 'test'));
|
||||
const unSuccessful1 = await sig.sign(testData, makeTetraplet(ctx.peerId, 'wrong', 'wrong'));
|
||||
|
||||
sig.securityGuard = allowServiceFn('wrong', 'wrong');
|
||||
|
||||
const successful2 = await sig.sign(testData, makeTetraplet(ctx.peerId, 'wrong', 'wrong'));
|
||||
const unSuccessful2 = await sig.sign(testData, makeTetraplet(ctx.peerId, 'test', 'test'));
|
||||
|
||||
expect(successful1.success).toBe(true);
|
||||
expect(successful2.success).toBe(true);
|
||||
expect(unSuccessful1.success).toBe(false);
|
||||
expect(unSuccessful2.success).toBe(false);
|
||||
});
|
||||
});
|
@ -1,7 +1,7 @@
|
||||
import each from 'jest-each';
|
||||
|
||||
import { Fluence, FluencePeer } from '../..';
|
||||
import { forTests } from '../../internal/compilerSupport/v2';
|
||||
import { Fluence, FluencePeer } from '../../..';
|
||||
import { forTests } from '../../../internal/compilerSupport/v2';
|
||||
|
||||
const peer = new FluencePeer();
|
||||
const cfg = { ttl: 1000 };
|
@ -1,5 +1,5 @@
|
||||
import each from 'jest-each';
|
||||
import { aqua2ts, ts2aqua } from '../../internal/compilerSupport/v3impl/conversions';
|
||||
import { aqua2ts, ts2aqua } from '../../../internal/compilerSupport/v3impl/conversions';
|
||||
|
||||
const i32 = { tag: 'scalar', name: 'i32' } as const;
|
||||
|
15
packages/fluence-js/src/__test__/util.ts
Normal file
15
packages/fluence-js/src/__test__/util.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { FluencePeer } from '../index';
|
||||
import { Particle } from '../internal/Particle';
|
||||
import { MakeServiceCall } from '../internal/utils';
|
||||
|
||||
export const registerHandlersHelper = (
|
||||
peer: FluencePeer,
|
||||
particle: Particle,
|
||||
handlers: Record<string, Record<string, any>>,
|
||||
) => {
|
||||
Object.entries(handlers).forEach(([serviceId, service]) => {
|
||||
Object.entries(service).forEach(([fnName, fn]) => {
|
||||
peer.internals.regHandler.forParticle(particle.id, serviceId, fnName, MakeServiceCall(fn));
|
||||
});
|
||||
});
|
||||
};
|
243
pnpm-lock.yaml
generated
243
pnpm-lock.yaml
generated
@ -2,45 +2,6 @@ lockfileVersion: 5.4
|
||||
|
||||
importers:
|
||||
|
||||
packages/@tests-integration:
|
||||
specifiers:
|
||||
'@fluencelabs/aqua': ^0.7.2-307
|
||||
'@fluencelabs/aqua-lib': ^0.5.1
|
||||
'@fluencelabs/fluence': workspace:*
|
||||
'@fluencelabs/fluence-network-environment': ^1.0.13
|
||||
'@multiformats/multiaddr': ^10.1.8
|
||||
'@types/jest': ^27.5.1
|
||||
'@types/node': ^17.0.36
|
||||
'@types/platform': ^1.3.4
|
||||
'@types/uuid': ^8.3.4
|
||||
add: ^2.0.6
|
||||
bs58: 5.0.0
|
||||
jest: ^28.1.0
|
||||
jest-each: ^28.1.0
|
||||
js-base64: ^3.7.2
|
||||
ts-jest: ^28.0.2
|
||||
ts-node: ^10.8.1
|
||||
typescript: ^4.0.0
|
||||
dependencies:
|
||||
'@fluencelabs/fluence': link:../fluence-js
|
||||
'@fluencelabs/fluence-network-environment': 1.0.13
|
||||
'@multiformats/multiaddr': 10.1.8
|
||||
bs58: 5.0.0
|
||||
js-base64: 3.7.2
|
||||
devDependencies:
|
||||
'@fluencelabs/aqua': 0.7.2-314_7sa2e64agunq5kj4zcolhrnkbm
|
||||
'@fluencelabs/aqua-lib': 0.5.1
|
||||
'@types/jest': 27.5.1
|
||||
'@types/node': 17.0.36
|
||||
'@types/platform': 1.3.4
|
||||
'@types/uuid': 8.3.4
|
||||
add: 2.0.6
|
||||
jest: 28.1.0_5safgrhnvw3xobf557mvjg2uay
|
||||
jest-each: 28.1.0
|
||||
ts-jest: 28.0.3_7sa2e64agunq5kj4zcolhrnkbm
|
||||
ts-node: 10.8.1_w6gfxie3xfwntbz3mwbbvycbdq
|
||||
typescript: 4.7.2
|
||||
|
||||
packages/fluence-connection:
|
||||
specifiers:
|
||||
'@chainsafe/libp2p-noise': ^6.1.1
|
||||
@ -55,7 +16,7 @@ importers:
|
||||
browser-or-node: ^2.0.0
|
||||
it-length-prefixed: 5.0.3
|
||||
it-pipe: 1.1.0
|
||||
libp2p: fluencelabs/js-libp2p#no-nat-manager
|
||||
libp2p: fluencelabs/js-libp2p#ae99a9dcdf73461ca00642f9592e416b9c5fbd1f
|
||||
loglevel: 1.8.0
|
||||
rollup: ^2.74.1
|
||||
rollup-plugin-clear: ^2.0.7
|
||||
@ -74,7 +35,7 @@ importers:
|
||||
browser-or-node: 2.0.0
|
||||
it-length-prefixed: 5.0.3
|
||||
it-pipe: 1.1.0
|
||||
libp2p: github.com/fluencelabs/js-libp2p/1b3cd8b401e2cff36b45527bc5dc6a66de0fb495_ghdhn57z7cu2fxsztxwq2v4ikm
|
||||
libp2p: github.com/fluencelabs/js-libp2p/ae99a9dcdf73461ca00642f9592e416b9c5fbd1f_ghdhn57z7cu2fxsztxwq2v4ikm
|
||||
loglevel: 1.8.0
|
||||
devDependencies:
|
||||
'@libp2p/interfaces': 2.0.2
|
||||
@ -161,7 +122,7 @@ importers:
|
||||
cids: 1.1.9
|
||||
it-length-prefixed: 5.0.3
|
||||
it-pipe: 1.1.0
|
||||
libp2p: github.com/fluencelabs/js-libp2p/1b3cd8b401e2cff36b45527bc5dc6a66de0fb495_uluuwrprffmsiwy2zanpihzgue
|
||||
libp2p: github.com/fluencelabs/js-libp2p/ae99a9dcdf73461ca00642f9592e416b9c5fbd1f_uluuwrprffmsiwy2zanpihzgue
|
||||
loglevel: 1.8.0
|
||||
platform: 1.3.6
|
||||
regenerator-runtime: 0.13.9
|
||||
@ -587,6 +548,7 @@ packages:
|
||||
engines: {node: '>=12'}
|
||||
dependencies:
|
||||
'@jridgewell/trace-mapping': 0.3.9
|
||||
dev: false
|
||||
|
||||
/@fluencelabs/aqua-ipfs/0.5.2:
|
||||
resolution: {integrity: sha512-vSZYH6mjCGly7Cifts1c84icAzeq6pQf3aspEW3ttA0AFVQTjDWlr86Imseg+p3I9oaNUykv/W+VqWX1ouj9Vg==}
|
||||
@ -629,6 +591,7 @@ packages:
|
||||
|
||||
/@fluencelabs/fluence-network-environment/1.0.13:
|
||||
resolution: {integrity: sha512-2pci3T0sUHE08jwEs1r/vHKVT4XUh/A3j/QJ0eIhddsxyIjEksjdn05X7DF6STD14CF8GgBVOJEPgav8qaUMpA==}
|
||||
dev: true
|
||||
|
||||
/@fluencelabs/fluence/0.23.0_7sa2e64agunq5kj4zcolhrnkbm:
|
||||
resolution: {integrity: sha512-HbSmOzXnRaLKUfS75FreXJ6E1P4HA+Qi0yUFD1VfEyvN5p40ujzHGu5wv+6hHOQnBJPkWse9Lv4U9NQVdwUzvQ==}
|
||||
@ -753,49 +716,6 @@ packages:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- ts-node
|
||||
dev: true
|
||||
|
||||
/@jest/core/28.1.0_ts-node@10.8.1:
|
||||
resolution: {integrity: sha512-/2PTt0ywhjZ4NwNO4bUqD9IVJfmFVhVKGlhvSpmEfUCuxYf/3NHcKmRFI+I71lYzbTT3wMuYpETDCTHo81gC/g==}
|
||||
engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}
|
||||
peerDependencies:
|
||||
node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
|
||||
peerDependenciesMeta:
|
||||
node-notifier:
|
||||
optional: true
|
||||
dependencies:
|
||||
'@jest/console': 28.1.0
|
||||
'@jest/reporters': 28.1.0
|
||||
'@jest/test-result': 28.1.0
|
||||
'@jest/transform': 28.1.0
|
||||
'@jest/types': 28.1.0
|
||||
'@types/node': 17.0.36
|
||||
ansi-escapes: 4.3.2
|
||||
chalk: 4.1.2
|
||||
ci-info: 3.3.1
|
||||
exit: 0.1.2
|
||||
graceful-fs: 4.2.10
|
||||
jest-changed-files: 28.0.2
|
||||
jest-config: 28.1.0_5safgrhnvw3xobf557mvjg2uay
|
||||
jest-haste-map: 28.1.0
|
||||
jest-message-util: 28.1.0
|
||||
jest-regex-util: 28.0.2
|
||||
jest-resolve: 28.1.0
|
||||
jest-resolve-dependencies: 28.1.0
|
||||
jest-runner: 28.1.0
|
||||
jest-runtime: 28.1.0
|
||||
jest-snapshot: 28.1.0
|
||||
jest-util: 28.1.0
|
||||
jest-validate: 28.1.0
|
||||
jest-watcher: 28.1.0
|
||||
micromatch: 4.0.5
|
||||
pretty-format: 28.1.0
|
||||
rimraf: 3.0.2
|
||||
slash: 3.0.0
|
||||
strip-ansi: 6.0.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- ts-node
|
||||
|
||||
/@jest/environment/28.1.0:
|
||||
resolution: {integrity: sha512-S44WGSxkRngzHslhV6RoAExekfF7Qhwa6R5+IYFa81mpcj0YgdBnRSmvHe3SNwOt64yXaE5GG8Y2xM28ii5ssA==}
|
||||
@ -997,6 +917,7 @@ packages:
|
||||
dependencies:
|
||||
'@jridgewell/resolve-uri': 3.0.7
|
||||
'@jridgewell/sourcemap-codec': 1.4.13
|
||||
dev: false
|
||||
|
||||
/@libp2p/connection/2.0.3:
|
||||
resolution: {integrity: sha512-anzB0bZ0SA8+WiIkypZeTeh6V5gEtaE7RutGWOP3O1jroFXvQgkXyYxXm58ZnSIHhV6sKc6HWRPvb37fCtyT2Q==}
|
||||
@ -1762,15 +1683,19 @@ packages:
|
||||
|
||||
/@tsconfig/node10/1.0.8:
|
||||
resolution: {integrity: sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==}
|
||||
dev: false
|
||||
|
||||
/@tsconfig/node12/1.0.9:
|
||||
resolution: {integrity: sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==}
|
||||
dev: false
|
||||
|
||||
/@tsconfig/node14/1.0.1:
|
||||
resolution: {integrity: sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==}
|
||||
dev: false
|
||||
|
||||
/@tsconfig/node16/1.0.2:
|
||||
resolution: {integrity: sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==}
|
||||
dev: false
|
||||
|
||||
/@types/babel__core/7.1.19:
|
||||
resolution: {integrity: sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw==}
|
||||
@ -1934,6 +1859,7 @@ packages:
|
||||
/acorn-walk/8.2.0:
|
||||
resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==}
|
||||
engines: {node: '>=0.4.0'}
|
||||
dev: false
|
||||
|
||||
/acorn/8.7.1:
|
||||
resolution: {integrity: sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==}
|
||||
@ -2006,6 +1932,7 @@ packages:
|
||||
|
||||
/arg/4.1.3:
|
||||
resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
|
||||
dev: false
|
||||
|
||||
/argparse/1.0.10:
|
||||
resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==}
|
||||
@ -2421,6 +2348,7 @@ packages:
|
||||
|
||||
/create-require/1.1.1:
|
||||
resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}
|
||||
dev: false
|
||||
|
||||
/cross-spawn/7.0.3:
|
||||
resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}
|
||||
@ -2506,6 +2434,7 @@ packages:
|
||||
/diff/4.0.2:
|
||||
resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==}
|
||||
engines: {node: '>=0.3.1'}
|
||||
dev: false
|
||||
|
||||
/dns-over-http-resolver/1.2.3:
|
||||
resolution: {integrity: sha512-miDiVSI6KSNbi4SVifzO/reD8rMnxgrlnkrlkugOLQpWQTe2qMdHsZp5DmfKjxNE+/T3VAAYLQUZMv9SMr6+AA==}
|
||||
@ -3553,33 +3482,6 @@ packages:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
/jest-cli/28.1.0_5safgrhnvw3xobf557mvjg2uay:
|
||||
resolution: {integrity: sha512-fDJRt6WPRriHrBsvvgb93OxgajHHsJbk4jZxiPqmZbMDRcHskfJBBfTyjFko0jjfprP544hOktdSi9HVgl4VUQ==}
|
||||
engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
|
||||
peerDependenciesMeta:
|
||||
node-notifier:
|
||||
optional: true
|
||||
dependencies:
|
||||
'@jest/core': 28.1.0_ts-node@10.8.1
|
||||
'@jest/test-result': 28.1.0
|
||||
'@jest/types': 28.1.0
|
||||
chalk: 4.1.2
|
||||
exit: 0.1.2
|
||||
graceful-fs: 4.2.10
|
||||
import-local: 3.1.0
|
||||
jest-config: 28.1.0_5safgrhnvw3xobf557mvjg2uay
|
||||
jest-util: 28.1.0
|
||||
jest-validate: 28.1.0
|
||||
prompts: 2.4.2
|
||||
yargs: 17.5.1
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- supports-color
|
||||
- ts-node
|
||||
|
||||
/jest-cli/28.1.0_@types+node@17.0.36:
|
||||
resolution: {integrity: sha512-fDJRt6WPRriHrBsvvgb93OxgajHHsJbk4jZxiPqmZbMDRcHskfJBBfTyjFko0jjfprP544hOktdSi9HVgl4VUQ==}
|
||||
engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}
|
||||
@ -3606,46 +3508,6 @@ packages:
|
||||
- '@types/node'
|
||||
- supports-color
|
||||
- ts-node
|
||||
dev: true
|
||||
|
||||
/jest-config/28.1.0_5safgrhnvw3xobf557mvjg2uay:
|
||||
resolution: {integrity: sha512-aOV80E9LeWrmflp7hfZNn/zGA4QKv/xsn2w8QCBP0t0+YqObuCWTSgNbHJ0j9YsTuCO08ZR/wsvlxqqHX20iUA==}
|
||||
engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}
|
||||
peerDependencies:
|
||||
'@types/node': '*'
|
||||
ts-node: '>=9.0.0'
|
||||
peerDependenciesMeta:
|
||||
'@types/node':
|
||||
optional: true
|
||||
ts-node:
|
||||
optional: true
|
||||
dependencies:
|
||||
'@babel/core': 7.18.2
|
||||
'@jest/test-sequencer': 28.1.0
|
||||
'@jest/types': 28.1.0
|
||||
'@types/node': 17.0.36
|
||||
babel-jest: 28.1.0_@babel+core@7.18.2
|
||||
chalk: 4.1.2
|
||||
ci-info: 3.3.1
|
||||
deepmerge: 4.2.2
|
||||
glob: 7.2.3
|
||||
graceful-fs: 4.2.10
|
||||
jest-circus: 28.1.0
|
||||
jest-environment-node: 28.1.0
|
||||
jest-get-type: 28.0.2
|
||||
jest-regex-util: 28.0.2
|
||||
jest-resolve: 28.1.0
|
||||
jest-runner: 28.1.0
|
||||
jest-util: 28.1.0
|
||||
jest-validate: 28.1.0
|
||||
micromatch: 4.0.5
|
||||
parse-json: 5.2.0
|
||||
pretty-format: 28.1.0
|
||||
slash: 3.0.0
|
||||
strip-json-comments: 3.1.1
|
||||
ts-node: 10.8.1_w6gfxie3xfwntbz3mwbbvycbdq
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
/jest-config/28.1.0_@types+node@17.0.36:
|
||||
resolution: {integrity: sha512-aOV80E9LeWrmflp7hfZNn/zGA4QKv/xsn2w8QCBP0t0+YqObuCWTSgNbHJ0j9YsTuCO08ZR/wsvlxqqHX20iUA==}
|
||||
@ -3684,7 +3546,6 @@ packages:
|
||||
strip-json-comments: 3.1.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/jest-diff/27.5.1:
|
||||
resolution: {integrity: sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw==}
|
||||
@ -3991,24 +3852,6 @@ packages:
|
||||
merge-stream: 2.0.0
|
||||
supports-color: 8.1.1
|
||||
|
||||
/jest/28.1.0_5safgrhnvw3xobf557mvjg2uay:
|
||||
resolution: {integrity: sha512-TZR+tHxopPhzw3c3560IJXZWLNHgpcz1Zh0w5A65vynLGNcg/5pZ+VildAd7+XGOu6jd58XMY/HNn0IkZIXVXg==}
|
||||
engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
|
||||
peerDependenciesMeta:
|
||||
node-notifier:
|
||||
optional: true
|
||||
dependencies:
|
||||
'@jest/core': 28.1.0_ts-node@10.8.1
|
||||
import-local: 3.1.0
|
||||
jest-cli: 28.1.0_5safgrhnvw3xobf557mvjg2uay
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
- supports-color
|
||||
- ts-node
|
||||
|
||||
/jest/28.1.0_@types+node@17.0.36:
|
||||
resolution: {integrity: sha512-TZR+tHxopPhzw3c3560IJXZWLNHgpcz1Zh0w5A65vynLGNcg/5pZ+VildAd7+XGOu6jd58XMY/HNn0IkZIXVXg==}
|
||||
engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}
|
||||
@ -4026,7 +3869,6 @@ packages:
|
||||
- '@types/node'
|
||||
- supports-color
|
||||
- ts-node
|
||||
dev: true
|
||||
|
||||
/joycon/3.1.1:
|
||||
resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==}
|
||||
@ -4035,6 +3877,7 @@ packages:
|
||||
|
||||
/js-base64/3.7.2:
|
||||
resolution: {integrity: sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ==}
|
||||
dev: true
|
||||
|
||||
/js-sha3/0.8.0:
|
||||
resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==}
|
||||
@ -5503,7 +5346,7 @@ packages:
|
||||
dev: true
|
||||
|
||||
/truncate-utf8-bytes/1.0.2:
|
||||
resolution: {integrity: sha1-QFkjkJWS1W94pYGENLC3hInKXys=}
|
||||
resolution: {integrity: sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==}
|
||||
dependencies:
|
||||
utf8-byte-length: 1.0.4
|
||||
|
||||
@ -5531,7 +5374,7 @@ packages:
|
||||
'@types/jest': 27.5.1
|
||||
bs-logger: 0.2.6
|
||||
fast-json-stable-stringify: 2.1.0
|
||||
jest: 28.1.0_5safgrhnvw3xobf557mvjg2uay
|
||||
jest: 28.1.0_@types+node@17.0.36
|
||||
jest-util: 27.5.1
|
||||
json5: 2.2.1
|
||||
lodash.memoize: 4.1.2
|
||||
@ -5564,7 +5407,7 @@ packages:
|
||||
'@types/jest': 27.5.1
|
||||
bs-logger: 0.2.6
|
||||
fast-json-stable-stringify: 2.1.0
|
||||
jest: 28.1.0_5safgrhnvw3xobf557mvjg2uay
|
||||
jest: 28.1.0_@types+node@17.0.36
|
||||
jest-util: 28.1.0
|
||||
json5: 2.2.1
|
||||
lodash.memoize: 4.1.2
|
||||
@ -5649,36 +5492,6 @@ packages:
|
||||
yn: 3.1.1
|
||||
dev: false
|
||||
|
||||
/ts-node/10.8.1_w6gfxie3xfwntbz3mwbbvycbdq:
|
||||
resolution: {integrity: sha512-Wwsnao4DQoJsN034wePSg5nZiw4YKXf56mPIAeD6wVmiv+RytNSWqc2f3fKvcUoV+Yn2+yocD71VOfQHbmVX4g==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
'@swc/core': '>=1.2.50'
|
||||
'@swc/wasm': '>=1.2.50'
|
||||
'@types/node': '*'
|
||||
typescript: '>=2.7'
|
||||
peerDependenciesMeta:
|
||||
'@swc/core':
|
||||
optional: true
|
||||
'@swc/wasm':
|
||||
optional: true
|
||||
dependencies:
|
||||
'@cspotcode/source-map-support': 0.8.1
|
||||
'@tsconfig/node10': 1.0.8
|
||||
'@tsconfig/node12': 1.0.9
|
||||
'@tsconfig/node14': 1.0.1
|
||||
'@tsconfig/node16': 1.0.2
|
||||
'@types/node': 17.0.36
|
||||
acorn: 8.7.1
|
||||
acorn-walk: 8.2.0
|
||||
arg: 4.1.3
|
||||
create-require: 1.1.1
|
||||
diff: 4.0.2
|
||||
make-error: 1.3.6
|
||||
typescript: 4.7.2
|
||||
v8-compile-cache-lib: 3.0.1
|
||||
yn: 3.1.1
|
||||
|
||||
/ts-node/7.0.1:
|
||||
resolution: {integrity: sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==}
|
||||
engines: {node: '>=4.2.0'}
|
||||
@ -5787,7 +5600,7 @@ packages:
|
||||
dev: true
|
||||
|
||||
/utf8-byte-length/1.0.4:
|
||||
resolution: {integrity: sha1-9F8VDExm7uloGGUFq5P8u4rWv2E=}
|
||||
resolution: {integrity: sha512-4+wkEYLBbWxqTahEsWrhxepcoVOJ+1z5PGIjPZxRkytcdSUaNjIjBM7Xn8E+pdSuV7SzvWovBFA54FO0JSoqhA==}
|
||||
|
||||
/util-deprecate/1.0.2:
|
||||
resolution: {integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=}
|
||||
@ -5810,6 +5623,7 @@ packages:
|
||||
|
||||
/v8-compile-cache-lib/3.0.1:
|
||||
resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
|
||||
dev: false
|
||||
|
||||
/v8-to-istanbul/9.0.0:
|
||||
resolution: {integrity: sha512-HcvgY/xaRm7isYmyx+lFKA4uQmfUbN0J4M0nNItvzTvH/iQ9kW5j/t4YSR+Ge323/lrgDAWJoF46tzGQHwBHFw==}
|
||||
@ -5955,17 +5769,18 @@ packages:
|
||||
/yn/3.1.1:
|
||||
resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==}
|
||||
engines: {node: '>=6'}
|
||||
dev: false
|
||||
|
||||
/yocto-queue/1.0.0:
|
||||
resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==}
|
||||
engines: {node: '>=12.20'}
|
||||
dev: false
|
||||
|
||||
github.com/fluencelabs/js-libp2p/1b3cd8b401e2cff36b45527bc5dc6a66de0fb495_ghdhn57z7cu2fxsztxwq2v4ikm:
|
||||
resolution: {tarball: https://codeload.github.com/fluencelabs/js-libp2p/tar.gz/1b3cd8b401e2cff36b45527bc5dc6a66de0fb495}
|
||||
id: github.com/fluencelabs/js-libp2p/1b3cd8b401e2cff36b45527bc5dc6a66de0fb495
|
||||
github.com/fluencelabs/js-libp2p/ae99a9dcdf73461ca00642f9592e416b9c5fbd1f_ghdhn57z7cu2fxsztxwq2v4ikm:
|
||||
resolution: {tarball: https://codeload.github.com/fluencelabs/js-libp2p/tar.gz/ae99a9dcdf73461ca00642f9592e416b9c5fbd1f}
|
||||
id: github.com/fluencelabs/js-libp2p/ae99a9dcdf73461ca00642f9592e416b9c5fbd1f
|
||||
name: libp2p
|
||||
version: 0.37.2
|
||||
version: 0.37.3
|
||||
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
|
||||
prepare: true
|
||||
requiresBuild: true
|
||||
@ -6030,11 +5845,11 @@ packages:
|
||||
- undici
|
||||
dev: false
|
||||
|
||||
github.com/fluencelabs/js-libp2p/1b3cd8b401e2cff36b45527bc5dc6a66de0fb495_uluuwrprffmsiwy2zanpihzgue:
|
||||
resolution: {tarball: https://codeload.github.com/fluencelabs/js-libp2p/tar.gz/1b3cd8b401e2cff36b45527bc5dc6a66de0fb495}
|
||||
id: github.com/fluencelabs/js-libp2p/1b3cd8b401e2cff36b45527bc5dc6a66de0fb495
|
||||
github.com/fluencelabs/js-libp2p/ae99a9dcdf73461ca00642f9592e416b9c5fbd1f_uluuwrprffmsiwy2zanpihzgue:
|
||||
resolution: {tarball: https://codeload.github.com/fluencelabs/js-libp2p/tar.gz/ae99a9dcdf73461ca00642f9592e416b9c5fbd1f}
|
||||
id: github.com/fluencelabs/js-libp2p/ae99a9dcdf73461ca00642f9592e416b9c5fbd1f
|
||||
name: libp2p
|
||||
version: 0.37.2
|
||||
version: 0.37.3
|
||||
engines: {node: '>=16.0.0', npm: '>=7.0.0'}
|
||||
prepare: true
|
||||
requiresBuild: true
|
||||
|
Loading…
x
Reference in New Issue
Block a user