Giter Club home page Giter Club logo

neomodules's People

Contributors

brunofreitasgit avatar juliavi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neomodules's Issues

RPC client not working in Unity WebGL

In the editor and in the native player, the RPC code works fine to invoke a contract and returns the expected result. But in WebGL I get the following stack trace during the RpcClient.SendAsync call:

NeoModules.JsonRpc.Client.RpcClientUnknownException: Error occurred when trying to send rpc requests(s) ---> System.ArgumentNullException: Value cannot be null. UnityLoader.js:1043:37
Parameter name: obj UnityLoader.js:1043:37
  at System.Threading.Monitor.ReliableEnterTimeout (System.Object obj, System.Int32 timeout, System.Boolean& lockTaken) [0x00000] in <00000000000000000000000000000000>:0 UnityLoader.js:1043:37
   --- End of inner exception stack trace --- UnityLoader.js:1043:37
  at NeoModules.JsonRpc.Client.RpcClient+<SendAsync>d__17.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 UnityLoader.js:1043:37
--- End of stack trace from previous location where exception was thrown ---

I did some testing and found that the Nethereum RPC client does work in WebGL as long as the AOT version of the Newtonsoft DLL is used, however I have tried that and still receive the error above. I'm unable to pinpoint where the difference lies between the RPC implementation in NeoModules and Nethereum that leads to the error, as the RPC client code doesn't seem all that different.

TransactionBuilderHelper.GetUnspent() fails with ArgumentNullException

I suppose it fails here:
Output = new TransactionOutput
{
...
AssetId = UInt256.Parse(balanceEntry.AssetHash),
...
}
because balanceEntry.AssetHash is null (restService returns null at least for local private network)

Native coins transfer does not work because of this issue (AccountSignerTransactionManager.SendNativeAsset())

Parsing error for RPC method getapplicationlog

I have some problem with the RPC library parsing getapplicationlog result.

Error and working curl example:
image
As you can see, json parsing throws on path 'executions[0].notifications[0].state.type'

Curl request:

curl -X POST \
    http://localhost:20332 \
    -H 'Content-Type: application/json' \
    -d '{ "jsonrpc": "2.0", "id": 5, "method": "getapplicationlog", "params": ["a5e6a987e36bcc99545cb2b68c1d9dd855ce51eb2e78be4b270299b6f54cb3e0"] }'

Curl response:
{"jsonrpc":"2.0","id":5,"result":{"txid":"0x8fdc250403ecabda4a5d204fe5f1f3596533be5a6eefd1c2c73d123961d846a2","executions":[{"trigger":"Application","contract":"0xef95a5008fe8bd2a28673a1cb49559a7d7d860f2","vmstate":"HALT, BREAK","gas_consumed":"8.879","stack":[{"type":"Integer","value":"1"}],"notifications":[{"contract":"0xfde69a7dd2a1c948977fb3ce512158987c0e2197","state":{"type":"Array","value":[{"type":"ByteArray","value":"6f7261636c654f70657261746f72"},{"type":"ByteArray","value":"6d8603dc755b733aa10f0bb96585c8bed967ce1b"},{"type":"ByteArray","value":"736e656f5f7072696365"},{"type":"ByteArray","value":""},{"type":"ByteArray","value":"78ea9741"},{"type":"Integer","value":"2"}]}},{"contract":"0xfde69a7dd2a1c948977fb3ce512158987c0e2197","state":{"type":"Array","value":[{"type":"ByteArray","value":"6f7261636c654f70657261746f72"},{"type":"ByteArray","value":"6d8603dc755b733aa10f0bb96585c8bed967ce1b"},{"type":"ByteArray","value":"736e656f5f7072696365"},{"type":"ByteArray","value":""},{"type":"Integer","value":"1094979175"},{"type":"Integer","value":"5"}]}}]}]}}

neo cli version 2.9.4
C# packages:

<PackageReference Include="NeoModules.Rest" Version="2.0.0" />
<PackageReference Include="NeoModules.RPC" Version="1.2.0" />

Nuget version is not the same of the code

Trying to use the Nuget package and in the object AccountSignerTransactionManager there is no CallContract but there is in the code.

When you expect to have a new Nuget version?

Node list cannot be deserialized.

JsonSerializationException occurs when acquiring NodeList and performing Json deserialization.
I think the cause is that there is "type: WebSockets" in Site.

"Type: webSockets" was added 4 days ago.
CityOfZion/neo-mon@7b61d08#diff-830ceffa80e1e74ebac9697c8d391e31R18

I coded the deserialization process of the node list with reference to the sample.
https://github.com/CityOfZion/NeoModules/blob/master/src/NeoModules.Demo/Program.cs#L134

private static async Task<NodeList> NodesListTestAsync()
{
            var service = new NeoNodesListService();
            var result = await service.GetNodesList(MonitorNet.TestNet);
            var nodes = JsonConvert.DeserializeObject<NodeList>(result);
            return nodes;
}

Design a way to get the transaction history of a specific address

Right now, the only way NeoModules has to get the transaction history of an address is to use the neoscan.io public API. However, this being the only solution right now, it's dangerous to depend on a single point of failure for you application/service. This means we have to design/implement another way to get this type of data.

The only way to do it with the tools of NeoModules.RPC now is to search block by block (since block 0 to blockCount) for transactions of a specific address. Of course this is an absurd solution, so we need to implement some kind of persistance/chain integration, that do not compromise the decoupling of the project.

ScriptHash return a strange error

When I deploy a smart contract in the blockchain using NeoGui i get the script hash:
0xf79edf718d2bb58d3eba9975e1d5b4c9feb21a69

then I try to execute the CallContract using this hash I get BatFormat Exception.

I notice in the example the Script Hash that you have are a little bit different:
// contract
public const string ContractScriptHash = "ed07cffad18f1308db51920d99a2af60ac66a7b3";

where do you calculate this Contract script hash?????

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.