Skip to content

v2.1.0

Compare
Choose a tag to compare
@larry0x larry0x released this 28 Jun 17:19
· 37 commits to main since this release
b1d04d8

Implement a new struct AssetInfoKey, which allows AssetInfo to be used as storage keys in maps:

use cosmwasm_std::testing::mock_dependencies;
use cw_asset::{AssetInfo, AssetInfoKey};
use cw_storage_plus::Map;

let deps = mock_dependencies();
let map: Map<AssetInfoKey, u64> = Map::new("map");

map.save(
    deps.as_mut().storage,
    AssetInfo::native("uosmo").into(), // cast AssetInfo into AssetInfoKey
    &12345,
)
.unwrap();