Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ref-exchange/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ref-exchange"
version = "1.9.12"
version = "1.9.13"
authors = ["Illia Polosukhin <illia.polosukhin@gmail.com>"]
edition = "2018"
publish = false
Expand Down
6 changes: 6 additions & 0 deletions ref-exchange/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes

### Version 1.9.13
```
4izBbspd1Uiu1vjYcWpkebzoVxqmiZK7ZXSn4b2fAF2D
```
1. add batch_views.

### Version 1.9.12
```
68GhAQax4ndABL7Ks1sVncmJDuendk6hDETCq4dqS5rJ
Expand Down
15 changes: 15 additions & 0 deletions ref-exchange/src/views.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1007,4 +1007,19 @@ impl Contract {
})
.collect()
}

pub fn batch_views(
&self,
account_id: Option<ValidAccountId>,
pool_ids: Option<Vec<u64>>,
) -> (
Option<HashMap<u64, ShadowRecordInfo>>,
Option<HashMap<String, UnitShareTokens>>,
Option<Vec<U128>>,
) {
let shadow_records = account_id.as_ref().map(|v| self.get_shadow_records(v.clone()));
let unit_lpt_assets = pool_ids.as_ref().map(|v| self.get_unit_lpt_assets(v.clone()));
let pool_shares = account_id.zip(pool_ids).map(|(aid, pids)| self.get_pool_shares_batch(pids, aid));
(shadow_records, unit_lpt_assets, pool_shares)
}
}
2 changes: 1 addition & 1 deletion ref-exchange/tests/test_migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn test_upgrade() {
.assert_success();
let metadata = get_metadata(&pool);
// println!("{:#?}", metadata);
assert_eq!(metadata.version, "1.9.12".to_string());
assert_eq!(metadata.version, "1.9.13".to_string());
assert_eq!(metadata.admin_fee_bps, 5);
assert_eq!(metadata.boost_farm_id, "boost_farm".to_string());
assert_eq!(metadata.burrowland_id, "burrowland".to_string());
Expand Down
Binary file modified releases/ref_exchange_release.wasm
Binary file not shown.
Binary file added releases/ref_exchange_release_v1912.wasm
Binary file not shown.