@cryptotaxi247 / kubo / commits / dfc58c791

blockstore: rename RuntimeHashing to HashOnRead

License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

Jakub Sztandera committed Aug 29, 2016 at 21:53 UTC dfc58c791dd6eaa784f3e2c1e8446648fedf30f1
4 files changed +5 -5
blocks/blockstore/blockstore.go
+1 -1
@@ -76,7 +76,7 @@ type blockstore struct {
76 rehash bool
77 }
78
79 -func (bs *blockstore) RuntimeHashing(enabled bool) {
79 +func (bs *blockstore) HashOnRead(enabled bool) {
80 bs.rehash = enabled
81 }
82
blocks/blockstore/blockstore_test.go
+2 -2
@@ -53,7 +53,7 @@ func TestPutThenGetBlock(t *testing.T) {
53 }
54 }
55
56 -func TestRuntimeHashing(t *testing.T) {
56 +func TestHashOnRead(t *testing.T) {
57 orginalDebug := u.Debug
58 defer (func() {
59 u.Debug = orginalDebug
@@ -69,7 +69,7 @@ func TestRuntimeHashing(t *testing.T) {
69 bl2 := blocks.NewBlock([]byte("some other data"))
70 bs.Put(blBad)
71 bs.Put(bl2)
72 - bs.RuntimeHashing(true)
72 + bs.HashOnRead(true)
73
74 if _, err := bs.Get(bl.Key()); err != ErrHashMismatch {
75 t.Fatalf("expected '%v' got '%v'\n", ErrHashMismatch, err)
core/builder.go
+1 -1
@@ -177,7 +177,7 @@ func setupNode(ctx context.Context, n *IpfsNode, cfg *BuildCfg) error {
177 }
178
179 if rcfg.Datastore.HashOnRead {
180 - bs.RuntimeHashing(true)
180 + bs.HashOnRead(true)
181 }
182
183 if cfg.Online {
core/commands/repo.go
+1 -1
@@ -241,7 +241,7 @@ var repoVerifyCmd = &cmds.Command{
241 defer close(out)
242 bs := bstore.NewBlockstore(nd.Repo.Datastore())
243
244 - bs.RuntimeHashing(true)
244 + bs.HashOnRead(true)
245
246 keys, err := bs.AllKeysChan(req.Context())
247 if err != nil {