Questions tagged [vec]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer

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

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

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

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

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

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