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

@appliedblockchain/parity-revert-reason

Package Overview
Dependencies
Maintainers
20
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appliedblockchain/parity-revert-reason - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

index.js

@@ -15,3 +15,3 @@ const debug = require('debug')('parity-revert-reason')

const throwWithRevertReason = async (web3, rawTxHash, defaultMsg = 'Transaction failed.') => {
const throwWithRevertReason = async (web3, rawTxHash, fallbackMsg = 'Transaction failed.') => {
return new Promise((resolve, reject) => {

@@ -44,3 +44,3 @@ debug('rawTxHash', rawTxHash)

return reject(new Error(defaultMsg))
return reject(new Error(fallbackMsg))
})

@@ -47,0 +47,0 @@ })

{
"name": "@appliedblockchain/parity-revert-reason",
"version": "1.0.0",
"version": "1.0.1",
"description": "Small function and tests for retrieving Solidity revert reason from require()",

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

@@ -13,6 +13,22 @@ # Get EVM revert reason on Parity

# Run the tests
## Usage
```js
const { throwWithRevertReason } = require('@appliedblockchain/parity-revert-reason')
const method = 'myMethod'
const args = []
const contract = new web3.eth.Contract(abi, address)
const txParams = {...}
const tx = await web3.eth.signTransaction(txParams)
await web3.eth.sendSignedTransaction(tx.raw).catch(async () => {
const fallbackErrMsg = `Transaction ${method}(${inspect(args)}) (nonce: ${txParams.nonce}) failed.`
await throwWithRevertReason(web3, tx.raw)
})
```
## Run the tests
`docker run --rm -d -p 8545:8545 appliedblockchain/parity-solo:v4.0.0`
`npm test`
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