abi-code-gen icon indicating copy to clipboard operation
abi-code-gen copied to clipboard

generateFunctionCall and generateFunctionCallMultipleOutputsDTO generate code without fromAddress

Open StefH opened this issue 7 years ago • 5 comments

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 avatar Dec 29 '17 19:12 StefH

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

StefH avatar Jan 04 '18 14:01 StefH

Thanks, I'll have a look over the weekend

juanfranblanco avatar Jan 04 '18 19:01 juanfranblanco

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.

juanfranblanco avatar Jan 08 '18 10:01 juanfranblanco

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

StefH avatar Jan 08 '18 12:01 StefH

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.

juanfranblanco avatar Jan 08 '18 12:01 juanfranblanco