Skip to content

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