Skip to content

Commit

Permalink
Only update and when update fields are non empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayanski committed Jan 6, 2025
1 parent 1871ad0 commit 9ff1132
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions framework/packages/abstract-client/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,21 @@ impl<Chain: CwEnv> AbstractClientBuilder<Chain> {

fn update_ans(&self, abstr: &Abstract<Chain>) -> AbstractClientResult<()> {
let ans_host = &abstr.ans_host;
ans_host.update_dexes(self.dexes.clone(), vec![])?;
ans_host.update_contract_addresses(self.contracts.clone(), vec![])?;
ans_host.update_asset_addresses(self.assets.clone(), vec![])?;
ans_host.update_channels(self.channels.clone(), vec![])?;
ans_host.update_pools(self.pools.clone(), vec![])?;
if !self.dexes.is_empty() {
ans_host.update_dexes(self.dexes.clone(), vec![])?;
}
if !self.contracts.is_empty() {
ans_host.update_contract_addresses(self.contracts.clone(), vec![])?;

Check warning on line 147 in framework/packages/abstract-client/src/builder.rs

View check run for this annotation

Codecov / codecov/patch

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

Added line #L147 was not covered by tests
}
if !self.assets.is_empty() {
ans_host.update_asset_addresses(self.assets.clone(), vec![])?;
}
if !self.channels.is_empty() {
ans_host.update_channels(self.channels.clone(), vec![])?;

Check warning on line 153 in framework/packages/abstract-client/src/builder.rs

View check run for this annotation

Codecov / codecov/patch

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

Added line #L153 was not covered by tests
}
if !self.pools.is_empty() {
ans_host.update_pools(self.pools.clone(), vec![])?;

Check warning on line 156 in framework/packages/abstract-client/src/builder.rs

View check run for this annotation

Codecov / codecov/patch

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

Added line #L156 was not covered by tests
}

Ok(())
}
Expand Down

0 comments on commit 9ff1132

Please sign in to comment.