Ethereum truffle MetaCoin intrinsic gas too low error

0 votes

After running truffle test I get this:

 TestMetacoin
    1) "before all" hook: prepare suite

  Contract: MetaCoin
    ✓ should put 10000 MetaCoin in the first account
    2) should call a function that depends on a linked library
    > No events were emitted
    ✓ should send coin correctly (6078ms)


  2 passing (6s)
  2 failing

  1) TestMetacoin "before all" hook: prepare suite:
     Error: Intrinsic gas too low
      at Object.InvalidResponse (/usr/lib/node_modules/truffle/node_modules/truffle-contract/node_modules/web3/lib/web3/errors.js:35:16)
      at /usr/lib/node_modules/truffle/node_modules/truffle-contract/node_modules/web3/lib/web3/requestmanager.js:86:36
      at XMLHttpRequest.request.onreadystatechange (/usr/lib/node_modules/truffle/node_modules/web3/lib/web3/httpprovider.js:119:13)
      at XMLHttpRequestEventTarget.dispatchEvent (/usr/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:64:18)
      at XMLHttpRequest._setReadyState (/usr/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:354:12)
      at XMLHttpRequest._onHttpResponseEnd (/usr/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:509:12)
      at IncomingMessage.<anonymous> (/usr/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:469:24)
      at endReadableNT (_stream_readable.js:974:12)
      at _combinedTickCallback (internal/process/next_tick.js:74:11)
      at process._tickDomainCallback (internal/process/next_tick.js:122:9)

  2) Contract: MetaCoin should call a function that depends on a linked library:
     AssertionError: Library function returned unexpected function, linkage may be broken: expected 0 to equal 20000
      at test/metacoin.js:25:14
      at process._tickDomainCallback (internal/process/next_tick.js:129:7)

My genesis block is as follows:

{
    "nonce": "0x0000000000000042",
    "difficulty": "0x4000",
    "alloc": {
            "0xfd0ceb7965a0e4c3146c1f901fbab9668653af6b": {
            "balance": "325406000000000"
        }
    },
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "coinbase": "0xfd0ceb7965a0e4c3146c1f901fbab9668653af6b",
    "etherbase" : "0xfd0ceb7965a0e4c3146c1f901fbab9668653af6b",
    "timestamp": "0x00",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "extraData": "0x",
    "gasLimit": "0x3d0900"
}

And my truffle.js is like this:

module.exports = {
  networks: {
    development: {
      host: "localhost",
      port: 8545,
      network_id: "*", // Match any network id
      gas: 1000000
    }
  }
};
Oct 22, 2018 in Blockchain by slayer
• 29,370 points
1,320 views

1 answer to this question.

0 votes

Change the genesis block gasLimit to

"gasLimit": "0x2FEFD800", 

config for homestead block to 10 :

"config": {
            "homesteadBlock": 10
    },

and truffle.js gas setting to 5000000.

This should work

answered Oct 22, 2018 by Omkar
• 69,220 points

Related Questions In Blockchain

0 votes
1 answer

Intrinsic gas too low and exceeds block limit

If you are talking about the public ...READ MORE

answered Aug 29, 2018 in Blockchain by digger
• 26,740 points
3,045 views
0 votes
1 answer
0 votes
1 answer

web3.eth.sendSignedTransaction() always return “Returned error: nonce too low”

This bit of code looks wrong: var rawTx ...READ MORE

answered Oct 1, 2018 in Blockchain by slayer
• 29,370 points
6,046 views
0 votes
1 answer

Web3j Transfer.sendFunds() returns Error “insufficient funds for gas * price + value”

DISCLAIMER. This may not necessarily be an answer to your ...READ MORE

answered Jun 16, 2018 in Blockchain by charlie_brown
• 7,720 points
3,058 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,935 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,460 views
+1 vote
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,460 points
1,447 views
0 votes
1 answer

Ethereum "truffle server" gives error: TypeError: fsevents is not a constructor

Looks like you have files missing.  Try creating project with: truffle ...READ MORE

answered Nov 30, 2018 in Blockchain by Omkar
• 69,220 points
947 views
0 votes
1 answer

Truffle "Migrations" ran out of gas error

This error is caused because the amount ...READ MORE

answered Jan 17, 2019 in Blockchain by Omkar
• 69,220 points
4,080 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP