【区块链】TestRPC Runtime Error: out of gas

TestRPC Runtime Error: out of gas


转载自:here

一、 问题描述

  Transaction: 0x089d31b5316e7076268ea09dd86000dfa4316d72d98318440eb5684b619497f9
  Gas usage: 0x015f90
  Block Number: 0x0b
  Block Time: Sat Sep 23 2017 13:08:40 GMT+0800 (CST)
  Runtime Error: out of gas

二、TestRPC新特性

参考:here

三、解决方法

修改JavaScript文件

web3.eth.sendTransaction({..., gas: 3141592})//选择合适的Gas限制

例如:我修改了app.js文件,调用合约的代码

var meta;
UserManagement.deployed().then(function(instance) {
    meta = instance;
    meta.userRgister.sendTransaction(phone, {from: account, gas: 3141592});
}).catch(function(e){
    console.log(e);
});

猜你喜欢

转载自blog.csdn.net/loy_184548/article/details/78070279
gas