Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SolochainDefaultConfig uses incorrect AccountData #5922

Closed
2 tasks done
dandanlen opened this issue Oct 4, 2024 · 0 comments · Fixed by #5941
Closed
2 tasks done

SolochainDefaultConfig uses incorrect AccountData #5922

dandanlen opened this issue Oct 4, 2024 · 0 comments · Fixed by #5941
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@dandanlen
Copy link

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

In the definition of SolochainDefaultConfig:

			/// The default data to be stored in an account.
			type AccountData = crate::AccountInfo<Self::Nonce, ()>;

And the Account storage the frame_system pallet:

	/// The full account information for a particular account ID.
	#[pallet::storage]
	#[pallet::getter(fn account)]
	pub type Account<T: Config> = StorageMap<
		_,
		Blake2_128Concat,
		T::AccountId,
		AccountInfo<T::Nonce, T::AccountData>,
		ValueQuery,
	>;

which using the default config resolves to:

	/// The full account information for a particular account ID.
	#[pallet::storage]
	#[pallet::getter(fn account)]
	pub type Account<T: Config> = StorageMap<
		_,
		Blake2_128Concat,
		T::AccountId,
		//-- Note the duplication of AccountInfo --//
		AccountInfo<T::Nonce, AccountInfo<T::Nonce, ()>>,
		ValueQuery,
	>;

Not really a bug in the 'broken' sense but could be confusing for newcomers in that it will add an unused AccountInfo.

Probably makes most sense to just not default this at all and force the implementer to choose.

Steps to reproduce

No response

@dandanlen dandanlen added I10-unconfirmed Issue might be valid, but it's not yet known. I2-bug The node fails to follow expected behavior. labels Oct 4, 2024
github-merge-queue bot pushed a commit that referenced this issue Oct 8, 2024
`AccountData` should be set to `()` and not to `AccountInfo`.

Closes: #5922

---------

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant