You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Add a helper method on ContractInvokeSuccess for deserializing events into structured types. It should assume that only a single contract is called and thus that only one type of event is produced.
I needed this method several times for #347 and @DOBEN pointed out that we should add it to the testing library.
This function achieves the same result for Cis2Events:
fndeserialize_update_events(update:&ContractInvokeSuccess,) -> Vec<Cis2Event<ContractTokenId,ContractTokenAmount>>{
update
.events().flat_map(|(_addr, events)| {
events.iter().map(|e| {let e = from_bytes(e.as_ref()).expect("Deserialize event");
e
})}).collect()}
Once implemented, we should replace all the deserialize_update_events in the example contracts with the new method.
The text was updated successfully, but these errors were encountered:
Description
Add a helper method on
ContractInvokeSuccess
for deserializing events into structured types. It should assume that only a single contract is called and thus that only one type of event is produced.I needed this method several times for #347 and @DOBEN pointed out that we should add it to the testing library.
This function achieves the same result for
Cis2Event
s:Once implemented, we should replace all the
deserialize_update_events
in the example contracts with the new method.The text was updated successfully, but these errors were encountered: