misc fixes

This commit is contained in:
Pavel Murygin 2023-02-08 02:01:27 +04:00
parent d5b090edfa
commit f8eb751983
6 changed files with 15 additions and 9 deletions

View File

@ -1,7 +1,7 @@
import { SecurityTetraplet } from '@fluencelabs/avm'; import { SecurityTetraplet } from '@fluencelabs/avm';
import type { MultiaddrInput } from '@multiformats/multiaddr'; import type { MultiaddrInput } from '@multiformats/multiaddr';
import { FnConfig, FunctionCallDef, ServiceDef } from './compilerSupport'; import { FnConfig, FunctionCallDef, ServiceDef } from './compilerSupport.js';
export * from './compilerSupport'; export * from './compilerSupport.js';
/** /**
* Peer ID's id as a base58 string (multihash/CIDv0). * Peer ID's id as a base58 string (multihash/CIDv0).

View File

@ -1,4 +1,4 @@
import { aqua2ts, ts2aqua } from '../conversions'; import { aqua2ts, ts2aqua } from '../conversions.js';
const i32 = { tag: 'scalar', name: 'i32' } as const; const i32 = { tag: 'scalar', name: 'i32' } as const;

View File

@ -5,8 +5,8 @@ import {
NonArrowType, NonArrowType,
getArgumentTypes, getArgumentTypes,
isReturnTypeVoid, isReturnTypeVoid,
IFluencePeer,
} from '@fluencelabs/interface'; } from '@fluencelabs/interface';
import { IFluencePeer } from '@fluencelabs/interface';
import { import {
injectRelayService, injectRelayService,

View File

@ -1,6 +1,6 @@
import { jsonify } from '../js-peer/utils.js'; import { jsonify } from '../js-peer/utils.js';
import { match } from 'ts-pattern'; import { match } from 'ts-pattern';
import { ArrowType, ArrowWithoutCallbacks, NonArrowType } from '@fluencelabs/interface'; import type { ArrowType, ArrowWithoutCallbacks, NonArrowType } from '@fluencelabs/interface';
import { CallServiceData } from '../interfaces/commonTypes.js'; import { CallServiceData } from '../interfaces/commonTypes.js';
/** /**
@ -103,6 +103,7 @@ export const ts2aqua = (value: any, type: NonArrowType): any => {
return [ts2aqua(value, opt.type)]; return [ts2aqua(value, opt.type)];
} }
}) })
// @ts-ignore
.with({ tag: 'scalar' }, { tag: 'bottomType' }, { tag: 'topType' }, () => { .with({ tag: 'scalar' }, { tag: 'bottomType' }, { tag: 'topType' }, () => {
return value; return value;
}) })

View File

@ -1,5 +1,4 @@
import { IFluencePeer } from '@fluencelabs/interface'; import type { IFluencePeer, ServiceDef } from '@fluencelabs/interface';
import { ServiceDef } from '@fluencelabs/interface';
import { registerGlobalService, userHandlerService } from './services.js'; import { registerGlobalService, userHandlerService } from './services.js';
export const registerServiceImpl = ( export const registerServiceImpl = (

View File

@ -3,10 +3,16 @@ import { match } from 'ts-pattern';
import { Particle } from '../js-peer/Particle.js'; import { Particle } from '../js-peer/Particle.js';
import { CallServiceData, GenericCallServiceHandler, ResultCodes } from '../interfaces/commonTypes.js'; import { CallServiceData, GenericCallServiceHandler, ResultCodes } from '../interfaces/commonTypes.js';
import { IFluencePeer, CallParams } from '@fluencelabs/interface';
import { aquaArgs2Ts, responseServiceValue2ts, returnType2Aqua, ts2aqua } from './conversions.js'; import { aquaArgs2Ts, responseServiceValue2ts, returnType2Aqua, ts2aqua } from './conversions.js';
import { ArrowWithoutCallbacks, FunctionCallConstants, FunctionCallDef, NonArrowType } from '@fluencelabs/interface'; import {
IFluencePeer,
CallParams,
ArrowWithoutCallbacks,
FunctionCallConstants,
FunctionCallDef,
NonArrowType,
} from '@fluencelabs/interface';
export interface ServiceDescription { export interface ServiceDescription {
serviceId: string; serviceId: string;