Closed ebma closed 1 year ago
Maybe we should also consider emitting relevant events from our chain extension. Although I am not 100% sure if this is possible. For example, when transferring some balance using the orml pallet adapter in our chain extension, it would be great if we can emit the related event. Do you know if this is possible @ashneverdawn?
Maybe we should also consider emitting relevant events from our chain extension. Although I am not 100% sure if this is possible. For example, when transferring some balance using the orml pallet adapter in our chain extension, it would be great if we can emit the related event. Do you know if this is possible @ashneverdawn?
This should be possible, yes.
And most importantly, as you said, contracts can and should emit events of their own. ink! has the functionality to emit events described here: https://use.ink/basics/events So we definitely need to implement that in the psp_22 contract.
It seems like this already works properly and I only didn't see any events being emitted because the chain extension functions were not called correctly. At least when testing with the ERC-20 wrapper, the expected events were emitted properly by the used pallets.
That's why I think I will close this ticket for now.
At the moment, the psp_22 contract does not emit any events which makes it difficult to understand what happened in a call to the smart contract. I tested the events on-chain and e.g. when using the smart contract to transfer some asset between two accounts, this does not appear anywhere in the block.
We should consider emitting events from within the smart contract so that we can track what happened in a smart contract call.