From c0de004c6cf146319167be0805c9b34777935a46 Mon Sep 17 00:00:00 2001 From: Jakub Matys Date: Wed, 21 Mar 2018 15:47:59 +0100 Subject: [PATCH] Removed dependency of ZCashBlockParser on BitcoinBlockParser --- bchain/coins/zec/zcashparser.go | 35 +++++++++++++++++---------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/bchain/coins/zec/zcashparser.go b/bchain/coins/zec/zcashparser.go index 36a35ec0..98b62ff4 100644 --- a/bchain/coins/zec/zcashparser.go +++ b/bchain/coins/zec/zcashparser.go @@ -2,32 +2,17 @@ package zec import ( "blockbook/bchain" - "blockbook/bchain/coins/btc" "bytes" "encoding/binary" "encoding/gob" + "errors" "github.com/btcsuite/btcd/chaincfg" ) // bitcoinwire parsing -type ZCashBlockParser struct { - btc.BitcoinBlockParser -} - -// getChainParams contains network parameters for the main Bitcoin network, -// the regression test Bitcoin network, the test Bitcoin network and -// the simulation test Bitcoin network, in this order -func GetChainParams(chain string) *chaincfg.Params { - switch chain { - case "test": - return &chaincfg.TestNet3Params - case "regtest": - return &chaincfg.RegressionNetParams - } - return &chaincfg.MainNetParams -} +type ZCashBlockParser struct{} func (p *ZCashBlockParser) GetUIDFromVout(output *bchain.Vout) string { if len(output.ScriptPubKey.Addresses) != 1 { @@ -85,3 +70,19 @@ func decodeTx(buf []byte) (*bchain.Tx, error) { } return tx, nil } + +func (p *ZCashBlockParser) AddressToOutputScript(address string) ([]byte, error) { + return nil, errors.New("AddressToOutputScript: not implemented") +} + +func (p *ZCashBlockParser) OutputScriptToAddresses(script []byte) ([]string, error) { + return nil, errors.New("OutputScriptToAddresses: not implemented") +} + +func (p *ZCashBlockParser) ParseBlock(b []byte) (*bchain.Block, error) { + return nil, errors.New("ParseBlock: not implemented") +} + +func (p *ZCashBlockParser) ParseTx(b []byte) (*bchain.Tx, error) { + return nil, errors.New("ParseTx: not implemented") +}