Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: no acknowledgement detail in ica callback #1636

Open
mmsqe opened this issue Oct 14, 2024 · 4 comments
Open

Problem: no acknowledgement detail in ica callback #1636

mmsqe opened this issue Oct 14, 2024 · 4 comments

Comments

@mmsqe
Copy link
Collaborator

mmsqe commented Oct 14, 2024

smart contract could get more detail when receives callback onPacketResult instead of a simple boolean indicating success or failure.

@yihuang
Copy link
Collaborator

yihuang commented Oct 14, 2024

but we need to keep it backward compatible, right? to avoid breaking existing contracts?

@mmsqe
Copy link
Collaborator Author

mmsqe commented Oct 14, 2024

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);

@yihuang
Copy link
Collaborator

yihuang commented Oct 14, 2024

better not, how about making the query api a special case, adding new apis only for query msg, without changing existing apis at all.

@mmsqe
Copy link
Collaborator Author

mmsqe commented Oct 14, 2024

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
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants