Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Problem (Fix #777): Order of client list address api is not sorted by creation order. #928

Merged
merged 1 commit into from
Jan 20, 2020

Conversation

yihuang
Copy link
Collaborator

@yihuang yihuang commented Jan 20, 2020

Solution:

  • change BTreeSet to IndexSet

This is required by new integration tests, also more intuitive to user.

Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't the order stable with TreeSet? Always sorted?

@devashishdxt
Copy link
Collaborator

isn't the order stable with TreeSet? Always sorted?

We can also use IndexSet if we want to preserve insertion order in set.

@yihuang yihuang changed the title Problem (Fix #777): Order of client list address api is not stable Problem (Fix #777): Order of client list address api is not sorted by creation. Jan 20, 2020
@yihuang yihuang changed the title Problem (Fix #777): Order of client list address api is not sorted by creation. Problem (Fix #777): Order of client list address api is not sorted by creation order. Jan 20, 2020
@yihuang
Copy link
Collaborator Author

yihuang commented Jan 20, 2020

isn't the order stable with TreeSet? Always sorted?

I need it sorted by creation order, just edited the title.

@yihuang
Copy link
Collaborator Author

yihuang commented Jan 20, 2020

isn't the order stable with TreeSet? Always sorted?

We can also use IndexSet if we want to preserve insertion order in set.

IndexSet is good as long as we don't need to remove item, it seems we won't have removal requirement in the future?

@devashishdxt
Copy link
Collaborator

isn't the order stable with TreeSet? Always sorted?

We can also use IndexSet if we want to preserve insertion order in set.

IndexSet is good as long as we don't need to remove, it seems we won't have removal requirement?

I can only foresee clear() (highly improbable that we'll need this) which is ok with IndexSet.

@codecov
Copy link

codecov bot commented Jan 20, 2020

Codecov Report

Merging #928 into master will increase coverage by 0.02%.
The diff coverage is 77.35%.

@@            Coverage Diff             @@
##           master     #928      +/-   ##
==========================================
+ Coverage   68.32%   68.34%   +0.02%     
==========================================
  Files         133      133              
  Lines       17534    17562      +28     
==========================================
+ Hits        11980    12003      +23     
- Misses       5554     5559       +5
Impacted Files Coverage Δ
client-core/src/wallet/syncer.rs 61.12% <100%> (+0.12%) ⬆️
client-common/src/key/public_key.rs 78.51% <100%> (ø) ⬆️
client-rpc/src/rpc/wallet_rpc.rs 62.98% <28.57%> (-0.14%) ⬇️
client-core/src/wallet/default_wallet_client.rs 43.89% <33.33%> (ø) ⬆️
client-core/src/service/wallet_service.rs 86.73% <87.5%> (+0.26%) ⬆️
chain-core/src/tx/fee/mod.rs 87.68% <0%> (-0.5%) ⬇️

…creation order

Solution:
- Change `BTreeSet` to `IndexSet`
@yihuang
Copy link
Collaborator Author

yihuang commented Jan 20, 2020

isn't the order stable with TreeSet? Always sorted?

We can also use IndexSet if we want to preserve insertion order in set.

IndexSet is good as long as we don't need to remove, it seems we won't have removal requirement?

I can only foresee clear() (highly improbable that we'll need this) which is ok with IndexSet.

Done, changed to use IndexSet.

@yihuang yihuang requested a review from devashishdxt January 20, 2020 04:12
@tomtau
Copy link
Contributor

tomtau commented Jan 20, 2020

bors r+

bors bot added a commit that referenced this pull request Jan 20, 2020
928: Problem (Fix #777): Order of client list address api is not sorted by creation order. r=tomtau a=yihuang

Solution:
- change `BTreeSet` to `IndexSet`

This is required by new integration tests, also more intuitive to user.

Co-authored-by: yihuang <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jan 20, 2020

@bors bors bot merged commit 5e9cfed into crypto-com:master Jan 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants