• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: Commit

Golang implemented sidechain for Bytom


Commit MetaInfo

Revisione2faecd00b2a6bd0a2064a805a14c042d8084e4f (tree)
Time2019-07-15 20:25:32
AuthorChengcheng Zhang <943420582@qq.c...>
CommiterChengcheng Zhang

Log Message

update

Change Summary

Incremental Difference

--- a/database/store_test.go
+++ b/database/store_test.go
@@ -207,9 +207,8 @@ func TestSaveBlock(t *testing.T) {
207207 t.Errorf("case %v: VerifyStatus mismatch: have %x, want %x", i, gotStatus.VerifyStatus, c.txStatus.VerifyStatus)
208208 }
209209
210- data := store.db.Get(calcBlockHeaderKey(&blockHash))
211- gotBlockHeader := new(types.BlockHeader)
212- if err := gotBlockHeader.UnmarshalText(data); err != nil {
210+ gotBlockHeader, err := store.GetBlockHeader(&blockHash)
211+ if err != nil {
213212 t.Fatal(err)
214213 }
215214
@@ -266,9 +265,9 @@ func TestSaveBlockHeader(t *testing.T) {
266265 BlockWitness: types.BlockWitness{
267266 Witness: [][]byte{
268267 []byte{0x3e, 0x94, 0x5d, 0x35},
269- []byte{0x3e, 0x94, 0x5d, 0x35},
270- []byte{0x3e, 0x94, 0x5d, 0x35},
271- []byte{0xd4, 0x3b, 0x3d, 0xe3},
268+ []byte{0xdd, 0x80, 0x67, 0x29},
269+ []byte{0xff, 0xff, 0xff, 0xff},
270+ []byte{0x00, 0x01, 0x02, 0x03},
272271 },
273272 },
274273 },
@@ -281,14 +280,13 @@ func TestSaveBlockHeader(t *testing.T) {
281280 }
282281
283282 blockHash := c.blockHeader.Hash()
284- gotBlockHeaderData := store.db.Get(calcBlockHeaderKey(&blockHash))
285- binaryBlockHeader, err := c.blockHeader.MarshalText()
283+ gotBlockHeader, err := store.GetBlockHeader(&blockHash)
286284 if err != nil {
287285 t.Fatal(err)
288286 }
289287
290- if !testutil.DeepEqual(gotBlockHeaderData, binaryBlockHeader) {
291- t.Errorf("case %v: block header mismatch: have %x, want %x", i, gotBlockHeaderData, binaryBlockHeader)
288+ if !testutil.DeepEqual(gotBlockHeader, c.blockHeader) {
289+ t.Errorf("case %v: block header mismatch: have %x, want %x", i, gotBlockHeader, c.blockHeader)
292290 }
293291 }
294292 }
Show on old repository browser