These are chat archives for Nethereum/Nethereum

30th
Mar 2017
Juan Blanco
@juanfranblanco
Mar 30 2017 07:56
@evo01 yes and yes.. but note that the estimations sometimes are a bit off (there is an ongoing issue with geth)
@Bennett-farley great you got sorted
Sergey Mashin
@smashin
Mar 30 2017 14:03
@juanfranblanco Hi, Juan! I'm trying to use Personal.SignAndSendTransaction to call contract function. I'm using ConstructorCallEncoder.EncodeRequest to encode transaction input. And one of my parameters is of type uint[]. Transaction executes, but parameter I see in parity ui is uint. Maybe it is mistake in EncodeRequest function? http://joxi.ru/n2YXVyBHEw9Bm6
var abiDeser = new ABIDeserialiser();
var abi = abiDeser.DeserialiseContract(Settings.QuestionAbi);
var function = abi.Functions.Single(f => "vote".Equals(f.Name, StringComparison.OrdinalIgnoreCase));
var encoder = new ConstructorCallEncoder();
var data = encoder.EncodeRequest(
Settings.QuestionBin,
function.InputParameters,
"FC574CBE-959C-4AA6-AB33-0004B6D5B1D7",
new uint[] { 1 });
var transInput = new TransactionInput {
From = Settings.AccountAddress,
To = addressTo,
Data = data
};
        var transHash = await web3.Personal.SignAndSendTransaction.SendRequestAsync(transInput, Settings.AccountPassword);
Juan Blanco
@juanfranblanco
Mar 30 2017 14:07
I assume that the parity ui has just use the first value and display it as such
your abi has uint[]
correct?
also any reason you are handcrafting the lot?
@smashin ^^
Juan Blanco
@juanfranblanco
Mar 30 2017 14:17
you can use something like:
var web3 = new Web3(new ManagedAccount(Settings.AccountAddress, Settings.AccoutPassword));
more info here:
this is new for 2.0.0 but nice to see feedback before releasing :)
Sergey Mashin
@smashin
Mar 30 2017 14:24
Thank you, I will try it. But I think there is a bug, because when I use UnlockAccount and function.SendTransactionAsync I have no problems with array parameter
Juan Blanco
@juanfranblanco
Mar 30 2017 14:24
ah interesting
the code as you have seen is the same underneath
to build the encoding for the transaction
at the end is the same TransactionInput
Sergey Mashin
@smashin
Mar 30 2017 14:25
Yes, I saw sources
Juan Blanco
@juanfranblanco
Mar 30 2017 14:26
I guess as you have gone down so low level
:)
so mainly when deserialising the abi
the uint[] is recognised as an array
and encode it accordingly
arrays are different than a single uint
as they have lenght
only thing i can think is parity
(well specially as you have mentioned the differences between sendTransactionAsync and personal)
Juan Blanco
@juanfranblanco
Mar 30 2017 14:36
@smashin I have tried to explain the issue to the parity team on their gitter channel
@gavofyork
Sergey Mashin
@smashin
Mar 30 2017 14:53
Ok, thank you!