Tezos truffle-contract returns BigNumber instead of BN
See original GitHub issueIn the alphaTez
branch, I noticed today that the Tezos version of truffle-contract
returns BigNumber objects instead of BN. As a matter of standardizing our output, we should move to BN.
Steps to reproduce:
- Get the
alphaTez
branch andyarn
,yarn bootstrap
, etc. (referred to astruffle
below) - Create a new project using the
truffle unbox tezos-example
box. Make sure you have all the Tezos requirements (e.g., Docker) installed before continuing. - In the project, fire up
truffle console
, then rundeploy
. After that, follow the commands below. You’ll see that when reading data from.storage()
, we get BigNumber output for integers.
truffle(development)> let instance = await SimpleStorage.deployed()
truffle(development)> await instance.storage()
BigNumber { s: 1, e: 0, c: [ 2 ] }
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Convert big number to regular number [duplicate]
But Please try this. First you can try using: web3.utils.isBN(bn). Then go to the following if it returns true.
Read more >Contract Abstractions - Truffle Suite
This function returns a Promise that resolves into a new instance of the contract abstraction at the newly deployed address.
Read more >(intermediate value).toBigNumber is not a function
I am following the Building your First Blockchain tutorial(https://www.youtube.com/watch?v=coQ5dg8wM2o&t=494s). I have the following in my index ...
Read more >truffle: Versions - Openbase
Notably, @truffle/contract is now compiled with Webpack rather than ... 5.5.0-tezos.4. tezos ... now returns numbers as BN by default instead of BigNumber....
Read more >Openzeppelin-test-helpers - npm.io
Import all required modules from openzeppelin-test-helpers const { BN, ... is the object returned by either a web3 Contract or a truffle-contract call....
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
These are my take on requirements:
Hello @haltman-at & @fainashalts can you please make a statement as to why Tezos support is not a priority anymore? To be honest it leaves a bad taste after the big announcement od Tezos support in Truffle (Twitter and Blogpost) over two years ago. The funny thing is the support didnt last long, less than a year later Truffle started to ghost all issues and update requests on github or stated to do it later… why the sudden change back then?
At least make either make it official and announce that you are not supporting Tezos anymore or at least update Tezos Truffle to current protocol standard. I dont know maybe its a failure on the communication side, maybe Truffle @tcoulter and Tezos Foundation @drchrispinnock need to talk but the current state is unfortunate.