Skip to content
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

Intitial commit of Block Interval Auctions #242

Merged
merged 13 commits into from
Dec 14, 2023
Merged

Conversation

zmanian
Copy link
Contributor

@zmanian zmanian commented Dec 13, 2023

Initial commit of Cellar Interval Auctions

Copy link
Member

@cbrit cbrit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit, seems good to me

x/cellarfees/keeper/abci.go Outdated Show resolved Hide resolved
Copy link
Member

@cbrit cbrit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One bug and some questions


}

func (suite *KeeperTestSuite) TestAuctionBeginWithInSufficientFunds() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I understand what this is testing. Does the module account implicitly have a zero balance? Why is BeginAuction being called if that's the case?

expectedEmission := sdk.NewCoin(appParams.BaseCoinUnit, event.Amount)
suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(ctx, gomock.Any(), gomock.Any(), sdk.NewCoins(expectedEmission)).Times(1)
suite.auctionKeeper.EXPECT().GetActiveAuctions(ctx).Return([]*auctionTypes.Auction{})
suite.bankKeeper.EXPECT().GetBalance(ctx, feesAccount.GetAddress(), gravityFeeDenom).Return(sdk.NewCoin(gravityFeeDenom, event.Amount))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it not get to these calls (inside of k.beginAuction) if the height modulo isn't zero (which i thought is what the test name implies)?

cellarfeesTypes "github.com/peggyjv/sommelier/v7/x/cellarfees/types"
)

func (suite *KeeperTestSuite) TestBeginBlockerZeroRewardsBalance() {
ctx, cellarfeesKeeper := suite.ctx, suite.cellarfeesKeeper

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to add the same fee accrual initialization here, the test panics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants