I need to use this field when configuring config under runtime. The compiler can jump through ctrl, but an error is reported during the compilation process.

this is my code.

pub NativeTreasuryAccount: AccountId = TreasuryPalletId::get().into_account();

enter image description here

1 Answer 1


Did you import the trait as suggested in the error message?

use sp_runtime::traits::AccountIdConversion;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.