You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
let fs = require('fs');
let Web3 = require('web3');
let web3 = new Web3();
let abi = JSON.parse(fs.readFileSync('test.abi', 'utf8'));
let contract = web3.eth.contract(abi).at('<address>');
web3.eth.defaultAccount = web3.eth.accounts[0];
console.log(contract.newTrip("0x01", 100, 150));
testrpc output:
Transaction: 0xfd355fd7a11fed9a16222bc378e387b7b9bdcf191b691065e0b9c68d2c1c9195
Gas usage: 0x015f90
Block Number: 0x56
Block Time: Mon Mar 06 2017 10:04:17 GMT-0700 (Mountain Standard Time)
Runtime Error: out of gas
If you rerun the node with console.log(contract.newTrip("0x01", 0, 0)); then contract executes successfully and I can call getTrips and see that the trip was added. So far any (u)int size I've tried has failed for non-zero values. All seem to work if I pass in zeroes or if I pass in a non-zero value but do not use that parameter (for example if in the solidity contract I don't use the stop parameter then I can pass in any value for stop).
Context
This is just a fundamental contract function call with web3.
Your Environment
Version used:
ethereumjs-testrpc@3.0.3
truffle@3.1.2
Environment name and version (e.g. PHP 5.4 on nginx 1.9.1): Node 7.6.0
Server type and version: Laptop
Operating System and version: Win 10 x64
Link to your project: N/A
The text was updated successfully, but these errors were encountered:
If I attempt to use a parameter that is of type uint64 or int8 and not 0 then I run out of gas.
Expected Behavior
Passing in and using a non-zero integer should not run out of gas.
Current Behavior
When storing a non-zero integer the transaction comes back with a Runtime error of "out of gas".
Steps to Reproduce (for bugs)
truffle migrate --reset
to deploynewTrip
function:If you rerun the node with
console.log(contract.newTrip("0x01", 0, 0));
then contract executes successfully and I can callgetTrips
and see that the trip was added. So far any (u)int size I've tried has failed for non-zero values. All seem to work if I pass in zeroes or if I pass in a non-zero value but do not use that parameter (for example if in the solidity contract I don't use thestop
parameter then I can pass in any value forstop
).Context
This is just a fundamental contract function call with web3.
Your Environment
ethereumjs-testrpc@3.0.3
truffle@3.1.2
The text was updated successfully, but these errors were encountered: