Skip to content

Commit

Permalink
Merge pull request CosmWasm#6 from aura-nw/cw2_supported_interface
Browse files Browse the repository at this point in the history
fix lint
  • Loading branch information
ThienLK1 authored Nov 8, 2022
2 parents 481f4a3 + ffd4cd8 commit e50547c
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions packages/cw2-supported-interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub fn set_contract_version<T: Into<String>, U: Into<String>>(
let val = ContractVersion {
contract: name.into(),
version: version.into(),
supported_interface: supported_interface.into(),
supported_interface,
};
CONTRACT.save(store, &val)
}
Expand Down Expand Up @@ -88,7 +88,6 @@ where
mod tests {
use super::*;
use cosmwasm_std::testing::MockStorage;
use std::vec::Vec;

#[test]
fn get_and_set_work() {
Expand All @@ -113,23 +112,18 @@ mod tests {
// set and get with supported_interface
let contract_name = "crate:cw20-base";
let contract_version = "0.2.0";
let supported_interface = Some(Vec::from([
let supported_interface: Option<Vec<String>> = Some(Vec::from([
"crates.io:cw2".to_string(),
"crates.io:cw721".to_string(),
]));
set_contract_version(
&mut store,
contract_name,
contract_version,
supported_interface.clone(),
)
.unwrap();
let v_ref = &supported_interface;
set_contract_version(&mut store, contract_name, contract_version, v_ref.clone()).unwrap();

let loaded = get_contract_version(&store).unwrap();
let expected = ContractVersion {
contract: contract_name.to_string(),
version: contract_version.to_string(),
supported_interface: supported_interface.clone(),
supported_interface: v_ref.clone(),
};
assert_eq!(expected, loaded);
}
Expand Down

0 comments on commit e50547c

Please sign in to comment.