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

Feature request: TruffleContract.version #1938

Closed
1 task done
wbt opened this issue Apr 22, 2019 · 3 comments
Closed
1 task done

Feature request: TruffleContract.version #1938

wbt opened this issue Apr 22, 2019 · 3 comments

Comments

@wbt
Copy link
Contributor

wbt commented Apr 22, 2019


Issue

Due to the semantic versioning system going away especially with web3, I have been spending an inordinate amount of time lately on bugs related to breaking changes in dependencies, and not knowing exactly which version of truffle-contract is being used in any particular test makes this a lot harder.

In some cases, a bug appears with a later version of truffle-contract which is not present in an earlier version, but identifying exactly where the bug appears can be a challenge (especially when other code must be adapted due to breaking changes between corresponding versions of web3).

Steps to Reproduce

  1. Follow the Pet Shop tutorial. (Optionally browse the source, including a review of package.json).
  2. Optionally attempt to replicate successful behavior in a different dapp, and fail because the files src/js/truffle-contract.js and/or src/js/web3.min.js are different versions.
  3. Attempt to determine the versions being used. As a simple example,
    console.log("web3 version: ",web3.version); (in the Pet Shop tutorial) produces api: "0.20.3" and more, in a response object.

Expected Behavior

console.log("TruffleContract version: ",TruffleContract.version); produces meaningful output other than undefined. If it produces a string like "4.0.12," one should be able to run npm install [email protected], look in node_modules/truffle-contract/dist and find an copy of truffle-contract.js or truffle-contract.min.js which is exactly the same as the one the client was running to produce that output.

Environment

  • Operating System: Windows 10 Pro
  • Ethereum client: N/A
  • Truffle version: That's the key question. truffle version produces 5.0.12.
  • node version (node --version): 9.3.0
  • npm version (npm --version): 6.9.0
@eggplantzzz
Copy link
Contributor

Thanks for the suggestion @wbt, seems like a good idea.

@eggplantzzz
Copy link
Contributor

PR #1948 adds this feature.

@eggplantzzz
Copy link
Contributor

Closing this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants