wrap-cli icon indicating copy to clipboard operation
wrap-cli copied to clipboard

Feat: Client validate method

Open cbrzn opened this issue 3 years ago • 0 comments

disclaimer: even tho this PR is "done" it's the first iteration and i am looking for feedback, I don't like the validate/wrapper-* folder but thought it was easier to implement, if someone has any improvement suggestions i am more than open :)

This PR aims to add the validate function to the client, being able to guarantee that the client can communicate with the given wrapper URI ahead-of-time

The interface is the following:

interface ValidateOptions {
  recursive: boolean
  abi: boolean
}
validate(uri: Uri | string, options: ValidateOptions) -> boolean
  • If abi is true, make sure the ABI from 1st level dependencies are available (the ones from importedModuleType)
  • If recursive is true, it will check all uris and make sure it can resolve them

Also, a compare function has been implemented in js/manifests/wrap to compare two array of method definitions, this function allow us to make sure that dependencies are equal and wont fail in runtime

cbrzn avatar Oct 17 '22 18:10 cbrzn