Socket
Socket
Sign inDemoInstall

truffle-assertions

Package Overview
Dependencies
2
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.9.0 to 0.9.1

16

index.js

@@ -6,2 +6,13 @@ const AssertionError = require('assertion-error');

class InvalidTxResultError extends Error {}
const validateResult = (result) => {
if (!result.logs) {
throw new InvalidTxResultError(
'First argument is not a transaction result. Did you accidentally pass a contract instance or transaction receipt?\n'
+ 'If that is the case, check out truffleAssert.createTransactionResult in the documentation.',
);
}
};
/* Creates a new assertion message, containing the passedAssertionMessage and

@@ -61,2 +72,4 @@ * the defaultAssertion message when passedAssertionMessage exists, otherwise

const assertEventEmittedFromTxResult = (result, eventType, filter, message) => {
validateResult(result);
/* Filter correct event types */

@@ -81,2 +94,4 @@ const events = result.logs.filter(entry => entry.event === eventType);

const assertEventNotEmittedFromTxResult = (result, eventType, filter, message) => {
validateResult(result);
/* Filter correct event types */

@@ -200,2 +215,3 @@ const events = result.logs.filter(entry => entry.event === eventType);

ErrorType,
InvalidTxResultError,
};

2

package.json
{
"name": "truffle-assertions",
"version": "0.9.0",
"version": "0.9.1",
"description": "Additional assertions and utilities for testing Ethereum smart contracts in Truffle unit tests",

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc