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)
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 enum
s 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
- Allow users to disable the confirmation listener that web3 implements (#3566 by @eggplantzzz)
- Add enum objects to contract objects (#3552 by @haltman-at)
- Have debugger/decoder make use of sources info in compilations (#3565 by @haltman-at)
- Add rudimentary Etherscan Vyper support to source-fetcher (#3560 by @haltman-at)
Internal improvements
- Turn on spaces in object literals in prettier (#3567 by @haltman-at)
- Add fetcher name to InvalidNetworkError (#3564 by @haltman-at)
- Lengthen timeout for build scenario test (#3558 by @gnidan)
- Change default @truffle/db adapter to
sqlite
(#3554 by @gnidan) - Fix logger names for @truffle/db resources (#3555 by @gnidan)
- Fix debugger test debug module names (#3561 by @haltman-at)
- Add sources to compile result (#3550 by @fainashalts)
- Make source-fetcher throw on invalid network (#3559 by @haltman-at)
- The visualizer (v1: Function calls and such) (#3520 by @haltman-at)
- Enable querying @truffle/db ABIs for individual entries (#3556 by @gnidan)
- Add workaround to mocha-webpack problem to debugger test script (#3549 by @haltman-at)
Dependency update
- Update highlight.js to 10.x (#3553 by @haltman-at)