Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

v5.1.55 – Cranberry sauce (the kind from a can)

Compare
Choose a tag to compare
@gnidan gnidan released this 28 Nov 02:12
· 5138 commits to develop since this release

Hello all! 👋

Got some updates for you this week. Let's take a quick peek!

Enums in @truffle/contract

You can now access Solidity-defined enums in @truffle/contract. Let's say you have a contract like so:

contract PotatoMasher {
  enum PotatoVariety {
    YukonGold,
    RussetBurbank,
    Vitolette
  }
 
  // ...
}

You can now do:

const PotatoMasher = artifacts.require("PotatoMasher");

const variety = PotatoMasher.PotatoVariety.YukonGold;

Pretty useful, right? 😄

Disable confirmation listener

A number of users have reported that Truffle does a lot of polling to eth_getBlockByNumber. This is kind of annoying, especially you're connecting to a node that enforces rate limits! So we've added an option to disable operation.on("confirmation"), since that was the culprit. Just add this to your truffle-config.js:

module.exports = {
  // ... rest of truffle-config
  networks: {
    "<network-name>": {
      // ... rest of config for <network-name>
      disableConfirmationListener: true
    }
  }
}

Hope this helps!

How to upgrade

We recommend upgrading to the latest version of Truffle by running:

npm uninstall -g truffle
npm install -g truffle

Changelog

Enhancements

Internal improvements

Dependency update