Closed rabi-siddique closed 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.
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.
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:
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:
This will create a vault that submits
70 ATOMs
as collateral and mints400 ISTs
We will later use these ISTs to place bids.Testing changing price. For example:
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 thegov1
account:Testing auction. You can test presence of different auction fields and their values following this example:
In this example,
book0.collateralAvailable
is the field we are looking for and0 ATOM
is the expected value.