Nethereum / abi-code-gen

Generic code generator from abi
21 stars 4 forks source link

generateFunctionCall and generateFunctionCallMultipleOutputsDTO generate code without fromAddress #2

Open StefH opened 6 years ago

StefH commented 6 years ago

The following C# code is generated:

public Task<bool> StoreDocumentAsyncCall(byte[] key, string name, string description) {
  var function = GetFunctionStoreDocument();
  return function.CallAsync<bool>(key, name, description);
}

And it would be better if also this code was generated:

public Task<bool> StoreDocumentAsyncCall(string addressFrom, byte[] key, string name, string description, HexBigInteger gas = null, HexBigInteger valueAmount = null) {
  var function = GetFunctionStoreDocument();
  return function.CallAsync<bool>(addressFrom, gas, valueAmount, key, name, description);
}
StefH commented 6 years ago

A possible solution can be found here: https://github.com/StefH/Solidity-Examples/tree/master/SmartContracts/Common/Solidity/templates

juanfranblanco commented 6 years ago

Thanks, I'll have a look over the weekend

juanfranblanco commented 6 years ago

Nice stuff, I have started to move code to common templates, you might find that useful. Also, note I am going to start generating more CQS based stuff.

StefH commented 6 years ago

Cool, if you have an update I would like to see that.

juanfranblanco commented 6 years ago

Yes I will push something this week, nothing major just starting, I am consolidating ideas to generate UI viewmodels, cqs, etc.. But having common utilities is a must to reduce the copy and paste.