OSDN Git Service

add new testcase
authorshenao78 <shenao.78@163.com>
Thu, 2 Apr 2020 08:42:39 +0000 (16:42 +0800)
committershenao78 <shenao.78@163.com>
Thu, 2 Apr 2020 08:42:39 +0000 (16:42 +0800)
test/subprotocol_test.go

index 42071a3..36ca3a5 100644 (file)
@@ -118,6 +118,29 @@ func TestSyncProtocolStatus(t *testing.T) {
                        },
                },
                {
+                       desc: "start height from 1, state of mov is not sync completed",
+                       savedBlocks: []*chainBlock{
+                               {
+                                       block:       blocks[0][0],
+                                       inMainChain: true,
+                               },
+                               {
+                                       block:       blocks[1][0],
+                                       inMainChain: true,
+                               },
+                               {
+                                       block:       blocks[2][0],
+                                       inMainChain: true,
+                               },
+                       },
+                       startHeight: 1,
+                       startHash:   hashPtr(blocks[1][0].Hash()),
+                       wantChainStatus: &chainStatus{
+                               blockHeight: 2,
+                               blockHash:   blocks[2][0].Hash(),
+                       },
+               },
+               {
                        desc: "chain status of mov is forked",
                        savedBlocks: []*chainBlock{
                                {