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(jellyfish-api-core): Add futureswap RPC #1273

Merged
merged 30 commits into from
Apr 8, 2022
Merged

Conversation

surangap
Copy link
Contributor

@surangap surangap commented Mar 28, 2022

What this PR does / why we need it:

Add futureswap RPC

Which issue(s) does this PR fixes?:

Fixes part of #1268

Additional comments?:

DeFiCh/ain#1155

@codeclimate
Copy link

codeclimate bot commented Mar 28, 2022

Code Climate has analyzed commit 403236c and detected 0 issues on this pull request.

View more on Code Climate.

@netlify
Copy link

netlify bot commented Mar 28, 2022

Deploy Preview for jellyfish-defi ready!

Name Link
🔨 Latest commit 403236c
🔍 Latest deploy log https://app.netlify.com/sites/jellyfish-defi/deploys/625033dbe54f4a000874550f
😎 Deploy Preview https://deploy-preview-1273--jellyfish-defi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@codecov
Copy link

codecov bot commented Mar 28, 2022

Codecov Report

Merging #1273 (403236c) into main (76c0abe) will increase coverage by 2.28%.
The diff coverage is 88.88%.

@@            Coverage Diff             @@
##             main    #1273      +/-   ##
==========================================
+ Coverage   88.44%   90.72%   +2.28%     
==========================================
  Files         337      348      +11     
  Lines        9675    10008     +333     
  Branches     1177     1222      +45     
==========================================
+ Hits         8557     9080     +523     
+ Misses       1063      881     -182     
+ Partials       55       47       -8     
Impacted Files Coverage Δ
packages/jellyfish-api-core/src/category/oracle.ts 94.28% <0.00%> (+0.34%) ⬆️
apps/playground-api/src/setups/setup.dex.ts 96.96% <100.00%> (ø)
...ackages/jellyfish-api-core/src/category/account.ts 97.18% <100.00%> (-2.82%) ⬇️
packages/jellyfish-testing/src/token.ts 100.00% <100.00%> (ø)
...es/testcontainers/src/containers/DeFiDContainer.ts 91.11% <100.00%> (ø)
...ners/src/containers/RegTestContainer/Masternode.ts 97.34% <100.00%> (+0.14%) ⬆️
packages/jellyfish-address/src/p2wsh.ts 48.27% <0.00%> (-51.73%) ⬇️
packages/jellyfish-address/src/script/P2PKH.ts 91.66% <0.00%> (-8.34%) ⬇️
apps/legacy-api/src/modules/ControllerModule.ts 94.11% <0.00%> (-5.89%) ⬇️
... and 43 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 76c0abe...403236c. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Mar 28, 2022

Docker build preview for jellyfish/apps is ready!

Built with commit 00913fa

  • ghcr.io/defich/legacy-api:pr-1273
  • ghcr.io/defich/ocean-api:pr-1273
  • ghcr.io/defich/playground-api:pr-1273
  • ghcr.io/defich/status-api:pr-1273

@surangap surangap force-pushed the surangap/dfi2203-futures branch from a58b30a to a9990a2 Compare April 3, 2022 14:07
…jellyfish into surangap/dfi2203-futures

� Conflicts:
�	docs/node/CATEGORIES/08-account.md
�	packages/jellyfish-api-core/src/category/account.ts
@surangap surangap force-pushed the surangap/dfi2203-futures branch from cf90ff6 to 8a71f88 Compare April 5, 2022 11:05
@surangap surangap marked this pull request as ready for review April 5, 2022 12:46
@surangap surangap requested a review from fuxingloh as a code owner April 5, 2022 12:46
@jingyi2811
Copy link
Contributor

What if user passed in arbitrary UTXO?

@jingyi2811
Copy link
Contributor

Some typos:

Activat
Retrive
calclulate
TSLADUSD

@jingyi2811
Copy link
Contributor

What happened if the oracle is removed after futureswap?

@surangap
Copy link
Contributor Author

surangap commented Apr 7, 2022

What happened if the oracle is removed after futureswap?

invalid price -> https://github.com/DeFiCh/jellyfish/pull/1273/files#diff-ee8fba519a7bc06607fd3b0ea91b884d54fd950efd18398dcd9601ea0f771d00R549

canonbrother
canonbrother previously approved these changes Apr 8, 2022
chanakasameera
chanakasameera previously approved these changes Apr 8, 2022
@surangap surangap dismissed stale reviews from chanakasameera and canonbrother via db26ee4 April 8, 2022 07:20
chanakasameera
chanakasameera previously approved these changes Apr 8, 2022
@jingyi2811
Copy link
Contributor

jingyi2811 commented Apr 8, 2022

This is the final one.

If you passed in an arbitrary address like bcrt1qcnfukr6c78wlz2tqpv8vxe0zu339c06pmm3l30 as the address parameter of futureswap. You should get

Received message: "RpcApiError: 'Incorrect authorization for bcrt1qcnfukr6c78wlz2tqpv8vxe0zu339c06pmm3l30', code: -5, method: futureswap"

Copy link
Contributor

@fuxingloh fuxingloh left a comment

Choose a reason for hiding this comment

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

🚀 LGTM

@fuxingloh fuxingloh merged commit 57daee6 into main Apr 8, 2022
@fuxingloh fuxingloh deleted the surangap/dfi2203-futures branch April 8, 2022 14:25
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.

7 participants