OSDN Git Service

delete unsed file
authorpaladz <453256728@qq.com>
Thu, 24 May 2018 12:24:45 +0000 (20:24 +0800)
committerpaladz <453256728@qq.com>
Thu, 24 May 2018 12:24:45 +0000 (20:24 +0800)
blockchain/rpc/types/responses.go [deleted file]
blockchain/rpc/types/responses_test.go [deleted file]

diff --git a/blockchain/rpc/types/responses.go b/blockchain/rpc/types/responses.go
deleted file mode 100644 (file)
index 710f001..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-package core_types
-
-import (
-       "strings"
-       "time"
-
-       "github.com/tendermint/go-crypto"
-       "github.com/tendermint/go-wire/data"
-
-       "github.com/bytom/p2p"
-       "github.com/bytom/protocol/bc"
-)
-
-type BlockNonce [8]byte
-
-type ResultBlockchainInfo struct {
-       LastHeight uint64 `json:"last_height"`
-}
-
-type ResultBlock struct {
-}
-
-type ResultStatus struct {
-       NodeInfo          *p2p.NodeInfo `json:"node_info"`
-       PubKey            crypto.PubKey `json:"pub_key"`
-       LatestBlockHash   data.Bytes    `json:"latest_block_hash"`
-       LatestAppHash     data.Bytes    `json:"latest_app_hash"`
-       LatestBlockHeight int           `json:"latest_block_height"`
-       LatestBlockTime   int64         `json:"latest_block_time"` // nano
-}
-
-func (s *ResultStatus) TxIndexEnabled() bool {
-       if s == nil || s.NodeInfo == nil {
-               return false
-       }
-       for _, s := range s.NodeInfo.Other {
-               info := strings.Split(s, "=")
-               if len(info) == 2 && info[0] == "tx_index" {
-                       return info[1] == "on"
-               }
-       }
-       return false
-}
-
-type ResultNetInfo struct {
-       Listening bool     `json:"listening"`
-       Listeners []string `json:"listeners"`
-       Peers     []Peer   `json:"peers"`
-}
-
-type ResultBlockHeaderInfo struct {
-       Version int32 `json:"version"`
-       //Height uint64    `json:"height"`
-       MerkleRoot        bc.Hash   `json:"merkleroot"`
-       PreviousBlockHash bc.Hash   `json:"prevblockhash"`
-       TimestampMS       time.Time `json:"timestamp"`
-       Bits              uint64    `json:"bits"`
-       Nonce             uint64    `json:"nonce"`
-}
-
-type ResultDialSeeds struct {
-       Log string `json:"log"`
-}
-
-type Peer struct {
-       p2p.NodeInfo     `json:"node_info"`
-       IsOutbound       bool                 `json:"is_outbound"`
-       ConnectionStatus p2p.ConnectionStatus `json:"connection_status"`
-}
diff --git a/blockchain/rpc/types/responses_test.go b/blockchain/rpc/types/responses_test.go
deleted file mode 100644 (file)
index 9f82bbd..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-package core_types
-
-import (
-       "testing"
-
-       "github.com/bytom/p2p"
-       "github.com/stretchr/testify/assert"
-)
-
-func TestStatusIndexer(t *testing.T) {
-       assert := assert.New(t)
-
-       var status *ResultStatus
-       assert.False(status.TxIndexEnabled())
-
-       status = &ResultStatus{}
-       assert.False(status.TxIndexEnabled())
-
-       status.NodeInfo = &p2p.NodeInfo{}
-       assert.False(status.TxIndexEnabled())
-
-       cases := []struct {
-               expected bool
-               other    []string
-       }{
-               {false, nil},
-               {false, []string{}},
-               {false, []string{"a=b"}},
-               {false, []string{"tx_indexiskv", "some=dood"}},
-               {true, []string{"tx_index=on", "tx_index=other"}},
-               {true, []string{"^(*^(", "tx_index=on", "a=n=b=d="}},
-       }
-
-       for _, tc := range cases {
-               status.NodeInfo.Other = tc.other
-               assert.Equal(tc.expected, status.TxIndexEnabled())
-       }
-}