We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import "@stdlib/deploy"; message ForwardPayload{ to: map<Address, Int as coins>; } contract InvalidSerialization with Deployable { receive(m: ForwardPayload){ foreach(addr, amount in m.to){ dump(addr); dump(amount); } } }
No errors thrown
When one tries to send "ForwardPayload" message, it ends with 9 error code, because the serialization and deserialization differ:
export function storeForwardPayload(src: ForwardPayload) { return (builder: Builder) => { let b_0 = builder; b_0.storeUint(3264607134, 32); b_0.storeDict(src.to, Dictionary.Keys.Address(), Dictionary.Values.BigUint(124)); }; }
and in contract code:
var ($addr, $amount, $fresh$flag_0) = __tact_dict_min_slice_int($m'to, 267, 257); while ($fresh$flag_0) { __tact_debug_address($addr, __gen_slice_string_fff0772d56d2a3f45220c12e605b1692cb65b9ef6f72a2e11c228fd2152f47e2(), "File contracts/test.tact:11:13:"); __tact_debug_str(__tact_int_to_string($amount), __gen_slice_string_8ebac137868252bcaf2f59f69a6616ec14a1c79ceaf49369f36485c5fb48a8ec(), "File contracts/test.tact:12:13:"); ($addr, $amount, $fresh$flag_0) = __tact_dict_next_slice_int($m'to, 267, $addr, 257);
I expected that the map values are serialized correctly both in the func code and TypeScript
git clone https://github.com/imartemy1524/tact-map-bug cd tact-map-bug npm i npx blueprint build --all npx blueprint test
Blueprint
Source code: https://github.com/imartemy1524/tact-map-bug
The text was updated successfully, but these errors were encountered:
as coins
__tact_dict
Gusarich
Successfully merging a pull request may close this issue.
Are you using the latest released (or pre-released, a.k.a. "next") version?
Tact source code
Relevant Tact/build system log output
What happened?
When one tries to send "ForwardPayload" message, it ends with 9 error code, because the serialization and deserialization differ:
and in contract code:
What did you expect?
I expected that the map values are serialized correctly both in the func code and TypeScript
Steps to reproduce
How do you run Tact?
Blueprint
Anything else?
Source code: https://github.com/imartemy1524/tact-map-bug
The text was updated successfully, but these errors were encountered: