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

blockstore: rename RuntimeHashing to HashOnRead #3143

Merged
merged 1 commit into from
Sep 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blocks/blockstore/blockstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type blockstore struct {
rehash bool
}

func (bs *blockstore) RuntimeHashing(enabled bool) {
func (bs *blockstore) HashOnRead(enabled bool) {
bs.rehash = enabled
}

Expand Down
4 changes: 2 additions & 2 deletions blocks/blockstore/blockstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestPutThenGetBlock(t *testing.T) {
}
}

func TestRuntimeHashing(t *testing.T) {
func TestHashOnRead(t *testing.T) {
orginalDebug := u.Debug
defer (func() {
u.Debug = orginalDebug
Expand All @@ -69,7 +69,7 @@ func TestRuntimeHashing(t *testing.T) {
bl2 := blocks.NewBlock([]byte("some other data"))
bs.Put(blBad)
bs.Put(bl2)
bs.RuntimeHashing(true)
bs.HashOnRead(true)

if _, err := bs.Get(bl.Key()); err != ErrHashMismatch {
t.Fatalf("expected '%v' got '%v'\n", ErrHashMismatch, err)
Expand Down
2 changes: 1 addition & 1 deletion core/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func setupNode(ctx context.Context, n *IpfsNode, cfg *BuildCfg) error {
}

if rcfg.Datastore.HashOnRead {
bs.RuntimeHashing(true)
bs.HashOnRead(true)
}

if cfg.Online {
Expand Down
2 changes: 1 addition & 1 deletion core/commands/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ var repoVerifyCmd = &cmds.Command{
defer close(out)
bs := bstore.NewBlockstore(nd.Repo.Datastore())

bs.RuntimeHashing(true)
bs.HashOnRead(true)

keys, err := bs.AllKeysChan(req.Context())
if err != nil {
Expand Down