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

Oracle contract can't add header content #2430

Closed
superboyiii opened this issue Apr 8, 2021 · 0 comments · Fixed by neo-project/neo-modules#581
Closed

Oracle contract can't add header content #2430

superboyiii opened this issue Apr 8, 2021 · 0 comments · Fixed by neo-project/neo-modules#581
Assignees

Comments

@superboyiii
Copy link
Member

Describe the bug
Native Oracle can't add header content.

To Reproduce
Steps to reproduce the behavior:

  1. Try a very simple github api https://api.github.com/users/superboyiii.
  2. I could use curl https://api.github.com/users/superboyiii or postman.
C:\Users\SPIRIT>curl https://api.github.com/users/superboyiii
{
  "login": "superboyiii",
  "id": 38493437,
  "node_id": "MDQ6VXNlcjM4NDkzNDM3",
  "avatar_url": "https://avatars.githubusercontent.com/u/38493437?v=4",
  "gravatar_id": "",
  "url": "https://api.github.com/users/superboyiii",
  "html_url": "https://github.com/superboyiii",
  "followers_url": "https://api.github.com/users/superboyiii/followers",
  "following_url": "https://api.github.com/users/superboyiii/following{/other_user}",
  "gists_url": "https://api.github.com/users/superboyiii/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/superboyiii/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/superboyiii/subscriptions",
  "organizations_url": "https://api.github.com/users/superboyiii/orgs",
  "repos_url": "https://api.github.com/users/superboyiii/repos",
  "events_url": "https://api.github.com/users/superboyiii/events{/privacy}",
  "received_events_url": "https://api.github.com/users/superboyiii/received_events",
  "type": "User",
  "site_admin": false,
  "name": "Owen Zhang",
  "company": "NEO",
  "blog": "",
  "location": "Shanghai",
  "email": null,
  "hireable": null,
  "bio": null,
  "twitter_username": null,
  "public_repos": 20,
  "public_gists": 0,
  "followers": 22,
  "following": 2,
  "created_at": "2018-04-18T09:43:08Z",
  "updated_at": "2021-04-02T07:12:18Z"
}
  1. But I can't get correct response via native oracle contract since user-agent can't be added into header.
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "txid": "0x2f364a2ebdf9411ceebe6ac0b4b292bec6032bf8d7408502e40ecfea1d73b1e3",
        "executions": [
            {
                "trigger": "Application",
                "vmstate": "FAULT",
                "exception": "An unhandled exception was thrown. Oracle response failure with code 24",
                "gasconsumed": "2416920",
                "stack": [],
                "notifications": [
                    {
                        "contract": "0xfe924b7cfe89ddd271abaf7210a80a7e11178758",
                        "eventname": "OracleResponse",
                        "state": {
                            "type": "Array",
                            "value": [
                                {
                                    "type": "Integer",
                                    "value": "4"
                                },
                                {
                                    "type": "ByteString",
                                    "value": "JHhmRGtMdku9yJUpPdZYQlJ34kUm45Heav95vZuCvzU="
                                }
                            ]
                        }
                    }
                ]
            }
        ]
    }
}

Expected behavior
Header is able to be added to request in native Oracle.

Screenshots
If applicable, add screenshots to help explain your problem.
image
image

Platform:

  • OS: [any]
  • Version [neo latest]

@shargon @erikzhang

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

Successfully merging a pull request may close this issue.

2 participants