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

invalid ABI generated if project includes two classes with the same name #87

Open
boid-com opened this issue Feb 19, 2024 · 0 comments
Open

Comments

@boid-com
Copy link

boid-com commented Feb 19, 2024

In my example I have two contracts that need to communicate and read config data from each other. Each contract has a unique config table called Config. I import their config tables and the project builds correctly, but the ABI includes two definitions of Config which are different. When interacting with this contract the rpc node returns an error about the ABI . I was able to work around the issue by renaming the structs so they have unique names. Ideally there should be some technique to namespace classes when they are imported to prevent this issue from happening.

telegram-cloud-photo-size-1-5073641942348311469-x

[14:54:17] eosio ERROR: safeDo Error: https://test.telos.eosusa.io/ duplicate_abi_table_def_exception: Duplicate table definition in the ABI at /v1/chain/get_table_rows duplicate_abi_table_def_exception: Duplicate table definition in the ABI at /v1/chain/get_table_rows
    at APIClient.<anonymous> (/root/boid-worker/node_modules/@wharfkit/antelope/lib/antelope.js:5542:23)
    at Generator.next (<anonymous>)
    at fulfilled (/root/boid-worker/node_modules/tslib/tslib.js:166:62)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  path: '/v1/chain/get_table_rows',
  response: {
    headers: {
      'access-control-allow-headers': 'Origin, Accept, X-Requested-With, Content-Type',
      'access-control-allow-methods': 'GET, HEAD, OPTIONS, POST',
      'access-control-allow-origin': '*',
      connection: 'close',
      'content-length': '289',
      'content-type': 'application/json',
      server: 'nodeos/v5.0.0',
      'x-forwarded-proto': 'https',
      'x-frame-options': 'always'
    },
    status: 500,
    json: { code: 500, message: 'Internal Service Error', error: [Object] },
    text: '{"code":500,"message":"Internal Service Error","error":{"code":3015008,"name":"duplicate_abi_table_def_exception","what":"Duplicate table definition in the ABI","details":[{"message":"duplicate table definition detected","file":"abi_serializer.cpp","line_number":184,"method":"set_abi"}]}}'
  }
}
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