-
Notifications
You must be signed in to change notification settings - Fork 47
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
Validate the Environment
of a contract
#469
Comments
@SkymanOne sounds like a valuable addition to me. Just compiled the I was trying to find stuff like |
the validation should happen when the user tries to upload the file. wdyt @peetzweg ? |
Linking this issues from pjs api. Might be relevant for a future refactor: |
Hm bit stuck here, not sure how to make sure the environments of the chain and contract are compatible. Once creating a CodePromise with pjs the registry of the code promise seems to fallback to the chain registry. Not an expert on this registry magic pjs is doing and the docs lack a lot of detail what is actually happening. I made this codesandbox deno workspace which should show this. Run the following in the cs terminal. https://codesandbox.io/p/sandbox/custom-environment-80kxpj?file=%2Findex.ts%3A50%2C38-50%2C68 deno task start I've added a contract which has a non default environment to the workspace. I.e. changed the
Furthermore, for
No hunch how to get better types from pjs. Another option would be to ditch pjs and plainly do the comparison based on the raw chain metadata data and the contract environment data. However, it does not seem very trivial todo as some types like Need more knowledge about this type serialization in environment and chain metadata to come up with a proper solution to this. |
Is your feature request related to a problem? Please describe.
There has been a change to the ink! metadata. A new field
environment
has been addedDescribe the solution you'd like
It would be ideal if the UI could validate the types specified in
environment
match the types of the chain the contracts are tried to be deployed on. This will ensure resilience against type mismatch and data corruption.Additional context
See See use-ink/ink#1741 and use-ink/ink#1695
The text was updated successfully, but these errors were encountered: