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

Allow dumping of Address types #16

Closed
talkol opened this issue Mar 1, 2023 · 11 comments · Fixed by #175
Closed

Allow dumping of Address types #16

talkol opened this issue Mar 1, 2023 · 11 comments · Fixed by #175
Assignees
Labels
feature: builtins Builtin functions feature: dump Debugging with dump (__tact_debug) kind: language feature Intent to add a language feature
Milestone

Comments

@talkol
Copy link
Member

talkol commented Mar 1, 2023

dump() not supported for type: Address
@talkol
Copy link
Member Author

talkol commented Mar 1, 2023

I think it's fine to dump in this format (which should be easier):

0:83dfd552e63729b472fcbcc8c45ebcc6691702558b68ec7527e1ba403a0f31a8

@ex3ndr
Copy link
Member

ex3ndr commented Mar 1, 2023

Well, it is not trivial. We have to write out hex encoder.

@ex3ndr ex3ndr added the size: small Good for newcomers label Mar 1, 2023
@logvik
Copy link
Member

logvik commented Mar 8, 2023

To compare in the current version:
in tact

dump(beginCell().storeAddress(ctx.sender).endCell().hash());

in tests on ts

console.log(
            "address hash: " +
                BigInt(
                    "0x" + beginCell().storeAddress(contract.address).endCell().hash().toString("hex")
                )
        );

@ex3ndr
Copy link
Member

ex3ndr commented Mar 8, 2023

I doubt that this would be an address

@logvik
Copy link
Member

logvik commented Mar 8, 2023

It is just a way how to dump address in tact and compare via ts. Just for a case, if somebody will face with this issue, to find how to solve this issue right now.

@EmelyanenkoK
Copy link

We had address encoder task in funC contest №2, there are a few opensourced solutions, for instance:
https://github.com/ton-blockchain/func-contest2-solutions/blob/main/5.fc

@howardpen9
Copy link
Contributor

<3

@howardpen9
Copy link
Contributor

Is this solve as well or should be implement in Tact?

cc @anton-trunov ,

Reference:

https://tact-by-example.org/02-addresses

@anton-trunov anton-trunov added the kind: language feature Intent to add a language feature label Nov 28, 2023
@anton-trunov anton-trunov added this to the v1.3.0 milestone Feb 16, 2024
@Gusarich Gusarich self-assigned this Mar 9, 2024
@anton-trunov anton-trunov added feature: builtins Builtin functions and removed size: small Good for newcomers labels Apr 16, 2024
@anton-trunov anton-trunov added the feature: dump Debugging with dump (__tact_debug) label Jun 12, 2024
@BorisWild
Copy link

I'm using blueprint with @tact-lang/compiler version "1.4.2" and still can't dump Address dump(myAddress()) returns nothing...

@anton-trunov
Copy link
Member

@BorisWild What have you tried? Are you sure you provided enough gas? Because dumping is computationally expensive

@BorisWild
Copy link

Thank you) you are right! Not enough ton on balance...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: builtins Builtin functions feature: dump Debugging with dump (__tact_debug) kind: language feature Intent to add a language feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants