Socket
Socket
Sign inDemoInstall

micro-eth-signer

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micro-eth-signer - npm Package Compare versions

Comparing version 0.7.0 to 0.7.1

3

lib/_type_test.js

@@ -65,2 +65,5 @@ "use strict";

]));
assertType(web3.mapArgs([{ type: 'uint32[1][]' }]));
// zero sized arrays not supported by types
assertType(web3.mapArgs([{ type: 'uint32[0][]' }]));
// Without const

@@ -67,0 +70,0 @@ assertType(web3.mapArgs([

@@ -63,2 +63,5 @@ import * as web3 from './web3.js';

]));
assertType(web3.mapArgs([{ type: 'uint32[1][]' }]));
// zero sized arrays not supported by types
assertType(web3.mapArgs([{ type: 'uint32[0][]' }]));
// Without const

@@ -65,0 +68,0 @@ assertType(web3.mapArgs([

10

lib/esm/web3.js

@@ -81,7 +81,11 @@ import { keccak_256 } from '@noble/hashes/sha3';

let m;
if ((m = /^(.+)\[(\d+)?]$/.exec(c.type))) {
if ((m = ARRAY_RE.exec(c.type))) {
const inner = mapComponent({ ...c, type: m[1] });
if (inner.size === 0)
throw new Error('mapComponent: arrays of zero-size elements disabled (possible DoS attack)');
// Static array
if (+m[2]) {
let out = P.array(+m[2], inner);
if (m[3] !== undefined) {
if (!Number.isSafeInteger(+m[3]))
throw new Error(`mapComponent: wrong array size=${m[3]}`);
let out = P.array(+m[3], inner);
// Static array of dynamic values should be behind pointer too, again without reason.

@@ -88,0 +92,0 @@ if (inner.size === undefined)

@@ -88,7 +88,11 @@ "use strict";

let m;
if ((m = /^(.+)\[(\d+)?]$/.exec(c.type))) {
if ((m = ARRAY_RE.exec(c.type))) {
const inner = mapComponent({ ...c, type: m[1] });
if (inner.size === 0)
throw new Error('mapComponent: arrays of zero-size elements disabled (possible DoS attack)');
// Static array
if (+m[2]) {
let out = P.array(+m[2], inner);
if (m[3] !== undefined) {
if (!Number.isSafeInteger(+m[3]))
throw new Error(`mapComponent: wrong array size=${m[3]}`);
let out = P.array(+m[3], inner);
// Static array of dynamic values should be behind pointer too, again without reason.

@@ -95,0 +99,0 @@ if (inner.size === undefined)

{
"name": "micro-eth-signer",
"version": "0.7.0",
"version": "0.7.1",
"description": "Small tool for Ethereum transactions, addresses and smart contracts",

@@ -5,0 +5,0 @@ "files": [

@@ -93,2 +93,5 @@ import * as P from 'micro-packed';

);
assertType<P.CoderType<bigint[][]>>(web3.mapArgs([{ type: 'uint32[1][]' }] as const));
// zero sized arrays not supported by types
assertType<P.CoderType<unknown>>(web3.mapArgs([{ type: 'uint32[0][]' }] as const));
// Without const

@@ -95,0 +98,0 @@ assertType<P.CoderType<Record<string, unknown>>>(

@@ -195,7 +195,10 @@ import { keccak_256 } from '@noble/hashes/sha3';

let m;
if ((m = /^(.+)\[(\d+)?]$/.exec(c.type))) {
if ((m = ARRAY_RE.exec(c.type))) {
const inner = mapComponent({ ...c, type: m[1] });
if (inner.size === 0)
throw new Error('mapComponent: arrays of zero-size elements disabled (possible DoS attack)');
// Static array
if (+m[2]) {
let out = P.array(+m[2], inner);
if (m[3] !== undefined) {
if (!Number.isSafeInteger(+m[3])) throw new Error(`mapComponent: wrong array size=${m[3]}`);
let out = P.array(+m[3], inner);
// Static array of dynamic values should be behind pointer too, again without reason.

@@ -202,0 +205,0 @@ if (inner.size === undefined) out = P.pointer(PTR, out);

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