These are chat archives for Nethereum/Nethereum

Apr 2017
Juan Blanco
Apr 14 2017 00:57
oh that will be a List<string>
@mfamfa it needs a enumerable
@akopeliovich no is not possible
check your abi
Apr 14 2017 04:56

@juanfranblanco thanks, that helped! However I get another issue now. Sorry to bother you - but would you happen to know what might be the cause?

Error Message:
 System.MissingMethodException : Cannot create an instance of an interface.
Stack Trace:
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at Nethereum.ABI.Decoders.ArrayTypeDecoder.DecodeStaticElementType(Byte[] encoded, Type type)
   at Nethereum.ABI.Decoders.ArrayTypeDecoder.Decode(Byte[] encoded, Type type)
   at Nethereum.ABI.Decoders.DynamicArrayTypeDecoder.Decode(Byte[] encoded, Type type)
   at Nethereum.ABI.ABIType.Decode(Byte[] encoded, Type type)
   at Nethereum.ABI.FunctionEncoding.ParameterDecoder.DecodeOutput(String output, ParameterOutput[] outputParameters)
   at Nethereum.ABI.FunctionEncoding.FunctionCallDecoder.DecodeSimpleTypeOutput[T](Parameter outputParameter, String output)
   at Nethereum.Web3.FunctionBase.<CallAsync>d__26`1.MoveNext()

I have a testrpc running with contracts deployed (and data in the contracts).
I use Nethereum just to access/interact with these contracts.
I might be missing a crucial point here? Something I need to do to retrieve the contract/data?

Apr 14 2017 06:01
Additional info: I have compiled and deployed the contracts to TestRPC with Truffle. That shouldn't be a problem, right? The ABIs generated when I compile the .sol files from within vscode (using your solidity extension) are identical with the ABI generated when compiling the .sol files with truffle.
Lucas Cullen
Apr 14 2017 06:48
I assume if the method of the contract is payable, all i need to do to send 5 ETH is this? var buyTx = buyFunction.SendTransactionAsync(accounts[1], new Nethereum.Hex.HexTypes.HexBigInteger(30000), new Nethereum.Hex.HexTypes.HexBigInteger(5)).Result;
Apr 14 2017 09:39
For info: My issue is related to returning address[] from a mapping: mapping(address => address[]) public tokenHolders; - I am not sure if that's not allowed, but if I do it a different way everything works. So I found a workaround but if anybody has insights on why it didn't work, I would be interested. Thanks.
Juan Blanco
Apr 14 2017 10:51
@mfamfa your mapping with an array will be converted to a two parameter call 1 for the address and another for the indexer
@mfamfa try the code generator it creates your methods for you
There is one in vscode (solidity) and another on github release
@bitcoinbrisbane that is in Wei
You need to convert it
Use web3.Convert
@mfamfa re truffle yes it is the same
Lucas Cullen
Apr 14 2017 21:26
Thanks @juanfranblanco , I still get a 0 amount doing this
    amount += msg.value * 1000;
    balanceOf[msg.sender] += amount;
So I assume msg.value is 0?