diff --git a/x/clock/abci.go b/x/clock/abci.go index 024648d4c..549c048b0 100644 --- a/x/clock/abci.go +++ b/x/clock/abci.go @@ -10,9 +10,7 @@ import ( "github.com/CosmosContracts/juno/v18/x/clock/types" ) -var ( - endBlockSudoMessage = []byte(types.EndBlockSudoMessage) -) +var endBlockSudoMessage = []byte(types.EndBlockSudoMessage) // EndBlocker executes on contracts at the end of the block. func EndBlocker(ctx sdk.Context, k keeper.Keeper) { diff --git a/x/clock/abci_test.go b/x/clock/abci_test.go new file mode 100644 index 000000000..9e189685d --- /dev/null +++ b/x/clock/abci_test.go @@ -0,0 +1,41 @@ +package clock_test + +import ( + "testing" + + "github.com/stretchr/testify/suite" + + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/CosmosContracts/juno/v18/app" + clock "github.com/CosmosContracts/juno/v18/x/clock" +) + +type EndBlockerTestSuite struct { + suite.Suite + + ctx sdk.Context + + app *app.App +} + +func TestEndBlockerTestSuite(t *testing.T) { + suite.Run(t, new(EndBlockerTestSuite)) +} + +func (s *EndBlockerTestSuite) SetupTest() { + app := app.Setup(s.T()) + ctx := app.BaseApp.NewContext(false, tmproto.Header{ + ChainID: "testing", + }) + + s.app = app + s.ctx = ctx +} + +func (s *EndBlockerTestSuite) TestEndBlocker() { + // Call end blocker + clock.EndBlocker(s.ctx, s.app.AppKeepers.ClockKeeper) +} diff --git a/x/clock/keeper/keeper.go b/x/clock/keeper/keeper.go index 03961acc0..1195f4f80 100644 --- a/x/clock/keeper/keeper.go +++ b/x/clock/keeper/keeper.go @@ -1,11 +1,11 @@ package keeper import ( - "github.com/cometbft/cometbft/libs/log" - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/cometbft/cometbft/libs/log" + "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types"