Truffle Decoder's second parameter of dependent contracts should be optional
See original GitHub issueCalling this:
const decoder = await Decoder.forContractInstance(truffleContractInstance);
Produces a cryptic error:
TypeError: Cannot read property 'includes' of undefined
at index.js:374
at step (index.js:261)
at Object.next (index.js:192)
at index.js:164
...
It is only when you pass in an empty array as the second parameter does the error go away:
const decoder = await Decoder.forContractInstance(truffleContractInstance, []);
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Run Migrations - Truffle Suite
Deploy a specific contract, specified by the contract object, with optional constructor arguments. This is useful for singleton contracts, such that only one ......
Read more >ConsenSys/truffle - Gitter
Hi all, I'm trying to save some encrypted data into a Smart Contract. ... not found or not visible after argument-dependent lookup in...
Read more >How to deploy contracts that take parameters in their ...
I'm trying to build a smart contract with Truffle. I can compile it just fine, but when I try to deploy it on...
Read more >Solidity Documentation - Read the Docs
With Solidity you can create contracts for uses such as voting, ... (but dynamic, i.e. it can depend on runtime parameters) once they...
Read more >Flex-contract-fix NPM | npm.io
Can decode internal events (transaction events raised in other contracts). ... argument is a truffle artifact, // the bytecode will already be defined....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So, looking at the two issues you submitted, the conclusion I’m coming to is that I didn’t really optimize this for convenience in this just-a-simple-contract case, where there are no external structs or enums or contract types you need to deal with, no inheritance, you’re not decoding events of unknown provenance, etc. I was really focused on the opposite case (which I realize is not exactly convenient at the moment, but I was planning to make it so eventually). But, I guess I can largely address that by the means you suggest, of making that argument optional and treating it as
[]
. So, whew, problem avoided there.Oh, huh, why is this still open? Closing.