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

test: bash scripts for liquidation operations with vaults #272

Closed
wants to merge 1 commit into from
Closed

test: bash scripts for liquidation operations with vaults #272

wants to merge 1 commit into from

Conversation

rabi-siddique
Copy link
Contributor

@rabi-siddique rabi-siddique commented Apr 22, 2024

The PR adds bash scripts for creating vaults, changing prices, placing bids, and viewing auctions.

These scripts will be used in a subsequent PR for liquidation testing.

To test these scripts locally, make sure your local chain is up and running. Run the following command:

docker run -d -p 26657:26657 -p 1317:1317 -p 9090:9090 ghcr.io/agoric/agoric-3-proposals:latest

Make sure you are present in the root directory of dapp-inter. You can test the scripts randomly with different values.

  • Testing creating vaults. To create a vault, run the script:
~/dapp-inter/test/e2e/test-scripts/create-vaults.sh 400 70 gov1 

This will create a vault that submits 70 ATOMs as collateral and mints 400 ISTs We will later use these ISTs to place bids.

  • Testing changing price. For example:
~/dapp-inter/test/e2e/test-scripts/set-oracle-price.sh 9.99

In this script, the parameter 9.99 represents the desired price value you want to update in the oracle.

  • Testing placing bids. Run the place-bids.sh script to place bids from the gov1 account:
~/dapp-inter/test/e2e/test-scripts/place-bids.sh
  • Testing auction. You can test presence of different auction fields and their values following this example:
~/dapp-inter/test/e2e/test-scripts/view-auction.sh "book0.collateralAvailable" "0 ATOM"

In this example, book0.collateralAvailable is the field we are looking for and 0 ATOM is the expected value.

@rabi-siddique rabi-siddique linked an issue Apr 22, 2024 that may be closed by this pull request
Copy link
Member

@turadg turadg left a comment

Choose a reason for hiding this comment

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

Bash scripts are harder to maintain than code modules. Given most Agoric code is Javascript, could these be too?

NodeJS has pretty good scripting support built in. You could also use something like execa if you want more shell-ish usage.

@rabi-siddique
Copy link
Contributor Author

Bash scripts are harder to maintain than code modules. Given most Agoric code is Javascript, could these be too?

NodeJS has pretty good scripting support built in. You could also use something like execa if you want more shell-ish usage.

I'll explore it and let you know about it. execa seems cool. Will try to write a couple of test cases using execa and see if we can bring it in.

@rabi-siddique
Copy link
Contributor Author

I am no longer using bash scripts for liquidation tests. PR #275 introduces tests that do not rely on bash scripts. Therefore, I'm closing this pull request.

@turadg Thanks for the review and helpful insight on using JS instead of bash scripts.

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.

Liquidation Testing Completed
2 participants