Fix format

This commit is contained in:
Martin Boehm 2022-03-06 21:27:52 +01:00
parent 9b8b10b6e0
commit a282cde045
6 changed files with 11 additions and 13 deletions

View File

@ -129,14 +129,14 @@ func (b *BCashRPC) GetBlockRaw(hash string) (string, error) {
}
return "", errors.Annotatef(res.Error, "hash %v", hash)
}
return res.Result,nil
return res.Result, nil
}
// GetBlockBytes returns block with given hash as bytes
func (b *BCashRPC) GetBlockBytes(hash string) ([]byte, error) {
block,err:=b.GetBlockRaw(hash)
block, err := b.GetBlockRaw(hash)
if err != nil {
return nil,err
return nil, err
}
return hex.DecodeString(block)
}

View File

@ -620,14 +620,14 @@ func (b *BitcoinRPC) GetBlockRaw(hash string) (string, error) {
}
return "", errors.Annotatef(res.Error, "hash %v", hash)
}
return res.Result,nil
return res.Result, nil
}
// GetBlockBytes returns block with given hash as bytes
func (b *BitcoinRPC) GetBlockBytes(hash string) ([]byte, error) {
block,err:=b.GetBlockRaw(hash)
block, err := b.GetBlockRaw(hash)
if err != nil {
return nil,err
return nil, err
}
return hex.DecodeString(block)
}

View File

@ -153,14 +153,14 @@ func (zc *FiroRPC) GetBlockRaw(hash string) (string, error) {
}
return "", errors.Annotatef(res.Error, "hash %v", hash)
}
return res.Result,nil
return res.Result, nil
}
// GetBlockBytes returns block with given hash as bytes
func (zc *FiroRPC) GetBlockBytes(hash string) ([]byte, error) {
block,err:=zc.GetBlockRaw(hash)
block, err := zc.GetBlockRaw(hash)
if err != nil {
return nil,err
return nil, err
}
return hex.DecodeString(block)
}

View File

@ -13,7 +13,7 @@ const (
MainnetMagic wire.BitcoinNet = 0xd4b4bef9
TestnetMagic wire.BitcoinNet = 0x0709110b
RegtestMagic wire.BitcoinNet = 0xdab5bffa
SignetMagic wire.BitcoinNet = 0x7696b422
SignetMagic wire.BitcoinNet = 0x7696b422
)
// chain parameters
@ -21,7 +21,7 @@ var (
MainNetParams chaincfg.Params
TestNetParams chaincfg.Params
RegTestParams chaincfg.Params
SigNetParams chaincfg.Params
SigNetParams chaincfg.Params
)
func init() {

View File

@ -168,4 +168,3 @@ func (z *ZCashRPC) GetMempoolEntry(txid string) (*bchain.MempoolEntry, error) {
func (z *ZCashRPC) GetBlockRaw(hash string) (string, error) {
return "", errors.New("GetBlockRaw: not supported")
}

View File

@ -140,7 +140,6 @@ func (c *fakeBlockChain) GetBlockRaw(hash string) (string, error) {
return "00e0ff3fd42677a86f1515bafcf9802c1765e02226655a9b97fd44132602000000000000", nil
}
func (c *fakeBlockChain) GetTransaction(txid string) (v *bchain.Tx, err error) {
v = getTxInBlock(GetTestBitcoinTypeBlock1(c.Parser), txid)
if v == nil {