Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fabric-contract-api

Package Overview
Dependencies
Maintainers
1
Versions
221
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fabric-contract-api - npm Package Compare versions

Comparing version 1.4.0-snapshot.26 to 1.4.0-snapshot.27

37

lib/annotations/transaction.js

@@ -16,22 +16,23 @@ /*

const description = '';
const contextType = target.createContext().constructor;
const paramTypes = Reflect.getMetadata('design:paramtypes', target, propertyKey) || [];
const parameters = paramTypes.map((paramType, paramIdx) => {
let numRemoved = 0;
const parameters = paramTypes.filter((paramType, paramIdx) => {
const filter = paramType === contextType;
if (filter) {
paramNames.splice(paramIdx - numRemoved++, 1);
}
return !filter;
}).map((paramType, paramIdx) => {
const paramName = paramNames[paramIdx];
if (typeof paramType === 'function') {
return {
name: paramName,
description,
schema: {
type: paramType.name.toLowerCase()
}
};
} else {
return {
name: paramName,
description,
schema: {
type: paramType.toString().toLowerCase()
}
};
}
return {
name: paramName,
description,
schema: {
type: typeof paramType === 'function' ? paramType.name.toLowerCase() : paramType.toString().toLowerCase()
}
};
});

@@ -38,0 +39,0 @@

{
"name": "fabric-contract-api",
"version": "1.4.0-snapshot.26",
"version": "1.4.0-snapshot.27",
"tag":"unstable",

@@ -5,0 +5,0 @@ "description": "A node.js implementation of Hyperledger Fabric chaincode shim, to allow endorsing peers and user-provided chaincodes to communicate with each other",

@@ -24,7 +24,13 @@ /*

const utils = require('../../../lib/annotations/utils');
const Context = require('../../../lib/context');
require('reflect-metadata');
describe('Transaction.js', () => {
class MockContext extends Context {}
const mockTarget = {
mockKey: 'something'
mockKey: 'something',
createContext() {
return new MockContext();
}
};

@@ -68,8 +74,11 @@

}]).onSecondCall().returns([
MockContext,
mockFunc,
'someType'
MockContext,
'someType',
MockContext,
]);
TransactionAnnotations.__set__('getParams', () => {
return ['param1', 'param2'];
return ['ctx', 'param1', 'ctx2', 'param2', 'ctx3'];
});

@@ -76,0 +85,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc