New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@polkadot/params

Package Overview
Dependencies
Maintainers
1
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polkadot/params - npm Package Compare versions

Comparing version 0.17.12 to 0.17.13

20

encode/param.js

@@ -12,11 +12,23 @@ "use strict";

const typeToString = require('../typeToString');
const encodeType = require('./type'); // flowlint-next-line unclear-type:off
module.exports = function encodeParam(param, value, version) {
module.exports = function encodeParam(param, value, version = 'latest') {
if (Array.isArray(param.type)) {
assert(Array.isArray(value) && value.length === param.type.length, `Expected array values, with length matching ${param.type.length}`); // flowlint-next-line unclear-type:off
assert(Array.isArray(value), () => `Expected array values of type '${typeToString(param.type)}'`); // flowlint-next-line unclear-type:off
const arr = value;
return u8aConcat(bnToU8a(arr.length, 32, true), u8aConcat.apply(null, arr.map((v, index) => encodeParam(param.type[index], v, version))));
const arr = value; // $FlowFixMe we have determined that it is an array above
const types = param.type;
if (types.length === 1) {
return u8aConcat(bnToU8a(arr.length, 32, true), u8aConcat.apply(null, arr.map((v, index) => encodeType(types[0], v, version))));
}
return u8aConcat(bnToU8a(arr.length, 32, true), u8aConcat.apply(null, arr.map((v, index) => // NOTE since we may have embedded again, move to Param shape
encodeParam({
type: types[index]
}, v, version))));
}

@@ -23,0 +35,0 @@

6

package.json
{
"name": "@polkadot/params",
"version": "0.17.12",
"version": "0.17.13",
"description": "Type defintions for parameters as passed in calls",

@@ -33,6 +33,6 @@ "main": "index.js",

"@babel/runtime": "^7.0.0-beta.47",
"@polkadot/extrinsics": "^0.17.12",
"@polkadot/primitives": "^0.17.12",
"@polkadot/extrinsics": "^0.17.13",
"@polkadot/primitives": "^0.17.13",
"@polkadot/util": "^0.22.4"
}
}

Sorry, the diff of this file is not supported yet

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