Open mmsqe opened 1 month ago
but we need to keep it backward compatible, right? to avoid breaking existing contracts?
but we need to keep it backward compatible, right? to avoid breaking existing contracts?
yes, but if we add it as a new, we need call both functions?
function onPacketResultCallback(string calldata packetSrcChannel, uint64 seq, bool ack) external payable returns (bool);
function onPacketResultCallbackWithDetail(string calldata packetSrcChannel, uint64 seq, bool ack, bytes calldata rsp) external payable returns (bool);
better not, how about making the query api a special case, adding new apis only for query msg, without changing existing apis at all.
not sure if we just pass req.Data to contract, not sure how contract handle dynamically since safeRsp.Responses
could come from query balance or param
var safeRes hosttypes.MsgModuleQuerySafe
err := proto.Unmarshal(res.GetResult(), &safeRes)
if err != nil {
return err
}
for _, req := range safeRes.Requests {
var safeRsp hosttypes.MsgModuleQuerySafeResponse
if err := k.cdc.Unmarshal(req.Data, &safeRsp); err != nil {
return err
}
}
smart contract could get more detail when receives callback
onPacketResult
instead of a simple boolean indicating success or failure.