I try to call my Solidity function:
function getVehicleDetails(string _vin) returns (string _vln, uint _year, string _make, string _model, string _colour) {
Vehicle vehicle = vehicles[_vin];
if (vehicle.year == 0)
throw;
_vln = vehicle.vln;
_year = vehicle.year;
_make = vehicle.make;
_model = vehicle.model;
_colour = vehicle.colour;
}
Here's the geth command:
instance.getVehicleDetails("vin_101",{from:web3.eth.accounts[1]})
returns
"0x6cf98ab5b77bfa0397ee6eaa046f85a133c5a3ef636c59a56b4308dc73fb20fd"
i.e. it keeps returning a tx receipt!
Here's how I create a vehicle:
function setVehicleDetails(string _vin, string _vln, uint _year, string _make, string _model, string _colour) owneronly {
Vehicle vehicle = vehicles[_vin];
if (vehicle.year == 0)
throw;
vehicle.vln = _vln;
vehicle.year = _year;
vehicle.make = _make;
vehicle.model = _model;
vehicle.colour = _colour;
}
I call this in geth with:
instance.registerVehicle("vin_101","vln_101",2004,"ferrari","convertible","black",{from:web3.eth.accounts[0],gas:4000000})
What am I doing wrong?
All I want to do is read the return values from getVehicleDetails
and it just refuses to!
I'm on testrpc
.