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

Oracles #248

Closed
wants to merge 6 commits into from
Closed

Oracles #248

wants to merge 6 commits into from

Conversation

shargon
Copy link
Member

@shargon shargon commented Apr 18, 2020

Wait for #219 neo-project/neo#1584

This PR helps with the review of Oracles changes.

You can use this SmartContract for testing

using Neo.SmartContract.Framework;
using Neo.SmartContract.Framework.Services.Neo;

namespace Neo.Compiler.MSIL.TestClasses
{
    public class Contract_Oracle : SmartContract.Framework.SmartContract
    {
        public static object Download(string url, string filterArgs)
        {
            var ret = (object)Oracle.Get(url, null, "filterJson", filterArgs);

            if (ret == null)
            {
                Runtime.Log("Error downloading");
                return null;
            }

            Runtime.Log("Downloaded:" + (string)ret);
            return ret;
        }
        public static object FilterJson(string json, string find)
        {
            var item = (Map<string, int>)Json.Deserialize(json);
            return item[find];
        }
    }
}

@shargon shargon mentioned this pull request Apr 19, 2020
@shargon shargon marked this pull request as ready for review April 23, 2020 18:19
@erikzhang erikzhang closed this Sep 3, 2020
@erikzhang erikzhang deleted the oracles branch September 3, 2020 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants