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

fix an "invalid address" error coming from client.open() #57

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

imaman
Copy link

@imaman imaman commented May 21, 2024

in the 03 tutorial when client.open() is called I get an Invalid address error

image

After some debugging I realized that this is due to Address.isAddress() (in ton-core) using instanceof for determining that the given object is an address. The packing/bunding process of the code creates to a situation where there are two different Address classes at runtime, thereby making the instanceof check evaluate to false.

This was fixed by importing the Address class from @ton/ton (instead of @ton/core)

https://github.com/ton-core/ton-core/blob/main/src/contract/openContract.ts#L27
https://github.com/ton-core/ton-core/blob/main/src/address/Address.ts#L65

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

Successfully merging this pull request may close these issues.

1 participant