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

eth-json-rpc-errors

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eth-json-rpc-errors - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

2

package.json
{
"name": "eth-json-rpc-errors",
"version": "1.0.1",
"version": "1.1.0",
"description": "Ethereum JSON RPC errors and standard JSON RPC 2.0 errors.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -104,3 +104,7 @@

serialized.code = fallbackError.code
serialized.message = fallbackError.message
serialized.message = (
error && error.message
? error.message
: fallbackError.message
)
serialized.data = { originalError: assignOriginalError(error) }

@@ -107,0 +111,0 @@ }

@@ -20,2 +20,3 @@

const invalidError6 = undefined
const invalidError7 = { code: 34, message: dummyMessage , data: { ...dummyData } }

@@ -139,2 +140,18 @@ const validError0 = { code: 4001, message: dummyMessage }

test('invalid error: invalid code with string message', t => {
const result = serializeError(invalidError7)
t.ok(
dequal(
result,
{
code: jsonRpcCodes.internal,
message: dummyMessage,
data: { originalError: { ...invalidError7 } }
}
),
'serialized error matches expected result'
)
t.end()
})
test('valid error: code and message only', t => {

@@ -141,0 +158,0 @@ const result = serializeError(validError0)

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