Skip to content

[CU-34qhnj1] add lend and unlend functions to Lending pallet#2643

Merged
mergify[bot] merged 2 commits intomainfrom
kkast/lending-34qhnj1
Dec 13, 2022
Merged

[CU-34qhnj1] add lend and unlend functions to Lending pallet#2643
mergify[bot] merged 2 commits intomainfrom
kkast/lending-34qhnj1

Conversation

@kkast
Copy link
Contributor

@kkast kkast commented Dec 9, 2022

add lend and unlend functions to Lending pallet, fixing tests

@kkast kkast requested review from a team as code owners December 9, 2022 23:46
@vercel
Copy link

vercel bot commented Dec 9, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Updated
pablo-nightly ⬜️ Ignored (Inspect) Dec 13, 2022 at 9:15PM (UTC)
picasso-nightly ⬜️ Ignored (Inspect) Dec 13, 2022 at 9:15PM (UTC)

@github-actions
Copy link

github-actions bot commented Dec 9, 2022

Nix commands for this PR

NOTE: You can also run our Nix commands in Docker. See the bottom of this comment.

Make sure you have setup the Composable community cache:

(you only need to run it once on your machine)

nix-shell -p cachix --command "cachix use composable-community"

Show all possible apps, shells and packages:

nix flake show "github:ComposableFi/composable/7c30cf1a3edb62e0475511a684ad030f4dcf9c03 --allow-import-from-derivation

Run the Composable node alone:

nix run "github:ComposableFi/composable/7c30cf1a3edb62e0475511a684ad030f4dcf9c03#composable-node" -L

Spin up a local devnet:

nix run "github:ComposableFi/composable/7c30cf1a3edb62e0475511a684ad030f4dcf9c03#devnet" -L --option sandbox relaxed --show-trace

Spin up a local XCVM devnet:

nix run "github:ComposableFi/composable/7c30cf1a3edb62e0475511a684ad030f4dcf9c03#devnet-xcvm" -L

View the docs:

nix run ".#docs-server"

Run this without Nix in Docker.

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v nix:/nix -it nixos/nix bash -c "nix-env -iA nixpkgs.cachix && cachix use composable-community && nix run github:ComposableFi/Composable/7c30cf1a3edb62e0475511a684ad030f4dcf9c03#devnet-dali -L --extra-experimental-features nix-command --extra-experimental-features flakes"

NOTE: You can swap devnet-dali in the command above with any Nix package
For more info on how to use Nix, check out our Nix docs
Note that the initial build may take about one hour if it has not been cached by our CI yet. Once it is cached, builds should take about one minute. We currently do not provide build caches for ARM machines such as M1 Macs, but building on ARM is supported.

@benluelo
Copy link
Contributor

benluelo commented Dec 9, 2022

lend and unlend are pretty vague - perhaps something like deposit and withdraw (which is the same as the underlying vault functions called in these extrinsics)

Also, what's the purpose of these extrinsics? The relevant clickup ticket is empty: https://app.clickup.com/t/34qhnj1

@benluelo
Copy link
Contributor

benluelo commented Dec 9, 2022

Also please run nix run ".#fmt"

@kkast
Copy link
Contributor Author

kkast commented Dec 10, 2022

lend and unlend are pretty vague - perhaps something like deposit and withdraw (which is the same as the underlying vault functions called in these extrinsics)

Also, what's the purpose of these extrinsics? The relevant clickup ticket is empty: https://app.clickup.com/t/34qhnj1

the idea to use lend and unlend instead of deposit and withdraw i think is because there is already deposit_collateral and withdraw_collateral. rn, Lending pallet doesnt have extrinsic to work with vault. it needs to use vault extrinsics to deposit or withdraw. we want to have these functions here in order to pause them if necessary.

@benluelo
Copy link
Contributor

lend and unlend are pretty vague - perhaps something like deposit and withdraw (which is the same as the underlying vault functions called in these extrinsics)
Also, what's the purpose of these extrinsics? The relevant clickup ticket is empty: https://app.clickup.com/t/34qhnj1

the idea to use lend and unlend instead of deposit and withdraw i think is because there is already deposit_collateral and withdraw_collateral. rn, Lending pallet doesnt have extrinsic to work with vault. it needs to use vault extrinsics to deposit or withdraw. we want to have these functions here in order to pause them if necessary.

makes sense, but I see no reason why they couldn't be called vault_deposit and vault_withdraw though. Perhaps @kevin-composable can comment here

we want to have these functions here in order to pause them if necessary.
Maybe adding pausing functionality would be good?

@dzmitry-lahoda
Copy link
Contributor

imho it is good to have pallet methods for that. so i never seen such naming before. can we have diffeerent names which are more common?

@dzmitry-lahoda
Copy link
Contributor

dzmitry-lahoda commented Dec 10, 2022

lend does not happen when you call method. deposit and withdraw happen. so please rename.

Copy link

@keronels-crypto keronels-crypto left a comment

Choose a reason for hiding this comment

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

disregard

Copy link

@kevin-composable kevin-composable left a comment

Choose a reason for hiding this comment

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

This looks perfect; vault_deposit and vault_withdraw sound good to me

Copy link
Contributor

@vimukthi-git vimukthi-git left a comment

Choose a reason for hiding this comment

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

LGTM :) Though I'm unable to provide much in-depth review or insight without a design/spec or details in the task linked.

@kkast kkast changed the title WIP [#34qhnj1] add lend and unlend functions to Lending pallet add lend and unlend functions to Lending pallet Dec 13, 2022
@kkast kkast changed the title add lend and unlend functions to Lending pallet [CU-34qhnj1] add lend and unlend functions to Lending pallet Dec 13, 2022
@itsbobbyzz
Copy link

… tests

add extra pallet for lender vault

fix styling
@kkast kkast force-pushed the kkast/lending-34qhnj1 branch from 897af68 to 34679dd Compare December 13, 2022 18:47
@kkast kkast requested a review from a team December 13, 2022 21:15
mergify bot added a commit that referenced this pull request Dec 13, 2022
@mergify mergify bot merged commit 0d00172 into main Dec 13, 2022
@mergify mergify bot deleted the kkast/lending-34qhnj1 branch December 13, 2022 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants