Fix format
This commit is contained in:
parent
9b8b10b6e0
commit
a282cde045
@ -129,14 +129,14 @@ func (b *BCashRPC) GetBlockRaw(hash string) (string, error) {
|
|||||||
}
|
}
|
||||||
return "", errors.Annotatef(res.Error, "hash %v", hash)
|
return "", errors.Annotatef(res.Error, "hash %v", hash)
|
||||||
}
|
}
|
||||||
return res.Result,nil
|
return res.Result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetBlockBytes returns block with given hash as bytes
|
// GetBlockBytes returns block with given hash as bytes
|
||||||
func (b *BCashRPC) GetBlockBytes(hash string) ([]byte, error) {
|
func (b *BCashRPC) GetBlockBytes(hash string) ([]byte, error) {
|
||||||
block,err:=b.GetBlockRaw(hash)
|
block, err := b.GetBlockRaw(hash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil,err
|
return nil, err
|
||||||
}
|
}
|
||||||
return hex.DecodeString(block)
|
return hex.DecodeString(block)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -620,14 +620,14 @@ func (b *BitcoinRPC) GetBlockRaw(hash string) (string, error) {
|
|||||||
}
|
}
|
||||||
return "", errors.Annotatef(res.Error, "hash %v", hash)
|
return "", errors.Annotatef(res.Error, "hash %v", hash)
|
||||||
}
|
}
|
||||||
return res.Result,nil
|
return res.Result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetBlockBytes returns block with given hash as bytes
|
// GetBlockBytes returns block with given hash as bytes
|
||||||
func (b *BitcoinRPC) GetBlockBytes(hash string) ([]byte, error) {
|
func (b *BitcoinRPC) GetBlockBytes(hash string) ([]byte, error) {
|
||||||
block,err:=b.GetBlockRaw(hash)
|
block, err := b.GetBlockRaw(hash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil,err
|
return nil, err
|
||||||
}
|
}
|
||||||
return hex.DecodeString(block)
|
return hex.DecodeString(block)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -153,14 +153,14 @@ func (zc *FiroRPC) GetBlockRaw(hash string) (string, error) {
|
|||||||
}
|
}
|
||||||
return "", errors.Annotatef(res.Error, "hash %v", hash)
|
return "", errors.Annotatef(res.Error, "hash %v", hash)
|
||||||
}
|
}
|
||||||
return res.Result,nil
|
return res.Result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetBlockBytes returns block with given hash as bytes
|
// GetBlockBytes returns block with given hash as bytes
|
||||||
func (zc *FiroRPC) GetBlockBytes(hash string) ([]byte, error) {
|
func (zc *FiroRPC) GetBlockBytes(hash string) ([]byte, error) {
|
||||||
block,err:=zc.GetBlockRaw(hash)
|
block, err := zc.GetBlockRaw(hash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil,err
|
return nil, err
|
||||||
}
|
}
|
||||||
return hex.DecodeString(block)
|
return hex.DecodeString(block)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,7 @@ const (
|
|||||||
MainnetMagic wire.BitcoinNet = 0xd4b4bef9
|
MainnetMagic wire.BitcoinNet = 0xd4b4bef9
|
||||||
TestnetMagic wire.BitcoinNet = 0x0709110b
|
TestnetMagic wire.BitcoinNet = 0x0709110b
|
||||||
RegtestMagic wire.BitcoinNet = 0xdab5bffa
|
RegtestMagic wire.BitcoinNet = 0xdab5bffa
|
||||||
SignetMagic wire.BitcoinNet = 0x7696b422
|
SignetMagic wire.BitcoinNet = 0x7696b422
|
||||||
)
|
)
|
||||||
|
|
||||||
// chain parameters
|
// chain parameters
|
||||||
@ -21,7 +21,7 @@ var (
|
|||||||
MainNetParams chaincfg.Params
|
MainNetParams chaincfg.Params
|
||||||
TestNetParams chaincfg.Params
|
TestNetParams chaincfg.Params
|
||||||
RegTestParams chaincfg.Params
|
RegTestParams chaincfg.Params
|
||||||
SigNetParams chaincfg.Params
|
SigNetParams chaincfg.Params
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|||||||
@ -168,4 +168,3 @@ func (z *ZCashRPC) GetMempoolEntry(txid string) (*bchain.MempoolEntry, error) {
|
|||||||
func (z *ZCashRPC) GetBlockRaw(hash string) (string, error) {
|
func (z *ZCashRPC) GetBlockRaw(hash string) (string, error) {
|
||||||
return "", errors.New("GetBlockRaw: not supported")
|
return "", errors.New("GetBlockRaw: not supported")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -140,7 +140,6 @@ func (c *fakeBlockChain) GetBlockRaw(hash string) (string, error) {
|
|||||||
return "00e0ff3fd42677a86f1515bafcf9802c1765e02226655a9b97fd44132602000000000000", nil
|
return "00e0ff3fd42677a86f1515bafcf9802c1765e02226655a9b97fd44132602000000000000", nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (c *fakeBlockChain) GetTransaction(txid string) (v *bchain.Tx, err error) {
|
func (c *fakeBlockChain) GetTransaction(txid string) (v *bchain.Tx, err error) {
|
||||||
v = getTxInBlock(GetTestBitcoinTypeBlock1(c.Parser), txid)
|
v = getTxInBlock(GetTestBitcoinTypeBlock1(c.Parser), txid)
|
||||||
if v == nil {
|
if v == nil {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user