-
Notifications
You must be signed in to change notification settings - Fork 30
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
Lack of Default Primary Index Information in Antelope ABIs #197
Comments
@dafuga currently cdt doesn't fill out |
Here is some scrutiny results:
And here is original commit (due to different project structore 5 years ago this file is in a different repo): So |
@dafuga from our research this has not been supported for several years, and was deprecated. For contracts compiled with CDT version 3.x or 4.x are you able to see a primary index when there is a secondary index? From our review of the code the index fields are never returned. We are removing the bug label, and treating this as a feature request. We will discussion the right priority for this work. |
Apologies for the delayed response! The contract in question @dafuga was mentioning was probably 4-5 years old at this point, so this makes sense. If they've been gone that long and deprecated, then we could consider this a feature request (of somewhat high priority?). We need some way to identify what the table indices are, preferably by interpreting the ABI. We are using that information to map our new table querying language to the appropriate indices when calling To illustrate the mapping we're doing, the SDKs converting the {
code: 'eosio',
table: 'namebids',
scope: 'eosio',
index_position: 2,
key_type: 'i64',
} Into a more simply syntax where you can simply specify the field name. contract.table('namebids').query({
index: 'high_bid',
}) It maps that |
Hello,
I am part of the team developing Wharf (https://github.com/wharfkit), we've come across an issue where Antelope's ABIs does not provide a mechanism to determine the default or primary index of a table. It seems that the ABI only provides information on the primary index if there's a secondary index present.
For example, in the
eosio namebids
table, the primary index is not included in thekey_names
field:However, in the case of a table where secondary indexes exist, the
key_names
field does seem to include the primary index. For example, thedecentiumorg trending
table has the primary index data included in that array:As part of our ongoing development of the Wharf Contract kit, we are working on creating contract-specific helper functions to facilitate developers' use of the
get_table_rows
API. Our goal is to provide strongly typed functions to Wharf users. This will only be possible if we can determine the primary index of any given table from the contract ABI.Given these requirements, could you consider always including the primary index information in the key_names and key_types arrays, regardless of whether a secondary index exists or not? This change would ensure a consistent understanding of the default indices across all tables and greatly assist in the creation of developer-friendly functions in the Wharf Contract kit.
Thanks,
Daniel
The text was updated successfully, but these errors were encountered: