Contract code:
contract RecordStore{ struct Record { string value; address owner; } mapping(string => Record) records; Record lastRecord; function addRecord(string _recordId, string _value, address _owner) returns (bool) { Record r = records[_recordId]; r.value = _value; r.owner = _owner; lastRecord = r; return true; } function getLastRecordOwner() returns (addr) { return lastRecord.owner; } } Client code:
var rs = RecordStore.deployed(); var account = web3.eth.getAccounts()[0]; var recordName = "test_name"; rs.addRecord(recordName, account, recordName, account, {from:account}).then(function(res) { rs.getLastRecordOwner.call().then(function(lastRecord) { console.log("last record owner: " + lastRecord); }); }); When I run the test on testrpc everything works as expected. But when I run it on geth lastRecord is null. Does anyone know why?

--devflag? Also, it's likely an issue with your deployment/interaction, not with the contract, so you should post your process for testingtruffle migrate --resetfor deploy.