These are chat archives for Nethereum/Nethereum

23rd
Oct 2018
Juan Blanco
@juanfranblanco
Oct 23 2018 07:31
@spied001 have you code generated your inferface? if you use FuctionMesssages or DeploymentMessages it should be automatically estimated for you
although the estimation error happens when there is an error in your solidity (normally) so if it works in truffle it might be an issue with one of the values passed, maybe wrong address, etc
Tadej Fius
@tfius
Oct 23 2018 10:05
hey, i am calling gj.CallDeserializingToObjectAsync<List<GenItem>>(ofOwner).ConfigureAwait(true) but getting 'Generic Type should have a Function Ouput Attribute' exception, GenItem has FunctionOutput attributes
also error message has typo (Out*put)
so how can i deserialize to list of objects ?
Juan Blanco
@juanfranblanco
Oct 23 2018 10:06
you won't have a list of objects
that is not supported until v2
Tadej Fius
@tfius
Oct 23 2018 10:07
hmm i can deserialize to List<byte[]>
Juan Blanco
@juanfranblanco
Oct 23 2018 10:07
yeah you can do that
Tadej Fius
@tfius
Oct 23 2018 10:07
ok any ideas how can i get around it ?
Juan Blanco
@juanfranblanco
Oct 23 2018 10:08
for that you just deserialise using CallAsync<List<byte[]>(
what is GenItem
Tadej Fius
@tfius
Oct 23 2018 10:09
[FunctionOutput]
public class GenItem
{
[Parameter("bytes32", "genHash", 1, false)]
public byte[] genHash { get; set; }
[Parameter("uint256", "costToExecute", 2, false)]
public BigInteger costToExecute { get; set; }
[Parameter("uint256", "timesExecuted", 3, false)]
public BigInteger timesExecuted { get; set; }
    public void Info()
    {
            Console.WriteLine($"GenItem:" +
                $"\n genHash      : {genHash.ToHex()} " +
                $"\n costToExecute: {costToExecute} " +
                $"\n timesExecuted: {timesExecuted}");
    }
}
Juan Blanco
@juanfranblanco
Oct 23 2018 10:10
so what is solidity returning
GenItem
Tadej Fius
@tfius
Oct 23 2018 10:10
yes
genItem[]
array of GenItems
Juan Blanco
@juanfranblanco
Oct 23 2018 10:10
which is a struct?
Tadej Fius
@tfius
Oct 23 2018 10:10
yes
Juan Blanco
@juanfranblanco
Oct 23 2018 10:11
ok v2
Tadej Fius
@tfius
Oct 23 2018 10:12
can i get back 'raw' results ?
and i parse them myself?
but i have not created a sample for arrays, even if there is support :)
but this is v2...
let me do a sample later
Juan Blanco
@juanfranblanco
Oct 23 2018 10:20
a simple one would be something like this
but you need your structure abi :)
Tadej Fius
@tfius
Oct 23 2018 11:05
for geting single struct CallDeserializingToObjectAsync<SomeObject>(params...) works well
maybe the problem is that List has no function output?
Juan Blanco
@juanfranblanco
Oct 23 2018 12:28
@tfius checking that out now, it is not implemented
ill post something later :)
Tadej Fius
@tfius
Oct 23 2018 13:41
:) thanks for working on nethereum btw, much appreciated
although this is only in master
Tadej Fius
@tfius
Oct 23 2018 15:55
thank you