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

set reasonable bounds for PalletString everywhere #343

Open
brenzi opened this issue Aug 11, 2023 · 0 comments
Open

set reasonable bounds for PalletString everywhere #343

brenzi opened this issue Aug 11, 2023 · 0 comments

Comments

@brenzi
Copy link
Member

brenzi commented Aug 11, 2023

PalletString should have a type argument defining the size of the bounded vec

pub type PalletString = BoundedVec<u8, ConstU32<256>>;

256 by default is a lot because I suspect the chain DB blows it up to the bound (TBV)

Then we should allocate reasonable bounds everywhere. Especially these here should be reconsidered:

if self.name.len() > 20 {

if self.symbol.len() != 3 {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant