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
when using:
$contract->call("getRecord", 12345, function($err, $data) {
print_r($data);
}
the getRecord method in the contract returns 4 elements (address, string, string, uint256)
the $data returned is ONLY the uint256 (as an array). It looks like the decodeParameters function in Ethabi called from Contract.php is only returning the last element instead of returning an array of all elements. Any idea on how to get to all 4 returned elements? It works as expected in javascript web3 class. Thanks!
-jack
The text was updated successfully, but these errors were encountered:
OK. looks like the problem is it was considering the 'name' in the abi as being set even though it was empty. thus, each decodeParameters iteration through the paramaters was overwriting the previous object. might want to look at the way it is determines if the 'name' is set in the outputs parameters inside the Ethabi.php file in the decodeParameters function. maybe instead of just checking if isset($outputTypes['outputs'][$i]['name']) you should also check that it isn't == ""
thanks for the amazing work on this project though! excellent work!!
when using:
$contract->call("getRecord", 12345, function($err, $data) {
print_r($data);
}
the getRecord method in the contract returns 4 elements (address, string, string, uint256)
the $data returned is ONLY the uint256 (as an array). It looks like the decodeParameters function in Ethabi called from Contract.php is only returning the last element instead of returning an array of all elements. Any idea on how to get to all 4 returned elements? It works as expected in javascript web3 class. Thanks!
-jack
The text was updated successfully, but these errors were encountered: