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

Implement @dfinity/principal #251

Closed
14 tasks done
Tracked by #212
lastmjs opened this issue May 5, 2022 · 0 comments
Closed
14 tasks done
Tracked by #212

Implement @dfinity/principal #251

lastmjs opened this issue May 5, 2022 · 0 comments
Assignees
Milestone

Comments

@lastmjs
Copy link
Member

lastmjs commented May 5, 2022

Make sure this works and that we have tests for it

  • Make sure to document that selfAuthenticating will not work until Boa fixes: Strange issue with postfix increment and array indexing boa-dev/boa#1917
  • We have lots of tests
  • Make sure sha224 works
  • Fix all tests and examples
  • cross-canister calls should also break, check those tests
  • Suppress esbuild warning/s
  • Still might want the explicit esbuild-tsconfig.json
  • js-sha256 might be showing issues with closures, I do not think we should need all of the global variable definitions that we are forced to use right now
  • To get js-sha256 to work it seems like we need to fork it or provide a lot of strange polyfills...consider our strategy with other packages moving forward. It might be best to just fork what we need to fork...that will give us the ultimate control that we need. Community members can maintain the forks and hopefully upstream their changes over time. For @dfinity/principal, we shouldn't have to change anything except for using esbuild's import injection thing (I'm hoping this is possible) to point to another package that has the expected interface...and perhaps the easiest thing to point to is a fork of js-sha256 called js-sha256-azle
  • Another idea is to mess with the module format in esbuild or swc, perhaps we can strip away a lot of the code in js-sha256 that is messing things up
  • Why isn't the management canister example breaking?
  • go remove all of the custom code that we don't need anymore, I think it will mostly be in azle/canisters/ledger/address
  • The context used to create the Principal must be the context used during AzleTryFromJsValue
  • Remove the AzleTryFromJsValue context code and run all tests again, might not need the weird hack?? Actually we need it because of the stable storage issue, yes I remember now
{
    "compilerOptions": {
        "importsNotUsedAsValues": "preserve"
    }
}
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

1 participant