-
Notifications
You must be signed in to change notification settings - Fork 356
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
the method may_load
exists for struct cw_storage_plus::Map<'static, (std::string::String, Uint256), Uint256>
, but its trait bounds were not satisfied the following trait bounds were not satisfied: (std::string::String, Uint256): PrimaryKey
#663
Comments
Because as the error suggests, there's no implementation of a certain trait. |
That's correct. We purposely refrained for implementing You should be good to go with |
No I was using u256 because I was using solidity before and it was recommended to use u256. That's why. But yes u64 is enough. |
With u64 I have the same error |
Feel free to re-open and post a snippet of the failing code, and we'll take a look. |
pub const CARDS: Map<(String, u64), u64> = Map::new("cards"); |
Works for me. What version of |
cw-storage-plus = "0.8.0" |
cw-plus is now in version 0.12.1. I think you should try at least with version 0.10.x or so for this new format to work (check CHANGELOG.md, for details about For 0.8, using |
Sorry guys but now when I try to update I recieve this error
With this code |
Closing this, as this is not relevant to the original issue, nor an error or limitation in the API. |
Hello I have this error when I try to call may_load on a Map.
my code
let c = CARDS.may_load(deps.storage, (from, token_id))?; Ok(match c { Some(v) => { if v < value { return Err(ContractError::NoOwnCard) } }, None => return Err(ContractError::Unkown) });
The text was updated successfully, but these errors were encountered: