-
The issue appears to be with how we’re handling the Principal type in the tests, specifically for the updateNFTCount function.
-
We’ve tried several approaches:
-
Using Principal.fromText() directly
-
Converting Principal to raw bytes using toUint8Array()
-
Using the IDL Principal type (which didn’t work due to type issues)
- Key observations:
-
The Rust code correctly uses the Principal type from ic_cdk::export::Principal
-
The Candid interface expects IDL.Principal type
-
The test file that works (wallet.test.ts) uses a different approach with principalArray
- Current state:
-
getNFTCountWithProgress works correctly
-
updateNFTCount fails with “Invalid principal argument” error
-
The error occurs in the Candid encoding layer