Skip to content

Commit

Permalink
test: add unit test for module blockdao
Browse files Browse the repository at this point in the history
  • Loading branch information
saitofun committed Mar 13, 2024
1 parent 0ef24a2 commit 3c3180c
Show file tree
Hide file tree
Showing 6 changed files with 727 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ lint-rich:

.PHONY: test
test: fmt
$(GOTEST) -short -race ./...
$(GOTEST) -gcflags="all=-N -l" -short -race ./...

.PHONY: test-rich
test-rich:
Expand Down
11 changes: 6 additions & 5 deletions blockchain/blockdao/blockdao.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ import (
"context"
"sync/atomic"

"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"go.uber.org/zap"

"github.com/iotexproject/go-pkgs/cache"
"github.com/iotexproject/go-pkgs/hash"
"github.com/iotexproject/iotex-proto/golang/iotextypes"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"go.uber.org/zap"

"github.com/iotexproject/iotex-core/action"
"github.com/iotexproject/iotex-core/blockchain/block"
Expand Down Expand Up @@ -137,7 +136,9 @@ func (dao *blockDAO) checkIndexers(ctx context.Context) error {
return nil
}

func (dao *blockDAO) Stop(ctx context.Context) error { return dao.lifecycle.OnStop(ctx) }
func (dao *blockDAO) Stop(ctx context.Context) error {
return dao.lifecycle.OnStop(ctx)
}

func (dao *blockDAO) GetBlockHash(height uint64) (hash.Hash256, error) {
timer := dao.timerFactory.NewTimer("get_block_hash")
Expand Down
Loading

0 comments on commit 3c3180c

Please sign in to comment.