Skip to content

Commit

Permalink
tfi-factory: non-empty label when instantiating tfi-pair
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Jul 19, 2021
1 parent 04995e8 commit 004ece9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions contracts/tfi-factory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ pub fn execute_create_pair(
},
)?;

let pair_name = format!("{}-{}", asset_infos[0], asset_infos[1]);

Ok(Response {
messages: vec![],
attributes: vec![
attr("action", "create_pair"),
attr("pair", format!("{}-{}", asset_infos[0], asset_infos[1])),
attr("pair", pair_name.clone()),
],
data: None,
submessages: vec![SubMsg {
Expand All @@ -127,7 +129,7 @@ pub fn execute_create_pair(
code_id: config.pair_code_id,
send: vec![],
admin: None,
label: "".to_string(),
label: pair_name,
msg: to_binary(&PairInstantiateMsg {
asset_infos,
token_code_id: config.token_code_id,
Expand Down
2 changes: 1 addition & 1 deletion contracts/tfi-factory/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ fn create_pair() {
.unwrap(),
code_id: 321u64,
send: vec![],
label: "".to_string(),
label: "asset0000-asset0001".to_string(),
admin: None,
}
.into()
Expand Down

0 comments on commit 004ece9

Please sign in to comment.