-
Notifications
You must be signed in to change notification settings - Fork 161
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
fix: trivial e2e improvements #2274
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
10d1b58
delete eth dockerfiles
toteki 3a015ad
move gaia funcs to gaia.go
toteki a9c2e13
move metoken util out of setup folder; move oracle tests to oracle file
toteki 8089346
function comments
toteki 010081e
todo comments
toteki b1ecb91
comments
toteki 0f387d4
comments and combine some functions
toteki fb68b83
price-feeder.go
toteki ad36a20
import order
toteki 4acd3d0
ibc.go
toteki bdc0d24
init balance as coins, not string
toteki 8f66c2d
move vars around
toteki 3859ff5
comment
toteki 4b7ea69
suggestion++
toteki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this is repeated many time, then it would be better to use:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be - I merely moved this function between files without modifying it