Meadow icon indicating copy to clipboard operation
Meadow copied to clipboard

TestNode error on send from

Open bitcoinbrisbane opened this issue 6 years ago • 3 comments

Running truffle tests with a "send from" has the following error

eth_getLogs
{
  "fromBlock": "0xc"
}
{
  "code": -32000,
  "message": "A member with the name 'fromBlock' already exists on 'Meadow.JsonRpc.Types.FilterOptions'. Use the JsonPropertyAttribute to specify another name.",
  "data": {
    "exception": "Newtonsoft.Json.JsonSerializationException: A member with the name 'fromBlock' already exists on 'Meadow.JsonRpc.Types.FilterOptions'. Use the JsonPropertyAttribute to specify another name.\n   at Newtonsoft.Json.Serialization.JsonPropertyCollection.AddProperty(JsonProperty property)\n   at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateProperties(Type type, MemberSerialization memberSerialization)\n   at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract(Type objectType)\n   at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType)\n   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)\n   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)\n   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)\n   at Meadow.JsonRpc.Server.JsonRpcHttpServer.ProcessServerHandler(RpcRequestItem item) in /home/lucascullen/GitHub/Meadow/src/Meadow.JsonRpc.Server/JsonRpcHttpServer.cs:line 410"
  }
}

Standard ERC20 unit test

  it.only("owner should allow alice to transfer 100 tokens to bob", async () => {
    await contractInstance.approve(ALICE, 100);
    await contractInstance.transferFrom(OWNER, BOB, 100, {from: ALICE});
    const balance = await contractInstance.balanceOf(BOB);
    assert.equal(Number(balance), 100, "Balance should be 100");
  });

bitcoinbrisbane avatar Nov 09 '18 07:11 bitcoinbrisbane

This serialization exception should be fixed with the last commit to dev branch. Let me know if that fixes it for you. I think there may be logic problems with the eth_getLogs not returning anything, but you may not be running into that.

zone117x avatar Nov 09 '18 09:11 zone117x

Has this been resolved for you?

zone117x avatar Nov 22 '18 23:11 zone117x

No, still the same. I’ll try latest dev commit this weekend.

bitcoinbrisbane avatar Nov 22 '18 23:11 bitcoinbrisbane