Questions tagged [vec]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
42 views

How to handle all the characters in Vec<u8>?

I am using vec to storing the string data on the chain. So when any user passing few special character it just convert it into the binary data and storing that binary data on the chain. Which we ...
Pankaj's user avatar
  • 2,031
2 votes
1 answer
28 views

Data structure to choose for ordered items?

Can someone help me understand the difference b/w using a Vec (BoundedVec) instead of a StorageMap for storing ordered items? Basically inside a vector, the index would be an indicator of order ...
Purple_Turtle's user avatar
5 votes
2 answers
132 views

Problem with Vec using ink

I'm trying to make some changes to the Flipper contract, trying to use a vector like the documentation say's it should be imported: #[ink::contract] pub mod flipper_plus { use ink::storage::...
Pierina Ponce's user avatar
6 votes
1 answer
59 views

Are Vec<T> stored with unused space in ink?

I'm using a Vec<T> in ink!. When allocating elements to the vec, the underlying array may be resized to provide a constant amortised push complexity of O(1). This means that sometimes the vec ...
goastler's user avatar
  • 559
2 votes
1 answer
49 views

function or associated item not found in `std::vec::Vec<u8>` when using MaxEndodedLen

I have a struct definition as follows #[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] pub struct Songs { pub name: Vec<u8>, pub cast: Vec<u8>,...
not 0x12's user avatar
  • 353
0 votes
2 answers
83 views

About passing Vec<u8> parameters in pallet

Problem How can I get the correct Vec<u8> in the pallet when I use Vec<u8> as the parameter of the pallet? code pub fn generate_proof_vkey( origin: OriginFor<T>, ...
bun's user avatar
  • 383