mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-24 23:35:19 +00:00
fix: update vesting tests to use fixed block time (#1838)
* fix: update SWP circulating supply test constant * use fixed blocktime for vesting tests
This commit is contained in:
parent
1d944d5219
commit
069be95dde
@ -7,7 +7,6 @@ import (
|
|||||||
|
|
||||||
sdkmath "cosmossdk.io/math"
|
sdkmath "cosmossdk.io/math"
|
||||||
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||||
tmtime "github.com/cometbft/cometbft/types/time"
|
|
||||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
@ -38,12 +37,13 @@ func (m *mockBankKeeper) GetSupply(ctx sdk.Context, denom string) sdk.Coin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (suite *grpcQueryTestSuite) SetupTest() {
|
func (suite *grpcQueryTestSuite) SetupTest() {
|
||||||
|
testTime := time.Date(2024, 2, 29, 12, 00, 00, 00, time.UTC)
|
||||||
tApp := app.NewTestApp()
|
tApp := app.NewTestApp()
|
||||||
ctx := tApp.NewContext(true, tmproto.Header{Height: 1, Time: tmtime.Now()})
|
ctx := tApp.NewContext(true, tmproto.Header{Height: 1, Time: testTime})
|
||||||
suite.app = tApp
|
suite.app = tApp
|
||||||
suite.ctx = ctx
|
suite.ctx = ctx
|
||||||
suite.bk = &mockBankKeeper{}
|
suite.bk = &mockBankKeeper{}
|
||||||
suite.queryClient = suite.queryClientWithBlockTime(tmtime.Now())
|
suite.queryClient = suite.queryClientWithBlockTime(testTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGrpcQueryTestSuite(t *testing.T) {
|
func TestGrpcQueryTestSuite(t *testing.T) {
|
||||||
@ -89,9 +89,9 @@ func (suite *grpcQueryTestSuite) TestCirculatingSupplyUSDX() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (suite *grpcQueryTestSuite) TestCirculatingSupplySWP() {
|
func (suite *grpcQueryTestSuite) TestCirculatingSupplySWP() {
|
||||||
res, err := suite.queryClient.CirculatingSupplySWP(context.Background(), &types.QueryCirculatingSupplySWPRequest{})
|
res, err := suite.queryClient.CirculatingSupplySWP(suite.ctx, &types.QueryCirculatingSupplySWPRequest{})
|
||||||
suite.Require().NoError(err)
|
suite.Require().NoError(err)
|
||||||
suite.Require().Equal(sdkmath.NewInt(198437490), res.Amount)
|
suite.Require().Equal(sdkmath.NewInt(201302073), res.Amount)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *grpcQueryTestSuite) TestTotalSupplyHARD() {
|
func (suite *grpcQueryTestSuite) TestTotalSupplyHARD() {
|
||||||
|
Loading…
Reference in New Issue
Block a user