diff --git a/contract/package.json b/contract/package.json index 61d640d..be8e2c7 100644 --- a/contract/package.json +++ b/contract/package.json @@ -72,9 +72,9 @@ "asn1js": "^2.0.22", "fabric-contract-api": "1.4.1", "fabric-shim": "1.4.1", - "get-params": "^0.1.2", "pkijs": "^2.1.76", "reflect-metadata": "^0.1.13", + "reflect-params": "1.0.1", "uuid": "^3.3.2" } } diff --git a/contract/src/lib/ledger-api/state.ts b/contract/src/lib/ledger-api/state.ts index c906c9f..ab987a9 100644 --- a/contract/src/lib/ledger-api/state.ts +++ b/contract/src/lib/ledger-api/state.ts @@ -15,8 +15,8 @@ limitations under the License. 'use strict'; import { Object as ContractObject, Property } from 'fabric-contract-api'; -import * as getParams from 'get-params'; import 'reflect-metadata'; +import { ReflectParams } from 'reflect-params'; export interface IState { new (...args: any[]): T; @@ -53,7 +53,7 @@ export class State { } const paramNames: string[] = Reflect.getMetadata('contract:function', objClass.prototype, 'constructor') || - getParams(objClass.prototype.constructor); + ReflectParams(objClass.prototype.constructor); const args = []; const missingFields = []; diff --git a/contract/src/lib/utils/annotations.ts b/contract/src/lib/utils/annotations.ts index 1ad8b08..3ab45ba 100644 --- a/contract/src/lib/utils/annotations.ts +++ b/contract/src/lib/utils/annotations.ts @@ -11,8 +11,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import * as getParams from 'get-params'; import 'reflect-metadata'; +import { ReflectParams } from 'reflect-params'; export function NotRequired(target: any, propertyKey: string, descriptor: number) { if (typeof propertyKey === 'undefined') { @@ -21,7 +21,7 @@ export function NotRequired(target: any, propertyKey: string, descriptor: number } const existingParams = Reflect.getMetadata('contract:function', target, propertyKey) || - getParams(target[propertyKey]); + ReflectParams(target[propertyKey]); existingParams[descriptor] = (existingParams[descriptor] as string).endsWith('?') ? existingParams[descriptor] : existingParams[descriptor] + '?'; diff --git a/package-lock.json b/package-lock.json index f424aff..3934fcc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vehicle-manufacture-iot-extension", - "version": "1.0.0", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": {