question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Truffle Decoder's second parameter of dependent contracts should be optional

See original GitHub issue

Calling 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:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
haltman-atcommented, Feb 12, 2020

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.

0reactions
haltman-atcommented, Mar 20, 2020

Oh, huh, why is this still open? Closing.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found