Skip to content

Commit 97de5a8

Browse files
authored
Only update and when update fields are non empty (#562)
1 parent 1871ad0 commit 97de5a8

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

framework/packages/abstract-client/src/builder.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,21 @@ impl<Chain: CwEnv> AbstractClientBuilder<Chain> {
140140

141141
fn update_ans(&self, abstr: &Abstract<Chain>) -> AbstractClientResult<()> {
142142
let ans_host = &abstr.ans_host;
143-
ans_host.update_dexes(self.dexes.clone(), vec![])?;
144-
ans_host.update_contract_addresses(self.contracts.clone(), vec![])?;
145-
ans_host.update_asset_addresses(self.assets.clone(), vec![])?;
146-
ans_host.update_channels(self.channels.clone(), vec![])?;
147-
ans_host.update_pools(self.pools.clone(), vec![])?;
143+
if !self.dexes.is_empty() {
144+
ans_host.update_dexes(self.dexes.clone(), vec![])?;
145+
}
146+
if !self.contracts.is_empty() {
147+
ans_host.update_contract_addresses(self.contracts.clone(), vec![])?;
148+
}
149+
if !self.assets.is_empty() {
150+
ans_host.update_asset_addresses(self.assets.clone(), vec![])?;
151+
}
152+
if !self.channels.is_empty() {
153+
ans_host.update_channels(self.channels.clone(), vec![])?;
154+
}
155+
if !self.pools.is_empty() {
156+
ans_host.update_pools(self.pools.clone(), vec![])?;
157+
}
148158

149159
Ok(())
150160
}

0 commit comments

Comments
 (0)