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

feat: add restricted balances to AccountInfoV2 #4048

Merged
merged 5 commits into from Oct 12, 2023

Conversation

j4m1ef0rd
Copy link
Contributor

@j4m1ef0rd j4m1ef0rd commented Sep 26, 2023

Pull Request

Closes: PRO-834

Checklist

Please conduct a thorough self-review before opening the PR.

  • I am confident that the code works.
  • I have updated documentation where appropriate.

Summary

Added restricted_balances field to the cf_account_info_v2 RPC. No idea if this breaks things on the web side.
The restricted balances is a map of Eth addresses and amounts.
The available balance = balance - bond, So i did not add it to the struct because the info is already there.

Should we add something to the bouncer that checks this new field?

@j4m1ef0rd j4m1ef0rd self-assigned this Sep 26, 2023
@j4m1ef0rd j4m1ef0rd requested a review from a team as a code owner September 26, 2023 06:38
@j4m1ef0rd j4m1ef0rd requested review from acdibble and removed request for a team September 26, 2023 06:38
@linear
Copy link

linear bot commented Sep 26, 2023

PRO-834 Rpc for restricted SC FLIP balances

The front end needs to be able to display available/restricted funds.

See this conversation for details:

daniel said in WEB-430:

I agree this would be useful! There is no rpc yet for the redeemable amount. Bound address should be easy. I think the best thing would be to add this to the accountInfo rpc (or maybe a new endpoint - any preference??)

@j4m1ef0rd j4m1ef0rd removed the request for review from niklasnatter September 26, 2023 06:39
@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Merging #4048 (2ef31a9) into main (a860024) will increase coverage by 0%.
Report is 1 commits behind head on main.
The diff coverage is 77%.

@@          Coverage Diff          @@
##            main   #4048   +/-   ##
=====================================
  Coverage     71%     71%           
=====================================
  Files        377     377           
  Lines      60029   60090   +61     
  Branches   60029   60090   +61     
=====================================
+ Hits       42766   42818   +52     
- Misses     15021   15025    +4     
- Partials    2242    2247    +5     
Files Coverage Δ
state-chain/runtime/src/runtime_apis.rs 83% <ø> (ø)
state-chain/traits/src/lib.rs 49% <ø> (ø)
state-chain/custom-rpc/src/lib.rs 22% <91%> (+1%) ⬆️
state-chain/runtime/src/lib.rs 35% <0%> (-<1%) ⬇️

... and 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dandanlen
Copy link
Collaborator

It's bit more complicated than this I'm afraid.

@dandanlen
Copy link
Collaborator

I've added some more detail to the Linear issue.

@j4m1ef0rd j4m1ef0rd marked this pull request as draft September 27, 2023 02:25
@dandanlen
Copy link
Collaborator

Thanks @j4m1ef0rd , this looks fine.

@j4m1ef0rd j4m1ef0rd marked this pull request as ready for review October 2, 2023 05:39
@dandanlen dandanlen changed the title Added restricted balance to AccountInfoV2 feat: add restricted balances to AccountInfoV2 Oct 2, 2023
@j4m1ef0rd j4m1ef0rd force-pushed the feat/account-info-restricted-balance branch from 6a4e7c9 to c52a2c3 Compare October 12, 2023 03:07
@dandanlen dandanlen merged commit 5669b07 into main Oct 12, 2023
44 checks passed
@dandanlen dandanlen deleted the feat/account-info-restricted-balance branch October 12, 2023 14:49
syan095 added a commit that referenced this pull request Oct 12, 2023
* origin/main:
  Feat: Set pool fees (#4050)
  fix: don't egress empty all_batch calls (#4102)
  fix: don't abort broadcast if signers are unavailable (#4104)
  feat: add restricted balances to AccountInfoV2 (#4048)
  feat: use snake case for lp api method names (#4108)
  feat: add expiry block to liquidity channel event (#4111)

# Conflicts:
#	state-chain/custom-rpc/src/lib.rs
#	state-chain/runtime/src/lib.rs
#	state-chain/runtime/src/runtime_apis.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants