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 trusts types throughout client and compiler #2479

Closed
spencercorwin opened this issue Jun 17, 2021 · 3 comments · Fixed by #2499
Closed

Fix trusts types throughout client and compiler #2479

spencercorwin opened this issue Jun 17, 2021 · 3 comments · Fixed by #2499
Assignees
Labels
area/client Categorize issue or PR as client (@neo-one/client) related area/compiler Categorize issue or PR as compiler (@neo-one/smart-contract-compiler) related area/documentation Categorize issue or PR as documentation related kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/important-soon Must be staffed and worked on either currently, or very soon.

Comments

@spencercorwin
Copy link
Collaborator

No description provided.

@spencercorwin spencercorwin added priority/important-soon Must be staffed and worked on either currently, or very soon. area/client Categorize issue or PR as client (@neo-one/client) related area/compiler Categorize issue or PR as compiler (@neo-one/smart-contract-compiler) related area/documentation Categorize issue or PR as documentation related kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Jun 17, 2021
@spencercorwin spencercorwin self-assigned this Jun 17, 2021
@spencercorwin spencercorwin changed the title Fix trusts types through client and compiler Fix trusts types throughout client and compiler Jun 28, 2021
@spencercorwin
Copy link
Collaborator Author

spencercorwin commented Jun 28, 2021

Probably start at these files where the type is probably wrong for types:

  • ManifestSmartContractProcessor.ts
  • packages/neo-one-smart-contract-compiler/src/transpile/types.ts
  • getContractProperties.ts (line 67)
  • packages/neo-one-smart-contract-compiler/src/constants.ts (line 14)

Really want to start in getContractProperties.ts on line 370. That's where we use TS compiler APIs to parse the actual text in a user's smart contract.

Only really need to look at lines 370 to 434. That's the key chunk of code where parsing and checking of the trusts array is done.

@spencercorwin
Copy link
Collaborator Author

The user's smart contract should define a trusts property which is a string ('*') or an array of strings which are either UInt160 hex string or ECPoint (public key) string.

Also need to check index.d.ts comment on line 1218 and 1219.

@spencercorwin
Copy link
Collaborator Author

Need to fix the parsing in getContractProperties.ts to accept either UInt160 or ECPoint. Then ManifestSmartContractProcessor.ts will use those strings to create a new ContractPermissionDescriptor()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/client Categorize issue or PR as client (@neo-one/client) related area/compiler Categorize issue or PR as compiler (@neo-one/smart-contract-compiler) related area/documentation Categorize issue or PR as documentation related kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/important-soon Must be staffed and worked on either currently, or very soon.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant