Fix linting issues

This commit is contained in:
Martin Boehm 2019-06-11 17:22:24 +02:00
parent d52bd0352d
commit 480523a2b3
9 changed files with 25 additions and 8 deletions

View File

@ -3,16 +3,19 @@ package flo
import (
"blockbook/bchain"
"blockbook/bchain/coins/btc"
"github.com/martinboehm/btcd/wire"
"github.com/martinboehm/btcutil/chaincfg"
)
// magic numbers
const (
MainnetMagic wire.BitcoinNet = 0xf1a5c0fd
TestnetMagic wire.BitcoinNet = 0xf25ac0fd
RegtestMagic wire.BitcoinNet = 0xdab5bffa
)
// chain parameters
var (
MainNetParams chaincfg.Params
TestNetParams chaincfg.Params

View File

@ -9,10 +9,12 @@ import (
"github.com/juju/errors"
)
// KotoRPC is an interface to JSON-RPC bitcoind service
type KotoRPC struct {
*btc.BitcoinRPC
}
// NewKotoRPC returns new LitecoinRPC instance
func NewKotoRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error) {
b, err := btc.NewBitcoinRPC(config, pushHandler)
if err != nil {

View File

@ -7,11 +7,13 @@ import (
"github.com/martinboehm/btcutil/chaincfg"
)
// magic numbers
const (
MainnetMagic wire.BitcoinNet = 0xdbb6c0fb
TestnetMagic wire.BitcoinNet = 0xf1c8d2fd
)
// chain parameters
var (
MainNetParams chaincfg.Params
TestNetParams chaincfg.Params

View File

@ -10,10 +10,12 @@ import (
"github.com/martinboehm/btcutil/chaincfg"
)
// magic numbers
const (
MainnetMagic wire.BitcoinNet = 0xee7645af
)
// chain parameters
var (
MainNetParams chaincfg.Params
)

View File

@ -5,11 +5,12 @@ import (
"blockbook/bchain/coins/btc"
"encoding/hex"
"encoding/json"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/martinboehm/btcutil/hdkeychain"
"math/big"
"reflect"
"testing"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/martinboehm/btcutil/hdkeychain"
)
var (
@ -362,7 +363,7 @@ func TestDeriveAddressDescriptorsFromTo(t *testing.T) {
return
}
key1, err := changeExtKey.Child(0)
key1, _ := changeExtKey.Child(0)
priKey1, _ := key1.ECPrivKey()
wantPriKey1 := "0x995c98115809359eb57a5e179558faddd55ef88f88e5cf58617a5f9f3d6bb3a1"
if !reflect.DeepEqual(hexutil.MustDecode(wantPriKey1), priKey1.Serialize()) {
@ -376,7 +377,7 @@ func TestDeriveAddressDescriptorsFromTo(t *testing.T) {
return
}
key2, err := changeExtKey.Child(1)
key2, _ := changeExtKey.Child(1)
priKey2, _ := key2.ECPrivKey()
wantPriKey2 := "0x0f65dee42d3c974c1a4bcc79f141be89715dc8d6406faa9ad4f1f55ca95fabc8"
if !reflect.DeepEqual(hexutil.MustDecode(wantPriKey2), priKey2.Serialize()) {
@ -390,7 +391,7 @@ func TestDeriveAddressDescriptorsFromTo(t *testing.T) {
return
}
key3, err := changeExtKey.Child(2)
key3, _ := changeExtKey.Child(2)
priKey3, _ := key3.ECPrivKey()
wantPriKey3 := "0x6fd98d1d9c3f3ac1ff61bbf3f20e89f00ffa8d43a554f2a7d73fd464b6666f45"
if !reflect.DeepEqual(hexutil.MustDecode(wantPriKey3), priKey3.Serialize()) {
@ -404,7 +405,7 @@ func TestDeriveAddressDescriptorsFromTo(t *testing.T) {
return
}
key4, err := changeExtKey.Child(3)
key4, _ := changeExtKey.Child(3)
priKey4, _ := key4.ECPrivKey()
wantPriKey4 := "0x21412d9e33aba493faf4bc7d408ed5290bea5b36a7beec554b858051f8d4bff3"
if !reflect.DeepEqual(hexutil.MustDecode(wantPriKey4), priKey4.Serialize()) {
@ -418,7 +419,7 @@ func TestDeriveAddressDescriptorsFromTo(t *testing.T) {
return
}
key5, err := changeExtKey.Child(4)
key5, _ := changeExtKey.Child(4)
priKey5, _ := key5.ECPrivKey()
wantPriKey5 := "0xdc3d290e32a4e0f38bc26c25a78ceb1c8779110883d9cb0be54629043c1f8724"
if !reflect.DeepEqual(hexutil.MustDecode(wantPriKey5), priKey5.Serialize()) {

View File

@ -10,11 +10,13 @@ import (
"github.com/martinboehm/btcutil/chaincfg"
)
// magic numbers
const (
MainnetMagic wire.BitcoinNet = 0x4e564152
TestnetMagic wire.BitcoinNet = 0x544e5652
)
// chain parameters
var (
MainNetParams chaincfg.Params
TestNetParams chaincfg.Params

View File

@ -10,11 +10,13 @@ import (
"github.com/martinboehm/btcutil/chaincfg"
)
// magic numbers
const (
MainnetMagic wire.BitcoinNet = 0x2a7bc0a1
TestnetMagic wire.BitcoinNet = 0x514E5352
)
// chain parameters
var (
MainNetParams chaincfg.Params
TestNetParams chaincfg.Params

View File

@ -4,11 +4,11 @@ import (
"blockbook/bchain"
"blockbook/bchain/coins/btc"
"encoding/json"
"github.com/golang/glog"
)
// ViacoinRPC is an interface to JSON-RPC bitcoind service
type ViacoinRPC struct {
*btc.BitcoinRPC
}

View File

@ -12,11 +12,13 @@ import (
"github.com/martinboehm/btcutil/chaincfg"
)
// magic numbers
const (
MainnetMagic wire.BitcoinNet = 0x012ce7b5
TestnetMagic wire.BitcoinNet = 0x1a2b3c4d
)
// chain parameters
var (
MainNetParams chaincfg.Params
TestNetParams chaincfg.Params
@ -96,6 +98,7 @@ func parseBlockHeader(r io.Reader) (*wire.BlockHeader, error) {
return h, err
}
// ParseBlock parses block from byte array
func (p *VIPSTARCOINParser) ParseBlock(b []byte) (*bchain.Block, error) {
r := bytes.NewReader(b)
w := wire.MsgBlock{}