Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
expertdicer committed Jan 28, 2025
1 parent 9cc34b7 commit 7b4b9ef
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions x/evm/precompile/oracle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (s *OracleSuite) TestOracle_HappyPath() {
) {
contractInput, err := embeds.SmartContract_Oracle.ABI.Pack(
string(precompile.OracleMethod_queryExchangeRate),
"unibi:uusd",
"unibi@uusd",
)
s.Require().NoError(err)
evmObj, _ := deps.NewEVM()
Expand All @@ -84,7 +84,7 @@ func (s *OracleSuite) TestOracle_HappyPath() {
// 69 seconds + 420 nanoseconds === 69000 milliseconds for the
// return value from the UnixMilli() function
deps.Ctx = deps.Ctx.WithBlockTime(time.Unix(69, 420)).WithBlockHeight(69)
deps.App.OracleKeeper.SetPrice(deps.Ctx, "unibi:uusd", sdk.MustNewDecFromStr("0.067"))
deps.App.OracleKeeper.SetPrice(deps.Ctx, "unibi@uusd", sdk.MustNewDecFromStr("0.067"))

resp, err := runQuery(deps.Ctx)
s.NoError(err)
Expand Down Expand Up @@ -129,7 +129,7 @@ func (s *OracleSuite) TestOracle_HappyPath() {

contractInput, err := embeds.SmartContract_Oracle.ABI.Pack(
string(precompile.OracleMethod_chainLinkLatestRoundData),
"unibi:uusd",
"unibi@uusd",
)
s.Require().NoError(err)
evmObj, _ := deps.NewEVM()
Expand Down
2 changes: 1 addition & 1 deletion x/oracle/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ func TestQueryVoteTargets(t *testing.T) {
input.OracleKeeper.WhitelistedPairs.Delete(input.Ctx, p)
}

voteTargets := []asset.Pair{"denom1:denom2", "denom3:denom4", "denom5:denom6"}
voteTargets := []asset.Pair{"denom1@denom2", "denom3@denom4", "denom5@denom6"}
for _, target := range voteTargets {
input.OracleKeeper.WhitelistedPairs.Insert(input.Ctx, target)
}
Expand Down
8 changes: 4 additions & 4 deletions x/oracle/types/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,22 @@ func TestMsgAggregateExchangeRateVote(t *testing.T) {

exchangeRates := types.ExchangeRateTuples{
{
Pair: "FOO:USD",
Pair: "FOO@USD",
ExchangeRate: math.LegacyMustNewDecFromStr("1.0"),
},
{
Pair: "BAR:USD",
Pair: "BAR@USD",
ExchangeRate: math.LegacyMustNewDecFromStr("1232.132"),
},
}

abstainExchangeRates := types.ExchangeRateTuples{
{
Pair: "FOO:USD",
Pair: "FOO@USD",
ExchangeRate: math.LegacyZeroDec(),
},
{
Pair: "BAR:USD",
Pair: "BAR@USD",
ExchangeRate: math.LegacyMustNewDecFromStr("1232.132"),
},
}
Expand Down
10 changes: 5 additions & 5 deletions x/oracle/types/vote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ func TestExchangeRateTuples_ToString(t *testing.T) {
t.Run("inverse", func(t *testing.T) {
tuples := types.ExchangeRateTuples{
{
Pair: "BTC:USD",
Pair: "BTC@USD",
ExchangeRate: math.LegacyMustNewDecFromStr("40000.00"),
},

{
Pair: "ETH:USD",
Pair: "ETH@USD",
ExchangeRate: math.LegacyMustNewDecFromStr("4000.00"),
},
}
Expand All @@ -35,12 +35,12 @@ func TestExchangeRateTuples_ToString(t *testing.T) {
t.Run("check duplicates", func(t *testing.T) {
tuples := types.ExchangeRateTuples{
{
Pair: "BTC:USD",
Pair: "BTC@USD",
ExchangeRate: math.LegacyMustNewDecFromStr("40000.00"),
},

{
Pair: "BTC:USD",
Pair: "BTC@USD",
ExchangeRate: math.LegacyMustNewDecFromStr("4000.00"),
},
}
Expand All @@ -56,7 +56,7 @@ func TestExchangeRateTuples_ToString(t *testing.T) {
func TestExchangeRateTuple(t *testing.T) {
t.Run("inverse", func(t *testing.T) {
exchangeRate := types.ExchangeRateTuple{
Pair: "BTC:USD",
Pair: "BTC@USD",
ExchangeRate: math.LegacyMustNewDecFromStr("40000.00"),
}
exchangeRateStr, err := exchangeRate.ToString()
Expand Down

0 comments on commit 7b4b9ef

Please sign in to comment.