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

get_fallback_certificate, init_stable_store #2

Open
seb-icp opened this issue Dec 7, 2024 · 1 comment
Open

get_fallback_certificate, init_stable_store #2

seb-icp opened this issue Dec 7, 2024 · 1 comment

Comments

@seb-icp
Copy link

seb-icp commented Dec 7, 2024

Hello,

I've tried to install the library locally and I'm encountering two main errors:

1. Missing Function in AssetsUtils.mo

In AssetsUtils.mo, I'm getting the error field get_fallback_certificate does not exist in module at line 1430.

The get_fallback_certificate function is imported from the CertifiedAssets library. However, after reviewing the CertifiedAssets module, I couldn't find any reference to get_fallback_certificate.

I'm assuming this is the repository for Certified Assets: https://github.com/NatLabs/certified-assets

Could there be an unpublished version of CertifiedAssets?

2. Questions About init_stable_store

Is init_stable_store supposed to be callable in the actor? I'm asking because:

  • The first parameter is supposed to be the canister_id, but we can't access it in the body of an actor.
  • There seems to be a discrepancy between the README (which shows no parameters when calling Assets.init_stable_store) and the actual implementation

I love the work that is being done here; this is going to be massively useful for the Motoko ecosystem. Thanks!

@tomijaga
Copy link
Member

Hey, thank you for the bug report and the kind words!

I seem to have pushed the changes for this library without updating the certified-assets library. I've fixed this now and published version 0.1.0 to mops (https://mops.one/[email protected]) which should resolve the issues you encountered.

Is init_stable_store supposed to be callable in the actor? I'm asking because:
The first parameter is supposed to be the canister_id, but we can't access it in the body of an actor.

The DFINITY team released a new Motoko version recently, that supports this feature: https://github.com/dfinity/motoko/releases/tag/0.13.2.
I'm not sure if this has made it into dfx yet, but you can install it through mops with mops toolchain use moc and then set the environment variable with export DFX_MOC_PATH=moc-wrapper.

Yes, there was a mismatch between the README and the actual implementation. This was from the initial design that has since been updated. I've updated the README to reflect the current implementation.

Let me know if you run into any other issues.

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