Created
May 14, 2025 11:33
-
-
Save franciscoaguirre/e7d26c2dd720ca15531f74b3656c0a4f to your computer and use it in GitHub Desktop.
How to get a utility derived account in FRAME
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #[test] | |
| fn whats_the_derived_account_id() { | |
| use sp_runtime::AccountId32; | |
| let account_id = AccountId32::from_ss58check("13YMK2ehDHE4hoxL9L2jq4h8zwMFpo4cZnrR7YwzgxxSH8LR").unwrap(); | |
| let result = pallet_utility::Pallet::<Runtime>::derivative_account_id(account_id, 0); | |
| let derived_account_id = result.to_ss58check_with_version(42_u16.into()); | |
| dbg!(&derived_account_id); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment