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

SetContractPackageHash() works only to call entry points, not to query data from contract #8

Open
davidatwhiletrue opened this issue Sep 28, 2023 · 3 comments

Comments

@davidatwhiletrue
Copy link
Member

What happened?
A call to SetContractPackageHash() stores the package hash in the client so that an entry point can be called via package hash instead of contract hash. However, it not permits to read data from the contract. For that, SetContractHash() must be used.

What did you expect to happen?
SetContractPackageHash() may fetch the contract hash and use it to query the named keys.

Are you willing to submit a pull request to fix this bug?

@mystraio
Copy link

Please fix it asap. It will help a lot. Thank you.

@mystraio
Copy link

mystraio commented Sep 28, 2023

SetContractPackageHash() should work as follows:

  1. At the input of the function we provide Contract Package Hash (as string or GlobalStateKey).
  2. The function extracts and initializes the latest (highest), active version of the contract (contract hash) from the Contract Package Hash from function input, and allows you to operate on the initialized cep47/cep78 data.

Please fix this function for cep47Client and cep78Client.

@davidatwhiletrue
Copy link
Member Author

Thanks @mystraio for your notes. Just a comment about (2). SetContractPackage() accepts a second argument with the version number of the contract. If specified, this version must be used. If omitted, or null, then latest version of the contract must be used.

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

No branches or pull requests

2 participants