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

Minor updates to EIP #1966

Merged
merged 1 commit into from
Apr 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions EIPS/eip-1319.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Implementations are free to choose any scheme for generating a **releaseId**. A
function generateReleaseId(string packageName, string version)
public
view
returns (bytes32)
returns (bytes32 releaseId)
{
return keccak256(abi.encodePacked(packageName, version));
}
Expand Down Expand Up @@ -114,21 +114,21 @@ The read API consists of a set of methods that allows tooling to extract all con
function getAllPackageIds(uint offset, uint limit) public view
returns (
bytes32[] packageIds,
uint offset
uint pointer
);

// Retrieves the unique string `name` associated with a package's id.
function getPackageName(bytes32 packageId) public view returns (string name);
function getPackageName(bytes32 packageId) public view returns (string packageName);

// Retrieves the registry's unique identifier for an existing release of a package.
function getReleaseId(string packageName, string version) public view returns (bytes32);
function getReleaseId(string packageName, string version) public view returns (bytes32 releaseId);

// Retrieves a slice of the list of all release ids for a package.
// `offset` and `limit` enable paginated responses / retrieval of the complete set. (See note below)
function getAllReleaseIds(string packageName, uint offset, uint limit) public view
returns (
bytes32[] ids,
uint offset
bytes32[] releaseIds,
uint pointer
);

// Retrieves package name, release version and URI location data for a release id.
Expand All @@ -144,7 +144,7 @@ function getReleaseData(bytes32 releaseId) public view
function generateReleaseId(string packageName, string version)
public
view
returns (bytes32);
returns (bytes32 releaseId);

// Returns the total number of unique packages in a registry.
function numPackageIds() public view returns (uint totalCount);
Expand All @@ -154,7 +154,7 @@ function numReleaseIds(string packageName) public view returns (uint totalCount)
```
**Pagination**

`getAllPackageIds` and `getAllReleaseIds` support paginated requests because it's possible that the return values for these methods could become quite large. The methods should return an `offset` that is a pointer to the next available item in a list of all items such that a caller can use it to pick up from where the previous request left off. (See [here](https://mixmax.com/blog/api-paging-built-the-right-way) for a discussion of the merits and demerits of various pagination strategies.) The `limit` parameter defines the maximum number of items a registry should return per request.
`getAllPackageIds` and `getAllReleaseIds` support paginated requests because it's possible that the return values for these methods could become quite large. The methods should return a `pointer` that points to the next available item in a list of all items such that a caller can use it to pick up from where the previous request left off. (See [here](https://mixmax.com/blog/api-paging-built-the-right-way) for a discussion of the merits and demerits of various pagination strategies.) The `limit` parameter defines the maximum number of items a registry should return per request.

## Rationale
The proposal hopes to accomplish the following:
Expand Down