I developed and debugged this function in Remix but when I deploy the contract and execute this function it will either run out of gas or does not run at all. This is usually because Parity thinks it takes 21,000 gas to run the function.
function verifyPass(address _owner) {
require(_owner != 0x0);
var (,c,h,) = Storage(usedStorage).passByOwner(_owner);
uint _country = uint(c);
// An embassy can only verify passports of its own country
require(_country != 0 && _country == embassiesOfCountry[msg.sender]);
Storage(usedStorage).updatePassport(_owner, _country, bytes32(h), true);
}
Do you know why it fails? Or do you have a better idea to do the process of reading a value from another contract, updating values and posting it to another contract?
eth_estimateGas
RPC API to figure out how much is required.