From 004ece961d03cd012c3acf3e6793cb5eaf891e64 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Mon, 19 Jul 2021 17:49:30 +0200 Subject: [PATCH] tfi-factory: non-empty label when instantiating tfi-pair --- contracts/tfi-factory/src/contract.rs | 6 ++++-- contracts/tfi-factory/src/testing.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/contracts/tfi-factory/src/contract.rs b/contracts/tfi-factory/src/contract.rs index 72c005b..b04f1c4 100644 --- a/contracts/tfi-factory/src/contract.rs +++ b/contracts/tfi-factory/src/contract.rs @@ -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 { @@ -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, diff --git a/contracts/tfi-factory/src/testing.rs b/contracts/tfi-factory/src/testing.rs index 322a566..880d95f 100644 --- a/contracts/tfi-factory/src/testing.rs +++ b/contracts/tfi-factory/src/testing.rs @@ -148,7 +148,7 @@ fn create_pair() { .unwrap(), code_id: 321u64, send: vec![], - label: "".to_string(), + label: "asset0000-asset0001".to_string(), admin: None, } .into()