Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
fix for getting params (#21)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Hurt <[email protected]>
  • Loading branch information
awjh-ibm authored Sep 5, 2019
1 parent 33896b1 commit 9c25cc1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion contract/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 2 additions & 2 deletions contract/src/lib/ledger-api/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> {
new (...args: any[]): T;
Expand Down Expand Up @@ -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 = [];
Expand Down
4 changes: 2 additions & 2 deletions contract/src/lib/utils/annotations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -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] + '?';
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9c25cc1

Please sign in to comment.