Unity3dAPI: added receipt search#666
Unity3dAPI: added receipt search#666noescape00 wants to merge 2 commits intostratisproject:masterfrom
Conversation
| [HttpGet] | ||
| public async Task<List<ReceiptResponse>> ReceiptSearchAPI([FromQuery] string contractAddress, [FromQuery] string eventName, [FromQuery] List<string> topics = null, [FromQuery] int fromBlock = 0, [FromQuery] int? toBlock = null) | ||
| { | ||
| List<ReceiptResponse> result = this.smartContractsController.ReceiptSearch(contractAddress, eventName, topics, fromBlock, toBlock); |
There was a problem hiding this comment.
Hi Ivan,
It seems that the logic in SmartContractsController.ReceiptSearch is now shared between 2 controllers. There is already a smartContractTransactionService in this controller, so move the logic in SmartContractsController.ReceiptSearch there and then just call smartContractTransactionService.ReceipSearch from here (also just update SmartContractsController to do the same).
😎
There was a problem hiding this comment.
It seems that the logic in SmartContractsController.ReceiptSearch is now shared between 2 controllers.
Logic was just in SC controller and unity controller called it (same was done with other methods as well)
But anyway, changes applied
fassadlr
left a comment
There was a problem hiding this comment.
I know its a bit more code bit this looks a lot cleaner now ;) I was worried also that some person randomly moves or even remove the sc controller and then your code breaks.
| } | ||
|
|
||
| IEnumerable<byte[]> topicsBytes = topics != null ? topics.Where(topic => topic != null).Select(t => t.HexToByteArray()) : new List<byte[]>(); | ||
|
|
| /// Therefore, it is possible to return a smart contract's transaction receipts | ||
| /// which match a specific event (as defined by the struct name). |
There was a problem hiding this comment.
Perhaps put all of this on one line.
|
Fix the tests. |
|
Closing this one and moving it to #712 |
Pretty straight forward, it just calls receipt search from SC controller