# Principal Issues when Update NFT count is called

**URL:** <https://forum.dfinity.org/t/principal-issues-when-update-nft-count-is-called/42921>\
**Category:** Rust\
**Created:** [March 24, 2025, 1:36am UTC](https://forum.dfinity.org/t/principal-issues-when-update-nft-count-is-called/42921 "2025-03-24T01:36:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muggzie](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/muggzie/32/25519_2.png) [@Muggzie](https://forum.dfinity.org/u/Muggzie)\
**Post date:** [March 24, 2025, 1:36am UTC](https://forum.dfinity.org/t/principal-issues-when-update-nft-count-is-called/42921/1 "2025-03-24T01:36:26Z")

</div>

1. The issue appears to be with how we’re handling the Principal type in the tests, specifically for the updateNFTCount function.

2. 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)

1. 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

1. Current state:

- getNFTCountWithProgress works correctly

- updateNFTCount fails with “Invalid principal argument” error

- The error occurs in the Candid encoding layer
