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
When using send_message(), Sway allows for message data of arbitrary length to be sent as part of a MessageOut receipt. However, there does not seem to be a way to transform a struct into Vec<u64>, which is the type required for msg_data. I had assumed that send_message() would work in a manner similar to that of log() on non-reference types, where it accepts a generic type and allows for structs to be used. Is it possible for send_message() to be adjusted to allow for this?
Additionally, if the above adjustment is possible, is it also possible for the type used in this new send_message() to be added to loggedTypes in the ABI JSON? In the Fuel indexer, we leverage the logged types field to be able to decode the bytes into the structs found in the Sway contract. This would allow us to decode the data field in MessageOut receipts, and further augment our abilities to index contract events. (FuelLabs/fuel-indexer#300)
The text was updated successfully, but these errors were encountered:
Is it possible for send_message() to be adjusted to allow for this?
I think this is doable but what may make it challenging is being able to support both Vec<u8> AND non-heap types.
is it also possible for the type used in this new send_message() to be added to loggedTypes in the ABI JSON?
Even if we do this, there is no way to know what type corresponds to what smo instruction. This works for log because register $rB of log is used to store the "log ID" which is stored in the JSON ABI and allows looking up the type. smo does not have a free register that we can use for that.
When using
send_message()
, Sway allows for message data of arbitrary length to be sent as part of aMessageOut
receipt. However, there does not seem to be a way to transform a struct intoVec<u64>
, which is the type required formsg_data
. I had assumed thatsend_message()
would work in a manner similar to that oflog()
on non-reference types, where it accepts a generic type and allows for structs to be used. Is it possible forsend_message()
to be adjusted to allow for this?Additionally, if the above adjustment is possible, is it also possible for the type used in this new
send_message()
to be added tologgedTypes
in the ABI JSON? In the Fuel indexer, we leverage the logged types field to be able to decode the bytes into the structs found in the Sway contract. This would allow us to decode the data field inMessageOut
receipts, and further augment our abilities to index contract events. (FuelLabs/fuel-indexer#300)The text was updated successfully, but these errors were encountered: