Amiya Behera
Amiya Behera

Reputation: 2270

String and Vec<u128> not found in this scope

I have following code in decl_storage!

Group get(fn group): map hasher(blake2_128_concat) u128 => Vec<u128>;
VoteStatus get(fn vote_status): map hasher(blake2_128_concat) (u128, u128, String) => bool;

Neither its accepts String, nor Vec<u128>, it says not found in this scope.

Update:
Fixed the Vec part by importing

use sp_std::vec::Vec;

How can I import string?? Unable to use str?

Will I use Vec<u8>? Link

Upvotes: 0

Views: 232

Answers (1)

kianenigma
kianenigma

Reputation: 1405

You can also import sp_std::prelude::* for common stuff, such as Vec<_>. For string, as noted in your link, you cannot do it and can use Vec<u8> instead.

Upvotes: 3

Related Questions