Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Enrique Berrueta committed Oct 12, 2019
1 parent 38bebe8 commit 17677ac
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 308 deletions.
17 changes: 16 additions & 1 deletion bchain/coins/polis/polisparser.go
@@ -1,6 +1,7 @@
package polis

import (
"blockbook/bchain"
"blockbook/bchain/coins/btc"

"github.com/martinboehm/btcd/wire"
Expand Down Expand Up @@ -47,11 +48,15 @@ func init() {
// PolisParser handle
type PolisParser struct {
*btc.BitcoinParser
baseparser *bchain.BaseParser
}

// NewPolisParser returns new PolisParser instance
func NewPolisParser(params *chaincfg.Params, c *btc.Configuration) *PolisParser {
return &PolisParser{BitcoinParser: btc.NewBitcoinParser(params, c)}
return &PolisParser{
BitcoinParser: btc.NewBitcoinParser(params, c),
baseparser: &bchain.BaseParser{},
}
}

// GetChainParams contains network parameters for the main Polis network,
Expand Down Expand Up @@ -79,3 +84,13 @@ func GetChainParams(chain string) *chaincfg.Params {
return &MainNetParams
}
}

// PackTx packs transaction to byte array using protobuf
func (p *PolisParser) PackTx(tx *bchain.Tx, height uint32, blockTime int64) ([]byte, error) {
return p.baseparser.PackTx(tx, height, blockTime)
}

// UnpackTx unpacks transaction from protobuf byte array
func (p *PolisParser) UnpackTx(buf []byte) (*bchain.Tx, uint32, error) {
return p.baseparser.UnpackTx(buf)
}
307 changes: 0 additions & 307 deletions bchain/coins/polis/polisparser_test.go

This file was deleted.

0 comments on commit 17677ac

Please sign in to comment.