SignAndSend SuccessResponse that is a result of a contract call does NOT contain all events that are emitted during tx execution. The Object contains only events emitted from the contract that is called but does not contain events that were emitted during cross contract call. Is it expected behavior? I am using substrate-contract-node for tests.
1 Answer
To make sure that we are talking about the same thing you would have to post your TypeScript code.
Make sure you follow https://polkadot.js.org/docs/api/start/api.tx.subs/#transaction-events. The events should all be there.
I have an idea why you might not be seeing it. My guess is that you are only looking for decoded events. This will work fine if you are just calling one contract, where you know the metadata.
But for cross-contract calls you are calling a second contract, with unknown metadata. polkadot-js won't be able to decode the events from that other contract out of the box, because it doesn't know the metadata of this other contract.
So on a high level you should be looking for unencoded events and decode those with the metadata of the contract to which you made a cross-contract call.
Alternatively you could also emit an event in the contract from which you are using the metadata in your frontend.