Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only update and when update fields are non empty #562

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions framework/packages/abstract-client/src/builder.rs
Original file line number Diff line number Diff line change
@@ -140,11 +140,21 @@

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

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

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

Codecov / codecov/patch

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

Added line #L156 was not covered by tests
}

Ok(())
}