OSDN Git Service
(root)
/
bytom
/
vapor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update
[bytom/vapor.git]
/
database
/
store_test.go
diff --git
a/database/store_test.go
b/database/store_test.go
index
e9ec0fb
..
3686838
100644
(file)
--- a/
database/store_test.go
+++ b/
database/store_test.go
@@
-207,9
+207,8
@@
func TestSaveBlock(t *testing.T) {
t.Errorf("case %v: VerifyStatus mismatch: have %x, want %x", i, gotStatus.VerifyStatus, c.txStatus.VerifyStatus)
}
t.Errorf("case %v: VerifyStatus mismatch: have %x, want %x", i, gotStatus.VerifyStatus, c.txStatus.VerifyStatus)
}
- data := store.db.Get(calcBlockHeaderKey(&blockHash))
- gotBlockHeader := new(types.BlockHeader)
- if err := gotBlockHeader.UnmarshalText(data); err != nil {
+ gotBlockHeader, err := store.GetBlockHeader(&blockHash)
+ if err != nil {
t.Fatal(err)
}
t.Fatal(err)
}
@@
-266,9
+265,9
@@
func TestSaveBlockHeader(t *testing.T) {
BlockWitness: types.BlockWitness{
Witness: [][]byte{
[]byte{0x3e, 0x94, 0x5d, 0x35},
BlockWitness: types.BlockWitness{
Witness: [][]byte{
[]byte{0x3e, 0x94, 0x5d, 0x35},
- []byte{0x
3e, 0x94, 0x5d, 0x35
},
- []byte{0x
3e, 0x94, 0x5d, 0x35
},
- []byte{0x
d4, 0x3b, 0x3d, 0xe
3},
+ []byte{0x
dd, 0x80, 0x67, 0x29
},
+ []byte{0x
ff, 0xff, 0xff, 0xff
},
+ []byte{0x
00, 0x01, 0x02, 0x0
3},
},
},
},
},
},
},
@@
-281,14
+280,13
@@
func TestSaveBlockHeader(t *testing.T) {
}
blockHash := c.blockHeader.Hash()
}
blockHash := c.blockHeader.Hash()
- gotBlockHeaderData := store.db.Get(calcBlockHeaderKey(&blockHash))
- binaryBlockHeader, err := c.blockHeader.MarshalText()
+ gotBlockHeader, err := store.GetBlockHeader(&blockHash)
if err != nil {
t.Fatal(err)
}
if err != nil {
t.Fatal(err)
}
- if !testutil.DeepEqual(gotBlockHeader
Data, binaryB
lockHeader) {
- t.Errorf("case %v: block header mismatch: have %x, want %x", i, gotBlockHeader
Data, binaryB
lockHeader)
+ if !testutil.DeepEqual(gotBlockHeader
, c.b
lockHeader) {
+ t.Errorf("case %v: block header mismatch: have %x, want %x", i, gotBlockHeader
, c.b
lockHeader)
}
}
}
}
}
}