-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Optimize Pricefeed EndBlocker (#1851) * optimize pricefeed endblocker to iterate all markets only once to remove overhead of opening and closing iterator for each market individually. In addition, extend tests to cover 100% of abci and price updating behavior. * use test cases that can't be confused with mean to ensure median is always used * update kvtool to master branch * update changelog --------- Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
- Loading branch information
1 parent
77e63c4
commit af611ca
Showing
8 changed files
with
364 additions
and
14 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
golang 1.21 | ||
golang 1.21.9 | ||
nodejs 18.16.0 |
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
Submodule kvtool
updated
23 files
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,20 @@ | ||
package pricefeed_test | ||
|
||
import ( | ||
"testing" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/kava-labs/kava/x/pricefeed" | ||
"github.com/kava-labs/kava/x/pricefeed/keeper" | ||
"github.com/kava-labs/kava/x/pricefeed/testutil" | ||
) | ||
|
||
func TestEndBlocker_UpdatesMultipleMarkets(t *testing.T) { | ||
testutil.SetCurrentPrices_PriceCalculations(t, func(ctx sdk.Context, keeper keeper.Keeper) { | ||
pricefeed.EndBlocker(ctx, keeper) | ||
}) | ||
|
||
testutil.SetCurrentPrices_EventEmission(t, func(ctx sdk.Context, keeper keeper.Keeper) { | ||
pricefeed.EndBlocker(ctx, keeper) | ||
}) | ||
} |
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
Oops, something went wrong.