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

Docs: illustrate how to process input messages manually #1225

Open
anton-trunov opened this issue Dec 20, 2024 · 0 comments
Open

Docs: illustrate how to process input messages manually #1225

anton-trunov opened this issue Dec 20, 2024 · 0 comments
Assignees
Labels
docs.tact-lang.org Documentation for docs.tact-lang.org kept in docs folder

Comments

@anton-trunov
Copy link
Member

If someone needs to manually process all input messages, they would need to do it in the following manner:

contract MyContract {
    fun rcvWithoutOpcode(msg: Slice) { dump(42) }

    receive(msg: Slice) {
        // load opcode from `msg` first
        rcvWithoutOpcode(msg);
    }

    bounced(msg: Slice) { rcvWithoutOpcode(msg) }
}

Mention also msg in the bounced receiver won't have the 0xFFFFFFFF opcode.

This should be linked where the docs mention the receivers' priorities:
image

@anton-trunov anton-trunov added the docs.tact-lang.org Documentation for docs.tact-lang.org kept in docs folder label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs.tact-lang.org Documentation for docs.tact-lang.org kept in docs folder
Projects
None yet
Development

No branches or pull requests

2 participants