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

[BUG] Parsing contract abi is not correct #37

Closed
Avm07 opened this issue Jan 17, 2020 · 1 comment
Closed

[BUG] Parsing contract abi is not correct #37

Avm07 opened this issue Jan 17, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Avm07
Copy link

Avm07 commented Jan 17, 2020

Seems like abi parsing is not correct then actions names redifined by struct name.

Contract action:

[[eosio::action("issue")]] void issue_token(const name &to, const asset &quantity, const std::string &memo);

In abi its defined like:

"structs": [
{
            "name": "issue_token",
            "base": "",
            "fields": [
                {
                    "name": "to",
                    "type": "name"
                },
                {
                    "name": "quantity",
                    "type": "asset"
                },
                {
                    "name": "memo",
                    "type": "string"
                }
            ]
        }
}],
"actions": [
{
            "name": "issue",
            "type": "issue_token",
            "ricardian_contract": ""
}
 contract = await eoslime.Contract.deploy(
     CONTRACT_WASM_PATH,
     CONTRACT_ABI_PATH
   );

After deploy - contract has method issue
but when i call it -

error occurred TypeError: Cannot read property 'fields' of undefined
I looked at the code of your library and make console.log(this.contractStructs) in contract/contract-function/contract-function.js

There is no issue key, but it has

     issue_token: {
        name: 'issue_token',
        base: '',
        fields: [ [Object], [Object], [Object] ]
      }

Eoslime should support this case, and parse actions too for checking valid name of action inside abi.

@bakasura980 bakasura980 self-assigned this Jan 19, 2020
@bakasura980 bakasura980 added the bug Something isn't working label Jan 19, 2020
@bakasura980
Copy link
Collaborator

bakasura980 commented Jan 20, 2020

Has been fixed in v1.0.2 with the following pull request - #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants