Removed dependency of ZCashBlockParser on BitcoinBlockParser

indexv1
Jakub Matys 2018-03-21 15:47:59 +01:00
parent 83ec7a37a6
commit c0de004c6c
1 changed files with 18 additions and 17 deletions

View File

@ -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")
}