-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: trivial e2e improvements (#2274)
* delete eth dockerfiles * move gaia funcs to gaia.go * move metoken util out of setup folder; move oracle tests to oracle file * function comments * todo comments * comments * comments and combine some functions * price-feeder.go * import order * ibc.go * init balance as coins, not string * move vars around * comment * suggestion++ Co-authored-by: kosegor <[email protected]> --------- Co-authored-by: kosegor <[email protected]>
- Loading branch information
Showing
15 changed files
with
554 additions
and
513 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package e2e | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/umee-network/umee/v6/tests/grpc" | ||
) | ||
|
||
// TestMedians queries for the oracle params, collects historical | ||
// prices based on those params, checks that the stored medians and | ||
// medians deviations are correct, updates the oracle params with | ||
// a gov prop, then checks the medians and median deviations again. | ||
func (s *E2ETest) TestMedians() { | ||
err := grpc.MedianCheck(s.Umee) | ||
s.Require().NoError(err) | ||
} | ||
|
||
func (s *E2ETest) TestUpdateOracleParams() { | ||
params, err := s.Umee.QueryOracleParams() | ||
s.Require().NoError(err) | ||
|
||
s.Require().Equal(uint64(5), params.HistoricStampPeriod) | ||
s.Require().Equal(uint64(4), params.MaximumPriceStamps) | ||
s.Require().Equal(uint64(20), params.MedianStampPeriod) | ||
|
||
// simple retry loop to submit and pass a proposal | ||
for i := 0; i < 3; i++ { | ||
err = grpc.SubmitAndPassProposal( | ||
s.Umee, | ||
grpc.OracleParamChanges(10, 2, 20), | ||
) | ||
if err == nil { | ||
break | ||
} | ||
|
||
time.Sleep(1 * time.Second) | ||
} | ||
|
||
s.Require().NoError(err, "submit and pass proposal") | ||
|
||
params, err = s.Umee.QueryOracleParams() | ||
s.Require().NoError(err) | ||
|
||
s.Require().Equal(uint64(10), params.HistoricStampPeriod) | ||
s.Require().Equal(uint64(2), params.MaximumPriceStamps) | ||
s.Require().Equal(uint64(20), params.MedianStampPeriod) | ||
|
||
s.Require().NoError(err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package setup | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/crypto/keyring" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
||
appparams "github.com/umee-network/umee/v6/app/params" | ||
"github.com/umee-network/umee/v6/util/coin" | ||
"github.com/umee-network/umee/v6/x/metoken/mocks" | ||
) | ||
|
||
type testAccount struct { | ||
mnemonic string | ||
keyInfo keyring.Record | ||
addr sdk.AccAddress | ||
} | ||
|
||
var ( | ||
// Initial coins to give to validators | ||
valCoins = sdk.NewCoins( | ||
coin.New(appparams.BondDenom, 1_000000_000000), | ||
coin.New(PhotonDenom, 1_000000_000000), | ||
coin.New(mocks.USDTBaseDenom, 1_000000_000000), | ||
) | ||
|
||
// TODO: stake less on the validators, and instead delegate from a test account | ||
stakeAmountCoin = coin.New(appparams.BondDenom, 1_000000) | ||
stakeAmountCoin2 = coin.New(appparams.BondDenom, 5_000000) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.