Agoric / dapp-inter

User application for Agoric Inter Protocol—Vaults, BLD Boost, Liquidations, etc.
2 stars 7 forks source link

test: bash scripts for liquidation operations with vaults #272

Closed rabi-siddique closed 2 months ago

rabi-siddique commented 2 months ago

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.

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

rabi-siddique commented 2 months ago

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 commented 2 months ago

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.