Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define return values for Read API 'no result' cases #4

Open
cgewecke opened this issue Aug 23, 2019 · 0 comments
Open

Define return values for Read API 'no result' cases #4

cgewecke opened this issue Aug 23, 2019 · 0 comments

Comments

@cgewecke
Copy link
Contributor

cgewecke commented Aug 23, 2019

@njgheorghita @pipermerriam

After looking over the registry implementations again I wonder if we should consider giving clear definitions to the ERC1319 Read API return values for "error" or "no-result" .

I'm worried about this because at the moment we gate-keep some view methods with require checks that return an error reason string. But web3.js doesn't support that for calls - instead it returns un-decoded bytecode strings without throwing.

Do these require statements work as expected for Python's web3?

What are your views about amending the EIP to define a set of null return values which signal that the view request failed? And documenting a canonical way of generating these in Solidity (since their format in Python, JS etc will vary)?

Examples

getAllPackageIds ... returns (bytes32[], uint)

bytes32[] memory ids;
uint256 ptr;
return (ids, ptr); 

getPackageName...returns (string)

return '';

getReleaseId...returns (bytes32)

return bytes32(0); 

getAllReleaseIds...returns (bytes32[], uint)

bytes32[] memory ids;
uint256 ptr;
return (ids, ptr); 

generateReleaseId...returns(bytes32)

return bytes32(0);

getReleaseData...returns(string, string, string)

return ('','','');

numPackageIds...returns(uint)

return 0; 

numReleaseIds...returns(uint)

return 0; 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant