2

I get the following error when running truffle test:

{ BigNumber Error: new BigNumber() not a number: [object Object]
    at raise (/Users/danielyakobian/.nvm/versions/node/v7.5.0/lib/node_modules/truffle/node_modules/web3/node_modules/bignumber.js/bignumber.js:1177:25)
    at /Users/danielyakobian/.nvm/versions/node/v7.5.0/lib/node_modules/truffle/node_modules/web3/node_modules/bignumber.js/bignumber.js:1165:33
    at new BigNumber (/Users/danielyakobian/.nvm/versions/node/v7.5.0/lib/node_modules/truffle/node_modules/web3/node_modules/bignumber.js/bignumber.js:193:67)
    at new BigNumber (/Users/danielyakobian/.nvm/versions/node/v7.5.0/lib/node_modules/truffle/node_modules/web3/node_modules/bignumber.js/bignumber.js:203:25)
    at toBigNumber (/Users/danielyakobian/.nvm/versions/node/v7.5.0/lib/node_modules/truffle/node_modules/web3/lib/utils/utils.js:367:12)
    at Object.toTwosComplement (/Users/danielyakobian/.nvm/versions/node/v7.5.0/lib/node_modules/truffle/node_modules/web3/lib/utils/utils.js:378:21)
    at SolidityTypeUInt.formatInputInt [as _inputFormatter] (/Users/danielyakobian/.nvm/versions/node/v7.5.0/lib/node_modules/truffle/node_modules/web3/lib/solidity/formatters.js:40:38)
    at SolidityTypeUInt.SolidityType.encode (/Users/danielyakobian/.nvm/versions/node/v7.5.0/lib/node_modules/truffle/node_modules/web3/lib/solidity/type.js:188:17)
    at /Users/danielyakobian/.nvm/versions/node/v7.5.0/lib/node_modules/truffle/node_modules/web3/lib/solidity/coder.js:91:29
    at Array.map (native) name: 'BigNumber Error' }

I've narrowed the cause to estimateGas function called in the following code:

        return FlightFuture.deployed()
        .then((instance) => {
            future = instance;
            return future.offer.estimateGas();
        })
        .then((gas) => {
            transaction_options.gas = gas;
            console.log(transaction_options.gas);
            return future.offer.apply(this, valid_offer_params.concat(transaction_options))
        })

Im having trouble finding any documentation on how to call estimateGas on a contract function, any ideas what I'm doing wrong?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.