Discussion - What's Missing for Motoko Adoption?

Also, implicit conversion between Blob and [Nat8], please.

This is an unnecessary pain point given that these types are essentially the same thing. I’m currently battling through similar issues to those mentioned two years ago → Confusing type error when crossing canisters: expression of type MyType cannot produce expected type MyType__1 - Developers - Internet Computer Developer Forum

Everything ran locally fine. I had the ICP index canister defined in dfx.json as a remote canister, pointing to the released did and wasm. I was using get_account_transactions with the subaccount in the account object defined as Blob. As mentioned, all runs fine locally.

As soon as I try to deploy I get the error that the type is expected to be [Nat8]. Not sure why this wasn’t a problem locally, given that the did I am referencing for the index canister also defines it as [Nat8]. Anyway, I’ve just made the changes locally to use [Nat8] instead of Blob (which seems to require clunky conversions that could just be implicit - Option.map<[Nat8], Blob>(acc.subaccount, Blob.fromArray)).

The trouble is I get the opposite error now locally than I was getting when trying to deploy. Locally the compiler wants Blob for that index canister call (despite the vec nat8 in the did I’m using). I’ve tried a clean rebuild. I suspect there’s something I’m missing that I’ll figure out shortly. This is no doubt an unnecessary paint point though.

1 Like